Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/src/packages/frontend/account/profile-settings.tsx
Views: 687
/*1* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45import { useIntl } from "react-intl";6import { Panel } from "@cocalc/frontend/antd-bootstrap";7import { Rendered, useTypedRedux } from "@cocalc/frontend/app-framework";8import { ColorPicker } from "@cocalc/frontend/colorpicker";9import { Gap, LabeledRow, Loading } from "@cocalc/frontend/components";10import { labels } from "@cocalc/frontend/i18n";11import { Avatar } from "./avatar/avatar";12import { ProfileImageSelector, setProfile } from "./profile-image";1314interface Props {15email_address?: string;16// first_name?: string;17// last_name?: string;18}1920export function ProfileSettings({ email_address }: Props) {21const intl = useIntl();2223// const [show_instructions, set_show_instructions] = useState<boolean>(false);2425const account_id: string = useTypedRedux("account", "account_id");26const profile = useTypedRedux("account", "profile");2728function onColorChange(value: string) {29setProfile({30account_id,31profile: { color: value },32});33}3435function render_header(): Rendered {36return (37<>38<Avatar account_id={account_id} size={48} />39<Gap />40<Gap />41Avatar42</>43);44}4546if (account_id == null || profile == null) {47return <Loading />;48}4950return (51<Panel header={render_header()}>52<LabeledRow label={intl.formatMessage(labels.color)}>53<ColorPicker54color={profile?.get("color")}55justifyContent={"flex-start"}56onChange={onColorChange}57/>58</LabeledRow>59<LabeledRow label="Style">60<ProfileImageSelector61account_id={account_id}62email_address={email_address}63profile={profile}64/>65</LabeledRow>66</Panel>67);68}697071