mirror of
https://github.com/antebudimir/feishin.git
synced 2025-12-31 18:13:31 +00:00
Add full container spinner/loader
This commit is contained in:
parent
5dbc0c61c5
commit
691bc8f1ef
3 changed files with 16 additions and 20 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import { Center } from '@mantine/core';
|
||||
import type { IconType } from 'react-icons';
|
||||
import { RiLoader5Fill } from 'react-icons/ri';
|
||||
import styled from 'styled-components';
|
||||
|
|
@ -5,6 +6,7 @@ import { rotating } from '/@/renderer/styles';
|
|||
|
||||
interface SpinnerProps extends IconType {
|
||||
color?: string;
|
||||
container?: boolean;
|
||||
size?: number;
|
||||
}
|
||||
|
||||
|
|
@ -14,6 +16,17 @@ export const SpinnerIcon = styled(RiLoader5Fill)`
|
|||
`;
|
||||
|
||||
export const Spinner = ({ ...props }: SpinnerProps) => {
|
||||
if (props.container) {
|
||||
return (
|
||||
<Center
|
||||
h="100%"
|
||||
w="100%"
|
||||
>
|
||||
<SpinnerIcon {...props} />
|
||||
</Center>
|
||||
);
|
||||
}
|
||||
|
||||
return <SpinnerIcon {...props} />;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue