This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { useContext, useState } from "react"; | |
| // Settings default values | |
| // These well later be overwritten by specifying 'value' | |
| const ThemeContext = React.createContext({ | |
| theme: "light", | |
| setTheme: () => "", | |
| }); | |
| const App = () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| type: "SIGN_IN", | |
| payload: { | |
| email: "test@mail.com", | |
| password: "12345" | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const numbers = [27, 52, 28, 122, 67]; | |
| // Example 1 | |
| const average = arr => arr.reduce((a, b) => a + b) / arr.length | |
| console.log(average(numbers)); | |
| // => 59.2 | |
| // Example 2 | |
| const anotherAverage = arr => { | |
| const sum = arr.reduce((partialSum, nextNumber) => partialSum + nextNumber, 0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "use strict"; | |
| Object.defineProperty(exports, "__esModule", { value: true }); | |
| exports.default = null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .container { | |
| display: grid; | |
| place-items: center; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .container { | |
| display: flex; | |
| justify-content: center; | |
| align-items: center; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .container { | |
| text-align: center; | |
| } | |
| .content { | |
| display: inline-block; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .container { | |
| position: relative; | |
| } | |
| .content { | |
| position: absolute; | |
| left: 50%; | |
| top: 50%; | |
| transform: translate(-50%, -50%); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="container"> | |
| <div class="content">I am centered~</div> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from "react"; | |
| import { Link } from "react-router-dom"; | |
| import { HashScroll } from "react-hash-scroll"; | |
| const HashScrollPage = () => { | |
| return ( | |
| <main className="page"> | |
| <nav> | |
| <ul> | |
| <li> |