|
1 | 1 | import './App.css'; |
2 | | -import React, {Component} from 'react'; |
3 | | -import { Strategy, changeRed } from './components/Strategy/Strategy' |
4 | | -import { InputField } from './components/Canvas/InputField.js'; |
5 | | -import MainCanvas from './components/Canvas/MainCanvas'; |
| 2 | +import React, {Component} from 'react'; |
| 3 | +import { |
| 4 | + BrowserRouter as Router, |
| 5 | + Switch, |
| 6 | + Route, |
| 7 | + Link, |
| 8 | +} from 'react-router-dom'; |
6 | 9 |
|
7 | | -class App extends Component { |
| 10 | +import Header from './partial/Header'; |
| 11 | +import Selection from './partial/Selection'; |
| 12 | +import Footer from './partial/Footer'; |
| 13 | +import {Strategy, changeRed} from './components/Strategy/Strategy'; |
| 14 | +import {InputField} from './components/Canvas/InputField.js'; |
| 15 | +import MainCanvas from './components/Canvas/MainCanvas'; |
| 16 | +import SplashScreen from './components/Container/Splash/SplashScreen'; |
| 17 | +import {Routes} from 'react-router'; |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | +function About() { |
| 22 | + return null; |
| 23 | +} |
8 | 24 |
|
9 | | - constructor(props) { |
10 | | - super(props); |
11 | | - // this.changeRed = new changeRed(); |
12 | | - // this.Strategy = new Strategy().setStrategy = this.changeRed; |
13 | | - } |
| 25 | + |
| 26 | + |
| 27 | +class App extends Component { |
14 | 28 |
|
15 | 29 | render() { |
16 | 30 | return ( |
17 | | - <> |
18 | | - <MainCanvas/> |
19 | | - </> |
20 | | - ) |
| 31 | + <> |
| 32 | + <Router> |
| 33 | + {/*<Layout>*/} |
| 34 | + <Routes> |
| 35 | + {/* A <Switch> looks through its children <Route>s and |
| 36 | + renders the first one that matches the current URL. */} |
| 37 | + <Route exact path = "/about" element = {<About/>}/> |
| 38 | + <Route exact path = "/home" element = {<MainCanvas/>}/> |
| 39 | + {/*<Route exact path = "/" element = {<SplashScreen/>}/>*/} |
| 40 | + <Route exact path = "/" element = {<MainCanvas/>}/> |
| 41 | + </Routes> |
| 42 | + {/*</Layout>*/} |
| 43 | + </Router> |
| 44 | + </> |
| 45 | + |
| 46 | + ); |
| 47 | + |
21 | 48 | } |
22 | 49 | } |
23 | 50 |
|
24 | 51 |
|
| 52 | + |
25 | 53 | export default App; |
0 commit comments