Path: blob/master/src/packages/frontend/account/messages.tsx
5979 views
import { Button } from "antd";12import { Panel, Switch } from "@cocalc/frontend/antd-bootstrap";3import { redux, useTypedRedux } from "@cocalc/frontend/app-framework";4import { Icon } from "@cocalc/frontend/components/icon";56export default function Messages() {7const other_settings = useTypedRedux("account", "other_settings");8const email_address_verified = useTypedRedux(9"account",10"email_address_verified",11);12const email_address = useTypedRedux("account", "email_address");1314const isVerified = !!email_address_verified?.get(email_address ?? "");15return (16<Panel17size={"small"}18style={{ marginTop: "10px" }}19header={20<Button21onClick={() => {22redux.getActions("page").set_active_tab("notifications");23redux24.getActions("mentions")25.set_filter("messages-inbox" as "messages-inbox");26}}27type="link"28style={{ fontSize: "16px", marginLeft: "-15px" }}29>30<Icon name="mail" /> Message Settings31</Button>32}33>34<Switch35checked={other_settings?.get("no_email_new_messages")}36onChange={(e) => {37const actions = redux.getActions("account");38actions.set_other_settings("no_email_new_messages", e.target.checked);39}}40>41Do NOT send email when you get new internal messages42</Switch>43{!isVerified && !other_settings?.get("no_email_new_messages") && (44<>45(NOTE: You must also verify your email address above to get emails46about new messages.)47</>48)}49</Panel>50);51}525354