|
1 | 1 | import { |
2 | | - Typography, |
3 | 2 | Button, |
4 | 3 | Dialog, |
5 | 4 | DialogContent, |
6 | | - DialogContentText, |
7 | | - DialogTitle, |
| 5 | + Divider, |
8 | 6 | Link, |
9 | 7 | Stack, |
| 8 | + Typography, |
10 | 9 | } from "@mui/material"; |
| 10 | +import { styled } from "@mui/system"; |
| 11 | +import logo from "../assets/icon-transparent.png"; |
| 12 | +import googleIcon from "../assets/images/icons/google.svg"; |
| 13 | + |
| 14 | +const Logo = styled("img")({ |
| 15 | + width: "50px", |
| 16 | + margin: "0 auto", |
| 17 | +}); |
11 | 18 |
|
12 | | -function LoginDialog({ open, handleClose, redirectPath }) { |
| 19 | +function LoginDialog({ open, handleClose, redirectPath, loginMessage }) { |
13 | 20 | return ( |
14 | 21 | <Dialog |
15 | 22 | open={open} |
16 | 23 | onClose={handleClose} |
17 | 24 | aria-labelledby="login-dialog-title" |
18 | 25 | aria-describedby="login-dialog-description" |
| 26 | + maxWidth="xs" |
| 27 | + sx={{ |
| 28 | + textAlign: "center", |
| 29 | + }} |
19 | 30 | > |
20 | | - <DialogTitle |
21 | | - id="login-dialog-title" |
22 | | - sx={{ display: "flex", justifyContent: "center" }} |
23 | | - > |
24 | | - <Typography variant="h4">Sign in to continue</Typography> |
25 | | - </DialogTitle> |
26 | | - <DialogContent> |
27 | | - <DialogContentText id="login-dialog-description"> |
28 | | - <Stack sx={{ alignItems: "center" }}> |
29 | | - <Typography variant="body" gutterBottom> |
30 | | - Access 100+ community applications for free. Use ChatGPT, GPT-4, |
31 | | - Claude 2, DALLE 3, and others - all on Promptly. |
32 | | - </Typography> |
33 | | - <Stack sx={{ width: "100%", alignItems: "center" }}> |
34 | | - <Link |
35 | | - underline="none" |
36 | | - href={ |
37 | | - redirectPath |
38 | | - ? `/api/provider/login?provider_id=google&redirectUrl=${redirectPath}` |
39 | | - : "/api/provider/login?provider_id=google" |
40 | | - } |
41 | | - > |
42 | | - <Button variant="contained" autoFocus> |
43 | | - Login With Google |
44 | | - </Button> |
45 | | - </Link> |
46 | | - </Stack> |
47 | | - <Typography variant="caption" sx={{ marginTop: "4px" }}> |
48 | | - By continuing, you agree to our{" "} |
49 | | - <span> |
50 | | - <a href="https://www.trypromptly.com/tos">Terms of Service</a> |
51 | | - </span>{" "} |
52 | | - and{" "} |
53 | | - <span> |
54 | | - <a href="https://www.trypromptly.com/privacy">Privacy Policy</a> |
55 | | - </span> |
56 | | - </Typography> |
57 | | - </Stack> |
58 | | - </DialogContentText> |
| 31 | + <Stack m={8}> |
| 32 | + <Logo src={logo} alt="logo" /> |
| 33 | + <Typography |
| 34 | + sx={{ |
| 35 | + fontSize: "48px", |
| 36 | + fontWeight: 600, |
| 37 | + color: "#0a398d", |
| 38 | + }} |
| 39 | + > |
| 40 | + Promptly |
| 41 | + </Typography> |
| 42 | + </Stack> |
| 43 | + <Divider /> |
| 44 | + <DialogContent sx={{ backgroundColor: "#f7f7f7" }}> |
| 45 | + <Stack sx={{ alignItems: "center", margin: "1em" }} gap={8}> |
| 46 | + <Typography sx={{ fontSize: "18px", maxWidth: "250px" }}> |
| 47 | + {loginMessage || "Please sign in to continue using the platform."} |
| 48 | + </Typography> |
| 49 | + <Link |
| 50 | + underline="none" |
| 51 | + href={ |
| 52 | + redirectPath |
| 53 | + ? `/accounts/google/login/?next=${redirectPath}` |
| 54 | + : "/accounts/google/login/" |
| 55 | + } |
| 56 | + > |
| 57 | + <Button |
| 58 | + variant="outlined" |
| 59 | + size="large" |
| 60 | + sx={{ |
| 61 | + textTransform: "none", |
| 62 | + fontSize: "18px", |
| 63 | + width: "300px", |
| 64 | + padding: "10px", |
| 65 | + backgroundColor: "#fff", |
| 66 | + }} |
| 67 | + > |
| 68 | + <img src={googleIcon} alt="Google" width={"24px"} /> |
| 69 | + Continue with Google |
| 70 | + </Button> |
| 71 | + </Link> |
| 72 | + <Typography |
| 73 | + sx={{ |
| 74 | + fontSize: "16px", |
| 75 | + color: "#2f3437", |
| 76 | + lineHeight: "1.8em", |
| 77 | + border: "1px solid #e0e0e0", |
| 78 | + padding: "10px", |
| 79 | + borderRadius: "5px", |
| 80 | + backgroundColor: "#fff", |
| 81 | + }} |
| 82 | + > |
| 83 | + Access thousands of Generative AI applications for free. Use |
| 84 | + ChatGPT, GPT-4, Claude 2, DALLE 3, and others - all on Promptly. |
| 85 | + </Typography> |
| 86 | + <Typography variant="caption" sx={{ marginTop: "4px" }}> |
| 87 | + By continuing, you agree to our{" "} |
| 88 | + <span> |
| 89 | + <a href="https://www.trypromptly.com/tos">Terms of Service</a> |
| 90 | + </span>{" "} |
| 91 | + and{" "} |
| 92 | + <span> |
| 93 | + <a href="https://www.trypromptly.com/privacy">Privacy Policy</a> |
| 94 | + </span> |
| 95 | + </Typography> |
| 96 | + </Stack> |
59 | 97 | </DialogContent> |
60 | 98 | </Dialog> |
61 | 99 | ); |
|
0 commit comments