Skip to content

Commit 2a7c9ec

Browse files
committed
Restore Platform.isWeb condition
1 parent 0955d9f commit 2a7c9ec

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

packages/block-library/src/gallery/edit.js

+5-6
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ import {
6060
import useImageSizes from './use-image-sizes';
6161
import useGetNewImages from './use-get-new-images';
6262
import useGetMedia from './use-get-media';
63-
import useGapStyles from './gap-styles';
63+
import GapStyles from './gap-styles';
6464

6565
const MAX_COLUMNS = 8;
6666
const linkOptions = [
@@ -535,11 +535,6 @@ function GalleryEdit( props ) {
535535
...nativeInnerBlockProps,
536536
} );
537537

538-
useGapStyles( {
539-
blockGap: attributes.style?.spacing?.blockGap,
540-
clientId,
541-
} );
542-
543538
if ( ! hasImages ) {
544539
return (
545540
<View { ...innerBlocksProps }>
@@ -658,6 +653,10 @@ function GalleryEdit( props ) {
658653
addToGallery={ hasImageIds }
659654
/>
660655
</BlockControls>
656+
<GapStyles
657+
blockGap={ attributes.style?.spacing?.blockGap }
658+
clientId={ clientId }
659+
/>
661660
</>
662661
) }
663662
<Gallery

packages/block-library/src/gallery/gap-styles.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { unlock } from '../lock-unlock';
1313

1414
const { useStyleOverride } = unlock( blockEditorPrivateApis );
1515

16-
export default function useGapStyles( { blockGap, clientId } ) {
16+
export default function GapStyles( { blockGap, clientId } ) {
1717
// --gallery-block--gutter-size is deprecated. --wp--style--gallery-gap-default should be used by themes that want to set a default
1818
// gap on the gallery.
1919
const fallbackValue = `var( --wp--style--gallery-gap-default, var( --gallery-block--gutter-size, var( --wp--style--block-gap, 0.5em ) ) )`;

0 commit comments

Comments
 (0)