Skip to content

Commit c54b331

Browse files
committed
feat(web): add center option to Loader component
1 parent f46b018 commit c54b331

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

web/src/components/Loader.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,22 @@ const StyledKlerosIcon = styled(KlerosIcon)`
2727
animation: ${breathing} 2s ease-out infinite normal;
2828
`;
2929

30-
const Container = styled.div<{ width?: Width; height?: Height }>`
30+
const Container = styled.div<{ width?: Width; height?: Height; center?: boolean }>`
3131
width: ${({ width }) => width ?? "100%"};
3232
height: ${({ height }) => height ?? "100%"};
33+
${({ center }) => (center ? "margin: auto" : "")};
3334
`;
3435

3536
interface ILoader {
3637
width?: Width;
3738
height?: Height;
39+
center?: boolean;
3840
className?: string;
3941
}
4042

41-
const Loader: React.FC<ILoader> = ({ width, height, className }) => {
43+
const Loader: React.FC<ILoader> = ({ width, height, center, className }) => {
4244
return (
43-
<Container {...{ width, height, className }}>
45+
<Container {...{ width, height, center, className }}>
4446
<StyledKlerosIcon />
4547
</Container>
4648
);

0 commit comments

Comments
 (0)