Skip to content

Commit

Permalink
Move all non-live content behind the same flag (#534)
Browse files Browse the repository at this point in the history
Temporarily loses us the sentence below the video but that's OK for now.
  • Loading branch information
microbit-matt-hillsdon authored Nov 19, 2024
1 parent ac1a3e8 commit 9883df7
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 30 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
38 changes: 20 additions & 18 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 Down

0 comments on commit 9883df7

Please sign in to comment.