App.tsx 1.19 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import React from 'react'
import styled, { ThemeProvider } from 'styled-components'
import { GlobalStyle } from './style/Global'
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom'
import { darkTheme } from './style/theme'
import { ErrorPage } from './pages/errorPage/ErrorPage'
import { Home } from './pages/home/Home'
import { BikeSharingMap } from "./pages/map/BikeSharingMap"
import { BikePointDetails } from './pages/bikePointDetails/BikePointDetails'

const App = () => {

    return (
        <ThemeProvider theme={darkTheme}>
            <GlobalStyle/>
            <Router>
                <SiteWrapper>
                    <Switch>
                        <Route path='/' exact component={Home}/>
                        <Route path='/map' exact component={BikeSharingMap}/>
                        <Route path='/bike-point-details/:bikePointId' exact component={BikePointDetails}/>
                        <Route component={ErrorPage}/>
                    </Switch>
                </SiteWrapper>
            </Router>
        </ThemeProvider>
    )
}

const SiteWrapper = styled.div`
    display: flex;
    flex-flow: column nowrap;
    justify-content: flex-start;
`

export default App