2023-08-04 13:26:51 +03:00
|
|
|
import { useMemo } from 'react';
|
2023-07-15 17:46:19 +03:00
|
|
|
import { Route, Routes } from 'react-router-dom';
|
|
|
|
|
2023-07-25 20:27:29 +03:00
|
|
|
import Footer from './components/Footer';
|
2023-07-15 17:46:19 +03:00
|
|
|
import Navigation from './components/Navigation/Navigation';
|
2023-07-25 20:27:29 +03:00
|
|
|
import ToasterThemed from './components/ToasterThemed';
|
2023-08-03 17:34:55 +03:00
|
|
|
import { useConceptTheme } from './context/ThemeContext';
|
2023-07-28 00:03:37 +03:00
|
|
|
import CreateRSFormPage from './pages/CreateRSFormPage';
|
2023-07-15 17:46:19 +03:00
|
|
|
import HomePage from './pages/HomePage';
|
2023-07-28 00:03:37 +03:00
|
|
|
import LibraryPage from './pages/LibraryPage';
|
2023-07-15 17:46:19 +03:00
|
|
|
import LoginPage from './pages/LoginPage';
|
|
|
|
import ManualsPage from './pages/ManualsPage';
|
2023-07-25 20:27:29 +03:00
|
|
|
import NotFoundPage from './pages/NotFoundPage';
|
|
|
|
import RegisterPage from './pages/RegisterPage';
|
|
|
|
import RestorePasswordPage from './pages/RestorePasswordPage';
|
|
|
|
import RSFormPage from './pages/RSFormPage';
|
|
|
|
import UserProfilePage from './pages/UserProfilePage';
|
2023-07-15 17:46:19 +03:00
|
|
|
|
2023-07-25 20:27:29 +03:00
|
|
|
function App () {
|
2023-08-03 17:34:55 +03:00
|
|
|
const { noNavigation } = useConceptTheme();
|
|
|
|
|
2023-08-04 13:26:51 +03:00
|
|
|
const scrollWindowSize = useMemo(() => {
|
|
|
|
return !noNavigation ?
|
|
|
|
'max-h-[calc(100vh-4.5rem)]'
|
|
|
|
: 'max-h-[100vh]';
|
|
|
|
}, [noNavigation]);
|
|
|
|
const mainSize = useMemo(() => {
|
|
|
|
return !noNavigation ?
|
|
|
|
'min-h-[calc(100vh-12rem)]'
|
|
|
|
: 'min-h-[calc(100vh-8rem)] ';
|
|
|
|
}, [noNavigation]);
|
|
|
|
|
2023-07-15 17:46:19 +03:00
|
|
|
return (
|
2023-07-21 18:44:14 +03:00
|
|
|
<div className='antialiased clr-app'>
|
2023-07-15 17:46:19 +03:00
|
|
|
<Navigation />
|
2023-07-15 18:25:31 +03:00
|
|
|
<ToasterThemed
|
|
|
|
className='mt-[4rem] text-sm'
|
|
|
|
autoClose={3000}
|
|
|
|
draggable={false}
|
2023-07-20 17:11:03 +03:00
|
|
|
pauseOnFocusLoss={false}
|
2023-07-15 18:25:31 +03:00
|
|
|
/>
|
2023-08-04 13:26:51 +03:00
|
|
|
|
|
|
|
<div className={`${scrollWindowSize} overflow-auto`}>
|
|
|
|
<main className={`${mainSize} px-2`}>
|
2023-07-15 17:46:19 +03:00
|
|
|
<Routes>
|
|
|
|
<Route path='/' element={ <HomePage/>} />
|
|
|
|
|
|
|
|
<Route path='login' element={ <LoginPage/>} />
|
|
|
|
<Route path='signup' element={<RegisterPage/>} />
|
|
|
|
<Route path='restore-password' element={ <RestorePasswordPage/>} />
|
|
|
|
<Route path='profile' element={<UserProfilePage/>} />
|
2023-07-25 20:27:29 +03:00
|
|
|
|
2023-07-15 17:46:19 +03:00
|
|
|
<Route path='manuals' element={<ManualsPage/>} />
|
2023-07-25 20:27:29 +03:00
|
|
|
|
2023-07-28 00:03:37 +03:00
|
|
|
<Route path='library' element={<LibraryPage/>} />
|
2023-07-15 17:46:19 +03:00
|
|
|
<Route path='rsforms/:id' element={ <RSFormPage/>} />
|
2023-07-28 00:03:37 +03:00
|
|
|
<Route path='rsform-create' element={ <CreateRSFormPage/>} />
|
2023-07-15 17:46:19 +03:00
|
|
|
<Route path='*' element={ <NotFoundPage/>} />
|
|
|
|
</Routes>
|
|
|
|
</main>
|
|
|
|
<Footer />
|
2023-08-03 17:34:55 +03:00
|
|
|
</div>
|
2023-07-15 17:46:19 +03:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2023-07-25 20:27:29 +03:00
|
|
|
export default App;
|