forked from ddrilling/asb_cloud_front
19 lines
503 B
TypeScript
19 lines
503 B
TypeScript
import Loader from './Loader'
|
|
|
|
type LoaderPortalProps = {
|
|
show?: boolean,
|
|
fade?: boolean,
|
|
children: any,
|
|
[other: string]: any
|
|
}
|
|
|
|
export const LoaderPortal: React.FC<LoaderPortalProps> = ({show, fade=true, children, ...other}) => (
|
|
<div className={'loader-container'} {...other}>
|
|
<div className={'loader-content'}>{children}</div>
|
|
{show && fade && <div className={'loader-fade'}/>}
|
|
{show && <div className={'loader-overlay'}><Loader/></div>}
|
|
</div>
|
|
)
|
|
|
|
export default LoaderPortal
|