From e76ea14dd9dfee8b888d862aca1d64382fdd6516 Mon Sep 17 00:00:00 2001 From: Matt Gallo Date: Wed, 14 Feb 2024 15:54:40 -0500 Subject: [PATCH] chore: refactor customStep types --- .../components/APIKeyModal/APIKeyModal.tsx | 1 + .../APIKeyModal/APIKeyModal.types.ts | 28 +++++++------------ 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/packages/ibm-products/src/components/APIKeyModal/APIKeyModal.tsx b/packages/ibm-products/src/components/APIKeyModal/APIKeyModal.tsx index 749a9c73a8..e2b7029a71 100644 --- a/packages/ibm-products/src/components/APIKeyModal/APIKeyModal.tsx +++ b/packages/ibm-products/src/components/APIKeyModal/APIKeyModal.tsx @@ -374,6 +374,7 @@ APIKeyModal.propTypes = { /** * if you need more options for key creation beyond just the name use custom steps to obtain whatever data is required. */ + /**@ts-ignore*/ customSteps: PropTypes.arrayOf( PropTypes.shape({ /** diff --git a/packages/ibm-products/src/components/APIKeyModal/APIKeyModal.types.ts b/packages/ibm-products/src/components/APIKeyModal/APIKeyModal.types.ts index 0e9aee2b11..0d34d12a95 100644 --- a/packages/ibm-products/src/components/APIKeyModal/APIKeyModal.types.ts +++ b/packages/ibm-products/src/components/APIKeyModal/APIKeyModal.types.ts @@ -40,15 +40,11 @@ interface APIKeyModalCommonProps { /** * if you need more options for key creation beyond just the name use custom steps to obtain whatever data is required. */ - customSteps?: Array< - | { - valid?: boolean | undefined | null; - content?: ReactNode | undefined | null; - title?: string | undefined | null; - } - | undefined - | null - >; + customSteps?: Array<{ + valid?: boolean; + content?: ReactNode; + title?: string; + }>; /** * designates if the modal is in the edit mode */ @@ -154,15 +150,11 @@ type CustomStepConditionalProps = { /** * if you need more options for key creation beyond just the name use custom steps to obtain whatever data is required. */ - customSteps?: Array< - | { - valid?: boolean | undefined | null; - content?: ReactNode | undefined | null; - title?: string | undefined | null; - } - | undefined - | null - >; + customSteps?: Array<{ + valid?: boolean; + content?: ReactNode; + title?: string; + }>; /** * text that displays in the secondary button when using custom steps to indicate to the user that there is a previous step */