Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tiled gallery & Slideshow: use BlockIcon component in mediaPlaceholders #12160

Merged
merged 3 commits into from
Apr 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion extensions/blocks/slideshow/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { isBlobURL } from '@wordpress/blob';
import { withDispatch } from '@wordpress/data';
import {
BlockControls,
BlockIcon,
InspectorControls,
MediaPlaceholder,
MediaUpload,
Expand All @@ -29,6 +30,7 @@ import {
/**
* Internal dependencies
*/
import { icon } from '.';
import Slideshow from './slideshow';
import './editor.scss';

Expand Down Expand Up @@ -184,7 +186,7 @@ class SlideshowEdit extends Component {
<Fragment>
{ controls }
<MediaPlaceholder
icon="format-gallery"
icon={ <BlockIcon icon={ icon } /> }
className={ className }
labels={ {
title: __( 'Slideshow', 'jetpack' ),
Expand Down
2 changes: 1 addition & 1 deletion extensions/blocks/slideshow/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import edit from './edit';
import save from './save';
import transforms from './transforms';

const icon = (
export const icon = (
<SVG xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
<Path d="M0 0h24v24H0z" fill="none" />
<Path d="M10 8v8l5-4-5-4zm9-5H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14z" />
Expand Down
3 changes: 2 additions & 1 deletion extensions/blocks/tiled-gallery/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Component, Fragment } from '@wordpress/element';
import { filter, get, pick } from 'lodash';
import {
BlockControls,
BlockIcon,
InspectorControls,
MediaPlaceholder,
MediaUpload,
Expand Down Expand Up @@ -207,7 +208,7 @@ class TiledGalleryEdit extends Component {
<Fragment>
{ controls }
<MediaPlaceholder
icon={ <div className="tiled-gallery__media-placeholder-icon">{ icon }</div> }
icon={ <BlockIcon icon={ icon } /> }
className={ className }
labels={ {
title: __( 'Tiled Gallery', 'jetpack' ),
Expand Down
11 changes: 1 addition & 10 deletions extensions/blocks/tiled-gallery/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -104,21 +104,12 @@
transform: translate( -50%, -50% );
}

// Hide captions and upload buttons in style picker preview
// Hide upload buttons in style picker preview
.editor-block-preview__content & {
/* @TODO Caption has been commented out */
// figcaption,
Copy link
Member Author

@simison simison Apr 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated leftover from #11980 that should be removed. Convenient to get it removed here.

.editor-media-placeholder {
display: none;
}
}

// Matches with `.dashicon` in `MediaPlaceholder` component
.tiled-gallery__media-placeholder-icon {
height: 20px;
margin-right: 1ch; // stylelint-disable-line unit-whitelist
width: 20px;
}
}

.tiled-gallery__filter-picker-menu {
Expand Down