ADDED all routes

master
enrico 2020-01-14 19:34:28 +01:00
parent 22154d1953
commit 0ae333e7aa
8 changed files with 99 additions and 2 deletions

View File

@ -2,8 +2,15 @@ import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
import React, { Suspense, lazy } from 'react'; import React, { Suspense, lazy } from 'react';
const Home = lazy(() => import('./routes/Home')); const Home = lazy(() => import('./routes/Home'));
const Film = lazy(() => import('./routes/Film'));
const Anime = lazy(() => import('./routes/Anime')); const Anime = lazy(() => import('./routes/Anime'));
const Notfound = lazy(() => import('./routes/notfound')); const SerieTV = lazy(() => import('./routes/SerieTV'));
const Immagini = lazy(() => import('./routes/Immagini'));
const Musica = lazy(() => import('./routes/Musica'));
const Giochi = lazy(() => import('./routes/Giochi'));
const Programmi = lazy(() => import('./routes/Programmi'));
const NotFound = lazy(() => import('./routes/NotFound'));
class App extends React.Component { class App extends React.Component {
@ -13,9 +20,15 @@ class App extends React.Component {
<Suspense fallback={<div>Loading...</div>}> <Suspense fallback={<div>Loading...</div>}>
<Switch> <Switch>
<Route exact path="/" component={Home}/> <Route exact path="/" component={Home}/>
<Route path="/Film" component={Film}/>
<Route path="/Anime" component={Anime}/> <Route path="/Anime" component={Anime}/>
<Route path="/SerieTV" component={SerieTV}/>
<Route path="/Immagini" component={Immagini}/>
<Route path="/Musica" component={Musica}/>
<Route path="/Giochi" component={Giochi}/>
<Route path="/Programmi" component={Programmi}/>
<Route component={Notfound} /> <Route component={NotFound} />
</Switch> </Switch>
</Suspense> </Suspense>
</Router> </Router>

14
src/routes/Film.js Normal file
View File

@ -0,0 +1,14 @@
import React from 'react';
import Navbar from '../Navbar';
class Film extends React.Component {
render() {
return (
<>
<Navbar brand="FILM" />
</>
);
}
}
export default Film;

14
src/routes/Giochi.js Normal file
View File

@ -0,0 +1,14 @@
import React from 'react';
import Navbar from '../Navbar';
class Giochi extends React.Component {
render() {
return (
<>
<Navbar brand="GIOCHI" />
</>
);
}
}
export default Giochi;

14
src/routes/Immagini.js Normal file
View File

@ -0,0 +1,14 @@
import React from 'react';
import Navbar from '../Navbar';
class Immagini extends React.Component {
render() {
return (
<>
<Navbar brand="IMMAGINI" />
</>
);
}
}
export default Immagini;

14
src/routes/Musica.js Normal file
View File

@ -0,0 +1,14 @@
import React from 'react';
import Navbar from '../Navbar';
class Musica extends React.Component {
render() {
return (
<>
<Navbar brand="MUSICA" />
</>
);
}
}
export default Musica;

14
src/routes/Programmi.js Normal file
View File

@ -0,0 +1,14 @@
import React from 'react';
import Navbar from '../Navbar';
class Programmi extends React.Component {
render() {
return (
<>
<Navbar brand="PROGRAMMI" />
</>
);
}
}
export default Programmi;

14
src/routes/SerieTV.js Normal file
View File

@ -0,0 +1,14 @@
import React from 'react';
import Navbar from '../Navbar';
class SerieTV extends React.Component {
render() {
return (
<>
<Navbar brand="SerieTV" />
</>
);
}
}
export default SerieTV;