Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Site Editor: Use a consistent snackbar position #61756

Merged
merged 1 commit into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
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>
);
}
Loading