File tree Expand file tree Collapse file tree 1 file changed +19
-13
lines changed Expand file tree Collapse file tree 1 file changed +19
-13
lines changed Original file line number Diff line number Diff line change @@ -26,9 +26,19 @@ const Banner = ({
26
26
variant ?: string ;
27
27
href ?: string ;
28
28
} ) : React . ReactElement => {
29
- const Link = href ? ExternalLink : React . Fragment ;
30
29
const arrow = href ? < Icon name = "chevron_right" size = { 2 } ml = { 2 } /> : null ;
31
- const linkProps = href ? { href, title : '' , color : 'white' } : { } ;
30
+ const textComponent = (
31
+ < Text
32
+ as = "p"
33
+ sx = { {
34
+ animation : `${ scroll } 30s linear infinite` ,
35
+ color : 'white'
36
+ } }
37
+ >
38
+ { content } { arrow }
39
+ </ Text >
40
+ ) ;
41
+
32
42
return (
33
43
< Alert
34
44
variant = { variant }
@@ -42,17 +52,13 @@ const Banner = ({
42
52
} }
43
53
>
44
54
{ typeof content === 'string' ? (
45
- < Link { ...linkProps } >
46
- < Text
47
- as = "p"
48
- sx = { {
49
- animation : `${ scroll } 30s linear infinite` ,
50
- color : href ? 'white' : undefined
51
- } }
52
- >
53
- { content } { arrow }
54
- </ Text >
55
- </ Link >
55
+ href ? (
56
+ < ExternalLink href = { href } title = "" styles = { { color : 'white' } } >
57
+ { textComponent }
58
+ </ ExternalLink >
59
+ ) : (
60
+ < div > { textComponent } </ div >
61
+ )
56
62
) : (
57
63
content
58
64
) }
You can’t perform that action at this time.
0 commit comments