Skip to content

Commit bfa8da1

Browse files
committed
chore: code refactor
1 parent 94d00d1 commit bfa8da1

File tree

2 files changed

+23
-28
lines changed

2 files changed

+23
-28
lines changed

src/font-size/editor.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
.block-editor-format-toolbar__blablablocks-font-size-popover {
66
.components-popover__content {
77
min-width: 20.625rem;
8-
padding: 5px;
8+
padding: 16px;
99
}
1010

1111
.reset-button {
1212
margin-top: 1rem;
1313
display: block;
1414
margin-left: auto;
1515
}
16-
}
16+
}

src/font-size/inline-ui.js

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,13 @@ function InlineUI( {
3535
settings: { isActive },
3636
} );
3737

38-
const {
39-
fontSizes,
40-
fontSizeValue,
41-
onFontSizeChange,
42-
onClear,
43-
} = useFontSize( {
44-
value,
45-
onChange,
46-
activeAttributes,
47-
} );
38+
const { fontSizes, fontSizeValue, onFontSizeChange, onClear } = useFontSize(
39+
{
40+
value,
41+
onChange,
42+
activeAttributes,
43+
}
44+
);
4845

4946
const handleClear = () => {
5047
onClear();
@@ -60,22 +57,20 @@ function InlineUI( {
6057
placement="bottom"
6158
shift
6259
>
63-
<div style={ { padding: '16px', minWidth: '220px' } }>
64-
<FontSizePicker
65-
value={ fontSizeValue }
66-
onChange={ onFontSizeChange }
67-
fontSizes={ fontSizes }
68-
__next40pxDefaultSize
69-
/>
70-
<Button
71-
className="reset-button"
72-
disabled={ ! fontSizeValue }
73-
onClick={ handleClear }
74-
variant="tertiary"
75-
>
76-
{ __( 'Clear', 'blablablocks-formats' ) }
77-
</Button>
78-
</div>
60+
<FontSizePicker
61+
value={ fontSizeValue }
62+
onChange={ onFontSizeChange }
63+
fontSizes={ fontSizes }
64+
__next40pxDefaultSize
65+
/>
66+
<Button
67+
className="reset-button"
68+
disabled={ ! fontSizeValue }
69+
onClick={ handleClear }
70+
variant="tertiary"
71+
>
72+
{ __( 'Clear', 'blablablocks-formats' ) }
73+
</Button>
7974
</Popover>
8075
);
8176
}

0 commit comments

Comments
 (0)