Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Merge branch 'add/8233-product-image-gallery-block' of https://github…
Browse files Browse the repository at this point in the history
….com/woocommerce/woocommerce-blocks into add/8233-product-image-gallery-block
  • Loading branch information
gigitux committed Jan 30, 2023
2 parents d9900e0 + 21a1fea commit 75d00bb
Showing 1 changed file with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* External dependencies
*/
import { useBorderProps } from '@woocommerce/base-hooks';
import { WC_BLOCKS_IMAGE_URL } from '@woocommerce/block-settings';
import { isEmptyObject } from '@woocommerce/types';
import { useBlockProps } from '@wordpress/block-editor';
Expand All @@ -13,17 +12,14 @@ import { Disabled } from '@wordpress/components';
*/
import './editor.scss';

const Placeholder = ( { attributes }: BlockAttributes ) => {
const marginProps = useBorderProps( attributes );

const Placeholder = () => {
return (
<div className="wc-block-editor-product-gallery">
<img
src={ `${ WC_BLOCKS_IMAGE_URL }template-placeholders/fallback.svg` }
style={ {
width: '500px',
height: '500px',
...marginProps.style,
} }
alt="Placeholder"
/>
Expand All @@ -36,7 +32,6 @@ const Placeholder = ( { attributes }: BlockAttributes ) => {
style={ {
width: '100px',
height: '100px',
...marginProps.style,
} }
alt="Placeholder"
/>
Expand All @@ -58,14 +53,14 @@ interface Props {
context: Context;
}

const Edit = ( { context, attributes }: Props ) => {
const Edit = ( { context }: Props ) => {
const blockProps = useBlockProps();

if ( isEmptyObject( context ) ) {
return (
<div { ...blockProps }>
<Disabled>
<Placeholder attributes={ attributes } />
<Placeholder />
</Disabled>
</div>
);
Expand Down

0 comments on commit 75d00bb

Please sign in to comment.