1
0
mirror of https://github.com/oceanprotocol/commons.git synced 2023-03-15 18:03:00 +01:00

make message part of spinner component

This commit is contained in:
Matthias Kretschmann 2019-02-13 13:04:11 +01:00
parent 4ab8fabb81
commit a249302a42
Signed by: m
GPG Key ID: 606EEEF3C479A91F
4 changed files with 11 additions and 9 deletions

View File

@ -25,7 +25,3 @@
width: 100%;
}
}
.loaderMessage {
color: $brand-grey-light;
}

View File

@ -128,10 +128,7 @@ class App extends Component<{}, AppState> {
<main className={styles.main}>
{this.state.isLoading ? (
<div className={styles.loader}>
<Spinner />
<div className={styles.loaderMessage}>
Connecting to Ocean...
</div>
<Spinner message="Connecting to Ocean..." />
</div>
) : (
<Routes />

View File

@ -22,6 +22,11 @@
}
}
.spinnerMessage {
color: $brand-grey-light;
margin-top: $spacer / 2;
}
@keyframes spinner {
to {
transform: rotate(360deg);

View File

@ -1,6 +1,10 @@
import React from 'react'
import styles from './Spinner.module.scss'
const Spinner = () => <div className={styles.spinner} />
const Spinner = ({ message }: { message?: string }) => (
<div className={styles.spinner}>
{message && <div className={styles.spinnerMessage}>{message}</div>}
</div>
)
export default Spinner