Skip to content

Commit 1340a0a

Browse files
authored
fix(react-email): mobile's sidebar broken in preview server (#2279)
1 parent c711c15 commit 1340a0a

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

.changeset/famous-pants-cross.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"react-email": patch
3+
---
4+
5+
fix mobile's sidebar broken in the preview server

packages/react-email/src/app/layout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ const RootLayout = async ({ children }: { children: React.ReactNode }) => {
2727
className={`${inter.variable} ${sfMono.variable} font-sans`}
2828
lang="en"
2929
>
30-
<body className="relative flex h-screen flex-col bg-black text-slate-11 leading-loose selection:bg-cyan-5 selection:text-cyan-12">
31-
<div className="bg-gradient-to-t from-slate-3 flex">
30+
<body className="relative h-screen bg-black text-slate-11 leading-loose selection:bg-cyan-5 selection:text-cyan-12">
31+
<div className="bg-gradient-to-t from-slate-3 flex flex-col">
3232
<EmailsProvider
3333
initialEmailsDirectoryMetadata={emailsDirectoryMetadata}
3434
>

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,10 @@ export const Shell = ({ children, currentEmailOpenSlug }: ShellProps) => {
8181
'inline-block relative overflow-hidden will-change-[width]',
8282
'w-full h-full',
8383
'[transition:width_0.2s_ease-in-out,_transform_0.2s_ease-in-out]',
84-
sidebarToggled && 'lg:w-[calc(100%-16rem)]',
84+
{
85+
'lg:w-[calc(100%-16rem)]': sidebarToggled,
86+
'opacity-0 lg:opacity-100': !sidebarToggled,
87+
},
8588
)}
8689
>
8790
{children}

0 commit comments

Comments
 (0)