forked from p34709852/monkey
Fixed white screen on map/going to map bug, implemented loading screen while UI is waiting for login status
This commit is contained in:
parent
ce26736ad2
commit
95cc44c4d2
|
@ -24,6 +24,7 @@ import 'react-toggle/style.css';
|
||||||
import 'react-table/react-table.css';
|
import 'react-table/react-table.css';
|
||||||
import notificationIcon from '../images/notification-logo-512x512.png';
|
import notificationIcon from '../images/notification-logo-512x512.png';
|
||||||
import {StandardLayoutComponent} from './layouts/StandardLayoutComponent';
|
import {StandardLayoutComponent} from './layouts/StandardLayoutComponent';
|
||||||
|
import LoadingScreen from './ui-components/LoadingScreen';
|
||||||
|
|
||||||
const reportZeroTrustRoute = '/report/zeroTrust';
|
const reportZeroTrustRoute = '/report/zeroTrust';
|
||||||
|
|
||||||
|
@ -82,10 +83,10 @@ class AppComponent extends AuthComponent {
|
||||||
case false:
|
case false:
|
||||||
return <Redirect to={{pathname: '/login'}}/>;
|
return <Redirect to={{pathname: '/login'}}/>;
|
||||||
default:
|
default:
|
||||||
return page_component;
|
return <LoadingScreen text={'Loading page...'}/>;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
return page_component;
|
return <LoadingScreen text={'Loading page...'}/>;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,8 @@ import React from 'react';
|
||||||
import {Button, Col, Container, Form, Row} from 'react-bootstrap';
|
import {Button, Col, Container, Form, Row} from 'react-bootstrap';
|
||||||
|
|
||||||
import AuthService from '../../services/AuthService';
|
import AuthService from '../../services/AuthService';
|
||||||
import Particles from 'react-particles-js';
|
|
||||||
import {particleParams} from '../../styles/components/particle-component/AuthPageParams';
|
|
||||||
import monkeyGeneral from '../../images/militant-monkey.svg';
|
import monkeyGeneral from '../../images/militant-monkey.svg';
|
||||||
|
import ParticleBackground from '../ui-components/ParticleBackground';
|
||||||
|
|
||||||
class LoginPageComponent extends React.Component {
|
class LoginPageComponent extends React.Component {
|
||||||
login = (event) => {
|
login = (event) => {
|
||||||
|
@ -60,7 +59,7 @@ class LoginPageComponent extends React.Component {
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<Container fluid className={'auth-container'}>
|
<Container fluid className={'auth-container'}>
|
||||||
<Particles className={'particle-background'} params={particleParams}/>
|
<ParticleBackground/>
|
||||||
<Row>
|
<Row>
|
||||||
<Col xs={12} lg={{span: 6, offset: 3}} md={{span: 7, offset: 3}} className={'auth-block'}>
|
<Col xs={12} lg={{span: 6, offset: 3}} md={{span: 7, offset: 3}} className={'auth-block'}>
|
||||||
<Row>
|
<Row>
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {Row, Col, Container, Form, Button} from 'react-bootstrap';
|
import {Row, Col, Container, Form, Button} from 'react-bootstrap';
|
||||||
import Particles from 'react-particles-js';
|
|
||||||
|
|
||||||
import AuthService from '../../services/AuthService';
|
import AuthService from '../../services/AuthService';
|
||||||
import {particleParams} from '../../styles/components/particle-component/AuthPageParams';
|
|
||||||
import monkeyDetective from '../../images/detective-monkey.svg';
|
import monkeyDetective from '../../images/detective-monkey.svg';
|
||||||
|
import ParticleBackground from "../ui-components/ParticleBackground";
|
||||||
|
|
||||||
class RegisterPageComponent extends React.Component {
|
class RegisterPageComponent extends React.Component {
|
||||||
|
|
||||||
|
@ -81,7 +80,7 @@ class RegisterPageComponent extends React.Component {
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<Container fluid className={'auth-container'}>
|
<Container fluid className={'auth-container'}>
|
||||||
<Particles className={'particle-background'} params={particleParams}/>
|
<ParticleBackground />
|
||||||
<Row>
|
<Row>
|
||||||
<Col xs={12} lg={{span: 6, offset: 3}} md={{span: 7, offset: 3}}
|
<Col xs={12} lg={{span: 6, offset: 3}} md={{span: 7, offset: 3}}
|
||||||
className={'auth-block'}>
|
className={'auth-block'}>
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
import React from 'react';
|
||||||
|
import monkeyLoader from '../../images/monkey_loading.gif';
|
||||||
|
import '../../styles/components/LoadingScreen.scss';
|
||||||
|
import ParticleBackground from './ParticleBackground';
|
||||||
|
|
||||||
|
export default function LoadingScreen(props) {
|
||||||
|
return (
|
||||||
|
<div className={'loading-screen'}>
|
||||||
|
<ParticleBackground/>
|
||||||
|
<div className={'loading-component'}>
|
||||||
|
<div className={'loading-image'}><img src={monkeyLoader}/></div>
|
||||||
|
<div className={'loading-text'}>{props.text.toUpperCase()}</div>
|
||||||
|
</div>
|
||||||
|
</div>);
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
import Particles from 'react-particles-js';
|
||||||
|
import {particleParams} from '../../styles/components/particle-component/ParticleBackgroundParams';
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
export default function ParticleBackground() {
|
||||||
|
return (<Particles className={'particle-background'} params={particleParams}/>);
|
||||||
|
}
|
Binary file not shown.
After Width: | Height: | Size: 166 KiB |
|
@ -11,6 +11,7 @@
|
||||||
@import 'components/InfoPane';
|
@import 'components/InfoPane';
|
||||||
@import 'components/PreviewPane';
|
@import 'components/PreviewPane';
|
||||||
@import 'components/AdvancedMultiSelect';
|
@import 'components/AdvancedMultiSelect';
|
||||||
|
@import 'components/particle-component/ParticleBackground';
|
||||||
|
|
||||||
|
|
||||||
// Define custom elements after bootstrap import
|
// Define custom elements after bootstrap import
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
.loading-screen {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loading-screen div.loading-component {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
margin-right: -50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
padding: 10px;
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loading-screen div.loading-component .loading-image img {
|
||||||
|
border: 5px solid #363536;
|
||||||
|
border-radius: 70px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loading-screen div.loading-component .loading-text {
|
||||||
|
margin-top: 15px;
|
||||||
|
text-align: center;
|
||||||
|
font-weight: bold;
|
||||||
|
background: #ffcc00;
|
||||||
|
padding: 0 5px 0 5px;
|
||||||
|
border-radius: 5px;
|
||||||
|
font-size: 1.2em;
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
.particle-background {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: -100;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background-color: $gray-300;
|
||||||
|
}
|
|
@ -36,16 +36,6 @@
|
||||||
max-height: 500px;
|
max-height: 500px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.particle-background {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
z-index: -100;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
background-color: $gray-300;
|
|
||||||
}
|
|
||||||
|
|
||||||
.auth-block {
|
.auth-block {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
background-color: rgba(255, 255, 255, 0.89);
|
background-color: rgba(255, 255, 255, 0.89);
|
||||||
|
|
Loading…
Reference in New Issue