Skip to content

Commit

Permalink
feat(fuselage): Add linkTarget prop for Banner component (#971)
Browse files Browse the repository at this point in the history
Co-authored-by: juliajforesti <[email protected]>
  • Loading branch information
tiagoevanp and juliajforesti authored Feb 3, 2023
1 parent 3377d6b commit f4e9645
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/fuselage/src/components/Banner/Banner.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { useBorderBoxSize } from '@rocket.chat/fuselage-hooks';
import type { ReactNode, AllHTMLAttributes } from 'react';
import type {
ReactNode,
AllHTMLAttributes,
HTMLAttributeAnchorTarget,
} from 'react';
import React, { useRef, useCallback, useMemo } from 'react';

import { composeClassNames as cx } from '../../helpers/composeClassNames';
Expand All @@ -23,6 +27,7 @@ type BannerProps = {
icon?: ReactNode;
inline?: boolean;
link?: string;
linkTarget?: HTMLAttributeAnchorTarget;
linkText?: string;
onAction?: () => void;
onClose?: () => void;
Expand All @@ -39,6 +44,7 @@ const Banner = ({
inline = false,
link,
linkText = 'More info',
linkTarget = '_blank',
onAction,
onClose,
title,
Expand Down Expand Up @@ -102,7 +108,7 @@ const Banner = ({
{link && (
<a
href={link}
target='_blank'
target={linkTarget}
className={cx('rcx-banner__link')({ [variant]: true })}
>
{linkText}
Expand Down

0 comments on commit f4e9645

Please sign in to comment.