Skip to content

Commit

Permalink
Move all non-live content behind the same flag
Browse files Browse the repository at this point in the history
It'll all go live together but we'll do a CreateAI release before that.
  • Loading branch information
microbit-matt-hillsdon committed Nov 19, 2024
1 parent ac1a3e8 commit d0f83d7
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 46 deletions.
21 changes: 12 additions & 9 deletions src/components/HelpMenuItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { userGuideUrl } from "../utils/external-links";
import AboutDialog from "./AboutDialog";
import ConnectFirstDialog from "./ConnectFirstDialog";
import FeedbackForm from "./FeedbackForm";
import { flags } from "../flags";

const HelpMenuItems = () => {
const aboutDialogDisclosure = useDisclosure();
Expand All @@ -35,15 +36,17 @@ const HelpMenuItems = () => {
onClose={feedbackDisclosure.onClose}
finalFocusRef={menuButtonRef}
/>
<MenuItem
as="a"
href={userGuideUrl()}
target="_blank"
rel="noopener"
icon={<RiExternalLinkLine />}
>
<FormattedMessage id="user-guide" />
</MenuItem>
{flags.websiteContent && (
<MenuItem
as="a"
href={userGuideUrl()}
target="_blank"
rel="noopener"
icon={<RiExternalLinkLine />}
>
<FormattedMessage id="user-guide" />
</MenuItem>
)}
<TourMenuItem />
{deployment.supportLinks.main && (
<>
Expand Down
6 changes: 3 additions & 3 deletions src/flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ export type Flag =
*/
| "preReleaseNotice"
/**
* Flag to show the home page projects section which lacks content.
* Flag to show links to website content for the CreateAI release.
*/
| "homePageProjects"
| "websiteContent"
/**
* Example flags used for testing.
*/
Expand All @@ -37,7 +37,7 @@ interface FlagMetadata {
const allFlags: FlagMetadata[] = [
// Alphabetical order.
{ name: "devtools", defaultOnStages: ["local"] },
{ name: "homePageProjects", defaultOnStages: ["local", "review", "staging"] },
{ name: "websiteContent", defaultOnStages: ["local", "review", "staging"] },
{
name: "preReleaseNotice",
defaultOnStages: ["production"],
Expand Down
72 changes: 38 additions & 34 deletions src/pages/HomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,23 +122,25 @@ const HomePage = () => {
alt={intl.formatMessage({ id: "homepage-video-alt" })}
/>
</Box>
<Text fontSize="md">
<FormattedMessage
id="homepage-how-it-works-paragraph"
values={{
appNameFull,
link: (children) => (
<Link
color="brand.600"
textDecoration="underline"
href={userGuideUrl()}
>
{children}
</Link>
),
}}
/>
</Text>
{flags.websiteContent && (
<Text fontSize="md">
<FormattedMessage
id="homepage-how-it-works-paragraph"
values={{
appNameFull,
link: (children) => (
<Link
color="brand.600"
textDecoration="underline"
href={userGuideUrl()}
>
{children}
</Link>
),
}}
/>
</Text>
)}
</VStack>
<VStack gap={10}>
<Heading as="h2" textAlign="center" variant="marketing">
Expand All @@ -152,7 +154,7 @@ const HomePage = () => {
<StepByStepIllustration />
</VStack>
</VStack>
{flags.homePageProjects && (
{flags.websiteContent && (
<VStack gap={10}>
<Heading as="h2" textAlign="center" variant="marketing">
<FormattedMessage id="homepage-projects" />
Expand All @@ -173,22 +175,24 @@ const HomePage = () => {
imgSrc={projectImage2}
/>
</HStack>
<Text fontSize="md">
<FormattedMessage
id="homepage-projects-more"
values={{
link: (children) => (
<Link
color="brand.600"
textDecoration="underline"
href={landingPageUrl()}
>
{children}
</Link>
),
}}
/>
</Text>
{flags.websiteContent && (
<Text fontSize="md">
<FormattedMessage
id="homepage-projects-more"
values={{
link: (children) => (
<Link
color="brand.600"
textDecoration="underline"
href={landingPageUrl()}
>
{children}
</Link>
),
}}
/>
</Text>
)}
</VStack>
)}
</Container>
Expand Down

0 comments on commit d0f83d7

Please sign in to comment.