@@ -13,7 +13,7 @@ import { useRootStore } from 'src/store/root';
1313
1414interface TopBarNotifyProps {
1515 notifyText : ReactNode ;
16- learnMoreLink ?: string ;
16+ learnMoreLink ?: string | ( ( ) => void ) ;
1717 buttonText ?: string ;
1818 bannerVersion : string ;
1919 icon ?: string ;
@@ -99,34 +99,68 @@ export default function TopBarNotify({
9999 { icon && ! sm ? < MarketLogo sx = { { ml : 2 } } size = { 32 } logo = { icon } /> : '' }
100100
101101 { learnMoreLink && md ? (
102- < Link
103- sx = { { color : 'white' , textDecoration : 'underline' , paddingLeft : 2 } }
104- // target={'_blank'} Todo option to pass as prop
105- href = { learnMoreLink }
106- >
107- < Trans > { buttonText ? buttonText : `Learn more` } </ Trans >
108- </ Link >
102+ typeof learnMoreLink === 'string' ? (
103+ < Link
104+ sx = { { color : 'white' , textDecoration : 'underline' , paddingLeft : 2 } }
105+ // target={'_blank'} Todo option to pass as prop
106+ href = { learnMoreLink }
107+ >
108+ < Trans > { buttonText ? buttonText : `Learn more` } </ Trans >
109+ </ Link >
110+ ) : (
111+ < Button
112+ sx = { {
113+ color : 'white' ,
114+ textDecoration : 'underline' ,
115+ paddingLeft : 2 ,
116+ background : 'none' ,
117+ textTransform : 'none' ,
118+ minWidth : 'auto' ,
119+ padding : 0 ,
120+ marginLeft : 2 ,
121+ } }
122+ onClick = { learnMoreLink }
123+ >
124+ < Trans > { buttonText ? buttonText : `Swap Now` } </ Trans >
125+ </ Button >
126+ )
109127 ) : null }
110128 </ Typography >
111129 </ Box >
112130
113131 < Box >
114132 { ! md && learnMoreLink ? (
115- < Button
116- component = "a"
117- // target={'_blank'} Todo option to pass as prop
118- size = "small"
119- href = { learnMoreLink }
120- sx = { {
121- minWidth : '90px' ,
122- marginLeft : 5 ,
123- height : '24px' ,
124- background : '#383D51' ,
125- color : '#EAEBEF' ,
126- } }
127- >
128- < Trans > { buttonText ? buttonText . toUpperCase ( ) : `LEARN MORE` } </ Trans >
129- </ Button >
133+ typeof learnMoreLink === 'string' ? (
134+ < Button
135+ component = "a"
136+ // target={'_blank'} Todo option to pass as prop
137+ size = "small"
138+ href = { learnMoreLink }
139+ sx = { {
140+ minWidth : '90px' ,
141+ marginLeft : 5 ,
142+ height : '24px' ,
143+ background : '#383D51' ,
144+ color : '#EAEBEF' ,
145+ } }
146+ >
147+ < Trans > { buttonText ? buttonText . toUpperCase ( ) : `LEARN MORE` } </ Trans >
148+ </ Button >
149+ ) : (
150+ < Button
151+ size = "small"
152+ onClick = { learnMoreLink }
153+ sx = { {
154+ minWidth : '90px' ,
155+ marginLeft : 5 ,
156+ height : '24px' ,
157+ background : '#383D51' ,
158+ color : '#EAEBEF' ,
159+ } }
160+ >
161+ < Trans > { buttonText ? buttonText . toUpperCase ( ) : `Swap Now` } </ Trans >
162+ </ Button >
163+ )
130164 ) : null }
131165 </ Box >
132166 < Button
0 commit comments