arseniy.sorokin | bdf2def | 2023-10-05 00:05:32 +0200 | [diff] [blame] | 1 | import React, { Component } from 'react'; |
| 2 | import Container from '@mui/material/Container'; |
| 3 | import Typography from '@mui/material/Typography'; |
| 4 | import Box from '@mui/material/Box'; |
| 5 | import './App.css'; |
| 6 | import Home from './Home'; |
| 7 | import { BrowserRouter as Router, Route, Switch } from 'react-router-dom'; |
| 8 | import ClientList from './ClientList'; |
| 9 | import InvoiceList from './InvoiceList'; |
| 10 | import ClientEdit from "./ClientEdit"; |
| 11 | |
| 12 | class App extends Component { |
| 13 | render() { |
| 14 | return ( |
| 15 | <Container maxWidth="sm"> |
| 16 | <Box sx={{ my: 4 }}> |
| 17 | <Typography variant="h4" component="h1" gutterBottom> |
| 18 | Invoicer App |
| 19 | </Typography> |
| 20 | <Router> |
| 21 | <Switch> |
| 22 | <Route path='/' exact={true} component={Home}/> |
| 23 | <Route path='/invoices' exact={true} component={InvoiceList}/> |
| 24 | <Route path='/clients' exact={true} component={ClientList}/> |
| 25 | <Route path='/clients/:id' component={ClientEdit}/> |
| 26 | </Switch> |
| 27 | </Router> |
| 28 | </Box> |
| 29 | </Container> |
| 30 | ) |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | export default App; |