Skip to content

Commit

Permalink
[not verified] Markdown Block: ensure the editor buttons look good ev…
Browse files Browse the repository at this point in the history
…erywhere (#15315)

Fixes #14978

This adds additional classes so the button can be properly styled by the editor.
  • Loading branch information
jeherve committed Apr 7, 2020
1 parent e87a469 commit a579a9f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions extensions/blocks/markdown/edit.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/**
* External dependencies
*/
import classnames from 'classnames';
import { __ } from '@wordpress/i18n';
import { BlockControls, PlainText } from '@wordpress/block-editor';
import { Component } from '@wordpress/element';
Expand Down Expand Up @@ -67,12 +68,13 @@ class MarkdownEdit extends Component {

renderToolbarButton( mode, label ) {
const { activePanel } = this.state;
const { className } = this.props;
const buttonClassnames = classnames( className, 'components-button components-tab-button', {
'is-pressed': activePanel === mode,
} );

return (
<button
className={ `components-tab-button ${ activePanel === mode ? 'is-active' : '' }` }
onClick={ this.toggleMode( mode ) }
>
<button className={ buttonClassnames } onClick={ this.toggleMode( mode ) }>
<span>{ label }</span>
</button>
);
Expand Down

0 comments on commit a579a9f

Please sign in to comment.