-
Notifications
You must be signed in to change notification settings - Fork 100
Expand file tree
/
Copy pathProfileIncompleteDialog.tsx
More file actions
85 lines (81 loc) · 2.45 KB
/
Copy pathProfileIncompleteDialog.tsx
File metadata and controls
85 lines (81 loc) · 2.45 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
import Button from "components/Button";
import {
Dialog,
DialogActions,
DialogContent,
DialogContentText,
DialogTitle,
} from "components/Dialog";
import StyledLink from "components/StyledLink";
import { Trans, useTranslation } from "i18n";
import { PROFILE } from "i18n/namespaces";
import Link from "next/link";
import React from "react";
import { howToCompleteProfileUrl, routeToEditProfile } from "routes";
interface ProfileIncompleteDialogProps {
open: boolean;
onClose: () => void;
attempted_action:
| "create_event"
| "send_message"
| "send_request"
| "create_public_trip"
| "send_friend_request"
| "create_discussion";
}
export default function ProfileIncompleteDialog({
open,
onClose,
attempted_action,
}: ProfileIncompleteDialogProps) {
const { t } = useTranslation([PROFILE]);
const action_text = t(
`profile:complete_profile_dialog.actions.${attempted_action}`,
);
return (
<Dialog
aria-labelledby="profile-incomplete-dialog-title"
open={open}
onClose={onClose}
>
<DialogTitle id="profile-incomplete-dialog-title">
{t("profile:complete_profile_dialog.title")}
</DialogTitle>
<DialogContent>
<DialogContentText>
<Trans i18nKey="profile:complete_profile_dialog.description_1">
Before you can {{ action_name: action_text }}, you must{" "}
<strong>write a bit about yourself</strong> in your profile and{" "}
<strong>upload a profile photo</strong>.
</Trans>
</DialogContentText>
<DialogContentText>
<Trans i18nKey="profile:complete_profile_dialog.description_2">
This helps build a trusted community and reduce spam. For more
information,{" "}
<StyledLink href={howToCompleteProfileUrl}>
please refer to this help page
</StyledLink>
. Thank you for your help!
</Trans>
</DialogContentText>
</DialogContent>
<DialogActions>
<Button
variant="outlined"
onClick={onClose}
sx={{ textAlign: "center" }}
>
{t("profile:complete_profile_dialog.cancel_button")}
</Button>
<Button
component={Link}
href={routeToEditProfile()}
sx={{ textAlign: "center" }}
>
{t("profile:complete_profile_dialog.edit_profile_button")}
</Button>
</DialogActions>
</Dialog>
);
}