Skip to content

Commit

Permalink
Disable the Preview dropdown in zoom-out instead of hiding it
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed May 6, 2024
1 parent a7715da commit e2f6bd0
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 40 deletions.
14 changes: 4 additions & 10 deletions packages/edit-post/src/components/header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,16 +135,10 @@ function Header( { setEntitiesSavedStatesCallback, initialPost } ) {
// when the publish sidebar has been closed.
<PostSavedState forceIsDirty={ hasActiveMetaboxes } />
) }
<div
className={ classnames(
'edit-post-header__preview-options',
{ 'is-zoomed-out': isZoomedOutView }
) }
>
<PreviewDropdown
forceIsAutosaveable={ hasActiveMetaboxes }
/>
</div>
<PreviewDropdown
disabled={ isZoomedOutView }
forceIsAutosaveable={ hasActiveMetaboxes }
/>
<PostPreviewButton
className="edit-post-header__post-preview-button"
forceIsAutosaveable={ hasActiveMetaboxes }
Expand Down
9 changes: 0 additions & 9 deletions packages/edit-post/src/components/header/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,3 @@
.components-popover.more-menu-dropdown__content {
z-index: z-index(".components-popover.more-menu__content");
}

.edit-post-header__preview-options {
opacity: 1;
transition: opacity 0.3s;

&.is-zoomed-out {
opacity: 0;
}
}
19 changes: 7 additions & 12 deletions packages/edit-site/src/components/header-edit-mode/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,18 +147,13 @@ export default function HeaderEditMode( { setEntitiesSavedStatesCallback } ) {
transition={ toolbarTransition }
>
{ isLargeViewport && (
<div
className={ classnames(
'edit-site-header-edit-mode__preview-options',
{ 'is-zoomed-out': isZoomedOutView }
) }
>
<PreviewDropdown
disabled={
isFocusMode || ! hasDefaultEditorCanvasView
}
/>
</div>
<PreviewDropdown
disabled={
isFocusMode ||
! hasDefaultEditorCanvasView ||
isZoomedOutView
}
/>
) }
<PostViewLink />
{
Expand Down
9 changes: 0 additions & 9 deletions packages/edit-site/src/components/header-edit-mode/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,6 @@
gap: $grid-unit-10;
}

.edit-site-header-edit-mode__preview-options {
opacity: 1;
transition: opacity 0.3s;

&.is-zoomed-out {
opacity: 0;
}
}

// Button text label styles

.edit-site-header-edit-mode.show-icon-labels {
Expand Down

0 comments on commit e2f6bd0

Please sign in to comment.