Skip to content

Commit

Permalink
feat(Title): mark showInTOC as optional
Browse files Browse the repository at this point in the history
  • Loading branch information
DaryaLari committed Jan 10, 2025
1 parent 85631fe commit e7a3ad0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/plugins/Title/Title.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import './Title.scss';
export interface PluginTitleProps extends PluginWidgetProps {
data: {
text: string;
showInTOC: boolean;
showInTOC?: boolean;
} & TitleFontDataProps &
PluginWidgetProps['data'];
}
Expand Down
12 changes: 1 addition & 11 deletions src/plugins/Title/__stories__/Title.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ export const Size: Story = {
<Flex direction="column" gap={2}>
{sizes.map((size) => (
<Card key={size}>
<PluginTitle
data={{size, text: `Title size=${size}`, showInTOC: true}}
{...args}
/>
<PluginTitle data={{size, text: `Title size=${size}`}} {...args} />
</Card>
))}
<Card>
Expand All @@ -32,7 +29,6 @@ export const Size: Story = {
fontSize: 40,
lineHeight: 100,
text: `Title fontSize=40, lineHeight=100`,
showInTOC: true,
}}
{...args}
/>
Expand All @@ -43,7 +39,6 @@ export const Size: Story = {
size: 'l',
fontSize: 40,
text: `Title size=l, fontSize=40`,
showInTOC: true,
}}
{...args}
/>
Expand All @@ -55,7 +50,6 @@ export const Size: Story = {
fontSize: 40,
lineHeight: 20,
text: `Title size=l, fontSize=40, lineHeight=20 🤷`,
showInTOC: true,
}}
{...args}
/>
Expand All @@ -67,7 +61,6 @@ export const Size: Story = {
fontSize: 40,
lineHeight: 70,
text: `Title size=l, fontSize=40, lineHeight=70`,
showInTOC: true,
}}
{...args}
/>
Expand All @@ -78,7 +71,6 @@ export const Size: Story = {
size: 'l',
lineHeight: 70,
text: `Title size=l, lineHeight=70`,
showInTOC: true,
}}
{...args}
/>
Expand All @@ -88,7 +80,6 @@ export const Size: Story = {
data={{
fontSize: 40,
text: `Title fontSize=40`,
showInTOC: true,
}}
{...args}
/>
Expand All @@ -107,7 +98,6 @@ export const Default: Story = {
data: {
size: 'm',
text: `Title`,
showInTOC: true,
},
},
};

0 comments on commit e7a3ad0

Please sign in to comment.