Created
June 22, 2020 16:00
-
-
Save gutengeek/c071c74207a890ac1b48854c3f9a97e5 to your computer and use it in GitHub Desktop.
This file contains 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
// import via npm | |
import Components from "@gutengeek/components"; | |
import '@gutengeek/components/build/core.css'; | |
import '@gutengeek/components/build/index.css'; | |
const { | |
ShapeControl | |
} = Components; | |
/** | |
* GutenBerg dependencies | |
*/ | |
const { | |
InspectorControls | |
} = wp.blockEditor; | |
const { __ } = wp.i18n; | |
const { | |
PanelBody, | |
} = wp.components; | |
export default function MyComponent( props ) { | |
const { | |
attributes: { | |
shape | |
}, | |
setAttributes | |
} = props | |
const [ device, setDevice ] = useState( 'desktop' ); | |
return <InspectorControls> | |
<PanelBody title={ __('My Panel Body') }> | |
<ShapeControl value={ shape } | |
device={ device } | |
onChangeDevice={ ( device ) => setDevice( device ) } | |
onChange={ ( value ) => setAttributes( { shape: value } ) } | |
/> | |
</PanelBody> | |
</InspectorControls> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment