Skip to content

Commit 22c65af

Browse files
committed
Add Loading
1 parent b27883b commit 22c65af

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import React from 'react';
2+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
3+
import { faSpinner } from '@fortawesome/free-solid-svg-icons';
4+
5+
import styles from './styles.css';
6+
import Layout from '~/components/common/Layout';
7+
8+
const Loading = ({ loading }) =>
9+
!loading ? null : (
10+
<Layout>
11+
<div className={styles.base}>
12+
<FontAwesomeIcon icon={faSpinner} size="3x" pulse />
13+
</div>
14+
</Layout>
15+
);
16+
17+
export default Loading;
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.base {
2+
display: flex;
3+
align-items: center;
4+
justify-content: center;
5+
width: 100%;
6+
height: 100%;
7+
background-color: rgba(0, 0, 0, 0.75);
8+
}

src/components/preview/PreviewPage/index.jsx

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react';
22

33
import Layout from '~/components/common/Layout';
4+
import Loading from '~/components/common/Loading';
45
import PreviewView from '~/components/preview/PreviewView';
56
import PreviewController from '~/components/preview/PreviewControlll';
67
import * as filters from '~/filters';
@@ -102,6 +103,7 @@ class PreviewPage extends React.Component {
102103
onSave={this.onSave}
103104
onClickFilterButton={this.onClickFilterButton}
104105
/>
106+
<Loading loading={loading} />
105107
</Layout>
106108
);
107109
}

0 commit comments

Comments
 (0)