summaryrefslogtreecommitdiff
path: root/client/src/App.tsx
blob: edd95043fc256d9d8c705751a91f702f4a804e06 (plain)
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
import React from "react";
import { BrowserRouter as Router, Switch, Route } from "react-router-dom";
import { Header } from "./Header/Header";
import { About } from "./About/About";
import { Mancala } from "./Mancala/Mancala";
import "./App.css";

export function App() {
    return (
        <Router>
            {/* The header with navigation options is always on top of every page */}
            <Header />

            <div className="main-content">
                <Switch>
                    {/* If the user goes to the url /about, show the about page */}
                    <Route path="/about">
                        <About />
                    </Route>

                    {/* If the user goes to any other url, show the play page */}
                    <Route path="/">
                        <Mancala />
                    </Route>
                </Switch>
            </div>
        </Router>
    )
}