Skip to content
Snippets Groups Projects
Commit 2ee12a49 authored by Planoetscher Daniel (Student Com20)'s avatar Planoetscher Daniel (Student Com20)
Browse files

Merge branch 'frontend-devel' of...

Merge branch 'frontend-devel' of gitlab.inf.unibz.it:Roland.Bernard/wie_202021_csbillero11 into frontend-devel
parents 7d76dd65 1e6cec59
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>
</>);
}
......@@ -29,7 +29,6 @@ export default function Home() {
<div className="inner">
</div>
</div>
</div>
<div className="content-container">
<div className="text-container">
<h1>ryoko</h1>
......
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
}
......@@ -3,13 +3,12 @@ import './tasks.scss';
export default function Tasks() {
return (
<>
<Page className="tasks-page">
<main className="content-container">
<h1>Tasks</h1>
<p>Hey Daniel, you have <strong>10</strong> Tasks for today.</p>
</main>
</Page>
</>
<Page className="tasks-page">
<main className="content-container">
<h1>Tasks</h1>
<p>Hey Daniel, you have <strong>10</strong> Tasks for today.</p>
</main>
</Page>
);
}
\ 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