import React from "react"; import DtmplViewDrawer from "../../module/dtmpl-view-drawer"; import { LocaleContext } from "../../locale/LocaleProvider"; interface UserInfoBarProps { gtmplSourceId: string; userCode: string; editable?: boolean; } interface UserInfoBarState { showDraw?: boolean; } class UserInfoBar extends React.PureComponent< UserInfoBarProps, UserInfoBarState > { state = { showDraw: false, }; static contextType = LocaleContext; context: React.ContextType; static defaultProps = { editable: false, }; async componentDidMount() {} showDraw = () => { this.setState({ showDraw: true, }); }; closeDrawer = () => { this.setState({ showDraw: false, }); }; render() { const { showDraw } = this.state; const { gtmplSourceId, userCode, editable } = this.props; const { translate } = this.context; return ( <> {userCode ? ( <> {translate("${个人信息}")} {showDraw ? ( ) : null} ) : null}{" "} ); } } export default UserInfoBar;