From 948dff7c889fc7a22d283b3bd7dcb0e35cb2786c Mon Sep 17 00:00:00 2001 From: Aizad Ridzo <103104395+aizad-deriv@users.noreply.github.com> Date: Mon, 12 Aug 2024 20:14:19 +0800 Subject: [PATCH] Aizad/WALL-4579/Change Password Button to Forgot Password Link on MT5TradeModal (#16379) * chore: Replace password button with Forgot Password link * chore: update stylings * chore: translate new string within component * chore: remove edit svg * chore: made changes based on comments * chore: added optinal value string * chore: update default value placement --- .../MT5TradeDetailsItem.scss | 16 ++--- .../MT5TradeDetailsItem.tsx | 62 ++++++++++++------- .../screens/MT5TradeScreen/MT5TradeScreen.tsx | 4 +- .../wallets/src/public/images/ic-edit.svg | 10 --- 4 files changed, 48 insertions(+), 44 deletions(-) delete mode 100644 packages/wallets/src/public/images/ic-edit.svg diff --git a/packages/wallets/src/features/cfd/screens/MT5TradeScreen/MT5TradeDetailsItem/MT5TradeDetailsItem.scss b/packages/wallets/src/features/cfd/screens/MT5TradeScreen/MT5TradeDetailsItem/MT5TradeDetailsItem.scss index 5e583abfab7c..88e3101860f2 100644 --- a/packages/wallets/src/features/cfd/screens/MT5TradeScreen/MT5TradeDetailsItem/MT5TradeDetailsItem.scss +++ b/packages/wallets/src/features/cfd/screens/MT5TradeScreen/MT5TradeDetailsItem/MT5TradeDetailsItem.scss @@ -21,19 +21,19 @@ align-items: center; gap: 0.8rem; padding-right: 0.8rem; - font-family: 'Courier', monospace; - - & .wallets-text { - font-family: 'Courier', serif; - } & .wallets-clipboard { border: none; border-radius: none; } - } - &__edit { - cursor: pointer; + &--mono-text { + font-family: 'Courier', serif; + } + + &--forgot-link { + text-decoration: underline; + cursor: pointer; + } } } diff --git a/packages/wallets/src/features/cfd/screens/MT5TradeScreen/MT5TradeDetailsItem/MT5TradeDetailsItem.tsx b/packages/wallets/src/features/cfd/screens/MT5TradeScreen/MT5TradeDetailsItem/MT5TradeDetailsItem.tsx index 0cce2068ee8c..66615c9a306d 100644 --- a/packages/wallets/src/features/cfd/screens/MT5TradeScreen/MT5TradeDetailsItem/MT5TradeDetailsItem.tsx +++ b/packages/wallets/src/features/cfd/screens/MT5TradeScreen/MT5TradeDetailsItem/MT5TradeDetailsItem.tsx @@ -1,55 +1,69 @@ import React, { FC } from 'react'; import classNames from 'classnames'; -import { Tooltip } from '@deriv-com/ui'; -import { WalletClipboard, WalletText } from '../../../../../components/Base'; +import { Localize } from '@deriv-com/translations'; +import { Text, useDevice } from '@deriv-com/ui'; +import { WalletClipboard } from '../../../../../components/Base'; import { useModal } from '../../../../../components/ModalProvider'; -import useDevice from '../../../../../hooks/useDevice'; -import EditIcon from '../../../../../public/images/ic-edit.svg'; import { ChangePassword } from '../../ChangePassword'; import './MT5TradeDetailsItem.scss'; type TMT5TradeDetailsItemProps = { label?: string; - value: string; + value?: string; variant?: 'clipboard' | 'info' | 'password'; }; -const MT5TradeDetailsItem: FC = ({ label, value, variant = 'clipboard' }) => { +const MT5TradeDetailsItem: FC = ({ label, value = '', variant = 'clipboard' }) => { const { isDesktop } = useDevice(); const { show } = useModal(); + + const textSize = isDesktop ? 'xs' : 'sm'; + return (
- {variant !== 'info' && ( + {variant === 'clipboard' && ( - + {label} - +
- + {value} - - {variant === 'clipboard' && } - {variant === 'password' && ( - show()} - tooltipContent='Change password' - tooltipPosition='left' - > - - - )} + + +
+
+ )} + {variant === 'password' && ( + + + {label} + +
+ show()} + size={textSize} + weight='bold' + > + +
)} {variant === 'info' && ( - + {value} - + )}
); diff --git a/packages/wallets/src/features/cfd/screens/MT5TradeScreen/MT5TradeScreen.tsx b/packages/wallets/src/features/cfd/screens/MT5TradeScreen/MT5TradeScreen.tsx index beb056d8de62..190ea7801995 100644 --- a/packages/wallets/src/features/cfd/screens/MT5TradeScreen/MT5TradeScreen.tsx +++ b/packages/wallets/src/features/cfd/screens/MT5TradeScreen/MT5TradeScreen.tsx @@ -167,13 +167,13 @@ const MT5TradeScreen: FC = ({ mt5Account }) => { value={details?.server_info?.environment ?? 'Deriv-Server'} /> - + )} {getModalState('platform') === dxtradePlatform && ( - + )} {getModalState('platform') === ctraderPlatform && ( diff --git a/packages/wallets/src/public/images/ic-edit.svg b/packages/wallets/src/public/images/ic-edit.svg deleted file mode 100644 index 11fa8f91964e..000000000000 --- a/packages/wallets/src/public/images/ic-edit.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - -