Skip to content

Commit d97a0c7

Browse files
zehfernandeszenorocha
authored andcommitted
fix: Page Jumps (#1998)
Co-authored-by: Zeno Rocha <[email protected]>
1 parent c8137c1 commit d97a0c7

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

apps/web/src/app/layout.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ const RootLayout = ({ children }: { children: React.ReactNode }) => {
8787
<html
8888
className={`${inter.variable} ${commitMono.variable} antialiased`}
8989
lang="en"
90+
color-scheme="dark"
9091
>
9192
<body className="overflow-x-hidden bg-black font-sans text-sm text-slate-11 h-screen-ios selection:bg-cyan-5 selection:text-cyan-12">
9293
<div

packages/react-email/src/app/preview/[...slug]/preview.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,13 @@ const Preview = ({ emailTitle }: PreviewProps) => {
108108
</Topbar>
109109

110110
<ShellContent
111-
className="relative flex bg-gray-200"
111+
className="relative flex bg-gray-200 p-4"
112112
ref={(element) => {
113113
const observer = new ResizeObserver((entry) => {
114114
const [elementEntry] = entry;
115115
if (elementEntry) {
116-
maxWidthRef.current = elementEntry.contentRect.width - 80;
117-
maxHeightRef.current = elementEntry.contentRect.height - 80;
116+
maxWidthRef.current = elementEntry.contentRect.width;
117+
maxHeightRef.current = elementEntry.contentRect.height;
118118
}
119119
});
120120

packages/react-email/src/components/shell.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ export const Shell = ({ children, currentEmailOpenSlug }: ShellProps) => {
7474
</React.Suspense>
7575
<main
7676
className={cn(
77-
'h-full max-h-full min-h-full overflow-hidden will-change-width lg:mt-0',
78-
'grow',
77+
'h-full max-h-full min-h-full overflow-hidden will-change-width lg:mt-0 w-full',
7978
'[transition:width_0.2s_ease-in-out,_transform_0.2s_ease-in-out]',
8079
)}
8180
>

packages/react-email/src/components/toolbar.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,11 @@ const ToolbarInner = ({
227227
Running compatibility check...
228228
</div>
229229
) : compatibilityCheckingResults?.length === 0 ? (
230-
<div className="flex flex-col items-center justify-center py-8 px-4 my-4">
230+
<div className="flex flex-col items-center justify-center pt-8">
231231
<SuccessIcon />
232232
<SuccessTitle>Great compatibility</SuccessTitle>
233233
<SuccessDescription>
234-
It should render properly everywhere.
234+
Template should render properly everywhere.
235235
</SuccessDescription>
236236
</div>
237237
) : (
@@ -244,7 +244,7 @@ const ToolbarInner = ({
244244
Running spam check...
245245
</div>
246246
) : spamCheckingResult?.isSpam === false ? (
247-
<div className="flex flex-col items-center justify-center py-4 px-4 my-4">
247+
<div className="flex flex-col items-center justify-center pt-8">
248248
<SuccessIcon />
249249
<SuccessTitle>10/10</SuccessTitle>
250250
<SuccessDescription>
@@ -282,7 +282,7 @@ const SuccessTitle = ({ children }) => {
282282

283283
const SuccessDescription = ({ children }) => {
284284
return (
285-
<p className="text-slate-11 text-sm text-center max-w-[300px]">
285+
<p className="text-slate-11 text-sm text-center max-w-[320px]">
286286
{children}
287287
</p>
288288
);

0 commit comments

Comments
 (0)