Skip to content

Commit

Permalink
Storybook: Improve the structure of TextDecorationControl story
Browse files Browse the repository at this point in the history
  • Loading branch information
himanshupathak95 committed Dec 20, 2024
1 parent 6427278 commit 0883889
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ Then, you can use the component in your block editor UI:
### `value`

- **Type:** `String`
- **Default:** `none`
- **Options:** `none`, `underline`, `line-through`

The current value of the Text Decoration setting. You may only choose from the `Options` listed above.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ const meta = {
type: {
summary: 'string',
},
defaultValue: { summary: 'none' },
},
},
onChange: {
Expand All @@ -52,18 +51,15 @@ const meta = {

export default meta;

/**
* Default story showing TextDecorationControl
*/
export const Default = {
render: function Template( { onChange, ...args } ) {
const [ value, setValue ] = useState( 'none' );
const [ value, setValue ] = useState();
return (
<TextDecorationControl
{ ...args }
onChange={ ( newValue ) => {
onChange( newValue );
setValue( newValue );
onChange={ ( ...changeArgs ) => {
onChange( ...changeArgs );
setValue( ...changeArgs );
} }
value={ value }
/>
Expand Down

0 comments on commit 0883889

Please sign in to comment.