Skip to content

Commit f4e9645

Browse files
feat(fuselage): Add linkTarget prop for Banner component (#971)
Co-authored-by: juliajforesti <juliajforesti@gmail.com>
1 parent 3377d6b commit f4e9645

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

packages/fuselage/src/components/Banner/Banner.tsx

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import { useBorderBoxSize } from '@rocket.chat/fuselage-hooks';
2-
import type { ReactNode, AllHTMLAttributes } from 'react';
2+
import type {
3+
ReactNode,
4+
AllHTMLAttributes,
5+
HTMLAttributeAnchorTarget,
6+
} from 'react';
37
import React, { useRef, useCallback, useMemo } from 'react';
48

59
import { composeClassNames as cx } from '../../helpers/composeClassNames';
@@ -23,6 +27,7 @@ type BannerProps = {
2327
icon?: ReactNode;
2428
inline?: boolean;
2529
link?: string;
30+
linkTarget?: HTMLAttributeAnchorTarget;
2631
linkText?: string;
2732
onAction?: () => void;
2833
onClose?: () => void;
@@ -39,6 +44,7 @@ const Banner = ({
3944
inline = false,
4045
link,
4146
linkText = 'More info',
47+
linkTarget = '_blank',
4248
onAction,
4349
onClose,
4450
title,
@@ -102,7 +108,7 @@ const Banner = ({
102108
{link && (
103109
<a
104110
href={link}
105-
target='_blank'
111+
target={linkTarget}
106112
className={cx('rcx-banner__link')({ [variant]: true })}
107113
>
108114
{linkText}

0 commit comments

Comments
 (0)