|
@ -1,7 +1,7 @@ |
|
|
import React from 'react' |
|
|
import React from 'react' |
|
|
import PropTypes from 'prop-types' |
|
|
import PropTypes from 'prop-types' |
|
|
import Isvg from 'react-inlinesvg' |
|
|
import Isvg from 'react-inlinesvg' |
|
|
|
|
|
import { Transition, animated, config } from 'react-spring' |
|
|
import cloudLightningIcon from 'icons/cloud_lightning.svg' |
|
|
import cloudLightningIcon from 'icons/cloud_lightning.svg' |
|
|
|
|
|
|
|
|
import { FormattedMessage } from 'react-intl' |
|
|
import { FormattedMessage } from 'react-intl' |
|
@ -9,18 +9,31 @@ import messages from './messages' |
|
|
|
|
|
|
|
|
import styles from './LoadingBolt.scss' |
|
|
import styles from './LoadingBolt.scss' |
|
|
|
|
|
|
|
|
const LoadingBolt = ({ theme }) => ( |
|
|
class LoadingBolt extends React.PureComponent { |
|
|
<div className={`${styles.container} ${theme}`}> |
|
|
render() { |
|
|
|
|
|
const { theme, visible = true } = this.props |
|
|
|
|
|
return ( |
|
|
|
|
|
<div> |
|
|
|
|
|
<Transition enter={{ opacity: 1 }} leave={{ opacity: 0 }} config={config.slow} native> |
|
|
|
|
|
{visible && |
|
|
|
|
|
(springStyles => ( |
|
|
|
|
|
<animated.div style={springStyles} className={`${styles.container} ${theme}`}> |
|
|
<div className={styles.content}> |
|
|
<div className={styles.content}> |
|
|
<Isvg className={styles.bolt} src={cloudLightningIcon} /> |
|
|
<Isvg className={styles.bolt} src={cloudLightningIcon} /> |
|
|
<h1> |
|
|
<h1> |
|
|
<FormattedMessage {...messages.loading} /> |
|
|
<FormattedMessage {...messages.loading} /> |
|
|
</h1> |
|
|
</h1> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
</animated.div> |
|
|
|
|
|
))} |
|
|
|
|
|
</Transition> |
|
|
</div> |
|
|
</div> |
|
|
) |
|
|
) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
LoadingBolt.propTypes = { |
|
|
LoadingBolt.propTypes = { |
|
|
|
|
|
visible: PropTypes.bool, |
|
|
theme: PropTypes.string.isRequired |
|
|
theme: PropTypes.string.isRequired |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|