From 39c96f86daa3e4960b9cc184d4647abac34f4fe2 Mon Sep 17 00:00:00 2001 From: Ai Ling <50992674+ailing35@users.noreply.github.com> Date: Fri, 4 Nov 2022 19:07:35 +0800 Subject: [PATCH] [ui][button] Add rel and target properties to button (#505) * [ui][button] Add rel and target properties to button * [ui][fix] Remove undefined --- packages/ui/src/Button/Button.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/ui/src/Button/Button.tsx b/packages/ui/src/Button/Button.tsx index 9988c1aa..d970fef8 100644 --- a/packages/ui/src/Button/Button.tsx +++ b/packages/ui/src/Button/Button.tsx @@ -1,5 +1,6 @@ import clsx from 'clsx'; import Link from 'next/link'; +import type { HTMLAttributeAnchorTarget } from 'react'; import type { UrlObject } from 'url'; import { Spinner } from '../'; @@ -30,7 +31,9 @@ type Props = Readonly<{ isLoading?: boolean; label: string; onClick?: (event: React.MouseEvent) => void; + rel?: string; size?: ButtonSize; + target?: HTMLAttributeAnchorTarget; type?: ButtonType; variant: ButtonVariant; }>; @@ -115,6 +118,8 @@ export default function Button({ type = 'button', variant, onClick, + rel, + target, }: Props) { const iconSpacingClass = (() => { if (!isLabelHidden && addonPosition === 'start') { @@ -166,6 +171,6 @@ export default function Button({ return ( // TODO: Allow passing in of Link component. - + ); }