Skip to content

Commit

Permalink
Merge pull request #244 from dd3tech/fix/callout
Browse files Browse the repository at this point in the history
Fix(Callout): description custom was added as a new prop
  • Loading branch information
arielsrodriguez authored Sep 27, 2024
2 parents 8cc1551 + bab602c commit f189ab3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/components/Callout/Callout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ export interface CalloutProps extends HTMLAttributes<HTMLDivElement> {
* the user to take a specific action.
*/
callToAction?: ReactNode
/**
* This prop is used to render a custom description in the Callout.
* It can be a button, link, or any other interactive element that prompts
* the user to take a specific action.
*/
descriptionCustom?: ReactNode
}

const Callout = forwardRef<HTMLDivElement, CalloutProps>((props, ref) => {
Expand All @@ -60,6 +66,7 @@ const Callout = forwardRef<HTMLDivElement, CalloutProps>((props, ref) => {
icon: Icon,
className,
callToAction,
descriptionCustom,
...otherProps
} = props

Expand Down Expand Up @@ -93,7 +100,7 @@ const Callout = forwardRef<HTMLDivElement, CalloutProps>((props, ref) => {
</Flex>
<Flex justifyContent="between">
<Text variant="p" size="sm" className={spacing.sm.marginTop}>
{description}
{descriptionCustom ?? description}
</Text>
{callToAction}
</Flex>
Expand Down

0 comments on commit f189ab3

Please sign in to comment.