Skip to content

Commit 87b432f

Browse files
authored
Hosting Dashboard: Add Snackbar to the Site Settings backport (#103620)
1 parent 05935db commit 87b432f

File tree

4 files changed

+34
-15
lines changed

4 files changed

+34
-15
lines changed

client/sites/settings/v2/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { useEffect, useRef } from 'react';
44
import { createRoot } from 'react-dom/client';
55
import { persistPromise, queryClient } from 'calypso/dashboard/app/query-client';
66
import { getRouter } from './router';
7-
import './style.scss';
87

98
export default function DashboardBackportSiteSettingsRenderer() {
109
const rootInstanceRef = useRef< ReturnType< typeof createRoot > | null >( null );

client/sites/settings/v2/root.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { Outlet } from '@tanstack/react-router';
2+
import Snackbars from 'calypso/dashboard/app/snackbars';
3+
import './style.scss';
4+
5+
export default function Root() {
6+
return (
7+
<>
8+
<Outlet />
9+
<Snackbars />
10+
</>
11+
);
12+
}

client/sites/settings/v2/router.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ import {
1010
} from '@tanstack/react-router';
1111
import { siteSettingsQuery } from 'calypso/dashboard/app/queries';
1212
import { queryClient } from 'calypso/dashboard/app/query-client';
13+
import Root from './root';
1314

14-
const rootRoute = createRootRoute( { component: () => <Outlet /> } );
15+
const rootRoute = createRootRoute( { component: Root } );
1516

1617
const dashboardSiteSettingsCompatibilityRouteRoot = createRoute( {
1718
getParentRoute: () => rootRoute,
@@ -137,6 +138,7 @@ export const getRouter = () => {
137138
defaultPreload: 'intent',
138139
defaultPreloadStaleTime: 0,
139140
defaultNotFoundComponent: () => null,
141+
defaultViewTransition: true,
140142

141143
// Use memory history to compartmentalize TanStack Router's history management.
142144
// This way, we separate TanStack Router's history implementation from the browser history used by page.js.

client/sites/settings/v2/style.scss

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
11
@import 'calypso/dashboard/app-dotcom/style.scss';
22

3-
.dashboard-backport-site-settings-root .dashboard-page-layout {
4-
align-self: center;
5-
margin: 0;
6-
padding: 0;
3+
.dashboard-backport-site-settings-root {
4+
.dashboard-page-layout {
5+
align-self: center;
6+
margin: 0;
7+
padding: 0;
78

8-
h1 {
9-
font-family: var( --dashboard-h1__font-family );
10-
font-weight: var( --dashboard-h1__font-weight ) !important;
9+
h1 {
10+
font-family: var( --dashboard-h1__font-family );
11+
font-weight: var( --dashboard-h1__font-weight ) !important;
12+
}
13+
14+
h2 {
15+
font-size: 1.25rem;
16+
font-weight: 500;
17+
line-height: 1.5;
18+
margin-bottom: 0;
19+
}
1120
}
1221

13-
h2 {
14-
font-size: 1.25rem;
15-
font-weight: 500;
16-
line-height: 1.5;
17-
margin-bottom: 0;
22+
.site-preview-pane:has( & .dashboard-snackbars ) {
23+
z-index: 176;
1824
}
19-
}
25+
}

0 commit comments

Comments
 (0)