CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/frontend/account/messages.tsx
Views: 821
1
import { Button, Card, Checkbox } from "antd";
2
import { redux, useTypedRedux } from "@cocalc/frontend/app-framework";
3
import { Icon } from "@cocalc/frontend/components/icon";
4
5
export default function Messages() {
6
const other_settings = useTypedRedux("account", "other_settings");
7
const email_address_verified = useTypedRedux(
8
"account",
9
"email_address_verified",
10
);
11
const email_address = useTypedRedux("account", "email_address");
12
13
const isVerified = !!email_address_verified?.get(email_address ?? "");
14
return (
15
<Card
16
style={{ marginTop: "10px" }}
17
title={
18
<Button
19
onClick={() => {
20
redux.getActions("page").set_active_tab("notifications");
21
redux
22
.getActions("mentions")
23
.set_filter("messages-inbox" as "messages-inbox");
24
}}
25
type="link"
26
style={{ fontSize: "16px", marginLeft: "-15px" }}
27
>
28
<Icon name="mail" /> Message Settings
29
</Button>
30
}
31
>
32
<Checkbox
33
checked={other_settings?.get("no_email_new_messages")}
34
onChange={(e) => {
35
const actions = redux.getActions("account");
36
actions.set_other_settings("no_email_new_messages", e.target.checked);
37
}}
38
>
39
Do NOT send email when you get new internal messages
40
</Checkbox>
41
{!isVerified && !other_settings?.get("no_email_new_messages") && (
42
<>
43
(NOTE: You must also verify your email address above to get emails
44
about new messages.)
45
</>
46
)}
47
</Card>
48
);
49
}
50
51