refactor to dedicated directory,

This commit is contained in:
louiscklaw
2025-04-22 12:20:21 +08:00
parent 0fa277c50e
commit 033ca95dfe
7 changed files with 47 additions and 13 deletions

View File

@@ -12,9 +12,9 @@ import { Plus as PlusIcon } from '@phosphor-icons/react/dist/ssr/Plus';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import type { Address } from '@/types/Address'; 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 { export default function SampleAddressCard(): React.JSX.Element {
const { t } = useTranslation(); const { t } = useTranslation();
@@ -22,7 +22,10 @@ export default function SampleAddressCard(): React.JSX.Element {
<Card> <Card>
<CardHeader <CardHeader
action={ action={
<Button color="secondary" startIcon={<PlusIcon />}> <Button
color="secondary"
startIcon={<PlusIcon />}
>
{t('list.add')} {t('list.add')}
</Button> </Button>
} }
@@ -34,9 +37,16 @@ export default function SampleAddressCard(): React.JSX.Element {
title={t('list.shipping-addresses')} title={t('list.shipping-addresses')}
/> />
<CardContent> <CardContent>
<Grid container spacing={3}> <Grid
container
spacing={3}
>
{(SampleAddresses satisfies Address[]).map((address) => ( {(SampleAddresses satisfies Address[]).map((address) => (
<Grid key={address.id} md={6} xs={12}> <Grid
key={address.id}
md={6}
xs={12}
>
<ShippingAddress address={address} /> <ShippingAddress address={address} />
</Grid> </Grid>
))} ))}

View File

@@ -13,7 +13,7 @@ import { useTranslation } from 'react-i18next';
import { PropertyItem } from '@/components/core/property-item'; import { PropertyItem } from '@/components/core/property-item';
import { PropertyList } from '@/components/core/property-list'; 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'; import { SamplePayments } from './SamplePayments';
@@ -21,11 +21,19 @@ export default function SamplePaymentCard(): React.JSX.Element {
const { t } = useTranslation(); const { t } = useTranslation();
return ( return (
<> <>
<Payments ordersValue={2069.48} payments={SamplePayments} refundsValue={324.5} totalOrders={5} /> <Payments
ordersValue={2069.48}
payments={SamplePayments}
refundsValue={324.5}
totalOrders={5}
/>
<Card> <Card>
<CardHeader <CardHeader
action={ action={
<Button color="secondary" startIcon={<PencilSimpleIcon />}> <Button
color="secondary"
startIcon={<PencilSimpleIcon />}
>
{t('list.edit')} {t('list.edit')}
</Button> </Button>
} }
@@ -37,8 +45,14 @@ export default function SamplePaymentCard(): React.JSX.Element {
title={t('list.billing-details')} title={t('list.billing-details')}
/> />
<CardContent> <CardContent>
<Card sx={{ borderRadius: 1 }} variant="outlined"> <Card
<PropertyList divider={<Divider />} sx={{ '--PropertyItem-padding': '16px' }}> sx={{ borderRadius: 1 }}
variant="outlined"
>
<PropertyList
divider={<Divider />}
sx={{ '--PropertyItem-padding': '16px' }}
>
{( {(
[ [
{ key: t('Credit card'), value: '**** 4142' }, { key: t('Credit card'), value: '**** 4142' },
@@ -50,7 +64,11 @@ export default function SamplePaymentCard(): React.JSX.Element {
] satisfies { key: string; value: React.ReactNode }[] ] satisfies { key: string; value: React.ReactNode }[]
).map( ).map(
(item): React.JSX.Element => ( (item): React.JSX.Element => (
<PropertyItem key={item.key} name={item.key} value={item.value} /> <PropertyItem
key={item.key}
name={item.key}
value={item.value}
/>
) )
)} )}
</PropertyList> </PropertyList>

View File

@@ -27,11 +27,17 @@ export default function SampleSecurityCard(): React.JSX.Element {
<CardContent> <CardContent>
<Stack spacing={1}> <Stack spacing={1}>
<div> <div>
<Button color="error" variant="contained"> <Button
color="error"
variant="contained"
>
{t('Delete account')} {t('Delete account')}
</Button> </Button>
</div> </div>
<Typography color="text.secondary" variant="body2"> <Typography
color="text.secondary"
variant="body2"
>
{t('a-deleted-customer-cannot-be-restored-all-data-will-be-permanently-removed')} {t('a-deleted-customer-cannot-be-restored-all-data-will-be-permanently-removed')}
</Typography> </Typography>
</Stack> </Stack>