Skip to content

Commit 60e0291

Browse files
committed
show loading indicator
1 parent 2d0b6be commit 60e0291

File tree

6 files changed

+19
-9
lines changed

6 files changed

+19
-9
lines changed

build/main.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/main.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/main.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/app.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,10 @@
1010
#log-section {
1111
display: none; /** we overwrite this */
1212
}
13+
14+
.log-loading {
15+
position: absolute;
16+
top: 50%;
17+
left: 50%;
18+
transform: translate(-50%, -50%);
19+
}

js/App.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import styles from '../css/app.css';
2222
export class App extends Component {
2323
state = {
2424
entries: [],
25-
loading: false,
25+
loading: true,
2626
levels: [false, false, false, false, false],
2727
provider: null,
2828
relative: true,
@@ -52,7 +52,8 @@ export class App extends Component {
5252
dateFormat,
5353
provider: this.logProvider
5454
});
55-
this.logProvider.load();
55+
await this.logProvider.load();
56+
this.setState({loading: false});
5657
}
5758

5859
fetchNextPage = _.throttle(async () => {
@@ -129,6 +130,8 @@ export class App extends Component {
129130
dateFormat={this.state.dateFormat}/>
130131
</div>
131132
</ReactScrolla>
133+
} else if (this.state.loading) {
134+
content = <div className="loading log-loading"/>
132135
} else {
133136
content = <div className="emptycontent">
134137
<div className="icon-filetype-text"/>

0 commit comments

Comments
 (0)