({
preview,
children,
hideFooter = false,
showUnsubscribe,
}: EmailLayoutProps)
| 23 | * Includes Html, Head, Body, Container with logo header, and Footer. |
| 24 | */ |
| 25 | export function EmailLayout({ |
| 26 | preview, |
| 27 | children, |
| 28 | hideFooter = false, |
| 29 | showUnsubscribe, |
| 30 | }: EmailLayoutProps) { |
| 31 | const brand = getBrandConfig() |
| 32 | const baseUrl = getBaseUrl() |
| 33 | const hasCustomLogo = Boolean(brand.logoUrl) |
| 34 | |
| 35 | return ( |
| 36 | <Html> |
| 37 | <Head> |
| 38 | <Font |
| 39 | fontFamily='Season Sans' |
| 40 | fallbackFontFamily={['Helvetica', 'sans-serif']} |
| 41 | webFont={{ |
| 42 | url: `${baseUrl}/brand/fonts/SeasonSansUprightsVF.woff2`, |
| 43 | format: 'woff2', |
| 44 | }} |
| 45 | fontWeight='300 800' |
| 46 | fontStyle='normal' |
| 47 | /> |
| 48 | </Head> |
| 49 | <Preview>{preview}</Preview> |
| 50 | <Body style={baseStyles.main}> |
| 51 | {/* Main card container */} |
| 52 | <Container style={baseStyles.container}> |
| 53 | {/* Header with logo */} |
| 54 | <Section style={baseStyles.header}> |
| 55 | <Img |
| 56 | src={brand.logoUrl || `${baseUrl}/brand/color/email/wordmark.png`} |
| 57 | height='34' |
| 58 | {...(hasCustomLogo ? {} : { width: '70' })} |
| 59 | alt={brand.name} |
| 60 | style={hasCustomLogo ? { display: 'block', width: 'auto' } : { display: 'block' }} |
| 61 | /> |
| 62 | </Section> |
| 63 | |
| 64 | {/* Content */} |
| 65 | <Section style={baseStyles.content}>{children}</Section> |
| 66 | </Container> |
| 67 | |
| 68 | {/* Footer in gray section */} |
| 69 | {!hideFooter && <EmailFooter baseUrl={baseUrl} showUnsubscribe={showUnsubscribe} />} |
| 70 | </Body> |
| 71 | </Html> |
| 72 | ) |
| 73 | } |
| 74 | |
| 75 | export default EmailLayout |
nothing calls this directly
no test coverage detected