Skip to content

Commit

Permalink
Solve issue where the address props would be forwarde to the element
Browse files Browse the repository at this point in the history
  • Loading branch information
paales committed Jan 10, 2025
1 parent 026114e commit a2f565f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,15 @@ import { Trans } from '@lingui/react'
import { Button } from '@mui/material'
import { useRouter } from 'next/router'

export type CustomerAddressActionCardProps = ActionCardItemRenderProps<
CustomerAddressFragment | null | undefined
>
export type CustomerAddressActionCardProps = ActionCardItemRenderProps<{
address?: CustomerAddressFragment | null | undefined
}>

export function CustomerAddressActionCard(props: CustomerAddressActionCardProps) {
const {
onReset,
company,
firstname,
lastname,
street,
postcode,
city,
country_code,
region,
id,
...cardProps
} = props
const { onReset, address, ...cardProps } = props
const { company, firstname, lastname, street, postcode, city, country_code, region, id } =
address ?? {}

const { push } = useRouter()
const country = useFindCountry(country_code)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export function CustomerAddressForm(props: CustomerAddressListProps) {
color='secondary'
required
items={[
...customerAddresses.map((address) => ({ ...address, value: address.id })),
...customerAddresses.map((address) => ({ address, value: address.id })),
{ value: -1 },
]}
render={CustomerAddressActionCard}
Expand Down

0 comments on commit a2f565f

Please sign in to comment.