taskcafe/frontend/src/App/Routes.tsx

41 lines
1.1 KiB
TypeScript
Raw Normal View History

2020-04-10 04:40:22 +02:00
import React from 'react';
import { Router, Switch, Route } from 'react-router-dom';
import * as H from 'history';
2020-04-10 18:31:29 +02:00
import Dashboard from 'Dashboard';
import Admin from 'Admin';
2020-04-10 04:40:22 +02:00
import Projects from 'Projects';
import Project from 'Projects/Project';
import Teams from 'Teams';
2020-04-10 04:40:22 +02:00
import Login from 'Auth';
2020-06-13 00:21:58 +02:00
import Profile from 'Profile';
import styled from 'styled-components';
2020-04-10 04:40:22 +02:00
2020-06-13 00:21:58 +02:00
const MainContent = styled.div`
padding: 0 0 0 0;
2020-06-13 00:21:58 +02:00
background: #262c49;
height: 100%;
2020-06-19 01:12:15 +02:00
display: flex;
flex-direction: column;
flex-grow: 1;
2020-06-13 00:21:58 +02:00
`;
2020-04-10 04:40:22 +02:00
type RoutesProps = {
history: H.History;
};
const Routes = ({ history }: RoutesProps) => (
2020-04-20 05:02:55 +02:00
<Switch>
<Route exact path="/login" component={Login} />
2020-06-13 00:21:58 +02:00
<MainContent>
<Route exact path="/" component={Dashboard} />
<Route exact path="/projects" component={Projects} />
<Route path="/projects/:projectID" component={Project} />
<Route path="/teams/:teamID" component={Teams} />
2020-06-13 00:21:58 +02:00
<Route path="/profile" component={Profile} />
<Route path="/admin" component={Admin} />
2020-06-13 00:21:58 +02:00
</MainContent>
2020-04-20 05:02:55 +02:00
</Switch>
2020-04-10 04:40:22 +02:00
);
export default Routes;