From fd213120a02586f3a3fbe5b1c693f5bdd4ce87cd Mon Sep 17 00:00:00 2001 From: Ari Stathopoulos Date: Fri, 18 Jun 2021 12:20:39 +0300 Subject: [PATCH] fix for native file --- .../block-library/src/buttons/edit.native.js | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/packages/block-library/src/buttons/edit.native.js b/packages/block-library/src/buttons/edit.native.js index beea2796c988b..a79e3ba6ef3f4 100644 --- a/packages/block-library/src/buttons/edit.native.js +++ b/packages/block-library/src/buttons/edit.native.js @@ -26,7 +26,6 @@ import { name as buttonBlockName } from '../button/'; import styles from './editor.scss'; const ALLOWED_BLOCKS = [ buttonBlockName ]; -const BUTTONS_TEMPLATE = [ [ 'core/button' ] ]; const layoutProp = { type: 'default', alignments: [] }; @@ -65,6 +64,14 @@ export default function ButtonsEdit( { }, [ clientId ] ); + + const preferredStyle = useSelect( ( select ) => { + const preferredStyleVariations = select( + blockEditorStore + ).getSettings().__experimentalPreferredStyleVariations; + return preferredStyleVariations?.value?.[ 'core/button' ]; + }, [] ); + const { getBlockOrder } = useSelect( blockEditorStore ); const { insertBlock, removeBlock, selectBlock } = useDispatch( blockEditorStore @@ -133,7 +140,18 @@ export default function ButtonsEdit( { { resizeObserver }