diff --git a/README.md b/README.md index 064a39440..36f7981f6 100644 --- a/README.md +++ b/README.md @@ -28,4 +28,4 @@ implement the ability to filter and sort people in the table. - Implement a solution following the [React task guideline](https://github.com/mate-academy/react_task-guideline#react-tasks-guideline). - Use the [React TypeScript cheat sheet](https://mate-academy.github.io/fe-program/js/extra/react-typescript). - Open one more terminal and run tests with `npm test` to ensure your solution is correct. -- Replace `` with your Github username in the [DEMO LINK](https://.github.io/react_people-table-advanced/) and add it to the PR description. +- Replace `` with your Github username in the [DEMO LINK](https://MaxShaggy.github.io/react_people-table-advanced/) and add it to the PR description. diff --git a/index.html b/index.html index 095fb3a45..290bace89 100644 --- a/index.html +++ b/index.html @@ -1,12 +1,15 @@ - - - - - Vite + React + TS - - -
- - - + + + + + + Vite + React + TS + + + +
+ + + + \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index df276ce8a..a2d822adb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,7 +20,7 @@ }, "devDependencies": { "@cypress/react18": "^2.0.1", - "@mate-academy/scripts": "^1.9.12", + "@mate-academy/scripts": "^2.1.3", "@mate-academy/students-ts-config": "*", "@mate-academy/stylelint-config": "*", "@types/node": "^20.14.10", @@ -1184,10 +1184,11 @@ } }, "node_modules/@mate-academy/scripts": { - "version": "1.9.12", - "resolved": "https://registry.npmjs.org/@mate-academy/scripts/-/scripts-1.9.12.tgz", - "integrity": "sha512-/OcmxMa34lYLFlGx7Ig926W1U1qjrnXbjFJ2TzUcDaLmED+A5se652NcWwGOidXRuMAOYLPU2jNYBEkKyXrFJA==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@mate-academy/scripts/-/scripts-2.1.3.tgz", + "integrity": "sha512-a07wHTj/1QUK2Aac5zHad+sGw4rIvcNl5lJmJpAD7OxeSbnCdyI6RXUHwXhjF5MaVo9YHrJ0xVahyERS2IIyBQ==", "dev": true, + "license": "MIT", "dependencies": { "@octokit/rest": "^17.11.2", "@types/get-port": "^4.2.0", diff --git a/package.json b/package.json index 919fbd42b..77fc93ccf 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ }, "devDependencies": { "@cypress/react18": "^2.0.1", - "@mate-academy/scripts": "^1.9.12", + "@mate-academy/scripts": "^2.1.3", "@mate-academy/students-ts-config": "*", "@mate-academy/stylelint-config": "*", "@types/node": "^20.14.10", diff --git a/src/App.tsx b/src/App.tsx index adcb8594e..13615ee47 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,20 +1,23 @@ -import { PeoplePage } from './components/PeoplePage'; -import { Navbar } from './components/Navbar'; +import { Routes, Route, Navigate } from 'react-router-dom'; import './App.scss'; +import { HomePage } from './pages/HomePage'; +import { NotFoundPage } from './pages/NotFoundPage'; +import { PeoplePage } from './pages/PeoplePage'; +import { Layout } from './components/Layout'; -export const App = () => { - return ( -
- - -
-
-

Home Page

-

Page not found

- -
-
-
- ); -}; +export const App = () => ( +
+ + }> + } /> + + } /> + } /> + + } /> + } /> + + +
+); diff --git a/src/components/Layout/Layout.tsx b/src/components/Layout/Layout.tsx new file mode 100644 index 000000000..dae11131e --- /dev/null +++ b/src/components/Layout/Layout.tsx @@ -0,0 +1,15 @@ +import { Outlet } from 'react-router-dom'; +import { Navigation } from '../Navigation'; + +export function Layout() { + return ( + <> + +
+
+ +
+
+ + ); +} diff --git a/src/components/Layout/index.tsx b/src/components/Layout/index.tsx new file mode 100644 index 000000000..9877e7f4a --- /dev/null +++ b/src/components/Layout/index.tsx @@ -0,0 +1 @@ +export * from './Layout'; diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx deleted file mode 100644 index 3f63898b2..000000000 --- a/src/components/Navbar.tsx +++ /dev/null @@ -1,26 +0,0 @@ -export const Navbar = () => { - return ( - - ); -}; diff --git a/src/components/Navigation/Navigation.tsx b/src/components/Navigation/Navigation.tsx new file mode 100644 index 000000000..39d0dbc05 --- /dev/null +++ b/src/components/Navigation/Navigation.tsx @@ -0,0 +1,38 @@ +import { Link, useLocation, useSearchParams } from 'react-router-dom'; + +export function Navigation() { + const { pathname } = useLocation(); + const [searchParams] = useSearchParams(); + + return ( + + ); +} diff --git a/src/components/Navigation/index.tsx b/src/components/Navigation/index.tsx new file mode 100644 index 000000000..95e14a93f --- /dev/null +++ b/src/components/Navigation/index.tsx @@ -0,0 +1 @@ +export * from './Navigation'; diff --git a/src/components/PeopleFilters.tsx b/src/components/PeopleFilters.tsx deleted file mode 100644 index c9c819cd3..000000000 --- a/src/components/PeopleFilters.tsx +++ /dev/null @@ -1,96 +0,0 @@ -export const PeopleFilters = () => { - return ( -