Skip to content

Commit

Permalink
Revisions
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgefilipecosta committed Oct 19, 2018
1 parent 194e40c commit e58c3c8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
12 changes: 9 additions & 3 deletions packages/block-library/src/media-text/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,16 @@ class MediaTextEdit extends Component {
}

render() {
const { attributes, backgroundColor, setAttributes, setBackgroundColor } = this.props;
const {
attributes,
className,
backgroundColor,
setAttributes,
setBackgroundColor,
} = this.props;
const { mediaPosition, mediaWidth } = attributes;
const temporaryMediaWidth = this.state.mediaWidth;
const className = classnames( 'wp-block-media-text', {
const classNames = classnames( className, {
'has-media-on-the-right': 'right' === mediaPosition,
[ backgroundColor.class ]: backgroundColor.class,
} );
Expand Down Expand Up @@ -142,7 +148,7 @@ class MediaTextEdit extends Component {
controls={ toolbarControls }
/>
</BlockControls>
<div className={ className } style={ style } >
<div className={ classNames } style={ style } >
{ this.renderMediaArea() }
<InnerBlocks
allowedBlocks={ ALLOWED_BLOCKS }
Expand Down
2 changes: 0 additions & 2 deletions packages/block-library/src/media-text/editor.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


.wp-block-media-text,
.wp-block-media-text.aligncenter {
grid-template-areas:
Expand Down
14 changes: 4 additions & 10 deletions packages/block-library/src/media-text/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ export const settings = {

category: 'layout',

keywords: [ __( 'image' ), __( 'video' ), __( 'half' ) ],

attributes: {
align: {
type: 'string',
Expand Down Expand Up @@ -86,16 +88,8 @@ export const settings = {
mediaWidth,
} = attributes;
const mediaTypeRenders = {
image: () => {
return (
<img src={ mediaUrl } alt={ mediaAlt } />
);
},
video: () => {
return (
<video controls src={ mediaUrl } />
);
},
image: () => <img src={ mediaUrl } alt={ mediaAlt } />,
video: () => <video controls src={ mediaUrl } />,
};

const backgroundClass = getColorClassName( 'background-color', backgroundColor );
Expand Down

0 comments on commit e58c3c8

Please sign in to comment.