File tree 5 files changed +12
-1
lines changed
pages/(components)/NavbarStickyBanner
5 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ blocks:
11
11
buttonText : See more
12
12
buttonLink : https://starkware.co
13
13
isActive : false
14
+ openNewPage : true
14
15
- type : group
15
16
blocks :
16
17
- type : home_hero
Original file line number Diff line number Diff line change @@ -910,6 +910,12 @@ export const blocks = [
910
910
widget : "boolean" ,
911
911
default : true ,
912
912
} ,
913
+ {
914
+ name : "openNewPage" ,
915
+ label : "openNewPage" ,
916
+ widget : "boolean" ,
917
+ default : false ,
918
+ } ,
913
919
] ,
914
920
} ,
915
921
] satisfies CmsFieldList [ "types" ] ;
Original file line number Diff line number Diff line change @@ -168,6 +168,7 @@ export interface NavStickyBannerBlock {
168
168
readonly buttonText : string ;
169
169
readonly buttonLink : string ;
170
170
readonly isActive : boolean ;
171
+ readonly openNewPage : boolean ;
171
172
}
172
173
173
174
export interface LinkListBlock {
Original file line number Diff line number Diff line change @@ -215,6 +215,7 @@ export function Block({
215
215
text = { block . text }
216
216
buttonText = { block . buttonText }
217
217
buttonLink = { block . buttonLink }
218
+ openNewPage = { block . openNewPage }
218
219
/>
219
220
) ;
220
221
}
Original file line number Diff line number Diff line change @@ -11,12 +11,14 @@ interface NavbarStickyBannerProps {
11
11
text : string ;
12
12
buttonText : string ;
13
13
buttonLink : string ;
14
+ openNewPage ?: boolean ;
14
15
}
15
16
16
17
const NavbarStickyBanner = ( {
17
18
text,
18
19
buttonText,
19
20
buttonLink,
21
+ openNewPage = false ,
20
22
} : NavbarStickyBannerProps ) => {
21
23
const hash = useMemo (
22
24
( ) => sha256 ( text + buttonLink + buttonText ) . slice ( - 8 ) ,
@@ -77,7 +79,7 @@ const NavbarStickyBanner = ({
77
79
} }
78
80
_hover = { { bgColor : "white" } }
79
81
variant = "solid"
80
- target = "_blank"
82
+ target = { openNewPage ? "_blank" : "" }
81
83
>
82
84
{ buttonText }
83
85
</ Button >
You can’t perform that action at this time.
0 commit comments