|
1 | | -import React,{useEffect} from 'react' |
| 1 | +import React from 'react' |
2 | 2 | import { BrowserRouter as Router, Switch, Route, Link } from 'react-router-dom'
|
3 | 3 |
|
4 | | -// style |
5 | 4 | import './styles/app.scss'
|
6 | 5 |
|
7 | | -// components |
8 | 6 | import { NavBar } from './components/shared'
|
9 | 7 | import { Home, Algorithms, About } from './pages'
|
| 8 | +import Modal from './components/shared/Modal' |
10 | 9 |
|
11 | 10 | const App: React.FC = () => {
|
12 | | - useEffect(() => { |
13 | | - alert( |
14 | | - `Caution!\nThe application shows flashing colors.\n Please, use it in color mode 'off' if you are affected by it.` |
15 | | - ) |
16 | | - }, []) |
17 | 11 | return (
|
18 | 12 | <div className='app'>
|
19 | 13 | <Router>
|
20 | 14 | <NavBar>
|
21 | 15 | <Link to='/algorithms'>ALGORITHMS</Link>
|
22 | 16 | <Link to='/about'>ABOUT</Link>
|
23 | 17 | </NavBar>
|
| 18 | + <Modal /> |
24 | 19 | <Switch>
|
25 | | - <Route path='/algorithms'> |
26 | | - <Algorithms /> |
27 | | - </Route> |
28 | | - <Route path='/about'> |
29 | | - <About /> |
30 | | - </Route> |
31 | | - <Route path='/'> |
32 | | - <Home /> |
33 | | - </Route> |
| 20 | + <Route exact path='/algorithms' component={Algorithms} /> |
| 21 | + <Route exact path='/about' component={About} /> |
| 22 | + <Route exact path='/' component={Home} /> |
34 | 23 | </Switch>
|
35 | 24 | </Router>
|
36 | | - </div> |
| 25 | + </div> |
37 | 26 | )
|
38 | 27 | }
|
39 | 28 |
|
|
0 commit comments