Created
June 22, 2020 16:20
-
-
Save gutengeek/905891c06ca52d550a7546d137be58bf 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 { | |
DevicesControl | |
} = Components; | |
/** | |
* GutenBerg dependencies | |
*/ | |
const { | |
InspectorControls | |
} = wp.blockEditor; | |
const { __ } = wp.i18n; | |
const { | |
PanelBody, | |
} = wp.components; | |
export default function MyComponent() { | |
const [ device, setDevice ] = useState( 'desktop' ); | |
return <InspectorControls> | |
<PanelBody title={ __('My Panel Body') }> | |
<DevicesControl label={ __( 'Border' ) } | |
value={ device } | |
onClick={ ( value ) => setDevice( value ) }/> | |
</PanelBody> | |
</InspectorControls> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment