Skip to content

Commit

Permalink
feat(icon): headericon for prompt
Browse files Browse the repository at this point in the history
Signed-off-by: Sudhanshu Dasgupta <[email protected]>
  • Loading branch information
sudhanshutech committed Nov 22, 2024
1 parent 01959f7 commit 49a2ccb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/custom/Prompt/promt-component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ interface State {
primaryOption: string;
showInfoIcon?: string;
variant?: PromptVariant;
headerIcon?: React.ReactNode;
}

interface ShowParams {
Expand All @@ -33,6 +34,7 @@ interface ShowParams {
primaryOption: string;
variant: PromptVariant;
showInfoIcon?: string;
headerIcon?: React.ReactNode;
}

export interface PromptRef {
Expand All @@ -46,7 +48,8 @@ const PromptComponent = forwardRef<PromptRef, PromptProps>(({ variant }, ref) =>
subtitle: '',
primaryOption: '',
showInfoIcon: '',
variant
variant,
headerIcon: undefined
});

/* This ref is used to store the resolve and reject functions of the promise returned by the show method */
Expand Down Expand Up @@ -78,7 +81,7 @@ const PromptComponent = forwardRef<PromptRef, PromptProps>(({ variant }, ref) =>
show
}));

const { isOpen, primaryOption, title, subtitle, showInfoIcon } = state;
const { isOpen, primaryOption, title, subtitle, showInfoIcon, headerIcon } = state;
const { resolve } = promiseInfoRef.current;

return (
Expand All @@ -87,7 +90,7 @@ const PromptComponent = forwardRef<PromptRef, PromptProps>(({ variant }, ref) =>
closeModal={hide}
title={title}
id="searchClick"
headerIcon={undefined}
headerIcon={headerIcon}
reactNode={undefined}
>
{subtitle && (
Expand Down

0 comments on commit 49a2ccb

Please sign in to comment.