Skip to content

Commit

Permalink
Try using site title as a link
Browse files Browse the repository at this point in the history
  • Loading branch information
richtabor committed May 8, 2024
1 parent 6a0188b commit 5940de0
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 21 deletions.
23 changes: 11 additions & 12 deletions packages/edit-site/src/components/site-hub/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { store as coreStore } from '@wordpress/core-data';
import { store as editorStore } from '@wordpress/editor';
import { decodeEntities } from '@wordpress/html-entities';
import { memo } from '@wordpress/element';
import { search, external } from '@wordpress/icons';
import { search } from '@wordpress/icons';
import { store as commandsStore } from '@wordpress/commands';
import { displayShortcut } from '@wordpress/keycodes';
import { filterURLForDisplay } from '@wordpress/url';
Expand Down Expand Up @@ -158,14 +158,8 @@ const SiteHub = memo( ( { isTransparent, className } ) => {
} }
>
<div className="edit-site-site-hub__title">
{ decodeEntities( siteTitle ) }
</div>
<HStack
spacing={ 0 }
expanded={ false }
className="edit-site-site-hub__actions"
>
<Button
variant="link"
href={ homeUrl }
target="_blank"
label={ __(
Expand All @@ -174,10 +168,15 @@ const SiteHub = memo( ( { isTransparent, className } ) => {
aria-label={ __(
'View site (opens in a new tab)'
) }
icon={ external }
className="edit-site-site-hub__site-view-link"
/>

>
{ decodeEntities( siteTitle ) }
</Button>
</div>
<HStack
spacing={ 0 }
expanded={ false }
className="edit-site-site-hub__actions"
>
<Button
className="edit-site-site-hub_toggle-command-center"
icon={ search }
Expand Down
28 changes: 19 additions & 9 deletions packages/edit-site/src/components/site-hub/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,28 @@
}
}

.edit-site-site-hub__title {
.edit-site-site-hub__title .components-button {
color: $gray-200;
flex-grow: 1;
font-size: 15px;
font-weight: 500;
overflow: hidden;
text-decoration: none;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
flex-grow: 1;
color: $gray-200;
}

.edit-site-site-hub__site-view-link {
margin-right: var(--wp-admin-border-width-focus);
svg {
fill: $gray-200;
&:hover,
&:focus,
&:active {
color: $gray-200;
}

&:hover::after,
&:focus::after,
&:active::after {
content: "";
font-weight: 400;
margin-left: $grid-unit-05;
}
}

Expand Down

0 comments on commit 5940de0

Please sign in to comment.