Skip to content

Commit

Permalink
Merge pull request #822 from sudhanshutech/prompt/headericon
Browse files Browse the repository at this point in the history
add headericon for prompt
  • Loading branch information
sudhanshutech authored Nov 22, 2024
2 parents 01959f7 + 49a2ccb commit f192415
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 f192415

Please sign in to comment.