myInfo的样式修改

This commit is contained in:
Xu Chang 2022-12-22 12:21:17 +08:00
parent 822edcf639
commit 0e180ca337
5 changed files with 21 additions and 14 deletions

View File

@ -24,7 +24,13 @@ export default function Render(
| '7x' | '7x'
| '8x' | '8x'
| '9x' | '9x'
| '10x'; | '10x'
| 'xs'
| '2xs'
| 'sm'
| 'lg'
| 'xl'
| '2xl';
}, },
{} {}
> >

View File

@ -24,7 +24,7 @@ export default OakComponent({
}; };
}, },
properties: { properties: {
hideLogout: Boolean, showLogout: Boolean,
}, },
lifetimes: { lifetimes: {
attached() { attached() {

View File

@ -4,7 +4,6 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: stretch; align-items: stretch;
min-height: 100vh;
background-color: var(--oak-bg-color-container); background-color: var(--oak-bg-color-container);
.header { .header {

View File

@ -24,13 +24,13 @@ const IdStateColor = {
verified: SuccessColor, verified: SuccessColor,
} }
export default function Render(props: WebComponentProps<EntityDict, 'token', false, { export default function Render(props: WebComponentProps<EntityDict, 'token', false, {
nameText?: string; mobileText?: string; userId?: string; gender: string; nameText?: string; mobileText?: string; userId?: string; gender: string; showLogout?: string;
nickname?: string; name?: string; idState?: string; userState?: string; nickname?: string; name?: string; idState?: string; userState?: string;
}, { }, {
logout: () => void; logout: () => void;
updateAttribute: (attr: string, value: any) => Promise<void>; updateAttribute: (attr: string, value: any) => Promise<void>;
}>) { }>) {
const { nameText, mobileText, userId, nickname, name, idState, userState, gender } = props.data; const { nameText, mobileText, userId, nickname, name, idState, userState, gender, showLogout } = props.data;
const { t, logout, navigateTo, updateAttribute } = props.methods; const { t, logout, navigateTo, updateAttribute } = props.methods;
const [updateAttr, setUpdateAttr] = useState(undefined as string | undefined); const [updateAttr, setUpdateAttr] = useState(undefined as string | undefined);
@ -69,12 +69,14 @@ export default function Render(props: WebComponentProps<EntityDict, 'token', fal
<div className={Styles.header}> <div className={Styles.header}>
<MyAvatar size={66} iconColor="white" /> <MyAvatar size={66} iconColor="white" />
<div className={Styles.name}>{nameText || t('unset')}</div> <div className={Styles.name}>{nameText || t('unset')}</div>
<Button {
showLogout && <Button
size='small' size='small'
onClick={() => logout()} onClick={() => logout()}
> >
{t('logout')} {t('logout')}
</Button> </Button>
}
</div> </div>
<div className={Styles.body}> <div className={Styles.body}>
<List <List

View File

@ -27,12 +27,12 @@ const IdStateColor = {
export default function Render(props: WebComponentProps<EntityDict, 'token', false, { export default function Render(props: WebComponentProps<EntityDict, 'token', false, {
nameText?: string; mobileText?: string; userId?: string; gender: string; nameText?: string; mobileText?: string; userId?: string; gender: string;
nickname?: string; name?: string; idState?: string; userState?: string; nickname?: string; name?: string; idState?: string; userState?: string;
hideLogout?: boolean; showLogout?: boolean;
}, { }, {
logout: () => void; logout: () => void;
updateAttribute: (attr: string, value: any) => Promise<void>; updateAttribute: (attr: string, value: any) => Promise<void>;
}>) { }>) {
const { nameText, mobileText, userId, nickname, name, idState, userState, gender, hideLogout } = props.data; const { nameText, mobileText, userId, nickname, name, idState, userState, gender, showLogout } = props.data;
const { t, logout, navigateTo, updateAttribute } = props.methods; const { t, logout, navigateTo, updateAttribute } = props.methods;
const [updateAttr, setUpdateAttr] = useState(undefined as string | undefined); const [updateAttr, setUpdateAttr] = useState(undefined as string | undefined);
@ -107,7 +107,7 @@ export default function Render(props: WebComponentProps<EntityDict, 'token', fal
</List> </List>
</div> </div>
{ {
!hideLogout && <> showLogout && <>
<div style={{ flex: 1 }} /> <div style={{ flex: 1 }} />
<Button <Button
block block