imported loading gifs

Enri1196 2020-03-08 17:40:44 +01:00
parent a30540059b
commit 4f6b0652a6
3 changed files with 16 additions and 13 deletions

View File

@ -1,6 +1,6 @@
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
import React, { Suspense, lazy } from 'react';
import Loading from "./routes/Loading"
import Loading from "./routes/Loading";
//const Home = lazy(() => import('./routes/Home'));
const Home = lazy(() => {

View File

@ -2,15 +2,26 @@ import React from 'react';
import Navbar from '../Navbar';
import 'bootstrap/dist/css/bootstrap.min.css';
import 'bootstrap/dist/js/bootstrap.min.js';
import "./centercontainer.css"
import images from "./loadinggifs/images"
import "./centercontainer.css";
import loading1 from "./loadinggifs/loading1.gif";
import loading2 from "./loadinggifs/loading2.gif";
import loading3 from "./loadinggifs/loading3.gif";
import loading4 from "./loadinggifs/loading4.gif";
class Loading extends React.Component {
render() {
let randInt = () => {
return Math.round(Math.random() * 4);
};
let randomGif = () => {
return images[3]
}
let images = [loading1, loading2, loading3, loading4]
return images[randInt()];
};
console.log(randomGif())
return (
<>
<Navbar brand="LOADING" />

View File

@ -1,8 +0,0 @@
const images = [
'./loadinggifs/loading1.gif',
'./loadinggifs/loading2.gif',
'./loadinggifs/loading3.gif',
'./loadinggifs/loading4.gif',
];
export default images;