From 623e993579b05e053d2d2f29684649cd4f4586de Mon Sep 17 00:00:00 2001 From: Paul Hachmang Date: Thu, 30 Jan 2025 13:15:34 +0100 Subject: [PATCH] `` now accepts all props of the FullPageMessage --- .changeset/young-olives-crash.md | 5 +++++ .../components/WaitForCustomer/WaitForCustomer.tsx | 13 ++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 .changeset/young-olives-crash.md diff --git a/.changeset/young-olives-crash.md b/.changeset/young-olives-crash.md new file mode 100644 index 0000000000..0799c84a69 --- /dev/null +++ b/.changeset/young-olives-crash.md @@ -0,0 +1,5 @@ +--- +'@graphcommerce/magento-customer': patch +--- + +`` now accepts all props of the FullPageMessage diff --git a/packages/magento-customer/components/WaitForCustomer/WaitForCustomer.tsx b/packages/magento-customer/components/WaitForCustomer/WaitForCustomer.tsx index abfaa0a51e..e4b32a535b 100644 --- a/packages/magento-customer/components/WaitForCustomer/WaitForCustomer.tsx +++ b/packages/magento-customer/components/WaitForCustomer/WaitForCustomer.tsx @@ -5,13 +5,12 @@ import { FullPageMessage, iconPerson, IconSvg } from '@graphcommerce/next-ui' import { Trans } from '@lingui/react' import { Button, CircularProgress } from '@mui/material' import React from 'react' +import type { SetOptional } from 'type-fest' import { useCustomerSession } from '../../hooks/useCustomerSession' import { ApolloCustomerErrorFullPage } from '../ApolloCustomerError/ApolloCustomerErrorFullPage' -export type WaitForCustomerProps = Omit & - Pick & { - waitFor?: WaitForQueriesProps['waitFor'] - fallback?: React.ReactNode +export type WaitForCustomerProps = SetOptional & + SetOptional & { unauthenticated?: React.ReactNode } @@ -42,7 +41,7 @@ export function nonNullable(value: T): value is NonNullable { * ``` */ export function WaitForCustomer(props: WaitForCustomerProps) { - const { waitFor = [], children, fallback, unauthenticated, disableMargin } = props + const { waitFor = [], children, fallback, unauthenticated, ...rest } = props const session = useCustomerSession() const queries = Array.isArray(waitFor) ? waitFor : [waitFor] @@ -58,7 +57,7 @@ export function WaitForCustomer(props: WaitForCustomerProps) { } title={} - disableMargin={disableMargin} + {...rest} > @@ -79,7 +78,7 @@ export function WaitForCustomer(props: WaitForCustomerProps) { )} } - disableMargin={disableMargin} + {...rest} /> ))} {session.loggedIn && error && }