chore: update heading styles

This commit is contained in:
Steven 2023-12-17 11:08:13 +08:00
parent 8095d94c97
commit 0793f96578

View File

@ -8,8 +8,21 @@ interface Props {
const Heading: React.FC<Props> = ({ level, children }: Props) => {
const Head = `h${level}` as keyof JSX.IntrinsicElements;
const className = (() => {
switch (level) {
case 1:
return "text-5xl leading-normal font-bold";
case 2:
return "text-3xl leading-normal font-medium";
case 3:
return "text-xl leading-normal font-medium";
case 4:
return "text-lg font-bold";
}
})();
return (
<Head>
<Head className={className}>
{children.map((child, index) => (
<Renderer key={`${child.type}-${index}`} node={child} />
))}