Skip to content

Commit 6730f99

Browse files
committed
Use a Tooltip, thanks to Pierre's suggestion
Before, the title of the SVG displayed instead.
1 parent 4737f82 commit 6730f99

File tree

1 file changed

+20
-18
lines changed

1 file changed

+20
-18
lines changed

assets/src/block-editor/components/amp-preview.js

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import PropTypes from 'prop-types';
88
* WordPress dependencies
99
*/
1010
import { Component, createRef, renderToString } from '@wordpress/element';
11-
import { Button, Icon } from '@wordpress/components';
11+
import { Button, Icon, Tooltip } from '@wordpress/components';
1212
import { __ } from '@wordpress/i18n';
1313
import { withSelect, withDispatch } from '@wordpress/data';
1414
import { compose } from '@wordpress/compose';
@@ -236,23 +236,25 @@ class AMPPreview extends Component {
236236

237237
return (
238238
isEnabled && ! errorMessages.length && ! isStandardMode && (
239-
<Button
240-
className="amp-editor-post-preview"
241-
href={ href }
242-
label={ __( 'Preview AMP', 'amp' ) }
243-
isSecondary
244-
disabled={ ! isSaveable }
245-
onClick={ this.openPreviewWindow }
246-
ref={ this.buttonRef }
247-
>
248-
{ ampFilledIcon( { viewBox: '0 0 62 62', width: 18, height: 18 } ) }
249-
<span className="screen-reader-text">
250-
{
251-
/* translators: accessibility text */
252-
__( '(opens in a new tab)', 'amp' )
253-
}
254-
</span>
255-
</Button>
239+
<Tooltip text={ __( 'Preview AMP', 'amp' ) } >
240+
<Button
241+
className="amp-editor-post-preview"
242+
href={ href }
243+
label={ __( 'Preview AMP', 'amp' ) }
244+
isSecondary
245+
disabled={ ! isSaveable }
246+
onClick={ this.openPreviewWindow }
247+
ref={ this.buttonRef }
248+
>
249+
{ ampFilledIcon( { viewBox: '0 0 62 62', width: 18, height: 18 } ) }
250+
<span className="screen-reader-text">
251+
{
252+
/* translators: accessibility text */
253+
__( '(opens in a new tab)', 'amp' )
254+
}
255+
</span>
256+
</Button>
257+
</Tooltip>
256258
)
257259
);
258260
}

0 commit comments

Comments
 (0)