tidy up inspector controls

This commit is contained in:
Ray Elliott 2020-08-14 18:43:44 +01:00
parent c032afc07a
commit 0a3962690b
1 changed files with 26 additions and 23 deletions

View File

@ -100,7 +100,7 @@ registerBlockType('room-vw/iconify', {
return (
<Fragment>
<InspectorControls>
<PanelBody title="Icon settings">
<PanelBody title="Icon size">
<RangeControl
label={`Font size (${attributes.fontUnit})`}
value={attributes.fontSize}
@ -111,28 +111,31 @@ registerBlockType('room-vw/iconify', {
setAttributes({ fontSize: value });
}}
/>
<PanelRow></PanelRow>
<PanelRow>
<ToggleControl
label="Is isInline"
checked={attributes.isInline}
onChange={(state) => {
setAttributes({ isInline: state });
}}
/>
<ToggleControl
label="Use ems"
checked={attributes.fontUnit === 'em'}
onChange={(state) => {
setAttributes({
fontUnit: state ? 'em' : 'px',
fontSize: state
? attributes.fontSize / 16
: attributes.fontSize * 16,
});
}}
/>
</PanelRow>
<ToggleControl
label="Use ems"
checked={attributes.fontUnit === 'em'}
onChange={(state) => {
setAttributes({
fontUnit: state ? 'em' : 'px',
fontSize: state
? attributes.fontSize / 16
: attributes.fontSize * 16,
});
}}
/>
</PanelBody>
<PanelBody title="Icon variations">
<ToggleControl
label="Inline"
checked={attributes.isInline}
onChange={(state) => {
setAttributes({ isInline: state });
}}
/>
<p>Color</p>
<p>Rotate</p>
<p>Flip</p>
<p>Etc</p>
</PanelBody>
</InspectorControls>