Completed
Push — master ( 1b782b...279c80 )
by Stefan
02:36
created

src/App.js   A

Complexity

Total Complexity 1
Complexity/F 1

Size

Lines of Code 52
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 47
mnd 0
bc 0
fnc 1
dl 0
loc 52
rs 10
bpm 0
cpm 1
noi 0
c 0
b 0
f 0
1
import React from 'react';
2
import {
3
    BrowserRouter as Router,
4
    Switch,
5
    Route,
6
    Link
7
} from "react-router-dom";
8
9
import Me from './Me.js';
10
import Reports from './Reports.js';
11
import Chat from './Chat.js';
12
import Login from './Login.js';
13
import Register from './Register.js';
14
15
16
import './App.css';
17
18
export default function App() {
19
    return (
20
        <Router>
21
            <div className="App">
22
                <nav>
23
                    <ul>
24
                        <li>
25
                            <Link to="/">Me</Link>
26
                        </li>
27
                        <li>
28
                            <Link to="/reports/">Reports</Link>
29
                        </li>
30
                        <li>
31
                            <Link to="/chat/">Chat</Link>
32
                        </li>
33
                        <li>
34
                            <Link to="/login/">Login</Link>
35
                        </li>
36
                    </ul>
37
                </nav>
38
39
                {/* A <Switch> looks through its children <Route>s and
40
            renders the first one that matches the current URL. */}
41
                <Switch>
42
                    <Route exact path="/" component={Me}/>
43
                    <Route path="/reports/" component={Reports}/>
44
                    <Route path="/chat/" component={Chat}/>
45
                    <Route path="/login/" component={Login}/>
46
                    <Route path="/register/" component={Register}/>
47
                </Switch>
48
            </div>
49
        </Router>
50
    );
51
}
52