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.
29 lines
487 B
JavaScript
29 lines
487 B
JavaScript
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 {
|
|
width: 876px;
|
|
height: 240px;
|
|
}
|
|
`}
|
|
</style>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
return props.children
|
|
}
|