Add AuthContext as a provider

This commit is contained in:
Ray 2023-09-19 10:47:17 +00:00 committed by GitHub
parent 6464316cb7
commit 1f39645265
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -92,6 +92,7 @@ const signIn = ( email, password ) => {
return ( return (
<div className="App"> <div className="App">
<Header items={nav} /> <Header items={nav} />
<AuthContext.Provider>
<Routes> <Routes>
<Route path="/" element={<Home greeting="Hey you're at home!" />} /> <Route path="/" element={<Home greeting="Hey you're at home!" />} />
<Route path="/about" element={<About greeting="Hey you, this is about page!" handler={saySomething} />} /> <Route path="/about" element={<About greeting="Hey you, this is about page!" handler={saySomething} />} />
@ -100,6 +101,7 @@ const signIn = ( email, password ) => {
<Route path="/signout" element={ <Signout handler={logOut}/> } /> <Route path="/signout" element={ <Signout handler={logOut}/> } />
<Route path="/signin" element={ <Signin handler={signIn} authstate={auth}/> } /> <Route path="/signin" element={ <Signin handler={signIn} authstate={auth}/> } />
</Routes> </Routes>
</AuthContext.Provider>
</div> </div>
); );
} }