Skip to content

Commit

Permalink
Switch out with Placeholder component
Browse files Browse the repository at this point in the history
  • Loading branch information
mkaz committed May 11, 2017
1 parent 59aac6d commit 91fec76
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions blocks/library/gallery/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
import './style.scss';
import { registerBlock, query as hpq } from '../../api';

// TODO: Revisit when we have a common components solution
import Dashicon from '../../../components/dashicon';
import Button from '../../../components/button';
import Button from 'components/button';
import Placeholder from 'components/placeholder';

import GalleryImage from './gallery-image';

Expand Down Expand Up @@ -37,19 +36,15 @@ registerBlock( 'core/gallery', {

if ( ! images ) {
return (
<div className="blocks-gallery is-placeholder">
<div className="blocks-gallery__placeholder-label">
<Dashicon icon="format-gallery" />
{ wp.i18n.__( 'Gallery' ) }
</div>
<div className="blocks-gallery__placeholder-instructions">
{ wp.i18n.__( 'Drag images here or insert from media library' ) }
</div>
<Button isLarge
onClick={ () => setAttributes( { images: canned } ) }>
<Placeholder
instructions={ wp.i18n.__( 'Drag images here or insert from media library' ) }
icon="format-gallery"
label={ wp.i18n.__( 'Gallery' ) }
className="blocks-gallery">
<Button isLarge onClick={ () => setAttributes( { images: canned } ) }>
{ wp.i18n.__( 'Insert from Media Library' ) }
</Button>
</div>
</Placeholder>
);
}

Expand All @@ -72,5 +67,6 @@ registerBlock( 'core/gallery', {
) ) }
</div>
);
}
},

} );

0 comments on commit 91fec76

Please sign in to comment.