Skip to content
205 changes: 78 additions & 127 deletions apps/demo/emails/reset-password/twitch-reset-password.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ import {
Preview,
Row,
Section,
Tailwind,
Text,
} from '@react-email/components';
import tailwindConfig from '../tailwind.config';

interface TwitchResetPasswordEmailProps {
username?: string;
Expand All @@ -33,83 +35,85 @@ export const TwitchResetPasswordEmail = ({
return (
<Html>
<Head />
<Body style={main}>
<Preview>You updated the password for your Twitch account</Preview>
<Container style={container}>
<Section style={logo}>
<Img
width={114}
src={`${baseUrl}/static/twitch-logo.png`}
alt="Twitch"
style={logoImg}
/>
</Section>
<Section style={sectionsBorders}>
<Tailwind config={tailwindConfig}>
<Body className="bg-[#efeef1] font-twitch">
<Preview>You updated the password for your Twitch account</Preview>
<Container className="max-w-[580px] my-8 mx-auto bg-white">
<Section className="p-8">
<Img
width={114}
src={`${baseUrl}/static/twitch-logo.png`}
alt="Twitch"
className="mx-auto"
/>
</Section>
<Section className="w-full">
<Row>
<Column className="border-b border-solid border-[rgb(238,238,238)] w-[249px]" />
<Column className="border-b border-solid border-[rgb(145,71,255)] w-[102px]" />
<Column className="border-b border-solid border-[rgb(238,238,238)] w-[249px]" />
</Row>
</Section>
<Section className="py-1.5 px-5 pb-2.5">
<Text className="leading-6 text-sm">Hi {username},</Text>
<Text className="leading-6 text-sm">
You updated the password for your Twitch account on{' '}
{formattedDate}. If this was you, then no further action is
required.
</Text>
<Text className="leading-6 text-sm">
However if you did NOT perform this password change, please{' '}
<Link href="https://www.twitch.tv" className="underline">
reset your account password
</Link>{' '}
immediately.
</Text>
<Text className="leading-6 text-sm">
Remember to use a password that is both strong and unique to
your Twitch account. To learn more about how to create a strong
and unique password,{' '}
<Link href="https://www.twitch.tv" className="underline">
click here.
</Link>
</Text>
<Text className="leading-6 text-sm">
Still have questions? Please contact{' '}
<Link href="https://www.twitch.tv" className="underline">
Twitch Support
</Link>
</Text>
<Text className="leading-6 text-sm">
Thanks,
<br />
Twitch Support Team
</Text>
</Section>
</Container>

<Section className="max-w-[580px] mx-auto">
<Row>
<Column style={sectionBorder} />
<Column style={sectionCenter} />
<Column style={sectionBorder} />
<Column align="right" className="w-1/2 pr-2">
<Img
src={`${baseUrl}/static/twitch-icon-twitter.png`}
alt="Twitter"
/>
</Column>
<Column align="left" className="w-1/2 pl-2">
<Img
src={`${baseUrl}/static/twitch-icon-facebook.png`}
alt="Facebook"
/>
</Column>
</Row>
<Row>
<Text className="text-center text-[#706a7b]">
© 2022 Twitch, All Rights Reserved <br />
350 Bush Street, 2nd Floor, San Francisco, CA, 94104 - USA
</Text>
</Row>
</Section>
<Section style={content}>
<Text style={paragraph}>Hi {username},</Text>
<Text style={paragraph}>
You updated the password for your Twitch account on{' '}
{formattedDate}. If this was you, then no further action is
required.
</Text>
<Text style={paragraph}>
However if you did NOT perform this password change, please{' '}
<Link href="https://www.twitch.tv" style={link}>
reset your account password
</Link>{' '}
immediately.
</Text>
<Text style={paragraph}>
Remember to use a password that is both strong and unique to your
Twitch account. To learn more about how to create a strong and
unique password,{' '}
<Link href="https://www.twitch.tv" style={link}>
click here.
</Link>
</Text>
<Text style={paragraph}>
Still have questions? Please contact{' '}
<Link href="https://www.twitch.tv" style={link}>
Twitch Support
</Link>
</Text>
<Text style={paragraph}>
Thanks,
<br />
Twitch Support Team
</Text>
</Section>
</Container>

<Section style={footer}>
<Row>
<Column align="right" style={{ width: '50%', paddingRight: '8px' }}>
<Img
src={`${baseUrl}/static/twitch-icon-twitter.png`}
alt="Twitter"
/>
</Column>
<Column align="left" style={{ width: '50%', paddingLeft: '8px' }}>
<Img
src={`${baseUrl}/static/twitch-icon-facebook.png`}
alt="Facebook"
/>
</Column>
</Row>
<Row>
<Text style={{ textAlign: 'center', color: '#706a7b' }}>
© 2022 Twitch, All Rights Reserved <br />
350 Bush Street, 2nd Floor, San Francisco, CA, 94104 - USA
</Text>
</Row>
</Section>
</Body>
</Body>
</Tailwind>
</Html>
);
};
Expand All @@ -120,56 +124,3 @@ TwitchResetPasswordEmail.PreviewProps = {
} as TwitchResetPasswordEmailProps;

export default TwitchResetPasswordEmail;

const fontFamily = 'HelveticaNeue,Helvetica,Arial,sans-serif';

const main = {
backgroundColor: '#efeef1',
fontFamily,
};

const paragraph = {
lineHeight: 1.5,
fontSize: 14,
};

const container = {
maxWidth: '580px',
margin: '30px auto',
backgroundColor: '#ffffff',
};

const footer = {
maxWidth: '580px',
margin: '0 auto',
};

const content = {
padding: '5px 20px 10px 20px',
};

const logo = {
padding: 30,
};

const logoImg = {
margin: '0 auto',
};

const sectionsBorders = {
width: '100%',
};

const sectionBorder = {
borderBottom: '1px solid rgb(238,238,238)',
width: '249px',
};

const sectionCenter = {
borderBottom: '1px solid rgb(145,71,255)',
width: '102px',
};

const link = {
textDecoration: 'underline',
};
10 changes: 10 additions & 0 deletions apps/demo/emails/tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { pixelBasedPreset, type TailwindConfig } from '@react-email/components';

export default {
presets: [pixelBasedPreset],
theme: {
fontFamily: {
twitch: ['HelveticaNeue', 'Helvetica', 'Arial', 'sans-serif'],
},
},
} satisfies TailwindConfig;
10 changes: 5 additions & 5 deletions apps/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
"export": "email-dev export"
},
"dependencies": {
"@react-email/components": "workspace:*",
"@react-email/components": "npm:@react-email/[email protected]",
"email-dev": "workspace:*",
"react": "^19",
"react-dom": "^19",
"email-dev": "workspace:*"
"react-dom": "^19"
},
"devDependencies": {
"@react-email/preview-server": "workspace:*",
"next": "^15.3.2",
"@types/react": "^19",
"@types/react-dom": "^19"
"@types/react-dom": "^19",
"next": "^15.3.2"
}
}
Loading
Loading