Skip to content

Commit fb3ffd6

Browse files
Put projects section behind a flag (#380)
It lacks content for beta
1 parent 86dae7a commit fb3ffd6

File tree

2 files changed

+21
-13
lines changed

2 files changed

+21
-13
lines changed

src/flags.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ export type Flag =
1919
* Flag to add a beta warning. Enabled for review and staging site stages.
2020
*/
2121
| "preReleaseNotice"
22+
/**
23+
* Flag to show the home page projects section which lacks content.
24+
*/
25+
| "homePageProjects"
2226
/**
2327
* Example flags used for testing.
2428
*/
@@ -33,6 +37,7 @@ interface FlagMetadata {
3337
const allFlags: FlagMetadata[] = [
3438
// Alphabetical order.
3539
{ name: "devtools", defaultOnStages: ["local"] },
40+
{ name: "homePageProjects", defaultOnStages: ["local"] },
3641
{ name: "preReleaseNotice", defaultOnStages: ["review", "staging"] },
3742
{ name: "exampleOptInA", defaultOnStages: ["review", "staging"] },
3843
{ name: "exampleOptInB", defaultOnStages: [] },

src/pages/HomePage.tsx

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import blockImage from "../images/block.png";
2525
import xyzGraph from "../images/xyz-graph.png";
2626
import clap from "../images/clap-square.png";
2727
import { createNewPageUrl } from "../urls";
28+
import { flags } from "../flags";
2829

2930
const graphData = {
3031
x: [
@@ -197,19 +198,21 @@ const HomePage = () => {
197198
/>
198199
</VStack>
199200
</VStack>
200-
<VStack gap={8}>
201-
<Heading as="h2" textAlign="center">
202-
<FormattedMessage id="homepage-projects" />
203-
</Heading>
204-
<HStack gap={5} flexDir={{ base: "column", lg: "row" }}>
205-
<ResourceCard
206-
title="Simple AI activity timer"
207-
url="https://www.example.com"
208-
imgSrc="https://cdn.sanity.io/images/ajwvhvgo/production/1aaac1553237900c774216aad17475ef34f8fe48-800x600.jpg?fit=max&w=1200&h=1200"
209-
/>
210-
<ResourceCardPlaceholder />
211-
</HStack>
212-
</VStack>
201+
{flags.homePageProjects && (
202+
<VStack gap={8}>
203+
<Heading as="h2" textAlign="center">
204+
<FormattedMessage id="homepage-projects" />
205+
</Heading>
206+
<HStack gap={5} flexDir={{ base: "column", lg: "row" }}>
207+
<ResourceCard
208+
title="Simple AI activity timer"
209+
url="https://www.example.com"
210+
imgSrc="https://cdn.sanity.io/images/ajwvhvgo/production/1aaac1553237900c774216aad17475ef34f8fe48-800x600.jpg?fit=max&w=1200&h=1200"
211+
/>
212+
<ResourceCardPlaceholder />
213+
</HStack>
214+
</VStack>
215+
)}
213216
</Container>
214217
</DefaultPageLayout>
215218
);

0 commit comments

Comments
 (0)