React 18 and Vite (#4510)
This commit is contained in:
parent
1bb1b13f6d
commit
21613fa602
244 changed files with 4547 additions and 8933 deletions
|
@ -1,17 +1,23 @@
|
|||
import React from 'react';
|
||||
import Spinner, { SpinnerSize } from '@/components/elements/Spinner';
|
||||
import Fade from '@/components/elements/Fade';
|
||||
import type { ReactNode } from 'react';
|
||||
import tw from 'twin.macro';
|
||||
|
||||
import Spinner, { SpinnerSize } from '@/components/elements/Spinner';
|
||||
|
||||
interface Props {
|
||||
children?: ReactNode;
|
||||
|
||||
visible: boolean;
|
||||
fixed?: boolean;
|
||||
size?: SpinnerSize;
|
||||
backgroundOpacity?: number;
|
||||
}
|
||||
|
||||
const SpinnerOverlay: React.FC<Props> = ({ size, fixed, visible, backgroundOpacity, children }) => (
|
||||
<Fade timeout={150} in={visible} unmountOnExit>
|
||||
function SpinnerOverlay({ size, fixed, visible, backgroundOpacity, children }: Props) {
|
||||
if (!visible) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
css={[
|
||||
tw`top-0 left-0 flex items-center justify-center w-full h-full rounded flex-col z-40`,
|
||||
|
@ -22,7 +28,7 @@ const SpinnerOverlay: React.FC<Props> = ({ size, fixed, visible, backgroundOpaci
|
|||
<Spinner size={size} />
|
||||
{children && (typeof children === 'string' ? <p css={tw`mt-4 text-neutral-400`}>{children}</p> : children)}
|
||||
</div>
|
||||
</Fade>
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
export default SpinnerOverlay;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue