forked from Faire/mjml-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMjmlButton.tsx
64 lines (61 loc) · 1.81 KB
/
MjmlButton.tsx
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
/*
* This file is generated. Don't edit it directly.
* Modify `scripts/generate-mjml-react.ts` to make changes to these files
*/
import React from "react";
import { convertPropsToMjmlAttributes } from "../utils";
export interface IMjmlButtonProps {
/** MJML default value: center */
align?: "left" | "center" | "right";
backgroundColor?: React.CSSProperties["backgroundColor"];
borderBottom?: string;
borderLeft?: string;
borderRadius?: React.CSSProperties["borderRadius"];
borderRight?: string;
borderTop?: string;
/** MJML default value: none */
border?: React.CSSProperties["border"];
/** MJML default value: #ffffff */
color?: React.CSSProperties["color"];
containerBackgroundColor?: string;
fontFamily?: string;
fontSize?: string | number;
fontStyle?: string;
fontWeight?: string;
height?: string | number;
href?: string;
name?: string;
title?: string;
innerPadding?: string | number;
letterSpacing?: string | number;
lineHeight?: string | number;
paddingBottom?: string | number;
paddingLeft?: string | number;
paddingRight?: string | number;
paddingTop?: string | number;
/** MJML default value: 10px 25px */
padding?: string | number;
rel?: string;
/** MJML default value: _blank */
target?: string;
textDecoration?: React.CSSProperties["textDecoration"];
textTransform?: React.CSSProperties["textTransform"];
verticalAlign?: "top" | "bottom" | "middle";
textAlign?: "left" | "right" | "center";
width?: string | number;
className?: string;
cssClass?: string;
mjmlClass?: string;
children?: React.ReactNode;
dangerouslySetInnerHTML?: { __html: string };
}
export function MjmlButton({
children,
...props
}: IMjmlButtonProps): JSX.Element {
return React.createElement(
"mj-button",
convertPropsToMjmlAttributes(props),
children
);
}