Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Restore the top bar animation
  • Loading branch information
youknowriad committed Dec 22, 2022
commit c1c5452dea8736aa600c091a75c40ab34b5d62c5
37 changes: 28 additions & 9 deletions packages/edit-site/src/components/layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,34 @@ export default function Layout( { onError } ) {
) }
</motion.div>

{ isEditorPage &&
( canvasMode === 'edit' || isMobileCanvasVisible ) && (
<NavigableRegion
className="edit-site-layout__header"
ariaLabel={ __( 'Editor top bar' ) }
>
{ canvasMode === 'edit' && <Header /> }
</NavigableRegion>
) }
<AnimatePresence initial={ false }>
{ isEditorPage &&
( canvasMode === 'edit' || isMobileCanvasVisible ) && (
<NavigableRegion
className="edit-site-layout__header"
ariaLabel={ __( 'Editor top bar' ) }
as={ motion.div }
animate={ {
y: 0,
} }
initial={ {
y: '-100%',
} }
exit={ {
y: '-100%',
} }
transition={ {
type: 'tween',
duration: disableMotion
? 0
: ANIMATION_DURATION,
ease: 'easeOut',
} }
>
{ canvasMode === 'edit' && <Header /> }
</NavigableRegion>
) }
</AnimatePresence>

<div className="edit-site-layout__content">
<AnimatePresence initial={ false }>
Expand Down
9 changes: 8 additions & 1 deletion packages/edit-site/src/components/layout/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ $hub-height: $grid-unit-20 * 2 + $button-size;
left: $canvas-padding;
width: calc(100vw - #{$canvas-padding * 2});
height: $hub-height;
z-index: 2;
z-index: 3;

background: $black;
padding: $grid-unit-20;
Expand Down Expand Up @@ -60,6 +60,13 @@ $hub-height: $grid-unit-20 * 2 + $button-size;
.edit-site-layout__header {
height: $header-height;
display: flex;
z-index: 2;

// This is only necessary for the exit animation
.edit-site-layout:not(.is-full-canvas) & {
position: fixed;
width: 100vw;
}
}

.edit-site-layout__content {
Expand Down