Router.js
37 lines
| 1 | /** |
| 2 | * External Dependencies |
| 3 | */ |
| 4 | import React from 'react' |
| 5 | import { Route, Routes, useLocation } from 'react-router-dom' |
| 6 | |
| 7 | /** |
| 8 | * Internal Dependencies |
| 9 | */ |
| 10 | import { |
| 11 | Dashboard, |
| 12 | Help, |
| 13 | Products, |
| 14 | Settings, |
| 15 | Modules, |
| 16 | FreeVsPro |
| 17 | } from './../screens' |
| 18 | |
| 19 | const Router = () => { |
| 20 | /* global _EVF_DASHBOARD_ */ |
| 21 | const { isPro, settingsURL } = |
| 22 | typeof _EVF_DASHBOARD_ !== 'undefined' && _EVF_DASHBOARD_ |
| 23 | return ( |
| 24 | <Routes> |
| 25 | <Route path='/' element={<Dashboard />} /> |
| 26 | <Route path='/settings' element={<Settings to={settingsURL} />} /> |
| 27 | <Route path='/features' element={<Modules />} /> |
| 28 | {!isPro && <Route path='/free-vs-pro' element={<FreeVsPro />} />} |
| 29 | <Route path='/help' element={<Help />} /> |
| 30 | <Route path='*' element={<Dashboard />} /> |
| 31 | <Route path='/products' element={<Products />} /> |
| 32 | </Routes> |
| 33 | ) |
| 34 | } |
| 35 | |
| 36 | export default Router |
| 37 |