import * as _ from "lodash"; import * as React from "react"; import { Avatar, IAvatarProps } from "../../components/Avatar"; import { Button, ButtonSize, ButtonType } from "../../components/Button"; import { Sheet, ISheetProps } from "../../components/Sheet"; import { Image } from "../../components/Image"; import { Input } from "../../components/Input"; import { Reveal, RevealType } from "../../components/Reveal"; import { getImageSrc } from "../../utilities/image"; import { Upload, IUploadProps } from "../../components/Upload"; interface IProfileSheetProps { /** Required */ onEditName: (name: string) => void; onEditProfile: (file: File) => void; onClose: () => void; name: string; /** Optional */ avatar?: IAvatarProps; sheet?: ISheetProps; imagePrefix?: string; upload?: IUploadProps; } interface IProfileSheetState { navigation: "profile" | "edit-name"; } const defaultState: IProfileSheetState = { navigation: "profile", } export class ProfileSheet extends React.Component { public editNameRef: React.RefObject; public state: IProfileSheetState = defaultState; constructor(props) { super(props); this.editNameRef = React.createRef(); } public render() { return (
{this.renderProfile(this.state.navigation === "profile")} {this.renderEditName(this.state.navigation === "edit-name")}
); } private renderProfile(render: boolean) { return ( {this.props.avatar && (
)}

{this.props.name}

Edit Profile Picture
{ this.props.onEditProfile(file); }} />
this.setState({ navigation: "edit-name", })} >
Edit Name
); } private renderEditName(render: boolean) { return (

Edit Name

); } }