Skip to content

Commit b10d142

Browse files
committed
editing to have cms option
1 parent c447b7b commit b10d142

File tree

5 files changed

+12
-1
lines changed

5 files changed

+12
-1
lines changed

_data/pages/home.yml

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ blocks:
1111
buttonText: See more
1212
buttonLink: https://starkware.co
1313
isActive: false
14+
openNewPage: true
1415
- type: group
1516
blocks:
1617
- type: home_hero

workspaces/cms-config/src/blocks.ts

+6
Original file line numberDiff line numberDiff line change
@@ -910,6 +910,12 @@ export const blocks = [
910910
widget: "boolean",
911911
default: true,
912912
},
913+
{
914+
name: "openNewPage",
915+
label: "openNewPage",
916+
widget: "boolean",
917+
default: false,
918+
},
913919
],
914920
},
915921
] satisfies CmsFieldList["types"];

workspaces/cms-data/src/pages.ts

+1
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ export interface NavStickyBannerBlock {
168168
readonly buttonText: string;
169169
readonly buttonLink: string;
170170
readonly isActive: boolean;
171+
readonly openNewPage: boolean;
171172
}
172173

173174
export interface LinkListBlock {

workspaces/website/src/blocks/Block.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ export function Block({
215215
text={block.text}
216216
buttonText={block.buttonText}
217217
buttonLink={block.buttonLink}
218+
openNewPage={block.openNewPage}
218219
/>
219220
);
220221
}

workspaces/website/src/pages/(components)/NavbarStickyBanner/NavbarStickyBanner.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ interface NavbarStickyBannerProps {
1111
text: string;
1212
buttonText: string;
1313
buttonLink: string;
14+
openNewPage?: boolean;
1415
}
1516

1617
const NavbarStickyBanner = ({
1718
text,
1819
buttonText,
1920
buttonLink,
21+
openNewPage = false,
2022
}: NavbarStickyBannerProps) => {
2123
const hash = useMemo(
2224
() => sha256(text + buttonLink + buttonText).slice(-8),
@@ -77,7 +79,7 @@ const NavbarStickyBanner = ({
7779
}}
7880
_hover={{ bgColor: "white" }}
7981
variant="solid"
80-
target="_blank"
82+
target={openNewPage ? "_blank" : ""}
8183
>
8284
{buttonText}
8385
</Button>

0 commit comments

Comments
 (0)