/
signup.tsx
343 lines (320 loc) Β· 13.1 KB
/
signup.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
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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
// import { css } from "@emotion/react";
// import { Heading } from "dyson/src/components/atoms/heading/Heading";
// import { TextBlock } from "dyson/src/components/atoms/textBlock/TextBlock";
// import { Text } from "dyson/src/components/atoms/text/Text";
// import { Button } from "dyson/src/components/atoms";
// import { useRouter } from "next/router";
// import Link from "next/link";
// import { getGithubLoginURL } from "@utils/core/external";
// const RocketImage = (props) => (
// <img
// {...props}
// src={
// "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAPCAYAAADUFP50AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJBSURBVHgBndJNSJNxHAfw77ZnPcu5Cb4u3yrnzMhMxQyLOnRQC0yJ9NBFSjHo0k0yIuhSmNClCJUOlpGHDpUkmka+5NSp0Wh7Njc3n/a4ILH26rO5t+efGXWaFX3P38/l9/sC/xnRvxbbOjoUyozy0kBUdCzgX3/9V9ja2io9W3O63UsltLz3yXNo1T4YtLN2yZ/QpE5XQDPWye4nTxvSx0aTKpvqUZgFvJxiV8Tbob6+vqP+Ce1Cz9R04QTzEYrkJBTlZcPD2uCxvhuNCzuLy07yGQf651b9ijO8F90aDaovNcNiYTA8NBxJ8OsfUb/KvkzVBXg8u1YIUfXmV1weN/ISWXoxGrtO4KA6G1bWjumpGTCmpTsL49PGLejLT2umvb6H4dgGFiHFiFiFRD6II0UliAoGmPVa6BkOM7Pz8zYHe/eHocj1HHXYFeykXCFwTnhGuBTZ3pIymWZ3Eg6/7cVAmMYnrxMSj8PImJfrvjrMri0YruDvUztiYmGN/nazJ/Mqu7/03vHEIJTd7eiXZ2FOkIOsfXnBuwwXvRzn/n0IQn6OgHt8qNphqmXPN9WRc8oE0pWbFm1JySODO5XLDUD8t324hhKBq4qG3LfJgwY1GaqRDeoU1PNVMYhbhFfxjJhszk5TntojUsoldt1nVJ4SZnJpLKjFsXp6syCIYI8LLbXYI9kIFkUYW1SJgbGlIbaqIC8clCrIegS4kSLgSjxI8RlIhlR0yzW2+IaxRAyNz8C726SmQGqoJssJLbbJd0nz9aMpv90CAAAAAElFTkSuQmCC"
// }
// />
// );
// const GitlabSVG = (props) => (
// <svg width={16} height={16} fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
// <path fillRule="evenodd" clipRule="evenodd" d="m8.001 15.37 2.946-9.07H5.055l2.946 9.07Z" fill="#E24329" />
// <path fillRule="evenodd" clipRule="evenodd" d="M8 15.37 5.056 6.3H.925l7.076 9.07Z" fill="#FC6D26" />
// <path fillRule="evenodd" clipRule="evenodd" d="M.926 6.3.03 9.058a.61.61 0 0 0 .221.682l7.749 5.63L.926 6.3Z" fill="#FCA326" />
// <path fillRule="evenodd" clipRule="evenodd" d="M.926 6.3h4.129L3.28.842a.305.305 0 0 0-.58 0L.926 6.3Z" fill="#E24329" />
// <path fillRule="evenodd" clipRule="evenodd" d="m8 15.37 2.946-9.07h4.129L8 15.37Z" fill="#FC6D26" />
// <path fillRule="evenodd" clipRule="evenodd" d="m15.075 6.3.895 2.755a.61.61 0 0 1-.222.682L8 15.37 15.075 6.3Z" fill="#FCA326" />
// <path fillRule="evenodd" clipRule="evenodd" d="M15.074 6.3h-4.13L12.72.839a.305.305 0 0 1 .58 0L15.074 6.3Z" fill="#E24329" />
// </svg>
// );
// export const GithubSVG = function (props) {
// return (
// <svg width={16} height={16} fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
// <path
// d="M8 0a8 8 0 0 0-2.529 15.591c.4.074.529-.174.529-.384v-1.49c-2.225.484-2.689-.944-2.689-.944-.364-.924-.888-1.17-.888-1.17-.726-.497.055-.486.055-.486.803.056 1.226.824 1.226.824.713 1.223 1.871.87 2.328.665.071-.517.279-.87.508-1.07-1.777-.203-3.645-.889-3.645-3.953 0-.874.313-1.588.824-2.148-.082-.202-.356-1.016.078-2.117 0 0 .672-.215 2.201.82A7.673 7.673 0 0 1 8 3.868c.68.004 1.365.093 2.004.27 1.527-1.035 2.198-.82 2.198-.82.435 1.102.161 1.916.079 2.117.513.56.823 1.274.823 2.148 0 3.072-1.871 3.749-3.653 3.947.287.248.549.735.549 1.481v2.196c0 .212.128.462.534.384A8.002 8.002 0 0 0 8 0Z"
// fill="#fff"
// />
// </svg>
// );
// };
// export default function SignupInitial({ loginWithEmailHandler }) {
// const router = useRouter();
// return (
// <div
// css={css(`
// height: 100vh;
// background: #0C0C0D;
// width: 100vw;
// `)}
// >
// <div className={"flex justify-center"}>
// <div className={"mt-84 flex flex-col items-center"}>
// <Heading type={1} fontSize={18}>
// Try crusher for free <RocketImage className={"ml-8"} />
// </Heading>
// <TextBlock fontSize={14.2} color={"#E7E7E7"} className={"mt-12"} leading={false}>
// Million of devs empower their workflow with crusher
// </TextBlock>
// <div css={overlayContainer} className={"mt-36 pt-32 pl-28 pr-28 pb-60"}>
// <TextBlock fontSize={14} color={"#E7E7E7"} className={"mb-24"} weight={600}>
// Create an account
// </TextBlock>
// <div className={" mb-72"}>
// <Link href={getGithubLoginURL()}>
// <Button
// className={"flex items-center justify-center"}
// css={css(`
// width: 100%;
// height: 38px;
// font-weight: 400;
// background: linear-gradient(180deg, #905CFF 25.39%, #6D55FF 74.5%, #6951FF 74.5%);
// `)}
// >
// <GithubSVG />{" "}
// <Text className={"ml-10"} fontSize={14} weight={700}>
// Github
// </Text>
// </Button>
// </Link>
// {/* <Button*/}
// {/* bgColor={"tertiary-dark"}*/}
// {/* className={"flex items-center justify-center mt-20"}*/}
// {/* css={css(`*/}
// {/* width: 100%;*/}
// {/* height: 38px;*/}
// {/*`)}*/}
// {/* >*/}
// {/* <GitlabSVG />{" "}*/}
// {/* <Text className={"ml-10"} fontSize={14} weight={500}>*/}
// {/* Gitlab*/}
// {/* </Text>*/}
// {/* </Button>*/}
// <Button
// onClick={loginWithEmailHandler}
// bgColor={"tertiary-dark"}
// className={"flex items-center justify-center mt-20"}
// css={css(`
// width: 100%;
// height: 38px;
// `)}
// >
// <Text fontSize={14} weight={500}>
// Use email
// </Text>
// </Button>
// </div>
// <div className="flex w-full justify-center">
// <Text className={"underline-on-hover"} fontSize={14}>
// Need help?
// </Text>
// </div>
// </div>
// <div onClick={() => router.push("/login")} className="flex w-full justify-center mt-40">
// <Text
// color={"#9692FF"}
// fontSize={14}
// css={css`
// :hover {
// color: #b9b6ff;
// text-decoration: underline;
// }
// `}
// >
// or go to login
// </Text>
// </div>
// </div>
// </div>
// </div>
// );
// }
// const overlayContainer = css(`
// background: #0a0b0c;
// border: 1px solid #21252f;
// border-radius: 10px;
// width: 372rem;
// min-height: 440px;
// `);
import { css } from "@emotion/react";
import { Heading } from "dyson/src/components/atoms/heading/Heading";
import { TextBlock } from "dyson/src/components/atoms/textBlock/TextBlock";
import { Text } from "dyson/src/components/atoms/text/Text";
import { Button } from "dyson/src/components/atoms";
import { useRouter } from "next/router";
import Link from "next/link";
import { getGithubLoginURL } from "@utils/core/external";
import { LoginNavBar } from "@ui/containers/common/login/navbar";
import React from "react";
import { useAtom } from "jotai";
import { inviteCodeUserKeyAtom } from "@store/atoms/global/inviteCode";
const RocketImage = (props) => (
<img
{...props}
src={
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAPCAYAAADUFP50AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJBSURBVHgBndJNSJNxHAfw77ZnPcu5Cb4u3yrnzMhMxQyLOnRQC0yJ9NBFSjHo0k0yIuhSmNClCJUOlpGHDpUkmka+5NSp0Wh7Njc3n/a4ILH26rO5t+efGXWaFX3P38/l9/sC/xnRvxbbOjoUyozy0kBUdCzgX3/9V9ja2io9W3O63UsltLz3yXNo1T4YtLN2yZ/QpE5XQDPWye4nTxvSx0aTKpvqUZgFvJxiV8Tbob6+vqP+Ce1Cz9R04QTzEYrkJBTlZcPD2uCxvhuNCzuLy07yGQf651b9ijO8F90aDaovNcNiYTA8NBxJ8OsfUb/KvkzVBXg8u1YIUfXmV1weN/ISWXoxGrtO4KA6G1bWjumpGTCmpTsL49PGLejLT2umvb6H4dgGFiHFiFiFRD6II0UliAoGmPVa6BkOM7Pz8zYHe/eHocj1HHXYFeykXCFwTnhGuBTZ3pIymWZ3Eg6/7cVAmMYnrxMSj8PImJfrvjrMri0YruDvUztiYmGN/nazJ/Mqu7/03vHEIJTd7eiXZ2FOkIOsfXnBuwwXvRzn/n0IQn6OgHt8qNphqmXPN9WRc8oE0pWbFm1JySODO5XLDUD8t324hhKBq4qG3LfJgwY1GaqRDeoU1PNVMYhbhFfxjJhszk5TntojUsoldt1nVJ4SZnJpLKjFsXp6syCIYI8LLbXYI9kIFkUYW1SJgbGlIbaqIC8clCrIegS4kSLgSjxI8RlIhlR0yzW2+IaxRAyNz8C726SmQGqoJssJLbbJd0nz9aMpv90CAAAAAElFTkSuQmCC"
}
/>
);
const GitlabSVG = (props) => (
<svg width={16} height={16} fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
<path fillRule="evenodd" clipRule="evenodd" d="m8.001 15.37 2.946-9.07H5.055l2.946 9.07Z" fill="#E24329" />
<path fillRule="evenodd" clipRule="evenodd" d="M8 15.37 5.056 6.3H.925l7.076 9.07Z" fill="#FC6D26" />
<path fillRule="evenodd" clipRule="evenodd" d="M.926 6.3.03 9.058a.61.61 0 0 0 .221.682l7.749 5.63L.926 6.3Z" fill="#FCA326" />
<path fillRule="evenodd" clipRule="evenodd" d="M.926 6.3h4.129L3.28.842a.305.305 0 0 0-.58 0L.926 6.3Z" fill="#E24329" />
<path fillRule="evenodd" clipRule="evenodd" d="m8 15.37 2.946-9.07h4.129L8 15.37Z" fill="#FC6D26" />
<path fillRule="evenodd" clipRule="evenodd" d="m15.075 6.3.895 2.755a.61.61 0 0 1-.222.682L8 15.37 15.075 6.3Z" fill="#FCA326" />
<path fillRule="evenodd" clipRule="evenodd" d="M15.074 6.3h-4.13L12.72.839a.305.305 0 0 1 .58 0L15.074 6.3Z" fill="#E24329" />
</svg>
);
export const GithubSVG = function (props) {
return (
<svg width={16} height={16} fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
<path
d="M8 0a8 8 0 0 0-2.529 15.591c.4.074.529-.174.529-.384v-1.49c-2.225.484-2.689-.944-2.689-.944-.364-.924-.888-1.17-.888-1.17-.726-.497.055-.486.055-.486.803.056 1.226.824 1.226.824.713 1.223 1.871.87 2.328.665.071-.517.279-.87.508-1.07-1.777-.203-3.645-.889-3.645-3.953 0-.874.313-1.588.824-2.148-.082-.202-.356-1.016.078-2.117 0 0 .672-.215 2.201.82A7.673 7.673 0 0 1 8 3.868c.68.004 1.365.093 2.004.27 1.527-1.035 2.198-.82 2.198-.82.435 1.102.161 1.916.079 2.117.513.56.823 1.274.823 2.148 0 3.072-1.871 3.749-3.653 3.947.287.248.549.735.549 1.481v2.196c0 .212.128.462.534.384A8.002 8.002 0 0 0 8 0Z"
fill="#fff"
/>
</svg>
);
};
export default function SignupInitial({ loginWithEmailHandler }) {
const router = useRouter();
const { query } = router;
const [sessionInviteCode, setSessionInviteCode] = useAtom(inviteCodeUserKeyAtom);
const handleGithub = () => {
if(!sessionInviteCode) { alert("Invite code needed to signup"); return; }
window.location.href = getGithubLoginURL(query?.inviteType?.toString(), query?.inviteCode?.toString(), sessionInviteCode)
};
return (
<div css={containerCSS}>
<div className="pt-28">
<LoginNavBar />
</div>
<div className={"flex justify-center"}>
<div
className={"flex flex-col items-center"}
css={css`
margin-top: 144rem;
`}
>
<Heading type={1} fontSize={22} weight={900}>
Use superpowers to{" "}
<span
css={css`
color: #d4eb79;
`}
>
ship fast
</span>{" "}
and{" "}
<span
css={css`
color: #8c67f5;
margin-right: 12px;
`}
>
better
</span>
π
</Heading>
<TextBlock
fontSize={14.2}
color={"#606060"}
className={"mt-16"}
css={css`
letter-spacing: 0.2px;
`}
leading={false}
>
Devs use crusher to test & ship fast with confidence. Get started in seconds
</TextBlock>
<div css={overlayContainer} className={"mt-48 pb-60"}>
<div className={" mb-42"}>
<Button onClick={handleGithub} className={"flex items-center justify-center"} css={githubButtonCSS}>
<GithubSVG />{" "}
<Text className={"ml-10"} fontSize={14} weight={700}>
Signup with Github
</Text>
</Button>
{/* <Button
onClick={loginWithEmailHandler}
bgColor={"tertiary-dark"}
className={"flex items-center justify-center mt-20"}
css={[buttonCSS, plainButton]}
>
<Text fontSize={14} weight={500}>
Signup with Gitlab
</Text>
</Button> */}
<Button
onClick={loginWithEmailHandler}
bgColor={"tertiary-dark"}
className={"flex items-center justify-center mt-20"}
css={[buttonCSS, plainButton]}
>
<Text fontSize={14} weight={500}>
or with email
</Text>
</Button>
</div>
<div className="flex w-full justify-center">
<Text css={[underLineonHover, helpCSS]} fontSize={14}>
Need help?
</Text>
</div>
</div>
<div onClick={() => router.push("/login")} className="flex w-full justify-center mt-40">
<Text
color={"#565657"}
fontSize={14}
css={css`
font-size: 14.5rem;
:hover {
text-decoration: underline;
}
`}
>
Or{" "}
<span
css={css`
color: #855aff;
`}
>
Login
</span>
</Text>
</div>
</div>
</div>
</div>
);
}
const helpCSS = css`
color: #565657;
`;
const containerCSS = css(`
height: 100vh;
background: #0C0C0D;
width: 100vw;
`);
const overlayContainer = css(`
width: 372rem;
`);
const underLineonHover = css`
:hover {
text-decoration: underline;
}
`;
const plainButton = css`
background: #0f0f0f;
`;
const githubButtonCSS = css(`
width: 100%;
height: 44rem;
font-weight: 400;
border-radius: 6rem;
background: linear-gradient(133.85deg, #905CFF 25.39%, #6D55FF 74.5%, #6951FF 74.5%);
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
`);
const buttonCSS = css(`
width: 100%;
height: 44rem;
border-radius: 6rem;
`);