Skip to content

Commit

Permalink
feat: render the corresponding h* element for a given heading level
Browse files Browse the repository at this point in the history
  • Loading branch information
astorije committed Sep 26, 2024
1 parent d9837ac commit 7852505
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/components/Heading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,9 @@ export interface HeadingProps extends React.PropsWithChildren {
}

export function Heading({ children, className, level }: HeadingProps) {
return <h2 className={clsx(styles.heading[level], className)}>{children}</h2>;
if (level === 2) {
return <h2 className={clsx(styles.heading[2], className)}>{children}</h2>;
} else {
return <h3 className={clsx(styles.heading[3], className)}>{children}</h3>;
}
}

0 comments on commit 7852505

Please sign in to comment.