Skip to content

Commit

Permalink
feat: update figure label and max heading level
Browse files Browse the repository at this point in the history
Update the figure label element from "label" to "h4" in figure.tsx.
Also, adjust the max heading level from 4 to 5 in content-to-jsx.tsx.
  • Loading branch information
nlisgo committed Feb 2, 2024
1 parent adf9363 commit 6dced7e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/atoms/figure/figure.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const Figure = ({
return (
<div className="figure-container">
<figure className="figure" {...(id && { id })}>
{label && <label className="figure__label">{label}</label>}
{label && <h4 className="figure__label">{label}</h4>}
{content}
{caption && <figcaption ref={captionRef} className={`figure__caption${expanded ? ' figure__caption--expanded' : ''}`}>{caption}</figcaption>}
</figure>
Expand Down
2 changes: 1 addition & 1 deletion src/utils/content-to-jsx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const contentToJsx = (content?: Content, options?: Options, index?: numbe
case 'Date':
return <time key={index}>{ contentToJsx(content.content, options)}</time>;
case 'Figure':
return <Figure key={index} id={content.id} caption={contentToJsx(content.caption, { ...options, maxHeadingLevel: 4 })} label={content.label} content={contentToJsx(content.content, options)} />;
return <Figure key={index} id={content.id} caption={contentToJsx(content.caption, { ...options, maxHeadingLevel: 5 })} label={content.label} content={contentToJsx(content.content, options)} />;
case 'ImageObject':
if (!content.contentUrl) {
return '';
Expand Down

0 comments on commit 6dced7e

Please sign in to comment.