UI Redesin!
This commit is contained in:
+39
-36
@@ -19,61 +19,64 @@ import DocumentStoragePage from './llm-fe/pages/DocumentStoragePage/DocumentStor
|
||||
import Account2 from './llm-fe/pages/Account2/Account2';
|
||||
import AnalyticsPage from './llm-fe/pages/Analytics/Analytics';
|
||||
import PasswordResetConfirmation from './llm-fe/pages/PasswordResetConfirmation/PasswordReset';
|
||||
import GlobalThemeWrapper from './llm-fe/components/GlobalThemeWrapper/GlobalThemeWrapper';
|
||||
|
||||
const ProtectedRoutes = () => {
|
||||
const { authenticated, needsNewPassword, loading } = useContext(AuthContext);
|
||||
if(loading){
|
||||
return(
|
||||
if (loading) {
|
||||
return (
|
||||
<div>Loading</div>
|
||||
)
|
||||
}
|
||||
if(!authenticated) return <Navigate to='/signin/' replace />
|
||||
if (!authenticated) return <Navigate to='/signin/' replace />
|
||||
//if(!needsNewPassword) return <Navigate to='/password_reset/' replace/>
|
||||
|
||||
return <Outlet key={Date.now()}/>
|
||||
return <Outlet key={Date.now()} />
|
||||
}
|
||||
|
||||
class App extends Component {
|
||||
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className='site'>
|
||||
<main>
|
||||
<div className="main-container">
|
||||
|
||||
|
||||
<Routes>
|
||||
<Route path='*' element={<NotFound />} />
|
||||
|
||||
<Route path={"/signin/"} Component={SignIn}/>
|
||||
<Route path={"/password_reset/"} Component={PasswordReset}/>
|
||||
<Route path={"/password_reset_confirmation/"} Component={PasswordResetConfirmation}/>
|
||||
<Route path={'/set_password/'} Component={SetPassword}/>
|
||||
|
||||
<GlobalThemeWrapper>
|
||||
<div className='site'>
|
||||
<main>
|
||||
<div className="main-container">
|
||||
|
||||
|
||||
<Route element={<ProtectedRoutes />}>
|
||||
<Route path={"/"} index={true} Component={AsyncDashboard2}/>
|
||||
<Route path={"/account/"} Component={Account2}/>
|
||||
<Route path={"/document_storage"} Component={DocumentStoragePage}/>
|
||||
<Route path={"/terms_of_service/"} Component={TermsOfService}/>
|
||||
<Route path={"/feedback/"} Component={FeedbackPage2}/>
|
||||
<Route path={"/analytics/"} Component={AnalyticsPage} />
|
||||
|
||||
</Route>
|
||||
<Routes>
|
||||
<Route path='*' element={<NotFound />} />
|
||||
|
||||
<Route path={"/signin/"} Component={SignIn} />
|
||||
<Route path={"/password_reset/"} Component={PasswordReset} />
|
||||
<Route path={"/password_reset_confirmation/"} Component={PasswordResetConfirmation} />
|
||||
<Route path={'/set_password/'} Component={SetPassword} />
|
||||
|
||||
|
||||
|
||||
<Route element={<ProtectedRoutes />}>
|
||||
<Route path={"/"} index={true} Component={AsyncDashboard2} />
|
||||
<Route path={"/account/"} Component={Account2} />
|
||||
<Route path={"/document_storage"} Component={DocumentStoragePage} />
|
||||
<Route path={"/terms_of_service/"} Component={TermsOfService} />
|
||||
<Route path={"/feedback/"} Component={FeedbackPage2} />
|
||||
<Route path={"/analytics/"} Component={AnalyticsPage} />
|
||||
|
||||
</Route>
|
||||
|
||||
</Routes>
|
||||
|
||||
</div>
|
||||
|
||||
</main>
|
||||
</div>
|
||||
</GlobalThemeWrapper>
|
||||
|
||||
|
||||
</Routes>
|
||||
|
||||
</div>
|
||||
|
||||
</main>
|
||||
</div>
|
||||
|
||||
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
export default App;
|
||||
|
||||
Reference in New Issue
Block a user