Skip to content

Commit 2f94b3d

Browse files
committed
chore(root): Format
1 parent 69d29f0 commit 2f94b3d

File tree

5 files changed

+84
-88
lines changed

5 files changed

+84
-88
lines changed

packages/body/src/body.tsx

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@ type RootProps = React.ComponentPropsWithoutRef<"body">;
55

66
export type BodyProps = RootProps;
77

8-
export const Body = React.forwardRef<
9-
BodyElement,
10-
Readonly<BodyProps>
11-
>(({ children, style, ...props }, ref) => {
12-
return (
13-
<body {...props} ref={ref} style={style}>
14-
{children}
15-
</body>
16-
);
17-
});
8+
export const Body = React.forwardRef<BodyElement, Readonly<BodyProps>>(
9+
({ children, style, ...props }, ref) => {
10+
return (
11+
<body {...props} ref={ref} style={style}>
12+
{children}
13+
</body>
14+
);
15+
},
16+
);
1817

1918
Body.displayName = "Body";

packages/button/src/button.tsx

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,42 +4,41 @@ import { parsePadding, pxToPt } from "./utils";
44
type ButtonElement = React.ElementRef<"a">;
55
export type ButtonProps = React.ComponentPropsWithoutRef<"a">;
66

7-
export const Button = React.forwardRef<
8-
ButtonElement,
9-
Readonly<ButtonProps>
10-
>(({ children, style, target = "_blank", ...props }, ref) => {
11-
const { pt, pr, pb, pl } = parsePadding({
12-
padding: style?.padding,
13-
paddingLeft: style?.paddingLeft,
14-
paddingRight: style?.paddingRight,
15-
paddingTop: style?.paddingTop,
16-
paddingBottom: style?.paddingBottom,
17-
});
7+
export const Button = React.forwardRef<ButtonElement, Readonly<ButtonProps>>(
8+
({ children, style, target = "_blank", ...props }, ref) => {
9+
const { pt, pr, pb, pl } = parsePadding({
10+
padding: style?.padding,
11+
paddingLeft: style?.paddingLeft,
12+
paddingRight: style?.paddingRight,
13+
paddingTop: style?.paddingTop,
14+
paddingBottom: style?.paddingBottom,
15+
});
1816

19-
const y = pt + pb;
20-
const textRaise = pxToPt(y);
17+
const y = pt + pb;
18+
const textRaise = pxToPt(y);
2119

22-
return (
23-
<a
24-
{...props}
25-
ref={ref}
26-
style={buttonStyle({ ...style, pt, pr, pb, pl })}
27-
target={target}
28-
>
29-
<span
30-
dangerouslySetInnerHTML={{
31-
__html: `<!--[if mso]><i style="letter-spacing: ${pl}px;mso-font-width:-100%;mso-text-raise:${textRaise}" hidden>&nbsp;</i><![endif]-->`,
32-
}}
33-
/>
34-
<span style={buttonTextStyle(pb)}>{children}</span>
35-
<span
36-
dangerouslySetInnerHTML={{
37-
__html: `<!--[if mso]><i style="letter-spacing: ${pr}px;mso-font-width:-100%" hidden>&nbsp;</i><![endif]-->`,
38-
}}
39-
/>
40-
</a>
41-
);
42-
});
20+
return (
21+
<a
22+
{...props}
23+
ref={ref}
24+
style={buttonStyle({ ...style, pt, pr, pb, pl })}
25+
target={target}
26+
>
27+
<span
28+
dangerouslySetInnerHTML={{
29+
__html: `<!--[if mso]><i style="letter-spacing: ${pl}px;mso-font-width:-100%;mso-text-raise:${textRaise}" hidden>&nbsp;</i><![endif]-->`,
30+
}}
31+
/>
32+
<span style={buttonTextStyle(pb)}>{children}</span>
33+
<span
34+
dangerouslySetInnerHTML={{
35+
__html: `<!--[if mso]><i style="letter-spacing: ${pr}px;mso-font-width:-100%" hidden>&nbsp;</i><![endif]-->`,
36+
}}
37+
/>
38+
</a>
39+
);
40+
},
41+
);
4342

4443
Button.displayName = "Button";
4544

packages/column/src/column.tsx

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@ type TdElement = React.ElementRef<"td">;
55

66
export type ColumnProps = RootProps;
77

8-
export const Column = React.forwardRef<
9-
TdElement,
10-
Readonly<ColumnProps>
11-
>(({ children, style, ...props }, ref) => {
12-
return (
13-
<td {...props} data-id="__react-email-column" ref={ref} style={style}>
14-
{children}
15-
</td>
16-
);
17-
});
8+
export const Column = React.forwardRef<TdElement, Readonly<ColumnProps>>(
9+
({ children, style, ...props }, ref) => {
10+
return (
11+
<td {...props} data-id="__react-email-column" ref={ref} style={style}>
12+
{children}
13+
</td>
14+
);
15+
},
16+
);
1817

1918
Column.displayName = "Column";

packages/head/src/head.tsx

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,14 @@ type HeadElement = React.ElementRef<"head">;
55

66
export type HeadProps = RootProps;
77

8-
export const Head = React.forwardRef<
9-
HeadElement,
10-
Readonly<HeadProps>
11-
>(({ children, ...props }, ref) => (
12-
<head {...props} ref={ref}>
13-
<meta content="text/html; charset=UTF-8" httpEquiv="Content-Type" />
14-
<meta name="x-apple-disable-message-reformatting" />
15-
{children}
16-
</head>
17-
));
8+
export const Head = React.forwardRef<HeadElement, Readonly<HeadProps>>(
9+
({ children, ...props }, ref) => (
10+
<head {...props} ref={ref}>
11+
<meta content="text/html; charset=UTF-8" httpEquiv="Content-Type" />
12+
<meta name="x-apple-disable-message-reformatting" />
13+
{children}
14+
</head>
15+
),
16+
);
1817

1918
Head.displayName = "Head";
20-

packages/preview/src/preview.tsx

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,30 @@ export interface PreviewProps extends RootProps {
88

99
const PREVIEW_MAX_LENGTH = 150;
1010

11-
export const Preview = React.forwardRef<React.ElementRef<"div">, Readonly<PreviewProps>>(
12-
({ children = "", ...props }, ref) => {
13-
let text = Array.isArray(children) ? children.join("") : children;
14-
text = text.substr(0, PREVIEW_MAX_LENGTH);
15-
return (
16-
<div
17-
ref={ref}
18-
style={{
19-
display: "none",
20-
overflow: "hidden",
21-
lineHeight: "1px",
22-
opacity: 0,
23-
maxHeight: 0,
24-
maxWidth: 0,
25-
}}
26-
{...props}
27-
>
28-
{text}
29-
{renderWhiteSpace(text)}
30-
</div>
31-
);
32-
},
33-
);
11+
export const Preview = React.forwardRef<
12+
React.ElementRef<"div">,
13+
Readonly<PreviewProps>
14+
>(({ children = "", ...props }, ref) => {
15+
let text = Array.isArray(children) ? children.join("") : children;
16+
text = text.substr(0, PREVIEW_MAX_LENGTH);
17+
return (
18+
<div
19+
ref={ref}
20+
style={{
21+
display: "none",
22+
overflow: "hidden",
23+
lineHeight: "1px",
24+
opacity: 0,
25+
maxHeight: 0,
26+
maxWidth: 0,
27+
}}
28+
{...props}
29+
>
30+
{text}
31+
{renderWhiteSpace(text)}
32+
</div>
33+
);
34+
});
3435

3536
Preview.displayName = "Preview";
3637

0 commit comments

Comments
 (0)