diff --git a/client/config/growthbook-features-default.json b/client/config/growthbook-features-default.json index c9c12b31eb6..0d9583cea8e 100644 --- a/client/config/growthbook-features-default.json +++ b/client/config/growthbook-features-default.json @@ -141,5 +141,8 @@ "name": "prod-landing-two-button-cta" } ] + }, + "disabled_blocks": { + "defaultValue": [] } } diff --git a/client/src/templates/Introduction/super-block-intro.tsx b/client/src/templates/Introduction/super-block-intro.tsx index 8fe2c8d0e7f..1f8b254e7ef 100644 --- a/client/src/templates/Introduction/super-block-intro.tsx +++ b/client/src/templates/Introduction/super-block-intro.tsx @@ -10,6 +10,7 @@ import { scroller } from 'react-scroll'; import { bindActionCreators, Dispatch } from 'redux'; import { createSelector } from 'reselect'; import { Container, Col, Row, Spacer } from '@freecodecamp/ui'; +import { useFeatureValue } from '@growthbook/growthbook-react'; import { chapterBasedSuperBlocks, @@ -151,6 +152,11 @@ const SuperBlockIntroductionPage = (props: SuperBlockProps) => { // eslint-disable-next-line react-hooks/exhaustive-deps }, []); + const disabledBlocksFeature = useFeatureValue( + 'disabled_blocks', + [] + ); + const { data: { allChallengeNode: { nodes }, @@ -288,22 +294,26 @@ const SuperBlockIntroductionPage = (props: SuperBlockProps) => { /> ) : (
- {blocks.map(block => { - const blockChallenges = superBlockChallenges.filter( - c => c.block === block - ); - const blockLabel = blockChallenges[0].blockLabel; + {blocks + .filter(block => { + return !disabledBlocksFeature.includes(block); + }) + .map(block => { + const blockChallenges = superBlockChallenges.filter( + c => c.block === block + ); + const blockLabel = blockChallenges[0].blockLabel; - return ( - - ); - })} + return ( + + ); + })} {showCertification && !!user && (