Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions shell/app/common/components/user-info/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ import { get } from 'lodash';
import i18n from 'i18n';
import { Avatar } from 'antd';
import { getAvatarChars } from 'common/utils';
import userStore from 'user/stores';
import Ellipsis from 'common/components/ellipsis';
import { AvatarSize } from 'antd/lib/avatar/SizeContext';

interface IPlatformUser {
avatar: string;
email: string;
id: string;
locked: boolean;
locked?: boolean;
name: string;
nick: string;
phone: string;
Expand All @@ -37,13 +38,14 @@ interface IProps {
render?: (data: IPlatformUser, id?: string | number) => React.ReactNode;
}

const defaultRender = (data: IPlatformUser, id: string | number) => {
const defaultRender = (data: IPlatformUser, id?: string | number) => {
return data.nick || data.name || id || i18n.t('None');
};

const UserInfo = ({ id, render = defaultRender }: IProps) => {
const userMap = useUserMap();
const userInfo: IPlatformUser = get(userMap, id, {});
const loginUser = userStore.useStore((s) => s.loginUser);
const userInfo = get({ [loginUser.id]: loginUser as unknown as IPlatformUser, ...userMap }, id, {}) as IPlatformUser;
return <>{render?.(userInfo, id)}</>;
};

Expand Down
6 changes: 3 additions & 3 deletions shell/app/layout/pages/page-container/page-container.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
top: 48px;
z-index: 2;
transition: box-shadow 0.1s ease-in-out;
&.show {
box-shadow: 0 6px 11px -11px $color-default-3 inset;
}
// &.show {
// box-shadow: 0 6px 11px -11px $color-default-3 inset;
// }
}
Loading