From e4dbc06202ddfcbf02e5c2d54f59d8acb7aebeb6 Mon Sep 17 00:00:00 2001 From: lethemanh Date: Wed, 11 Dec 2024 17:31:44 +0700 Subject: [PATCH] Reuse icon in application --- .../atoms/icons-agnostic/assets/account.svg | 14 -------------- .../atoms/icons-agnostic/assets/envelop.svg | 14 -------------- .../atoms/icons-agnostic/assets/logout.svg | 14 -------------- .../src/app/atoms/icons-agnostic/index.tsx | 3 --- .../src/app/components/menus/menu.scss | 19 +++++++++++++++++++ .../src/app/views/client/common/account.tsx | 12 ++++++------ 6 files changed, 25 insertions(+), 51 deletions(-) delete mode 100644 tdrive/frontend/src/app/atoms/icons-agnostic/assets/account.svg delete mode 100644 tdrive/frontend/src/app/atoms/icons-agnostic/assets/envelop.svg delete mode 100644 tdrive/frontend/src/app/atoms/icons-agnostic/assets/logout.svg diff --git a/tdrive/frontend/src/app/atoms/icons-agnostic/assets/account.svg b/tdrive/frontend/src/app/atoms/icons-agnostic/assets/account.svg deleted file mode 100644 index bfb51ef69..000000000 --- a/tdrive/frontend/src/app/atoms/icons-agnostic/assets/account.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - \ No newline at end of file diff --git a/tdrive/frontend/src/app/atoms/icons-agnostic/assets/envelop.svg b/tdrive/frontend/src/app/atoms/icons-agnostic/assets/envelop.svg deleted file mode 100644 index 4875726af..000000000 --- a/tdrive/frontend/src/app/atoms/icons-agnostic/assets/envelop.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - \ No newline at end of file diff --git a/tdrive/frontend/src/app/atoms/icons-agnostic/assets/logout.svg b/tdrive/frontend/src/app/atoms/icons-agnostic/assets/logout.svg deleted file mode 100644 index 8c1dd1d10..000000000 --- a/tdrive/frontend/src/app/atoms/icons-agnostic/assets/logout.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - \ No newline at end of file diff --git a/tdrive/frontend/src/app/atoms/icons-agnostic/index.tsx b/tdrive/frontend/src/app/atoms/icons-agnostic/index.tsx index 1521a8441..048abf6fe 100644 --- a/tdrive/frontend/src/app/atoms/icons-agnostic/index.tsx +++ b/tdrive/frontend/src/app/atoms/icons-agnostic/index.tsx @@ -48,6 +48,3 @@ export const StatusCheckDoubleIcon = (props: ComponentProps<'svg'>) => ( export const StatusCheckIcon = (props: ComponentProps<'svg'>) => ; export const UsersIcon = (props: ComponentProps<'svg'>) => ; export const SortIcon = (props: ComponentProps<'svg'>) => ; -export const EnvelopIcon = (props: ComponentProps<'svg'>) => ; -export const AccountIcon = (props: ComponentProps<'svg'>) => ; -export const LogoutIcon = (props: ComponentProps<'svg'>) => ; diff --git a/tdrive/frontend/src/app/components/menus/menu.scss b/tdrive/frontend/src/app/components/menus/menu.scss index aa0be79bb..4c8a4d819 100755 --- a/tdrive/frontend/src/app/components/menus/menu.scss +++ b/tdrive/frontend/src/app/components/menus/menu.scss @@ -48,9 +48,28 @@ } } + .email { + height: 46px !important; + line-height: 46px !important; + .icon { + font-size: 24px; + } + .text { + margin-left: 10px; + font-size: 13px; + cursor: text; + user-select: text !important; + -webkit-user-select: text !important; + } + } + .account-menu { height: 46px !important; line-height: 46px !important; + .icon { + font-size: 24px !important; + margin-left: 0 !important; + } .text { margin-left: 10px; } diff --git a/tdrive/frontend/src/app/views/client/common/account.tsx b/tdrive/frontend/src/app/views/client/common/account.tsx index 04a86df79..f7f7c1036 100644 --- a/tdrive/frontend/src/app/views/client/common/account.tsx +++ b/tdrive/frontend/src/app/views/client/common/account.tsx @@ -9,7 +9,7 @@ import ModalManagerDepreciated from '@deprecated/popupManager/popupManager'; import FeatureTogglesService, { FeatureNames, } from '@features/global/services/feature-toggles-service'; -import { AccountIcon, EnvelopIcon, LogoutIcon } from 'app/atoms/icons-agnostic'; +import Icon from '@components/icon/icon.jsx'; export default (): JSX.Element => { const { user } = useCurrentUser(); @@ -28,17 +28,17 @@ export default (): JSX.Element => { text: currentUserService.getFullName(user), }, { - type: 'menu', + type: 'text', text: user.email, - className: 'account-menu', - icon: , + className: 'email', + icon: , hide: !FeatureTogglesService.isActiveFeatureName(FeatureNames.COMPANY_DISPLAY_EMAIL), }, { type: 'separator' }, { type: 'menu', className: 'account-menu', - icon: , + icon: , text: Languages.t('scenes.app.channelsbar.currentuser.title'), //hide: InitService.server_infos?.configuration?.accounts?.type === 'remote', onClick: () => { @@ -48,7 +48,7 @@ export default (): JSX.Element => { { type: 'menu', className: 'account-menu', - icon: , + icon: , text: Languages.t('scenes.app.channelsbar.currentuser.logout'), onClick: () => { LoginService.logout();