Skip to content

Commit

Permalink
update the document actions design
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed May 16, 2023
1 parent dea6cc7 commit 483b752
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,18 @@ export default function DocumentActions() {
? __( 'template part' )
: __( 'template' );

const isMac = /Mac|iPod|iPhone|iPad/.test( window.navigator.platform );

return (
<div className="edit-site-document-actions">
<span></span>
<span className="edit-site-document-actions__left"></span>
<Text
size="body"
as="h1"
className="edit-site-document-actions__title"
>
<Button onClick={ () => openCommandCenter() }>
<BlockIcon icon={ icon } />
<VisuallyHidden as="span">
{ sprintf(
/* translators: %s: the entity being edited, like "template"*/
Expand All @@ -61,7 +64,12 @@ export default function DocumentActions() {
{ getTitle() }
</Button>
</Text>
<BlockIcon icon={ icon } />
<Button
className="edit-site-document-actions__shortcut"
onClick={ openCommandCenter }
>
{ isMac ? '⌘' : 'Ctrl' } K
</Button>
</div>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,14 @@
justify-content: center;
}
}

.edit-site-document-actions__shortcut {
color: $gray-700;
&:hover {
color: $gray-700;
}
}

.edit-site-document-actions__left {
min-width: $button-size;
}

0 comments on commit 483b752

Please sign in to comment.