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.
carbon/components/SpinnerWrapper.js

28 lines
459 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 {
height: 160px;
}
`}
</style>
</div>
)
}
return props.children
}