Skip to content

Commit a0601fe

Browse files
FEATURE FLAGSGSGGSSGGSSG
1 parent e2fa88c commit a0601fe

1 file changed

Lines changed: 25 additions & 16 deletions

File tree

src/pages/index.tsx

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import darkExtensions from "../assets/images/index/for-dark-theme/extensions.png
1313
import lightExtensions from "../assets/images/index/for-light-theme/extensions.png";
1414
import darkTools from "../assets/images/index/for-dark-theme/tools.png";
1515
import lightTools from "../assets/images/index/for-light-theme/tools.png";
16+
import { useFeatureIsOn } from "@growthbook/growthbook-react";
1617

1718
const pageName = "Home";
1819

@@ -21,42 +22,50 @@ type HomeProps = { appProps: AppProps };
2122
export function Home({ appProps }: HomeProps): React.ReactNode {
2223
const { data: session } = useSession();
2324

25+
const showImages = useFeatureIsOn("home-page-card-images");
26+
2427
// https://arcade.makecode.com/S14537-75361-35697-31523
2528
const quickLinks: QuickLink[] = [
2629
{
2730
name: "Extensions",
2831
description: `A list of ${Math.floor(appProps.extensionsListed / 10) * 10}+ awesome MakeCode Arcade extensions to further your games!`,
2932
link: "/extensions",
3033
linkText: "View awesome extensions",
31-
image: {
32-
darkTheme: darkExtensions,
33-
lightTheme: lightExtensions,
34-
altText:
35-
"A picture of the MakeCode Arcade extension puzzle piece icon in MakeCode Arcade image style.",
36-
},
34+
image: showImages
35+
? {
36+
darkTheme: darkExtensions,
37+
lightTheme: lightExtensions,
38+
altText:
39+
"A picture of the MakeCode Arcade extension puzzle piece icon in MakeCode Arcade image style.",
40+
}
41+
: undefined,
3742
},
3843
{
3944
name: "Tools",
4045
description: `A list of ${Math.floor(appProps.toolsListed / 10) * 10}+ awesome MakeCode Arcade tools to help you develop great games!`,
4146
link: "/tools",
4247
linkText: "View awesome tools",
43-
image: {
44-
darkTheme: darkTools,
45-
lightTheme: lightTools,
46-
altText: "A picture of tools in MakeCode Arcade image style.",
47-
},
48+
image: showImages
49+
? {
50+
darkTheme: darkTools,
51+
lightTheme: lightTools,
52+
altText: "A picture of tools in MakeCode Arcade image style.",
53+
}
54+
: undefined,
4855
},
4956
{
5057
name: "Blog",
5158
description:
5259
"Read about the latest news and updates in the MakeCode Arcade world!",
5360
link: "/blog",
5461
linkText: "Read the blog",
55-
image: {
56-
darkTheme: darkBlog,
57-
lightTheme: lightBlog,
58-
altText: "A picture of a newspaper in MakeCode Arcade image style.",
59-
},
62+
image: showImages
63+
? {
64+
darkTheme: darkBlog,
65+
lightTheme: lightBlog,
66+
altText: "A picture of a newspaper in MakeCode Arcade image style.",
67+
}
68+
: undefined,
6069
},
6170
];
6271

0 commit comments

Comments
 (0)