Skip to content

Commit 2b772c7

Browse files
code review comments
1 parent 582cffc commit 2b772c7

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

packages/template-retail-react-app/app/pages/checkout-one-click/partials/one-click-contact-info.jsx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -666,16 +666,18 @@ const ContactInfo = ({isSocialEnabled = false, idps = [], onRegisteredUserChoseG
666666
</Container>
667667
</ToggleCardEdit>
668668

669-
{(customer?.email || form.getValues('email')) && (
670-
<ToggleCardSummary>
671-
<Stack spacing={1}>
672-
<Text>{customer?.email || form.getValues('email')}</Text>
673-
{(customer?.phoneHome || form.getValues('phone')) && (
674-
<Text>{customer?.phoneHome || form.getValues('phone')}</Text>
675-
)}
676-
</Stack>
677-
</ToggleCardSummary>
678-
)}
669+
{(() => {
670+
const summaryEmail = customer?.email || form.getValues('email')
671+
const summaryPhone = customer?.phoneHome || form.getValues('phone')
672+
return summaryEmail ? (
673+
<ToggleCardSummary>
674+
<Stack spacing={1}>
675+
<Text>{summaryEmail}</Text>
676+
{summaryPhone && <Text>{summaryPhone}</Text>}
677+
</Stack>
678+
</ToggleCardSummary>
679+
) : null
680+
})()}
679681
</ToggleCard>
680682

681683
{/* Sign Out Confirmation Dialog */}

0 commit comments

Comments
 (0)