File tree 5 files changed +249
-15
lines changed
5 files changed +249
-15
lines changed Original file line number Diff line number Diff line change 3
3
"version" : " 0.1.0" ,
4
4
"private" : true ,
5
5
"dependencies" : {
6
+ "@emotion/react" : " ^11.10.6" ,
7
+ "@emotion/styled" : " ^11.10.6" ,
6
8
"@mui/icons-material" : " ^5.11.11" ,
7
9
"@mui/material" : " ^5.11.12" ,
8
10
"@mui/styled-engine-sc" : " ^5.11.11" ,
Original file line number Diff line number Diff line change 1
1
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'
2
9
3
10
function App ( ) {
4
11
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
+ </ >
20
26
)
21
27
}
22
28
Original file line number Diff line number Diff line change
1
+ import React from 'react'
2
+
3
+ const Home = ( ) => {
4
+ return < div > Home</ div >
5
+ }
6
+
7
+ export default Home
Original file line number Diff line number Diff line change
1
+ import React from 'react'
2
+
3
+ const Products = ( ) => {
4
+ return < div > Products</ div >
5
+ }
6
+
7
+ export default Products
You can’t perform that action at this time.
0 commit comments