Added a loading indicator
This commit is contained in:
@@ -4,6 +4,7 @@ import Link from 'react-router/lib/Link';
|
|||||||
|
|
||||||
import HeaderMenu from './components/HeaderMenu';
|
import HeaderMenu from './components/HeaderMenu';
|
||||||
import Flex from 'components/Flex';
|
import Flex from 'components/Flex';
|
||||||
|
import LoadingIndicator from 'components/LoadingIndicator';
|
||||||
|
|
||||||
import styles from './Layout.scss';
|
import styles from './Layout.scss';
|
||||||
import classNames from 'classnames/bind';
|
import classNames from 'classnames/bind';
|
||||||
@@ -14,11 +15,15 @@ class Layout extends React.Component {
|
|||||||
actions: React.PropTypes.node,
|
actions: React.PropTypes.node,
|
||||||
title: React.PropTypes.node,
|
title: React.PropTypes.node,
|
||||||
fixed: React.PropTypes.bool,
|
fixed: React.PropTypes.bool,
|
||||||
|
loading: React.PropTypes.bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div className={ styles.container }>
|
<div className={ styles.container }>
|
||||||
|
{ this.props.loading ? (
|
||||||
|
<LoadingIndicator />
|
||||||
|
) : null }
|
||||||
<div className={ cx(styles.header, { fixed: this.props.fixed }) }>
|
<div className={ cx(styles.header, { fixed: this.props.fixed }) }>
|
||||||
<div className={ styles.teamName }>
|
<div className={ styles.teamName }>
|
||||||
<Link to="/">{ this.props.teamName }</Link>
|
<Link to="/">{ this.props.teamName }</Link>
|
||||||
|
|||||||
13
src/components/LoadingIndicator/LoadingIndicator.js
Normal file
13
src/components/LoadingIndicator/LoadingIndicator.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
import styles from './LoadingIndicator.scss';
|
||||||
|
|
||||||
|
const LoadingIndicator = (props) => {
|
||||||
|
return (
|
||||||
|
<div className={ styles.loading }>
|
||||||
|
<div className={ styles.loader }></div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default LoadingIndicator;
|
||||||
18
src/components/LoadingIndicator/LoadingIndicator.scss
Normal file
18
src/components/LoadingIndicator/LoadingIndicator.scss
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
.loader {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 2px;
|
||||||
|
background-color: #03A9F4;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loading {
|
||||||
|
background-color: #03A9F4;
|
||||||
|
width: 100%;
|
||||||
|
animation: loading 4s ease-in-out infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes loading {
|
||||||
|
from {margin-left: -100%; z-index:100;}
|
||||||
|
to {margin-left: 100%; }
|
||||||
|
}
|
||||||
2
src/components/LoadingIndicator/index.js
Normal file
2
src/components/LoadingIndicator/index.js
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
import LoadingIndicator from './LoadingIndicator';
|
||||||
|
export default LoadingIndicator;
|
||||||
Reference in New Issue
Block a user