mirror of https://github.com/sgoudham/carbon.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
459 B
JavaScript
28 lines
459 B
JavaScript
6 years ago
|
import React from 'react'
|
||
|
import Spinner from 'react-spinner'
|
||
|
|
||
|
export default function SpinnerWrapper(props) {
|
||
|
const [loading, setLoading] = React.useState(true)
|
||
|
|
||
|
React.useEffect(() => {
|
||
|
setLoading(false)
|
||
|
}, [])
|
||
|
|
||
|
if (loading) {
|
||
|
return (
|
||
|
<div>
|
||
|
<Spinner />
|
||
|
<style jsx>
|
||
|
{`
|
||
|
div {
|
||
|
height: 160px;
|
||
|
}
|
||
|
`}
|
||
|
</style>
|
||
|
</div>
|
||
|
)
|
||
|
}
|
||
|
|
||
|
return props.children
|
||
|
}
|