From 55397a65049eb5ea049bb707055aca45dd352700 Mon Sep 17 00:00:00 2001 From: ameerul-deriv <103412909+ameerul-deriv@users.noreply.github.com> Date: Tue, 2 Apr 2024 14:06:36 +0800 Subject: [PATCH] [FEQ] / Ameerul / FEQ-1977 Refactor my profile page (#14331) * fix: ui issues in my-profile and create new ad button * fix: styling issues * fix: failing test cases * chore: remove PaymentMethodsHeader component and fix minor style issues * chore: replace Table component with deriv-com/ui one * fix: removed unused prop isFloating * chore: removed text * chore: refactored PaymentMethodForm, separated components out * chore: refactored PaymentMethodModals * fix: style discrepencies in BuySellModal * chore: removed Text and unused imports * chore: added suggestions * chore: added LightDivider component * fix: ui issues for share-my-ads-modal, dropdown in myadsrow, my-ads-delete-modal * fix: header padding ShareAdsModal * chore: removed color from LightDivider, changed prop name * chore: renamed PaymentMethodFormInput to PaymentMethodFormAutocomplete --- .../BuySellAmount/BuySellAmount.tsx | 9 +- .../components/BuySellForm/BuySellForm.scss | 1 - .../components/BuySellForm/BuySellForm.tsx | 7 +- .../BuySellFormHeader/BuySellFormHeader.tsx | 17 +- .../__tests__/BuySellFormHeader.spec.tsx | 5 + .../BuySellPaymentSection.tsx | 5 +- .../src/components/Clipboard/Clipboard.scss | 4 +- .../src/components/Clipboard/Clipboard.tsx | 2 +- .../FullPageMobileWrapper.scss | 1 + .../components/LightDivider/LightDivider.tsx | 14 ++ .../src/components/LightDivider/index.ts | 1 + .../src/components/MobileTabs/MobileTabs.scss | 7 +- .../src/components/MobileTabs/MobileTabs.tsx | 8 +- .../BlockUnblockUserModal.tsx | 9 +- .../Modals/FilterModal/FilterModal.scss | 1 - .../FilterModalFooter/FilterModalFooter.tsx | 12 +- .../MyAdsDeleteModal/MyAdsDeleteModal.scss | 20 +- .../MyAdsDeleteModal/MyAdsDeleteModal.tsx | 56 +++--- .../PaymentMethodErrorModal.scss | 43 ++-- .../PaymentMethodErrorModal.tsx | 42 ++-- .../PaymentMethodErrorModal.spec.tsx | 5 + .../PaymentMethodModal.scss | 37 ++++ .../PaymentMethodModal/PaymentMethodModal.tsx | 81 ++++---- .../__tests__/PaymentMethodModal.spec.tsx | 5 + .../Modals/PaymentMethods/styles.scss | 40 ---- .../Modals/ShareAdsModal/ShareAdsModal.scss | 21 ++ .../Modals/ShareAdsModal/ShareAdsModal.tsx | 149 +++++++------- .../Modals/ShareAdsModal/ShareAdsSocials.scss | 5 + .../Modals/ShareAdsModal/ShareAdsSocials.tsx | 5 +- .../__tests__/ShareAdsModal.spec.tsx | 4 +- .../src/components/PageReturn/PageReturn.scss | 1 + .../src/components/PageReturn/PageReturn.tsx | 7 +- .../PaymentMethodCardHeader.tsx | 2 +- .../PaymentMethodForm/PaymentMethodForm.scss | 35 +++- .../PaymentMethodForm/PaymentMethodForm.tsx | 187 ++++++------------ .../PaymentMethodFormAutocomplete.tsx | 101 ++++++++++ .../PaymentMethodFormAutocomplete/index.ts | 1 + .../PaymentMethodFormModalRenderer.tsx | 76 +++++++ .../PaymentMethodFormModalRenderer/index.ts | 1 + .../__test__/PaymentMethodForm.spec.tsx | 11 +- .../PaymentMethodsFormFooter.scss | 26 +-- .../PaymentMethodsFormFooter.tsx | 50 ++--- .../PaymentMethodsFormFooter.spec.tsx | 5 + .../PaymentMethodsHeader.scss | 13 -- .../PaymentMethodsHeader.tsx | 35 ---- .../__tests__/PaymentMethodsHeader.spec.tsx | 14 -- .../components/PaymentMethodsHeader/index.ts | 1 - .../PopoverDropdown/PopoverDropdown.scss | 18 +- .../PopoverDropdown/PopoverDropdown.tsx | 4 +- .../p2p-v2/src/components/Table/Table.tsx | 2 +- packages/p2p-v2/src/components/index.ts | 2 +- .../CurrencyDropdown/CurrencyDropdown.scss | 1 - .../MyAds/MyAdsTable/MyAdsDisplayWrapper.tsx | 1 + .../screens/MyProfile/MyProfile.scss | 19 +- .../screens/MyProfile/MyProfile.tsx | 26 +-- .../MyProfile/__tests__/MyProfile.spec.tsx | 5 +- .../MyProfileAdDetails.scss | 8 +- .../MyProfileAdDetails/MyProfileAdDetails.tsx | 3 +- .../MyProfileCounterparties.tsx | 1 + .../MyProfileCounterpartiesHeader.scss | 8 +- .../MyProfileCounterpartiesHeader.tsx | 13 +- .../MyProfileCounterpartiesTable.scss | 11 +- .../MyProfileCounterpartiesTable.tsx | 11 +- .../MyProfileCounterpartiesTableRow.scss | 1 - .../MyProfileCounterpartiesTableRow.tsx | 7 +- .../MyProfileCounterpartiesTableRow.spec.tsx | 17 +- .../MyProfileStats/MyProfileStatsItem.tsx | 41 ++-- .../MyProfileStats/MyProfileStatsMobile.tsx | 1 + .../__tests__/MyProfileStats.spec.tsx | 6 + .../__tests__/MyProfileStatsItem.spec.tsx | 7 +- .../PaymentMethodsEmpty.scss | 2 +- .../PaymentMethodsEmpty.tsx | 13 +- .../__tests__/PaymentMethodsEmpty.spec.tsx | 31 +-- .../PaymentMethodsList/AddNewButton.tsx | 5 +- .../PaymentMethodsList.scss | 30 +-- .../PaymentMethodsList/PaymentMethodsList.tsx | 14 +- .../PaymentMethodsListContent.scss | 25 +++ .../PaymentMethodsListContent.tsx | 11 +- .../PaymentMethodsListContent/index.ts | 1 + .../__test__/PaymentMethodsList.spec.tsx | 25 +-- .../PaymentMethodsListContent.spec.tsx | 2 +- .../OrderDetailsCard/OrderDetailsCard.tsx | 7 +- .../ActiveOrderInfo/ActiveOrderInfo.tsx | 9 +- .../OrdersChatSection/OrdersChatSection.scss | 1 - .../OrdersChatSection/OrdersChatSection.tsx | 8 +- .../p2p-v2/src/routes/AppContent/index.scss | 4 + 86 files changed, 930 insertions(+), 653 deletions(-) create mode 100644 packages/p2p-v2/src/components/LightDivider/LightDivider.tsx create mode 100644 packages/p2p-v2/src/components/LightDivider/index.ts create mode 100644 packages/p2p-v2/src/components/Modals/PaymentMethods/PaymentMethodModal/PaymentMethodModal.scss delete mode 100644 packages/p2p-v2/src/components/Modals/PaymentMethods/styles.scss create mode 100644 packages/p2p-v2/src/components/PaymentMethodForm/PaymentMethodFormAutocomplete/PaymentMethodFormAutocomplete.tsx create mode 100644 packages/p2p-v2/src/components/PaymentMethodForm/PaymentMethodFormAutocomplete/index.ts create mode 100644 packages/p2p-v2/src/components/PaymentMethodForm/PaymentMethodFormModalRenderer/PaymentMethodFormModalRenderer.tsx create mode 100644 packages/p2p-v2/src/components/PaymentMethodForm/PaymentMethodFormModalRenderer/index.ts delete mode 100644 packages/p2p-v2/src/components/PaymentMethodsHeader/PaymentMethodsHeader.scss delete mode 100644 packages/p2p-v2/src/components/PaymentMethodsHeader/PaymentMethodsHeader.tsx delete mode 100644 packages/p2p-v2/src/components/PaymentMethodsHeader/__tests__/PaymentMethodsHeader.spec.tsx delete mode 100644 packages/p2p-v2/src/components/PaymentMethodsHeader/index.ts create mode 100644 packages/p2p-v2/src/pages/my-profile/screens/PaymentMethods/PaymentMethodsList/PaymentMethodsListContent/PaymentMethodsListContent.scss rename packages/p2p-v2/src/pages/my-profile/screens/PaymentMethods/PaymentMethodsList/{ => PaymentMethodsListContent}/PaymentMethodsListContent.tsx (95%) create mode 100644 packages/p2p-v2/src/pages/my-profile/screens/PaymentMethods/PaymentMethodsList/PaymentMethodsListContent/index.ts diff --git a/packages/p2p-v2/src/components/BuySellForm/BuySellAmount/BuySellAmount.tsx b/packages/p2p-v2/src/components/BuySellForm/BuySellAmount/BuySellAmount.tsx index 34178a33c619..4070f13d2832 100644 --- a/packages/p2p-v2/src/components/BuySellForm/BuySellAmount/BuySellAmount.tsx +++ b/packages/p2p-v2/src/components/BuySellForm/BuySellAmount/BuySellAmount.tsx @@ -1,7 +1,8 @@ import React, { useEffect, useState } from 'react'; import { Controller, useForm } from 'react-hook-form'; +import { LightDivider } from '@/components'; import { floatingPointValidator } from '@/utils'; -import { Divider, Input, Text, useDevice } from '@deriv-com/ui'; +import { Input, Text, useDevice } from '@deriv-com/ui'; import { FormatUtils } from '@deriv-com/utils'; import './BuySellAmount.scss'; @@ -42,7 +43,7 @@ const BuySellAmount = ({ return (