App.js (978B)
1 import React from 'react'; 2 import { Route, BrowserRouter as Router, Switch } from 'react-router-dom'; 3 4 import CurrentTime from './comp/currentTime'; 5 import Footer from './comp/footer'; 6 import FromToTime from './comp/fromToTime'; 7 import Future from './comp/future'; 8 import Header from './comp/header'; 9 import Help from './comp/help'; 10 11 function App() { 12 const basePath = process.env.PUBLIC_URL; 13 return ( 14 <Router> 15 <div 16 className="container-fluid" 17 style={{ 18 maxWidth: '100vw', 19 overflow: 'hidden', 20 padding: 0, 21 }} 22 > 23 <Header /> 24 <Switch> 25 <Route component={Help} path={`${basePath}/help`} /> 26 <Route component={FromToTime} path={`${basePath}/from-to`} /> 27 <Route component={Future} path={`${basePath}/future`} /> 28 <Route component={CurrentTime} path={`${basePath}/`} /> 29 </Switch> 30 <Footer /> 31 </div> 32 </Router> 33 ); 34 } 35 36 export default App;