Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47,363 changes: 27,977 additions & 19,386 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"@storybook/addons": "^5.3.18",
"@storybook/react": "^5.3.18",
"@testing-library/react-hooks": "^3.2.1",
"@types/babel__core": "^7.20.0",
"@types/enzyme": "^3.10.5",
"@types/jest": "^25.1.4",
"@types/ramda": "^0.27.6",
Expand Down
46 changes: 23 additions & 23 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,28 @@ import { UserScreen } from "@/screens/UserScreen";

export const App: React.FC<{}> = () => (
<Router>
<nav>
<ul>
<li>
<Link to="/login">Login</Link>
</li>
<li>
<Link to="/field">Field</Link>
</li>
<li>
<Link to="/user/Nick">Nick</Link>
</li>
</ul>
</nav>
<Switch>
<Route path="/login">
<LoginScreen />
</Route>
<Route path="/field" render={() => <FieldScreen />} />
<Route path="/user/:name" component={UserScreen} />
<Route path="*">
<NoMatchScreen />
</Route>
</Switch>
<nav>
<ul>
<li>
<Link to="/login">Login</Link>
</li>
<li>
<Link to="/field">Field</Link>
</li>
<li>
<Link to="/user/Nick">Nick</Link>
</li>
</ul>
</nav>
<Switch>
<Route path="/login">
<LoginScreen />
</Route>
<Route path="/field" render={() => <FieldScreen />} />
<Route path="/user/:name" component={UserScreen} />
<Route path="*">
<NoMatchScreen />
</Route>
</Switch>
</Router>
);
2 changes: 1 addition & 1 deletion src/api/auth.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { sleep } from '@/utils/sleep';
import { sleep } from "@/utils/sleep";

export const login = async (name: string) => {
await sleep(1000);
Expand Down
91 changes: 0 additions & 91 deletions src/components/GameSettingsForm/GameSettingsForm.stories.tsx

This file was deleted.

1 change: 1 addition & 0 deletions src/components/GameSettingsForm/GameSettingsFormRef.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion */
import React from "react";
import { GameSettingsFormProps } from "./interfaces";
import { SYMBOL_OPTIONS } from "./constants";
Expand Down
49 changes: 0 additions & 49 deletions src/components/GameSettingsForm/GameSettingsFormState.test.tsx

This file was deleted.

9 changes: 3 additions & 6 deletions src/components/GameSettingsForm/GameSettingsFormState.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FormEvent } from "react";
import React, { FormEvent, Component } from "react";
import { GameSettingsFormProps } from "./interfaces";
import { SYMBOL_OPTIONS } from "./constants";
import { InputColor, InputText } from "./components";
Expand All @@ -13,7 +13,7 @@ interface GameSettingsFormStateState {
player2Symbol: string;
}

export class GameSettingsFormState extends React.Component<
export class GameSettingsFormState extends Component<
GameSettingsFormProps,
GameSettingsFormStateState
> {
Expand Down Expand Up @@ -42,16 +42,13 @@ export class GameSettingsFormState extends React.Component<
});
};

componentDidUpdate() {
console.log("@@GameSettingsFormState.componentDidUpdate");
}

handleFormInputChange = (ev: FormEvent<HTMLInputElement>) => {
this.setState({
[(ev.target as HTMLInputElement).getAttribute(
"name"
) as keyof GameSettingsFormStateState]: (ev.target as HTMLInputElement)
.value,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} as any);
};

Expand Down
5 changes: 1 addition & 4 deletions src/components/GameSettingsForm/components/Input.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from "react";
import { action } from "@storybook/addon-actions";
import { withKnobs, object } from "@storybook/addon-knobs";
import { withKnobs } from "@storybook/addon-knobs";

import { InputText, InputColor } from "./";

Expand All @@ -9,8 +8,6 @@ export default {
decorators: [withKnobs],
};

const elementClicked = action("Cell clicked (element)");

export const inputText = () => [
<InputText key="jsx" placeholder="textInput" />,
];
Expand Down
18 changes: 0 additions & 18 deletions src/components/GameSettingsForm/components/Input.test.tsx

This file was deleted.

7 changes: 7 additions & 0 deletions src/components/GameSettingsForm/components/InputText.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from "react";

export const InputText =
React.Component >
((props, ref) => <input ref={ref} type="text" {...props} />);

InputText.displayName = "InputText";
8 changes: 0 additions & 8 deletions src/components/GameSettingsForm/components/InputText.tsx

This file was deleted.

This file was deleted.

19 changes: 13 additions & 6 deletions src/lesson-13/homework/immutability.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import { OriginalTeam, ExpectedTeam } from "./immutability";
import {
SomeArray,
OriginalTeam,
ExpectedTeam,
originalTeamToExpectedTeam,
originalArrayToExpectedArray,
originalTeamToExpectedTeamDeep,
} from "./immutability";

// Задание 1
test("team to team", () => {
Expand All @@ -9,21 +16,21 @@ test("team to team", () => {
});

const expectedTeam: ExpectedTeam = {
name: "New York Badgers",
name: "Tampa Bay Roosters",
league: "Minor",
roster: 25,
};

expect(originalTeamToExpectedTeam(originalTeam)).toBe(expectedTeam);
expect(originalTeamToExpectedTeam(originalTeam)).toEqual(expectedTeam);
});

// Задание 2
test("array to array", () => {
const originalArray = Object.freeze([1, 2, 3, 4]);
const originalArray = Object.freeze([1, 2, 3, 4]) as SomeArray;

const expectedArray = ["two", 3, 4, 5];

expect(originalArrayToExpectedArray(originalArray)).toBe(expectedArray);
expect(originalArrayToExpectedArray(originalArray)).toEqual(expectedArray);
});

// Задание 3
Expand All @@ -44,5 +51,5 @@ test("team to team deep", () => {
},
};

expect(originalTeamToExpectedTeam(originalTeam)).toBe(expectedTeam);
expect(originalTeamToExpectedTeamDeep(originalTeam)).toEqual(expectedTeam);
});
Loading