-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Now supports adding multiple keys to the same ResVault profile. - Modified GlobalContext to handle state management. - Selected keys can now be exported using the download button.
- Loading branch information
1 parent
fe26861
commit 6c6d3f6
Showing
8 changed files
with
988 additions
and
721 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,34 @@ | ||
/*global chrome*/ | ||
import './css/App.css'; | ||
import React from 'react'; | ||
import React, { useContext } from 'react'; | ||
import Home from "./pages/Home"; | ||
import SignUp from "./pages/SignUp"; | ||
import Login from "./pages/Login"; | ||
import Dashboard from "./pages/Dashboard"; | ||
import Logs from "./pages/Logs"; | ||
import { Navigate, Route, Routes } from "react-router-dom"; | ||
import { GlobalProvider } from './context/GlobalContext'; | ||
import { Routes, Route, Navigate } from 'react-router-dom'; | ||
import { GlobalContext } from './context/GlobalContext'; | ||
|
||
function App() { | ||
const { isAuthenticated } = useContext(GlobalContext); | ||
|
||
return ( | ||
<GlobalProvider> | ||
<Routes> | ||
<Route path='/' element={<Home />} /> | ||
<Route path='/signup' element={<SignUp />} /> | ||
<Route path='/login' element={<Login />} /> | ||
<Route path='/dashboard' element={<Dashboard />} /> | ||
<Route path='/logs' element={<Logs />} /> | ||
<Route path='*' element={<Navigate to='/' />} /> | ||
</Routes> | ||
</GlobalProvider> | ||
<Routes> | ||
{!isAuthenticated ? ( | ||
<> | ||
<Route path="/" element={<Home />} /> | ||
<Route path="/signup" element={<SignUp />} /> | ||
<Route path="/login" element={<Login />} /> | ||
<Route path="*" element={<Navigate to="/" replace />} /> | ||
</> | ||
) : ( | ||
<> | ||
<Route path="/dashboard" element={<Dashboard />} /> | ||
<Route path="*" element={<Navigate to="/dashboard" replace />} /> | ||
</> | ||
)} | ||
</Routes> | ||
); | ||
} | ||
|
||
export default App; | ||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.