File tree 1 file changed +17
-0
lines changed
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ export interface QuartzButtonProps extends Omit<ButtonProps, 'css'> {
16
16
intent ?: Intent ;
17
17
icon ?: IconName ;
18
18
href ?: string ;
19
+ external ?: boolean ;
19
20
isLoading ?: boolean ;
20
21
loadingOnly ?: boolean ;
21
22
}
@@ -29,6 +30,7 @@ const Button: FC<QuartzButtonProps> = ({
29
30
isLoading,
30
31
loadingOnly,
31
32
target,
33
+ external,
32
34
...props
33
35
} : QuartzButtonProps ) => {
34
36
const test = { ...props } ;
@@ -50,6 +52,21 @@ const Button: FC<QuartzButtonProps> = ({
50
52
) ;
51
53
52
54
if ( href ) {
55
+ if ( external ) {
56
+ return (
57
+ < a
58
+ style = { {
59
+ textDecoration : 'none' ,
60
+ } }
61
+ href = { href }
62
+ target = { target }
63
+ { ...( target === '_blank' ? { rel : 'noopener noreferrer' } : { } ) }
64
+ >
65
+ { component }
66
+ </ a >
67
+ ) ;
68
+ }
69
+
53
70
return (
54
71
< Link
55
72
style = { {
You can’t perform that action at this time.
0 commit comments