Added a loading indicator

This commit is contained in:
Jori Lallo
2016-05-29 11:01:48 -07:00
parent 9cad1c5173
commit 6af3968634
4 changed files with 38 additions and 0 deletions

View File

@@ -4,6 +4,7 @@ import Link from 'react-router/lib/Link';
import HeaderMenu from './components/HeaderMenu';
import Flex from 'components/Flex';
import LoadingIndicator from 'components/LoadingIndicator';
import styles from './Layout.scss';
import classNames from 'classnames/bind';
@@ -14,11 +15,15 @@ class Layout extends React.Component {
actions: React.PropTypes.node,
title: React.PropTypes.node,
fixed: React.PropTypes.bool,
loading: React.PropTypes.bool,
}
render() {
return (
<div className={ styles.container }>
{ this.props.loading ? (
<LoadingIndicator />
) : null }
<div className={ cx(styles.header, { fixed: this.props.fixed }) }>
<div className={ styles.teamName }>
<Link to="/">{ this.props.teamName }</Link>

View 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;

View 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%; }
}

View File

@@ -0,0 +1,2 @@
import LoadingIndicator from './LoadingIndicator';
export default LoadingIndicator;