All files / emails components.tsx

100% Statements 3/3
100% Branches 0/0
100% Functions 1/1
100% Lines 3/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126                            14x                   14x                                                                                                                                         129x                                                                
/** @jsxImportSource react */
import { Body } from "@react-email/body";
import { Container } from "@react-email/container";
import { Head } from "@react-email/head";
import { Heading } from "@react-email/heading";
import { Hr } from "@react-email/hr";
import { Html } from "@react-email/html";
import { Link } from "@react-email/link";
import { Preview } from "@react-email/preview";
import { Section } from "@react-email/section";
import { Text } from "@react-email/text";
import type { ReactNode } from "react";
 
// Brand colors and styles - Terracotta theme
const colors = {
	primary: "#E86F4A", // Terracotta primary
	primaryDark: "#D65A3A", // Terracotta dark
	text: "#292524", // Stone-800
	textMuted: "#78716C", // Stone-500
	border: "#E7E5E4", // Stone-200
	background: "#FAF8F6", // Warm stone background
	white: "#FFFFFF",
};
 
const styles = {
	main: {
		backgroundColor: colors.background,
		fontFamily:
			'-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Ubuntu,sans-serif',
	},
	container: {
		backgroundColor: colors.white,
		margin: "0 auto",
		padding: "20px 0 48px",
		marginBottom: "64px",
		maxWidth: "560px",
	},
	section: {
		padding: "0 48px",
	},
	heading: {
		color: colors.text,
		fontSize: "24px",
		fontWeight: "600",
		lineHeight: "1.3",
		margin: "16px 0",
	},
	paragraph: {
		color: colors.text,
		fontSize: "16px",
		lineHeight: "26px",
		margin: "16px 0",
	},
	mutedText: {
		color: colors.textMuted,
		fontSize: "14px",
		lineHeight: "24px",
		margin: "16px 0",
	},
	button: {
		backgroundColor: colors.primary,
		borderRadius: "6px",
		color: colors.white,
		display: "inline-block",
		fontSize: "16px",
		fontWeight: "600",
		lineHeight: "100%",
		padding: "12px 24px",
		textAlign: "center" as const,
		textDecoration: "none",
	},
	hr: {
		borderColor: colors.border,
		margin: "32px 0",
	},
	link: {
		color: colors.primary,
		textDecoration: "underline",
	},
	footer: {
		color: colors.textMuted,
		fontSize: "12px",
		lineHeight: "20px",
		margin: "16px 0",
	},
};
 
type EmailLayoutProps = {
	preview: string;
	children: ReactNode;
};
 
export function EmailLayout({ preview, children }: EmailLayoutProps) {
	return (
		<Html>
			<Head />
			<Preview>{preview}</Preview>
			<Body style={styles.main}>
				<Container style={styles.container}>
					<Section style={styles.section}>
						<Heading style={{ ...styles.heading, textAlign: "center" }}>
							Interioring
						</Heading>
						<Hr style={styles.hr} />
					</Section>
					{children}
					<Section style={styles.section}>
						<Hr style={styles.hr} />
						<Text style={styles.footer}>
							This email was sent by Interioring. If you didn't request this
							email, you can safely ignore it.
						</Text>
						<Text style={styles.footer}>
							<Link href="https://interioring.com" style={styles.link}>
								interioring.com
							</Link>
						</Text>
					</Section>
				</Container>
			</Body>
		</Html>
	);
}
 
export { styles, colors };