Files
blitzkit/src/components/PageWrapper.tsx
T

33 lines
707 B
TypeScript
Raw Normal View History

2023-11-07 17:33:41 -06:00
import { Flex, Theme } from '@radix-ui/themes';
2023-09-18 22:32:21 +00:00
import { ComponentProps } from 'react';
2023-09-18 21:55:40 +00:00
2023-11-07 17:33:41 -06:00
interface PageWrapperProps extends ComponentProps<typeof Flex> {
2023-11-07 10:06:15 -06:00
color?: ComponentProps<typeof Theme>['accentColor'];
2023-12-01 12:23:17 -06:00
size?: 'regular' | 'wide';
2023-11-07 10:06:15 -06:00
}
2023-09-18 22:32:21 +00:00
export default function PageWrapper({
style,
2023-11-07 10:06:15 -06:00
color,
2023-12-01 12:23:17 -06:00
size = 'regular',
2023-09-18 22:32:21 +00:00
...props
2023-11-07 10:06:15 -06:00
}: PageWrapperProps) {
2023-09-18 21:55:40 +00:00
return (
2023-11-07 10:06:15 -06:00
<Theme accentColor={color}>
2023-11-07 17:33:41 -06:00
<Flex
direction="column"
gap="4"
2023-11-07 10:06:15 -06:00
style={{
width: '100%',
2023-12-03 18:26:48 -06:00
maxWidth: size === 'regular' ? 800 : 960,
2023-11-07 10:06:15 -06:00
margin: 'auto',
padding: 16,
boxSizing: 'border-box',
2023-09-18 22:32:21 +00:00
2023-11-07 10:06:15 -06:00
...style,
}}
2023-12-01 12:23:17 -06:00
{...props}
2023-11-07 10:06:15 -06:00
/>
</Theme>
2023-09-18 21:55:40 +00:00
);
}