Skip to content
Snippets Groups Projects
Commit 1e6cec59 authored by Bernard Roland (Student Com20)'s avatar Bernard Roland (Student Com20)
Browse files

Added the navbar and header back in

parent 156d4286
No related branches found
No related tags found
No related merge requests found
import { Suspense, lazy } from 'react';
import { BrowserRouter as Router, Switch, Route, } from 'react-router-dom';
import ProtectedRoute from 'components/helpers/Rerouters/ProtectedRoute';
import LoginRoute from 'components/helpers/Rerouters/LoginRoute';
import AppWrapper from 'pages/AppWrapper';
const Home = lazy(() => import('pages/Home'));
const Login = lazy(() => import('pages/Login'));
const Register = lazy(() => import('pages/Register'));
const Tasks = lazy(() => import('pages/Tasks'));
const Projects = lazy(() => import('pages/Projects'));
const Stats = lazy(() => import('pages/Stats'));
export default function App() {
return (
<Router>
<Suspense fallback={false}>
<Switch>
<ProtectedRoute path="/tasks" component={Tasks} />
<ProtectedRoute path="/projects" component={Projects} />
<ProtectedRoute path="/stats" component={Stats} />
<LoginRoute path="/login" component={Login} />
<LoginRoute path="/register" component={Register} />
<Route path={["/tasks", "/projects", "/stats"]} component={AppWrapper} />
<Route path="/" component={Home} />
</Switch>
</Suspense>
......
......@@ -10,7 +10,7 @@ export default function LoginRoute(props: RouteProps) {
if (history.length === 0) {
history.push('/tasks');
} else {
history.goBack();;
history.goBack();
}
}
})
......
import { Suspense, lazy } from 'react';
import ProtectedRoute from 'components/helpers/Rerouters/ProtectedRoute';
import Header from 'components/ui/Header';
import Navigation from 'components/ui/Navigation';
const Tasks = lazy(() => import('pages/Tasks'));
const Projects = lazy(() => import('pages/Projects'));
const Stats = lazy(() => import('pages/Stats'));
export default function AppWrapper() {
return (<>
<Header />
<Navigation />
<Suspense fallback={false}>
<ProtectedRoute path="/tasks" component={Tasks} />
<ProtectedRoute path="/projects" component={Projects} />
<ProtectedRoute path="/stats" component={Stats} />
</Suspense>
</>);
}
......@@ -35,7 +35,7 @@ export default function Home() {
<h1>ryoko</h1>
<p>Are you feeling lost with your tasks? Maximize your productivity now with ryoko.</p>
<div className="button-container">
<ButtonLink href="/register" routing={true}>Get started</ButtonLink>
<ButtonLink href="/tasks" routing={true}>Get started</ButtonLink>
</div>
</div>
</div>
......
import Navigation from 'components/ui/Navigation';
import './projects.scss';
export default function Tasks() {
return (
<div className="projects-page">
<Navigation />
<main>
<h1>Projects</h1>
</main>
</div>
);
}
\ No newline at end of file
}
import Navigation from 'components/ui/Navigation';
import './stats.scss';
export default function Tasks() {
return (
<div className="stats-page">
<Navigation />
<main>
<h1>Stats</h1>
</main>
</div>
);
}
\ No newline at end of file
}
import './tasks.scss';
export default function Tasks() {
return (
<>
<div className="tasks-page page-container">
<main className="content-container">
<h1>Tasks</h1>
<p>Hey Daniel, you have <strong>10</strong> Tasks for today.</p>
</main>
</div>
</>
<div className="tasks-page page-container">
<main className="content-container">
<h1>Tasks</h1>
<p>Hey Daniel, you have <strong>10</strong> Tasks for today.</p>
</main>
</div>
);
}
\ No newline at end of file
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment