File tree 12 files changed +172
-3
lines changed
12 files changed +172
-3
lines changed Original file line number Diff line number Diff line change 8
8
"@testing-library/user-event" : " ^13.5.0" ,
9
9
"react" : " ^18.2.0" ,
10
10
"react-dom" : " ^18.2.0" ,
11
+ "react-hot-toast" : " ^2.4.0" ,
12
+ "react-router-dom" : " ^6.4.2" ,
11
13
"react-scripts" : " 5.0.1" ,
12
14
"web-vitals" : " ^2.1.4"
13
15
},
Original file line number Diff line number Diff line change 2
2
< html lang ="en ">
3
3
< head >
4
4
< meta charset ="utf-8 " />
5
- < link rel ="icon " href ="%PUBLIC_URL%/favicon.ico " />
5
+ < link rel ="icon " href ="https://play-lh.googleusercontent.com/XDiye8wlBGFoAkxAyoxB5mPidDLtvViBBA9-DXWPmD6NxltrhFFTdJK2Eiv_h7EvaFc " />
6
6
< meta name ="viewport " content ="width=device-width, initial-scale=1 " />
7
7
< meta name ="theme-color " content ="#000000 " />
8
8
< meta
24
24
work correctly both with client-side routing and a non-root public URL.
25
25
Learn how to configure a non-root public URL by running `npm run build`.
26
26
-->
27
- < title > React App </ title >
27
+ < title > Fire Education </ title >
28
28
</ head >
29
29
< body >
30
30
< noscript > You need to enable JavaScript to run this app.</ noscript >
Original file line number Diff line number Diff line change
1
+ import { RouterProvider } from 'react-router-dom' ;
1
2
import './App.css' ;
3
+ import { routes } from './Routes/Routes' ;
2
4
3
5
function App ( ) {
4
6
return (
5
7
< div >
6
-
8
+ < RouterProvider router = { routes } > </ RouterProvider >
7
9
</ div >
8
10
) ;
9
11
}
Original file line number Diff line number Diff line change
1
+ import React from 'react' ;
2
+ import './Home.css'
3
+
4
+ const Home = ( ) => {
5
+ return (
6
+ < div >
7
+ < h2 > This is Home</ h2 >
8
+ </ div >
9
+ ) ;
10
+ } ;
11
+
12
+ export default Home ;
Original file line number Diff line number Diff line change
1
+ import React from 'react' ;
2
+ import './Header.css'
3
+
4
+ const Header = ( ) => {
5
+ return (
6
+ < div >
7
+ < h1 > This is a header</ h1 >
8
+ </ div >
9
+ ) ;
10
+ } ;
11
+
12
+ export default Header ;
Original file line number Diff line number Diff line change
1
+ import React from 'react' ;
2
+
3
+ const AuthProvider = ( ) => {
4
+ return (
5
+ < div >
6
+
7
+ </ div >
8
+ ) ;
9
+ } ;
10
+
11
+ export default AuthProvider ;
Original file line number Diff line number Diff line change
1
+ import React from 'react' ;
2
+ import { Outlet } from 'react-router-dom' ;
3
+ import Header from '../Components/Shared/Header/Header' ;
4
+
5
+ const Main = ( ) => {
6
+ return (
7
+ < >
8
+ < Header > </ Header >
9
+ < Outlet > </ Outlet >
10
+ </ >
11
+ ) ;
12
+ } ;
13
+
14
+ export default Main ;
Original file line number Diff line number Diff line change
1
+ import { createBrowserRouter } from "react-router-dom" ;
2
+ import Home from "../Components/Pages/Home/Home" ;
3
+ import Main from "../Layouts/Main" ;
4
+
5
+ export const routes = createBrowserRouter ( [
6
+
7
+ {
8
+ path : '/' ,
9
+ element : < Main > </ Main > ,
10
+ children : [
11
+ {
12
+ path : '/' ,
13
+ element : < Home > </ Home >
14
+ }
15
+ ]
16
+ }
17
+ ] )
You can’t perform that action at this time.
0 commit comments