From 033ca95dfef0e0a61545bf31555bf8f78814153d Mon Sep 17 00:00:00 2001 From: louiscklaw Date: Tue, 22 Apr 2025 12:20:21 +0800 Subject: [PATCH] refactor to dedicated directory, --- .../{ => AddressCard}/SampleAddresses.tsx | 0 .../dashboard/Sample/AddressCard/index.tsx | 20 +++++++++---- .../index.tsx} | 0 .../{ => PaymentCard}/SamplePayments.tsx | 0 .../index.tsx} | 30 +++++++++++++++---- .../index.tsx} | 10 +++++-- .../index.tsx} | 0 7 files changed, 47 insertions(+), 13 deletions(-) rename 002_source/cms/src/app/dashboard/Sample/{ => AddressCard}/SampleAddresses.tsx (100%) rename 002_source/cms/src/app/dashboard/Sample/{BasicDetailCard.tsx => BasicDetailCard/index.tsx} (100%) rename 002_source/cms/src/app/dashboard/Sample/{ => PaymentCard}/SamplePayments.tsx (100%) rename 002_source/cms/src/app/dashboard/Sample/{SamplePaymentCard.tsx => PaymentCard/index.tsx} (72%) rename 002_source/cms/src/app/dashboard/Sample/{SampleSecurityCard.tsx => SecurityCard/index.tsx} (85%) rename 002_source/cms/src/app/dashboard/Sample/{SampleTitleCard.tsx => TitleCard/index.tsx} (100%) diff --git a/002_source/cms/src/app/dashboard/Sample/SampleAddresses.tsx b/002_source/cms/src/app/dashboard/Sample/AddressCard/SampleAddresses.tsx similarity index 100% rename from 002_source/cms/src/app/dashboard/Sample/SampleAddresses.tsx rename to 002_source/cms/src/app/dashboard/Sample/AddressCard/SampleAddresses.tsx diff --git a/002_source/cms/src/app/dashboard/Sample/AddressCard/index.tsx b/002_source/cms/src/app/dashboard/Sample/AddressCard/index.tsx index 0fb481f..f87386c 100644 --- a/002_source/cms/src/app/dashboard/Sample/AddressCard/index.tsx +++ b/002_source/cms/src/app/dashboard/Sample/AddressCard/index.tsx @@ -12,9 +12,9 @@ import { Plus as PlusIcon } from '@phosphor-icons/react/dist/ssr/Plus'; import { useTranslation } from 'react-i18next'; import type { Address } from '@/types/Address'; -import { ShippingAddress } from '@/components/dashboard/lp_categories/shipping-address'; +import { ShippingAddress } from '@/components/dashboard/lp/categories/shipping-address'; -import { SampleAddresses } from '../SampleAddresses'; +import { SampleAddresses } from './SampleAddresses'; export default function SampleAddressCard(): React.JSX.Element { const { t } = useTranslation(); @@ -22,7 +22,10 @@ export default function SampleAddressCard(): React.JSX.Element { }> + } @@ -34,9 +37,16 @@ export default function SampleAddressCard(): React.JSX.Element { title={t('list.shipping-addresses')} /> - + {(SampleAddresses satisfies Address[]).map((address) => ( - + ))} diff --git a/002_source/cms/src/app/dashboard/Sample/BasicDetailCard.tsx b/002_source/cms/src/app/dashboard/Sample/BasicDetailCard/index.tsx similarity index 100% rename from 002_source/cms/src/app/dashboard/Sample/BasicDetailCard.tsx rename to 002_source/cms/src/app/dashboard/Sample/BasicDetailCard/index.tsx diff --git a/002_source/cms/src/app/dashboard/Sample/SamplePayments.tsx b/002_source/cms/src/app/dashboard/Sample/PaymentCard/SamplePayments.tsx similarity index 100% rename from 002_source/cms/src/app/dashboard/Sample/SamplePayments.tsx rename to 002_source/cms/src/app/dashboard/Sample/PaymentCard/SamplePayments.tsx diff --git a/002_source/cms/src/app/dashboard/Sample/SamplePaymentCard.tsx b/002_source/cms/src/app/dashboard/Sample/PaymentCard/index.tsx similarity index 72% rename from 002_source/cms/src/app/dashboard/Sample/SamplePaymentCard.tsx rename to 002_source/cms/src/app/dashboard/Sample/PaymentCard/index.tsx index 3c26112..64a0283 100644 --- a/002_source/cms/src/app/dashboard/Sample/SamplePaymentCard.tsx +++ b/002_source/cms/src/app/dashboard/Sample/PaymentCard/index.tsx @@ -13,7 +13,7 @@ import { useTranslation } from 'react-i18next'; import { PropertyItem } from '@/components/core/property-item'; import { PropertyList } from '@/components/core/property-list'; -import { Payments } from '@/components/dashboard/lp_categories/payments'; +import { Payments } from '@/components/dashboard/lp/categories/payments'; import { SamplePayments } from './SamplePayments'; @@ -21,11 +21,19 @@ export default function SamplePaymentCard(): React.JSX.Element { const { t } = useTranslation(); return ( <> - + }> + } @@ -37,8 +45,14 @@ export default function SamplePaymentCard(): React.JSX.Element { title={t('list.billing-details')} /> - - } sx={{ '--PropertyItem-padding': '16px' }}> + + } + sx={{ '--PropertyItem-padding': '16px' }} + > {( [ { key: t('Credit card'), value: '**** 4142' }, @@ -50,7 +64,11 @@ export default function SamplePaymentCard(): React.JSX.Element { ] satisfies { key: string; value: React.ReactNode }[] ).map( (item): React.JSX.Element => ( - + ) )} diff --git a/002_source/cms/src/app/dashboard/Sample/SampleSecurityCard.tsx b/002_source/cms/src/app/dashboard/Sample/SecurityCard/index.tsx similarity index 85% rename from 002_source/cms/src/app/dashboard/Sample/SampleSecurityCard.tsx rename to 002_source/cms/src/app/dashboard/Sample/SecurityCard/index.tsx index 31f9f77..342a94b 100644 --- a/002_source/cms/src/app/dashboard/Sample/SampleSecurityCard.tsx +++ b/002_source/cms/src/app/dashboard/Sample/SecurityCard/index.tsx @@ -27,11 +27,17 @@ export default function SampleSecurityCard(): React.JSX.Element {
-
- + {t('a-deleted-customer-cannot-be-restored-all-data-will-be-permanently-removed')}
diff --git a/002_source/cms/src/app/dashboard/Sample/SampleTitleCard.tsx b/002_source/cms/src/app/dashboard/Sample/TitleCard/index.tsx similarity index 100% rename from 002_source/cms/src/app/dashboard/Sample/SampleTitleCard.tsx rename to 002_source/cms/src/app/dashboard/Sample/TitleCard/index.tsx