Skip to content

Commit

Permalink
Site Editor: Use a consistent snackbar position (#61756)
Browse files Browse the repository at this point in the history
Co-authored-by: youknowriad <youknowriad@git.wordpress.org>
Co-authored-by: jasmussen <joen@git.wordpress.org>
Co-authored-by: jameskoster <jameskoster@git.wordpress.org>
Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org>
  • Loading branch information
5 people authored May 17, 2024
1 parent 72612dc commit d538f42
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 23 deletions.
2 changes: 0 additions & 2 deletions packages/edit-site/src/components/editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import {
EditorKeyboardShortcutsRegister,
EditorKeyboardShortcuts,
EditorNotices,
EditorSnackbars,
privateApis as editorPrivateApis,
store as editorStore,
} from '@wordpress/editor';
Expand Down Expand Up @@ -345,7 +344,6 @@ export default function Editor( { isLoading, onClick } ) {
}
/>
}
notices={ <EditorSnackbars /> }
content={
<>
<GlobalStylesRenderer />
Expand Down
15 changes: 0 additions & 15 deletions packages/edit-site/src/components/editor/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,3 @@
display: flex;
justify-content: center;
}

// Adjust the position of the notices when breadcrumbs are present
.edit-site .has-block-breadcrumbs.is-full-canvas .components-editor-notices__snackbar {
bottom: 40px;
}

// Adjust the position of the notices
.edit-site .components-editor-notices__snackbar {
position: absolute;
right: 0;
bottom: 16px;
padding-left: 16px;
padding-right: 16px;
}
@include editor-left(".edit-site .components-editor-notices__snackbar")
7 changes: 6 additions & 1 deletion packages/edit-site/src/components/layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ import {
store as blockEditorStore,
} from '@wordpress/block-editor';
import { privateApis as coreCommandsPrivateApis } from '@wordpress/core-commands';
import { privateApis as editorPrivateApis } from '@wordpress/editor';
import {
EditorSnackbars,
privateApis as editorPrivateApis,
} from '@wordpress/editor';

/**
* Internal dependencies
Expand Down Expand Up @@ -262,6 +265,8 @@ export default function Layout() {
</NavigableRegion>
) }

<EditorSnackbars />

{ isMobileViewport && areas.mobile && (
<div className="edit-site-layout__mobile">
{ areas.mobile }
Expand Down
8 changes: 8 additions & 0 deletions packages/edit-site/src/components/layout/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -277,3 +277,11 @@
margin: $canvas-padding $canvas-padding $canvas-padding 0;
}
}

.edit-site .components-editor-notices__snackbar {
position: fixed;
right: 0;
bottom: 16px;
padding-left: 16px;
padding-right: 16px;
}
6 changes: 1 addition & 5 deletions packages/edit-site/src/components/page/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ import clsx from 'clsx';
/**
* WordPress dependencies
*/
import {
EditorSnackbars,
privateApis as editorPrivateApis,
} from '@wordpress/editor';
import { privateApis as editorPrivateApis } from '@wordpress/editor';

/**
* Internal dependencies
Expand Down Expand Up @@ -41,7 +38,6 @@ export default function Page( {
) }
{ children }
</div>
<EditorSnackbars />
</NavigableRegion>
);
}

0 comments on commit d538f42

Please sign in to comment.