jonahkh
2020-05-29 e8b43eebd832e5ef41b3a077e824d96b6c1facfb
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
37
38
39
40
41
42
import React, { Component } from "react";
import Structure from "./Layout";
 
import {
    BrowserRouter as Router,
    Switch,
    Route,
} from "react-router-dom";
// import ShelterRESTService from "./Services/ShelterRESTService";
import AnimalList from "./Components/AnimalList";
import SheltersView from "./Views/SheltersView";
import ShelterFakeService from "./Services/ShelterFakeService";
// import ShelterRESTService from "./Services/ShelterRESTService";
 
// Services to connect to backends
const shelterService = new ShelterFakeService();
// Uncomment to use a real backend
// const shelterService = new ShelterRESTService(SERVICE_BASE_URL);
 
 
// The main React component that runs the whole webapp
export default class App extends Component {
    render() {
        return (
            <Router basename="/frontend">
                <Switch>
                    <Structure>
                        <Route path="/" exact >
                            Main
                        </Route>
                        <Route path="/shelters" exact>
                            <SheltersView shelterService={shelterService} />
                        </Route>
                        <Route path="/your-animals" exact>
                            <AnimalList />
                        </Route>
                    </Structure>
                </Switch>
            </Router>
        );
    }
}