Skip to content

Commit

Permalink
Restore Platform.isWeb condition
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Sep 18, 2023
1 parent 0955d9f commit 2a7c9ec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions packages/block-library/src/gallery/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ import {
import useImageSizes from './use-image-sizes';
import useGetNewImages from './use-get-new-images';
import useGetMedia from './use-get-media';
import useGapStyles from './gap-styles';
import GapStyles from './gap-styles';

const MAX_COLUMNS = 8;
const linkOptions = [
Expand Down Expand Up @@ -535,11 +535,6 @@ function GalleryEdit( props ) {
...nativeInnerBlockProps,
} );

useGapStyles( {
blockGap: attributes.style?.spacing?.blockGap,
clientId,
} );

if ( ! hasImages ) {
return (
<View { ...innerBlocksProps }>
Expand Down Expand Up @@ -658,6 +653,10 @@ function GalleryEdit( props ) {
addToGallery={ hasImageIds }
/>
</BlockControls>
<GapStyles
blockGap={ attributes.style?.spacing?.blockGap }
clientId={ clientId }
/>
</>
) }
<Gallery
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/gallery/gap-styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { unlock } from '../lock-unlock';

const { useStyleOverride } = unlock( blockEditorPrivateApis );

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

0 comments on commit 2a7c9ec

Please sign in to comment.