Skip to content

Commit

Permalink
Use value "unstyled" rather than empty string
Browse files Browse the repository at this point in the history
  • Loading branch information
gmcauliffe committed Nov 4, 2024
1 parent 0db6cc5 commit a9863a6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/components/Form/WysiwygControls/BlockStyleToolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import { RichUtils } from 'draft-js'
import 'draft-js/dist/Draft.css'

// FPCC
import WysiwygControls from 'components/Form/WysiwygControls'
import Button from 'components/Form/WysiwygControls/Button'
import HeaderSelect from 'components/Form/WysiwygControls/HeaderSelect'
import getIcon from 'common/utils/getIcon'

export const headerBlockTypes = [
{ label: 'Normal', value: 'unstyled' },
{ label: 'Heading', value: 'header-two' },
{ label: 'Subheading', value: 'header-three' },
]
Expand All @@ -27,14 +29,14 @@ function BlockStyleToolbar({ editorState, onChange, toolbar }) {
return (
<span className="flex border-b border-charcoal-100 text-xl text-charcoal-700">
{toolbar?.includes('HEADER') && (
<WysiwygControls.HeaderSelect
<HeaderSelect
headerBlockTypes={headerBlockTypes}
value={currentBlockType}
handleSelectChange={toggleBlockType}
/>
)}
{toolbar?.includes('OL') && (
<WysiwygControls.Button
<Button
onClickHandler={(event) =>
toggleBlockType(event, 'ordered-list-item')
}
Expand All @@ -43,7 +45,7 @@ function BlockStyleToolbar({ editorState, onChange, toolbar }) {
/>
)}
{toolbar?.includes('UL') && (
<WysiwygControls.Button
<Button
onClickHandler={(event) =>
toggleBlockType(event, 'unordered-list-item')
}
Expand Down
1 change: 0 additions & 1 deletion src/components/Form/WysiwygControls/HeaderSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ function HeaderSelect({ value, handleSelectChange, headerBlockTypes }) {
onChange={onToggle}
className="border-r border-charcoal-100 pl-3 pr-10 py-2 focus:outline-none focus:ring-scarlet-800 focus:border-scarlet-800 text-sm"
>
<option value="">Normal</option>
{headerBlockTypes.map((heading) => (
<option key={heading.value} value={heading.value}>
{heading.label}
Expand Down

0 comments on commit a9863a6

Please sign in to comment.