-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathinline-styles.tsx
More file actions
208 lines (206 loc) · 6.37 KB
/
Copy pathinline-styles.tsx
File metadata and controls
208 lines (206 loc) · 6.37 KB
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
import {
Body,
Button,
Column,
Container,
Head,
Heading,
Hr,
Html,
Preview,
Row,
Section,
Text,
} from '@react-email/components';
import { Layout } from '../_components/layout';
export const component = (
<Html>
<Head />
<Preview>Customer Reviews</Preview>
<Body>
<Container
style={{
backgroundColor: 'rgb(255,255,255)',
borderRadius: '8px',
marginLeft: 'auto',
marginRight: 'auto',
maxWidth: '400px',
paddingLeft: '42px',
paddingRight: '42px',
paddingTop: '24px',
paddingBottom: '24px',
}}
>
<Section>
<Heading as="h1" style={{ fontSize: '24px', lineHeight: '32px' }}>
Customer Reviews
</Heading>
<div
style={{
display: 'flex',
flexDirection: 'column',
marginTop: '12px',
}}
>
<Text style={{ display: 'none' }}>4 out of 5 stars</Text>
</div>
<Section style={{ marginTop: '24px', marginBottom: '24px' }}>
<Heading as="h2" style={{ display: 'none' }}>
Review data
</Heading>
<dl style={{ margin: '0px' }}>
{[
{ rating: 5, count: 1019 },
{ rating: 4, count: 162 },
{ rating: 3, count: 97 },
{ rating: 2, count: 199 },
{ rating: 1, count: 147 },
].map(({ count, rating }) => (
<>
<dt
key={`${rating}-dt`}
style={{
fontSize: '14px',
lineHeight: '20px',
}}
>
<Row align="center">
<Column width={undefined}>
<Text
style={{
color: 'rgb(107,114,128)',
fontWeight: '500',
width: '12px',
}}
>
{rating}
<span style={{ display: 'none' }}>
{' '}
star reviews
</span>
</Text>
</Column>
<Column
width="264"
height="12"
style={{
width: 264,
height: 12,
paddingLeft: 12,
}}
aria-hidden="true"
valign="middle"
>
<Row
aria-hidden="true"
width="264"
style={{
width: 264,
height: 12,
backgroundColor: 'rgb(243,244,246)',
border: '1px solid rgb(229,231,235)',
borderRadius: 6,
}}
>
<Column
height="12"
style={{
backgroundColor: 'rgb(79,70,229)',
borderRadius: 6,
height: 12,
width: `${(count / 1624) * 264}px`,
}}
width={(count / 1624) * 264}
/>
<Column
width={(1 - count / 1624) * 264}
style={{
width: `${(1 - count / 1624) * 264}px`,
}}
/>
</Row>
</Column>
</Row>
</dt>
<dd
key={`${rating}-dd`}
style={{
color: 'rgb(107,114,128)',
fontSize: '12px',
fontVariantNumeric: 'tabular-nums',
fontWeight: '500',
lineHeight: '1',
marginLeft: 12,
textAlign: 'right',
}}
>
{Math.round((count / 1624) * 100)}%
</dd>
</>
))}
</dl>
<Text
style={{
color: 'rgb(107,114,128)',
fontSize: '12px',
lineHeight: '24px',
marginTop: '14px',
textAlign: 'center',
}}
>
Based on <span style={{ fontWeight: '600' }}>1624</span> Reviews
</Text>
</Section>
<Hr />
<Section style={{ marginTop: '30px' }}>
<Heading
as="h3"
style={{
color: 'rgb(17,24,39)',
fontSize: '18px',
fontWeight: '500',
lineHeight: '24px',
marginBottom: '12px',
}}
>
Share your thoughts
</Heading>
<Text
style={{
color: 'rgb(107,114,128)',
fontSize: '14px',
lineHeight: '20px',
margin: '0px',
}}
>
If you’ve used this product, share your thoughts with other
customers
</Text>
<Button
href="#"
style={{
backgroundColor: 'rgb(79,70,229)',
borderRadius: '8px',
boxSizing: 'border-box',
color: 'rgb(255,255,255)',
display: 'inline-block',
fontWeight: '600',
marginTop: '26px',
marginBottom: '24px',
maxWidth: '100%',
padding: '12px',
textAlign: 'center',
width: '100%',
}}
>
Write a review
</Button>
</Section>
</Section>
</Container>
</Body>
</Html>
);
export default () => {
return <Layout>{component}</Layout>;
};