1
0
mirror of https://github.com/mgerb/mywebsite synced 2026-01-13 11:12:47 +00:00

added loading icon - next step: add sensor stuff and things

This commit is contained in:
2016-08-28 01:59:36 -05:00
parent d173b06129
commit 1c224f95ab
5 changed files with 46 additions and 13 deletions

View File

@@ -13,6 +13,9 @@ import '../../assets/scss/main.scss';
import 'font-awesome/css/font-awesome.min.css';
import '../../assets/css/dracula.css';
//loading icon
import loading from '../../assets/images/loading.svg';
export default class Index extends React.Component {
componentDidMount() {
this.props.actions.fetchPreview();
@@ -35,14 +38,14 @@ export default class Index extends React.Component {
render() {
const fetched = this.props.redux.fetched;
const fetching = this.props.redux.fetching;
return (
<div>
<Header />
<div class="Main">
{typeof this.page === 'undefined' && !fetching ? <Preview posts={this.props.redux.preview.posts} /> : null}
{this.page === 'post' && !fetching ? <Post content={this.props.redux.post}/> : null}
{fetching ? <div class="Content">Fetching</div> : null}
{fetching ? loadingElement : null}
<Sidebar />
</div>
<Footer />
@@ -50,3 +53,7 @@ export default class Index extends React.Component {
);
}
}
const loadingElement = <div class="Loading">
<img src={loading} alt="loading..."/>
</div>;