View utils.module.css
This file contains 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
.centeredFlex { | |
width: 100%; | |
height: 100%; | |
display: flex; | |
justify-content: center; | |
align-items: center; | |
} |
View CommandPanel.module.css
This file contains 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
.panel { | |
z-index: 10; | |
position: absolute; | |
bottom: -10px; | |
left: 60px; | |
background: white; | |
width: 200px; | |
padding: 6px; | |
transform: translateY(100%); | |
border-radius: 4px; |
View index.css
This file contains 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
body { | |
margin: 0; | |
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", | |
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", | |
sans-serif; | |
-webkit-font-smoothing: antialiased; | |
-moz-osx-font-smoothing: grayscale; | |
} | |
code { |
View Title.module.css
This file contains 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 { | |
padding-left: 40px; | |
padding-right: 40px; | |
max-width: 900px; | |
} | |
.title { | |
padding: 6px; | |
} |
View Spacer.module.css
This file contains 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
.spacer { | |
height: 200px; | |
width: 100%; | |
padding: 0 46px; | |
color: grey; | |
} |
View Node.module.css
This file contains 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
.node { | |
border-radius: 4px; | |
padding: 6px; | |
cursor: text; | |
width: 100%; | |
} | |
.page { | |
cursor: pointer; | |
font-weight: bold; |
View Page.tsx
This file contains 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 { useState } from "react"; | |
import { NodeData } from "../utils/types"; | |
import { useFocusedNodeIndex } from "./useFocusedNodeIndex"; | |
import { Cover } from "./Cover"; | |
import { Spacer } from "./Spacer"; | |
import { BasicNode } from "../Node/BasicNode"; | |
import { Title } from "./Title"; | |
import { nanoid } from "nanoid"; | |
export const Page = () => { |
View tictactoe_solver.js
This file contains 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
let solutions = []; // Points array | |
const checkCells = (...cells) => { | |
return !!cells[0] && cells[0] === cells[1] && cells[1] === cells[2]; | |
}; | |
const checkWinConditions = (solution) => { | |
let board = newBoard(); | |
solution.forEach((cell, k) => { | |
board[cell[0]][cell[1]] = k % 2 ? "x" : "y"; |
View HOC.tsx
This file contains 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
// -------------------- HOC definition ---- | |
type InjectedProps = { | |
initialState: AppState | |
} | |
export function withData<TProps>( | |
WrappedComponent: React.JSXElementConstructor<TProps & InjectedProps> | |
) { | |
const WrapperComponent: React.FC<Omit<TProps, keyof InjectedProps>> = ({ children, ...props }) => { |
View gist:8a247d55c287d9d5829354073dda12dc
This file contains 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
## Вебинар Тестирование Реакт Приложений | |
- Как настроить окружение | |
- Jest | |
- React Testing Library | |
- React Hooks Testing Library | |
- Какие плагины я использую | |
- VSCode Jest Plugin | |
- Как понять что тестировать | |
- Рендер |
NewerOlder