Skip to content

Commit

Permalink
fix: restore BoldItalicUnderlineToggles
Browse files Browse the repository at this point in the history
  • Loading branch information
petyosi committed Jun 23, 2024
1 parent 77a7566 commit 763fce6
Showing 1 changed file with 28 additions and 30 deletions.
58 changes: 28 additions & 30 deletions src/plugins/toolbar/components/BoldItalicUnderlineToggles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,38 +44,36 @@ export interface BoldItalicUnderlineTogglesProps {
export const BoldItalicUnderlineToggles: React.FC = ({ options }: BoldItalicUnderlineTogglesProps) => {
const t = useTranslation()

const showAllButtons = typeof options === 'undefined'
return (
<div className={styles.toolbarGroupOfGroups}>
{!options ||
(options.includes('Bold') && (
<FormatButton
format={IS_BOLD}
addTitle={t('toolbar.bold', 'Bold')}
removeTitle={t('toolbar.removeBold', 'Remove bold')}
icon="format_bold"
formatName="bold"
/>
))}
{!options ||
(options.includes('Italic') && (
<FormatButton
format={IS_ITALIC}
addTitle={t('toolbar.italic', 'Italic')}
removeTitle={t('toolbar.removeItalic', 'Remove italic')}
icon="format_italic"
formatName="italic"
/>
))}
{!options ||
(options.includes('Underline') && (
<FormatButton
format={IS_UNDERLINE}
addTitle={t('toolbar.underline', 'Underline')}
removeTitle={t('toolbar.removeUnderline', 'Remove underline')}
icon="format_underlined"
formatName="underline"
/>
))}
{showAllButtons || options.includes('Bold') ? (
<FormatButton
format={IS_BOLD}
addTitle={t('toolbar.bold', 'Bold')}
removeTitle={t('toolbar.removeBold', 'Remove bold')}
icon="format_bold"
formatName="bold"
/>
) : null}
{showAllButtons || options.includes('Italic') ? (
<FormatButton
format={IS_ITALIC}
addTitle={t('toolbar.italic', 'Italic')}
removeTitle={t('toolbar.removeItalic', 'Remove italic')}
icon="format_italic"
formatName="italic"
/>
) : null}
{showAllButtons || options.includes('Underline') ? (
<FormatButton
format={IS_UNDERLINE}
addTitle={t('toolbar.underline', 'Underline')}
removeTitle={t('toolbar.removeUnderline', 'Remove underline')}
icon="format_underlined"
formatName="underline"
/>
) : null}
</div>
)
}
Expand Down

0 comments on commit 763fce6

Please sign in to comment.