Created
April 1, 2022 14:55
-
-
Save alanef/30fddd3a43a1eb83b9d002b333c061bd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export default function Edit(props) { | |
| const {attributes, setAttributes} = props | |
| const UnitSelector = () => { | |
| const updateUnits = (val) => { | |
| setAttributes({units: val}); | |
| } | |
| return ( | |
| <TextControl | |
| label={__('Enter Units', 'blocks-for-weatherlink')} | |
| help={__('Knots, MPH, KPH', 'blocks-for-weatherlink')} | |
| type="text" | |
| value={attributes.units} | |
| onChange={updateUnits} | |
| /> | |
| ) | |
| } | |
| return ( | |
| <div {...useBlockProps()}> | |
| <InspectorControls> | |
| <Panel header={__('Weatherlink Settings', 'blocks-for-weatherlink')}> | |
| <PanelBody title={__('Units', 'blocks-for-weatherlink')} initialOpen={true}> | |
| <UnitSelector/> | |
| </PanelBody> | |
| </Panel> | |
| </InspectorControls> | |
| <p> DUMMY OUTPUT </p> | |
| </div> | |
| ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment