Commit 51a56b7b authored by tom's avatar tom

[skip ci] update heading component

parent 9795f1c5
...@@ -11,27 +11,25 @@ export const Heading = React.forwardRef<HTMLHeadingElement, HeadingProps>( ...@@ -11,27 +11,25 @@ export const Heading = React.forwardRef<HTMLHeadingElement, HeadingProps>(
const { level, ...rest } = props; const { level, ...rest } = props;
const textStyle = (() => { const textStyle = (() => {
if (level === '1') { switch (level) {
case '1':
return { base: 'heading.md', lg: 'heading.xl' }; return { base: 'heading.md', lg: 'heading.xl' };
} case '2':
if (level === '2') {
return { base: 'heading.sm', lg: 'heading.lg' }; return { base: 'heading.sm', lg: 'heading.lg' };
} case '3':
return { base: 'heading.xs', lg: 'heading.md' }; return { base: 'heading.xs', lg: 'heading.md' };
}
})(); })();
const as = (() => { const as = (() => {
if (level === '1') { switch (level) {
case '1':
return 'h1'; return 'h1';
} case '2':
if (level === '2') {
return 'h2'; return 'h2';
} case '3':
return 'h3'; return 'h3';
}
})(); })();
return <ChakraHeading ref={ ref } color="heading" textStyle={ textStyle } as={ as } { ...rest }/>; return <ChakraHeading ref={ ref } color="heading" textStyle={ textStyle } as={ as } { ...rest }/>;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment