mirror of https://github.com/sgoudham/carbon.git
clean up editor state more with Spinner wrapper
parent
109adb4cb0
commit
5dbed921d5
@ -0,0 +1,27 @@
|
||||
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
|
||||
}
|
Loading…
Reference in New Issue