Skip to content

Commit e6ec7bf

Browse files
committed
update project
1 parent 80835aa commit e6ec7bf

File tree

5 files changed

+249
-15
lines changed

5 files changed

+249
-15
lines changed

23-add-cart/package-lock.json

+212
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

23-add-cart/package.json

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
"version": "0.1.0",
44
"private": true,
55
"dependencies": {
6+
"@emotion/react": "^11.10.6",
7+
"@emotion/styled": "^11.10.6",
68
"@mui/icons-material": "^5.11.11",
79
"@mui/material": "^5.11.12",
810
"@mui/styled-engine-sc": "^5.11.11",

23-add-cart/src/App.tsx

+21-15
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,28 @@
11
import React from 'react'
2+
import { Route, Routes } from 'react-router'
3+
import { BrowserRouter } from 'react-router-dom'
4+
import AdminLayout from './layouts/admin-layout'
5+
import SimpleLayout from './layouts/simple-layout'
6+
import Home from './pages/home'
7+
import Login from './pages/login'
8+
import Products from './pages/products'
29

310
function App() {
411
return (
5-
<div className='App'>
6-
<header className='App-header'>
7-
<p>
8-
Edit <code>src/App.tsx</code> and save to reload.
9-
</p>
10-
<a
11-
className='App-link'
12-
href='https://reactjs.org'
13-
target='_blank'
14-
rel='noopener noreferrer'
15-
>
16-
Learn React
17-
</a>
18-
</header>
19-
</div>
12+
<>
13+
<BrowserRouter>
14+
<Routes>
15+
<Route element={<AdminLayout />}>
16+
<Route index element={<Home />} />
17+
<Route path='products' element={<Products />} />
18+
</Route>
19+
20+
<Route element={<SimpleLayout />}>
21+
<Route path='login' element={<Login />} />
22+
</Route>
23+
</Routes>
24+
</BrowserRouter>
25+
</>
2026
)
2127
}
2228

23-add-cart/src/pages/home/index.tsx

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import React from 'react'
2+
3+
const Home = () => {
4+
return <div>Home</div>
5+
}
6+
7+
export default Home
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import React from 'react'
2+
3+
const Products = () => {
4+
return <div>Products</div>
5+
}
6+
7+
export default Products

0 commit comments

Comments
 (0)