///
///
import * as React from "react";
import { fireClickOnEnter, CheckboxStatus } from "../util";
import { UserNotification } from "./UserNotification";
import { Checkbox } from "../controls/Checkbox";
import { Button } from "../controls/Button";
export interface UserPaneProps {
profile: pxt.auth.UserProfile;
notification?: pxt.ProfileNotification;
emailChecked: CheckboxStatus;
onSignOutClick: () => void;
onDeleteProfileClick: () => void;
onEmailCheckClick: (isChecked: boolean) => void;
}
export const UserPane = (props: UserPaneProps) => {
const { profile, onSignOutClick, onDeleteProfileClick, onEmailCheckClick, notification, emailChecked } = props;
const { username, displayName, picture, pictureUrl } = profile.idp;
const picUrl = pictureUrl ?? picture?.dataUrl;
const emailLabel = <>
{emailChecked === CheckboxStatus.Waiting ?
: undefined}
{lf("I would like to receive the MakeCode newsletter. ")}
{lf("View Privacy Statement")}
>
return
{ picUrl ?
// Google user picture URL must have referrer policy set to no-referrer
:
{pxt.auth.userInitials(profile)}
}
{displayName}
{ username &&
{username}
}
{ notification &&
}
}