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'
| '8x'
| '9x'
| '10x';
| '10x'
| 'xs'
| '2xs'
| 'sm'
| 'lg'
| 'xl'
| '2xl';
},
{}
>

View File

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

View File

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

View File

@ -24,13 +24,13 @@ const IdStateColor = {
verified: SuccessColor,
}
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;
}, {
logout: () => 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 [updateAttr, setUpdateAttr] = useState(undefined as string | undefined);
@ -69,12 +69,14 @@ export default function Render(props: WebComponentProps<EntityDict, 'token', fal
<div className={Styles.header}>
<MyAvatar size={66} iconColor="white" />
<div className={Styles.name}>{nameText || t('unset')}</div>
<Button
size='small'
onClick={() => logout()}
>
{t('logout')}
</Button>
{
showLogout && <Button
size='small'
onClick={() => logout()}
>
{t('logout')}
</Button>
}
</div>
<div className={Styles.body}>
<List

View File

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