Skip to content

Commit 73842f9

Browse files
lordelogosvcapretz
andauthored
fix(demo): update email templates with correct <Button> syntax (#965)
Co-authored-by: Vitor Capretz <[email protected]>
1 parent 1ae51ba commit 73842f9

12 files changed

+31
-48
lines changed

demo/emails/codepen-challengers.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export const CodepenChallengersEmail = () => (
9898
front-end designer or developer at any experience level.
9999
</Text>
100100

101-
<Button style={button} pX={12} pY={12}>
101+
<Button style={button}>
102102
<strong>Learn More</strong>
103103
</Button>
104104
</Section>
@@ -209,9 +209,7 @@ export const CodepenChallengersEmail = () => (
209209
</Section>
210210

211211
<Section style={goToChallenge}>
212-
<Button style={footerButton} pY={15} pX={30}>
213-
Go to Challenge Page
214-
</Button>
212+
<Button style={footerButton}>Go to Challenge Page</Button>
215213
</Section>
216214

217215
<Section style={footer}>
@@ -333,6 +331,7 @@ const button = {
333331
lineHeight: "18px",
334332
cursor: "pointer",
335333
borderRadius: "4px",
334+
padding: "12px",
336335
};
337336

338337
const resourcesTitle = {
@@ -395,6 +394,7 @@ const footerButton = {
395394
borderRadius: "4px",
396395
fontWeight: "bold",
397396
cursor: "pointer",
397+
padding: "15px 30px",
398398
};
399399

400400
const footer = {

demo/emails/dropbox-reset-password.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export const DropboxResetPasswordEmail = ({
4343
Someone recently requested a password change for your Dropbox
4444
account. If this was you, you can set a new password here:
4545
</Text>
46-
<Button style={button} href={resetPasswordLink} pX={7} pY={14}>
46+
<Button style={button} href={resetPasswordLink}>
4747
Reset password
4848
</Button>
4949
<Text style={text}>
@@ -102,6 +102,7 @@ const button = {
102102
textAlign: "center" as const,
103103
display: "block",
104104
width: "210px",
105+
padding: "14px 7px",
105106
};
106107

107108
const anchor = {

demo/emails/github-access-token.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ export const GithubAccessTokenEmail = ({
5151
recently added to your account.
5252
</Text>
5353

54-
<Button style={button} pX={24} pY={12}>
55-
View your token
56-
</Button>
54+
<Button style={button}>View your token</Button>
5755
</Section>
5856
<Text style={links}>
5957
<Link style={link}>Your security audit log</Link>{" "}
@@ -110,6 +108,7 @@ const button = {
110108
color: "#fff",
111109
lineHeight: 1.5,
112110
borderRadius: "0.5em",
111+
padding: "12px 24px",
113112
};
114113

115114
const links = {

demo/emails/koala-welcome.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export const KoalaWelcomeEmail = ({
4343
uncover qualified leads and close deals faster.
4444
</Text>
4545
<Section style={btnContainer}>
46-
<Button pX={12} pY={12} style={button} href="https://getkoala.com">
46+
<Button style={button} href="https://getkoala.com">
4747
Get started
4848
</Button>
4949
</Section>
@@ -97,6 +97,7 @@ const button = {
9797
textDecoration: "none",
9898
textAlign: "center" as const,
9999
display: "block",
100+
padding: "12px",
100101
};
101102

102103
const hr = {

demo/emails/linear-login-code.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const LinearLoginCodeEmail = ({
3939
/>
4040
<Heading style={heading}>Your login code for Linear</Heading>
4141
<Section style={buttonContainer}>
42-
<Button pY={11} pX={23} style={button} href="https://linear.app">
42+
<Button style={button} href="https://linear.app">
4343
Login to Linear
4444
</Button>
4545
</Section>
@@ -110,6 +110,7 @@ const button = {
110110
textDecoration: "none",
111111
textAlign: "center" as const,
112112
display: "block",
113+
padding: "11px 23px",
113114
};
114115

115116
const reportLink = {

demo/emails/netlify-welcome.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,7 @@ export const NetlifyWelcomeEmail = ({
125125
<ul>{steps?.map(({ Description }) => Description)}</ul>
126126

127127
<Section className="text-center">
128-
<Button
129-
className="bg-brand text-white rounded-lg"
130-
pY={12}
131-
pX={18}
132-
>
128+
<Button className="bg-brand text-white rounded-lg py-3 px-[18px]">
133129
Go to your dashboard
134130
</Button>
135131
</Section>

demo/emails/stripe-welcome.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,7 @@ export const StripeWelcomeEmail = () => (
3939
You can view your payments and a variety of other information about
4040
your account right from your dashboard.
4141
</Text>
42-
<Button
43-
pX={10}
44-
pY={10}
45-
style={button}
46-
href="https://dashboard.stripe.com/login"
47-
>
42+
<Button style={button} href="https://dashboard.stripe.com/login">
4843
View your Stripe Dashboard
4944
</Button>
5045
<Hr style={hr} />
@@ -147,6 +142,7 @@ const button = {
147142
textAlign: "center" as const,
148143
display: "block",
149144
width: "100%",
145+
padding: "10px",
150146
};
151147

152148
const footer = {

demo/emails/vercel-invite-user.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,7 @@ export const VercelInviteUserEmail = ({
109109
</Section>
110110
<Section className="text-center mt-[32px] mb-[32px]">
111111
<Button
112-
pX={20}
113-
pY={12}
114-
className="bg-[#000000] rounded text-white text-[12px] font-semibold no-underline text-center"
112+
className="bg-[#000000] rounded text-white text-[12px] font-semibold no-underline text-center px-5 py-3"
115113
href={inviteLink}
116114
>
117115
Join the team

demo/emails/yelp-recent-login.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,7 @@ export const YelpRecentLoginEmail = ({
109109
</Row>
110110
<Row style={{ ...boxInfos, paddingTop: "0" }}>
111111
<Column style={containerButton} colSpan={2}>
112-
<Button pY={12} pX={30} style={button}>
113-
Learn More
114-
</Button>
112+
<Button style={button}>Learn More</Button>
115113
</Column>
116114
</Row>
117115
</Section>
@@ -173,6 +171,7 @@ const button = {
173171
fontWeight: "bold",
174172
border: "1px solid rgb(0,0,0, 0.1)",
175173
cursor: "pointer",
174+
padding: "12px 30px",
176175
};
177176

178177
const content = {

docs/getting-started/manual-setup.mdx

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
2-
title: 'Manual Setup'
3-
sidebarTitle: 'Manual Setup'
4-
description: 'Create a brand-new folder with packages powered by React Email.'
5-
'og:image': 'https://react.email/static/covers/react-email.png'
6-
icon: 'hammer'
2+
title: "Manual Setup"
3+
sidebarTitle: "Manual Setup"
4+
description: "Create a brand-new folder with packages powered by React Email."
5+
"og:image": "https://react.email/static/covers/react-email.png"
6+
icon: "hammer"
77
---
88

9-
import NextSteps from '../snippets/next-steps.mdx';
9+
import NextSteps from "../snippets/next-steps.mdx";
1010

1111
## 1. Create directory
1212

@@ -55,18 +55,16 @@ Include the following script in your `package.json` file.
5555
Create a new folder called `emails`, create a file inside called `index.tsx`, and add the following code:
5656

5757
```jsx index.tsx
58-
import { Button } from '@react-email/button';
59-
import { Html } from '@react-email/html';
60-
import * as React from 'react';
58+
import { Button } from "@react-email/button";
59+
import { Html } from "@react-email/html";
60+
import * as React from "react";
6161

6262
export default function Email() {
6363
return (
6464
<Html>
6565
<Button
66-
pX={20}
67-
pY={12}
6866
href="https://example.com"
69-
style={{ background: '#000', color: '#fff' }}
67+
style={{ background: "#000", color: "#fff", padding: "12px 20px" }}
7068
>
7169
Click me
7270
</Button>

0 commit comments

Comments
 (0)