diff --git a/web/package.json b/web/package.json index 6945c6a..8a067fd 100644 --- a/web/package.json +++ b/web/package.json @@ -11,7 +11,8 @@ "dependencies": { "antd": "^4.22.8", "react": "^18.2.0", - "react-dom": "^18.2.0" + "react-dom": "^18.2.0", + "react-router-dom": "^6.3.0" }, "devDependencies": { "@types/react": "^18.0.17", diff --git a/web/src/App.jsx b/web/src/App.jsx index c83448c..26b8149 100644 --- a/web/src/App.jsx +++ b/web/src/App.jsx @@ -1,7 +1,14 @@ -import { Dashboard } from "./pages/dahsboard" +import { Navigate, Route, Routes } from 'react-router-dom'; + +import { Dashboard } from './pages/dahsboard'; +import { Login } from './pages/login'; export const App = () => { return ( - - ) -} + + } /> + } /> + } /> + + ); +}; diff --git a/web/src/main.jsx b/web/src/main.jsx index 42099b3..fe97335 100644 --- a/web/src/main.jsx +++ b/web/src/main.jsx @@ -1,9 +1,14 @@ import React from 'react'; import ReactDOM from 'react-dom/client'; +import { BrowserRouter } from 'react-router-dom'; import 'antd/dist/antd.css'; import './styles/global.scss'; import { App } from './App'; -ReactDOM.createRoot(document.getElementById('root')).render(); +ReactDOM.createRoot(document.getElementById('root')).render( + + + +); diff --git a/web/src/pages/login/index.jsx b/web/src/pages/login/index.jsx index f303fdf..9d2df45 100644 --- a/web/src/pages/login/index.jsx +++ b/web/src/pages/login/index.jsx @@ -1,6 +1,6 @@ import { Page } from '../../components/Page'; -export const Dashboard = () => { +export const Login = () => { return (

Login

diff --git a/web/yarn.lock b/web/yarn.lock index f8c8413..b23d3a4 100644 --- a/web/yarn.lock +++ b/web/yarn.lock @@ -240,7 +240,7 @@ "@babel/plugin-syntax-jsx" "^7.18.6" "@babel/types" "^7.18.10" -"@babel/runtime@^7.10.1", "@babel/runtime@^7.10.2", "@babel/runtime@^7.10.4", "@babel/runtime@^7.11.1", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.18.0", "@babel/runtime@^7.18.3": +"@babel/runtime@^7.10.1", "@babel/runtime@^7.10.2", "@babel/runtime@^7.10.4", "@babel/runtime@^7.11.1", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.18.0", "@babel/runtime@^7.18.3", "@babel/runtime@^7.7.6": version "7.18.9" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.18.9.tgz#b4fcfce55db3d2e5e080d2490f608a3b9f407f4a" integrity sha512-lkqXDcvlFT5rvEjiu6+QYO+1GXrEHRo2LOtS7E4GtX5ESIZOgepqsZBVIj6Pv+a6zqsya9VCgiK1KAK4BvJDAw== @@ -747,6 +747,13 @@ has@^1.0.3: dependencies: function-bind "^1.1.1" +history@^5.2.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/history/-/history-5.3.0.tgz#1548abaa245ba47992f063a0783db91ef201c73b" + integrity sha512-ZqaKwjjrAYUYfLG+htGaIIZ4nioX2L70ZUMIFysS3xvBsSG4x/n1V6TXV3N8ZYNuFGlDirFg32T7B6WOUPDYcQ== + dependencies: + "@babel/runtime" "^7.7.6" + immutable@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.1.0.tgz#f795787f0db780183307b9eb2091fcac1f6fafef" @@ -1264,6 +1271,21 @@ react-refresh@^0.14.0: resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.14.0.tgz#4e02825378a5f227079554d4284889354e5f553e" integrity sha512-wViHqhAd8OHeLS/IRMJjTSDHF3U9eWi62F/MledQGPdJGDhodXJ9PBLNGr6WWL7qlH12Mt3TyTpbS+hGXMjCzQ== +react-router-dom@^6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-6.3.0.tgz#a0216da813454e521905b5fa55e0e5176123f43d" + integrity sha512-uaJj7LKytRxZNQV8+RbzJWnJ8K2nPsOOEuX7aQstlMZKQT0164C+X2w6bnkqU3sjtLvpd5ojrezAyfZ1+0sStw== + dependencies: + history "^5.2.0" + react-router "6.3.0" + +react-router@6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/react-router/-/react-router-6.3.0.tgz#3970cc64b4cb4eae0c1ea5203a80334fdd175557" + integrity sha512-7Wh1DzVQ+tlFjkeo+ujvjSqSJmkt1+8JO+T5xklPlgrh70y7ogx75ODRW0ThWhY7S+6yEDks8TYrtQe/aoboBQ== + dependencies: + history "^5.2.0" + react@^18.2.0: version "18.2.0" resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5"