Refresh HiveGrid Cloud reference snapshot
This commit is contained in:
1 parent
5e99e14772
commit
7f88026f79
5955 files changed
+1177325
-188362
No files matched your search
+25
-15
@@ -3,6 +3,12 @@ import { BaseLayout } from "../_layout/BaseLayout.js";
|
||||
import { Button } from "../_layout/Button.js";
|
||||
import { Eyebrow } from "../_layout/Eyebrow.js";
|
||||
import type { MailBrand } from "../_layout/theme.js";
|
||||
import type { MailFooterCopy, MailLanguage } from "../_layout/Footer.js";
|
||||
|
||||
export interface TransactionalChromeProps {
|
||||
readonly language?: MailLanguage;
|
||||
readonly footerCopy?: MailFooterCopy;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shared visual scaffold for all transactional templates.
|
||||
@@ -12,15 +18,15 @@ import type { MailBrand } from "../_layout/theme.js";
|
||||
* Concentrating that into one component keeps per-template files small
|
||||
* and ensures brand-theme application is uniform.
|
||||
*/
|
||||
export interface TransactionalScaffoldProps {
|
||||
export interface TransactionalScaffoldProps extends TransactionalChromeProps {
|
||||
readonly brand: MailBrand;
|
||||
readonly subject: string;
|
||||
readonly previewText?: string;
|
||||
readonly eyebrow: string;
|
||||
readonly title: string;
|
||||
readonly intro: ReactNode;
|
||||
readonly actionUrl: string;
|
||||
readonly actionLabel: string;
|
||||
readonly actionUrl?: string;
|
||||
readonly actionLabel?: string;
|
||||
readonly outro?: ReactNode;
|
||||
readonly children?: ReactNode;
|
||||
readonly unsubscribeUrl?: string;
|
||||
@@ -28,9 +34,9 @@ export interface TransactionalScaffoldProps {
|
||||
}
|
||||
|
||||
const titleStyle = (brand: MailBrand): CSSProperties => ({
|
||||
margin: "8px 0 16px",
|
||||
fontSize: "28px",
|
||||
lineHeight: 1.2,
|
||||
margin: "8px 0 18px",
|
||||
fontSize: "30px",
|
||||
lineHeight: 1.16,
|
||||
color: brand.textColor,
|
||||
fontWeight: 700,
|
||||
});
|
||||
@@ -43,8 +49,8 @@ const paragraphStyle = (brand: MailBrand): CSSProperties => ({
|
||||
});
|
||||
|
||||
const outroStyle = (brand: MailBrand): CSSProperties => ({
|
||||
margin: "24px 0 0",
|
||||
fontSize: "14px",
|
||||
margin: "30px 0 0",
|
||||
fontSize: "15px",
|
||||
lineHeight: 1.6,
|
||||
color: brand.mutedTextColor,
|
||||
});
|
||||
@@ -69,21 +75,25 @@ export function TransactionalScaffold({
|
||||
children,
|
||||
unsubscribeUrl,
|
||||
signoffThanks,
|
||||
language,
|
||||
footerCopy,
|
||||
}: TransactionalScaffoldProps) {
|
||||
return (
|
||||
<BaseLayout brand={brand} title={subject} previewText={previewText ?? subject} unsubscribeUrl={unsubscribeUrl}>
|
||||
<BaseLayout brand={brand} title={subject} previewText={previewText ?? subject} unsubscribeUrl={unsubscribeUrl} language={language} footerCopy={footerCopy}>
|
||||
<Eyebrow brand={brand}>{eyebrow}</Eyebrow>
|
||||
<h1 style={titleStyle(brand)}>{title}</h1>
|
||||
<p style={paragraphStyle(brand)}>{intro}</p>
|
||||
<Button brand={brand} href={actionUrl}>
|
||||
{actionLabel}
|
||||
</Button>
|
||||
{actionUrl && actionLabel ? (
|
||||
<Button brand={brand} href={actionUrl}>
|
||||
{actionLabel}
|
||||
</Button>
|
||||
) : null}
|
||||
{outro ? <p style={outroStyle(brand)}>{outro}</p> : null}
|
||||
{children}
|
||||
<p style={signoffStyle(brand)}>
|
||||
{signoffThanks ?? "Thanks,"}
|
||||
<br />-<br />
|
||||
{brand.supportFromName}
|
||||
{footerCopy?.signoffClosing ?? signoffThanks ?? "Kind regards,"}
|
||||
<br />
|
||||
<strong>{footerCopy?.signoffTeam ?? brand.supportFromName}</strong>
|
||||
</p>
|
||||
</BaseLayout>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user