Skip to content

Commit

Permalink
Address review
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Dec 22, 2022
1 parent cc9f480 commit 86f01b7
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { store as preferencesStore } from '@wordpress/preferences';
* Internal dependencies
*/
import TemplateDetails from '../../template-details';
import useEditedEntityRecord from '../../edited-entity-title';
import useEditedEntityRecord from '../../use-edited-entity-record';

function getBlockDisplayText( block ) {
if ( block ) {
Expand Down
4 changes: 0 additions & 4 deletions packages/edit-site/src/components/layout/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,6 @@ $hub-height: $grid-unit-20 * 2 + $button-size;
min-height: 100% !important;
}

.edit-site-layout__view-mode-toggle-container {
height: $header-height;
width: $header-height;
}
.edit-site-layout__view-mode-toggle.components-button {
position: relative;
color: $white;
Expand Down
26 changes: 17 additions & 9 deletions packages/edit-site/src/components/site-hub/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { store as editSiteStore } from '../../store';
import { useLocation } from '../routes';
import getIsListPage from '../../utils/get-is-list-page';
import SiteIcon from '../site-icon';
import useEditedEntityRecord from '../edited-entity-title';
import useEditedEntityRecord from '../use-edited-entity-record';

const HUB_ANIMATION_DURATION = 0.3;

Expand Down Expand Up @@ -63,6 +63,7 @@ function SiteHub( {
const isBackToDashboardButton =
( ! isMobileViewport && canvasMode === 'view' ) ||
( isMobileViewport && ! isMobileCanvasVisible );
const showLabels = canvasMode !== 'edit';
const siteIconButtonProps = isBackToDashboardButton
? {
href: dashboardLink || 'index.php',
Expand All @@ -88,9 +89,12 @@ function SiteHub( {
ease: 'easeOut',
} }
>
<HStack justify="flex-start">
<HStack
justify="flex-start"
className="edit-site-site-hub__text-content"
>
<motion.div
className="edit-site-layout__view-mode-toggle-container"
className="edit-site-site-hub__view-mode-toggle-container"
layout
transition={ {
type: 'tween',
Expand All @@ -106,12 +110,16 @@ function SiteHub( {
</Button>
</motion.div>

<VStack spacing={ 0 }>
<div>{ getTitle() }</div>
<div className="edit-site-site-hub__post-type">
{ entityConfig?.label }
</div>
</VStack>
{ showLabels && (
<VStack spacing={ 0 }>
<div className="edit-site-site-hub__title">
{ getTitle() }
</div>
<div className="edit-site-site-hub__post-type">
{ entityConfig?.label }
</div>
</VStack>
) }
</HStack>

{ showEditButton && (
Expand Down
17 changes: 17 additions & 0 deletions packages/edit-site/src/components/site-hub/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,20 @@
.edit-site-site-hub__post-type {
opacity: 0.6;
}

.edit-site-site-hub__view-mode-toggle-container {
height: $header-height;
width: $header-height;
flex-shrink: 0;
}

.edit-site-site-hub__text-content {
// Necessary for the ellipsis to work.
overflow: hidden;
}

.edit-site-site-hub__title {
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}

1 comment on commit 86f01b7

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/3757206288
📝 Reported issues:

Please sign in to comment.