Skip to content

Commit e419d2b

Browse files
author
ignaciosantise
committed
chore: solved theming issue
1 parent a90d4ac commit e419d2b

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

packages/email/src/W3mEmailWebview.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,13 @@ export function EmailWebview() {
135135
webviewRef.current?.injectJavaScript(W3mFrameConstants.FRAME_MESSAGES_HANDLER);
136136
}
137137
const themeMode = Appearance.getColorScheme() ?? undefined;
138-
provider?.syncTheme({ themeMode });
138+
provider?.syncTheme({
139+
themeMode,
140+
w3mThemeVariables: {
141+
'--w3m-accent': Theme['accent-100'],
142+
'--w3m-background': Theme['bg-100']
143+
}
144+
});
139145
provider?.syncDappData?.({ projectId, sdkVersion });
140146
provider?.onWebviewLoaded();
141147
}

packages/email/src/W3mFrameSchema.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ export const AppUpdateEmailPrimaryOtpRequest = z.object({ otp: z.string() });
3838
export const AppUpdateEmailSecondaryOtpRequest = z.object({ otp: z.string() });
3939
export const AppSyncThemeRequest = z.object({
4040
themeMode: z.optional(z.enum(['light', 'dark'])),
41-
themeVariables: z.optional(z.record(z.string(), z.string().or(z.number())))
41+
themeVariables: z.optional(z.record(z.string(), z.string().or(z.number()))),
42+
w3mThemeVariables: z.optional(z.record(z.string(), z.string().or(z.number())))
4243
});
4344
export const AppSyncDappDataRequest = z.object({
4445
metadata: z

0 commit comments

Comments
 (0)