diff --git a/core/featureFlags/constants.ts b/core/featureFlags/constants.ts index 08246dcd968951939909edd729bbabfe8fa3602d..1f6cd4270d5521bfbdbef31f85289191c4dcff90 100644 --- a/core/featureFlags/constants.ts +++ b/core/featureFlags/constants.ts @@ -13,4 +13,5 @@ export enum FeatureFlagKey { NEW_HOME_FEED = 'NEW_HOME_FEED', // multivariate ('control', 'test') -> FeatureFlagAB TASK_CONTACT_CTA = 'TASK_CONTACT_CTA', // boolean EVENTS = 'EVENTS', // boolean + CHALLENGES_CAROUSEL = 'CHALLENGES_CAROUSEL', // boolean } diff --git a/core/featureFlags/featureFlagBootstrapValues.ts b/core/featureFlags/featureFlagBootstrapValues.ts index 9605aa48a379ed9518a8e4b3b4272a2f33db4b85..f3721c229c8f4f37f2198db9a99ccb6879600c50 100644 --- a/core/featureFlags/featureFlagBootstrapValues.ts +++ b/core/featureFlags/featureFlagBootstrapValues.ts @@ -29,6 +29,7 @@ export const featureFlagBootstrapValues: FeatureFlagsAndPayloads = { [FeatureFlagKey.POST_TRANSLATION]: false, [FeatureFlagKey.TASK_CONTACT_CTA]: false, [FeatureFlagKey.EVENTS]: false, + [FeatureFlagKey.CHALLENGES_CAROUSEL]: false, }, featureFlagPayloads: { [FeatureFlagKey.DONATIONS]: null, @@ -45,6 +46,7 @@ export const featureFlagBootstrapValues: FeatureFlagsAndPayloads = { [FeatureFlagKey.POST_TRANSLATION]: null, [FeatureFlagKey.TASK_CONTACT_CTA]: null, [FeatureFlagKey.EVENTS]: null, + [FeatureFlagKey.CHALLENGES_CAROUSEL]: null, }, } diff --git a/core/screens/homeFeed/Feed.tsx b/core/screens/homeFeed/Feed.tsx index 3c207b4b566d8f1bffc4b1518eb42aebfdd953a9..6d7f160de0b2d41757ac7aa3c56dfaadcfe17b37 100644 --- a/core/screens/homeFeed/Feed.tsx +++ b/core/screens/homeFeed/Feed.tsx @@ -36,6 +36,7 @@ import { useScrollToTop } from '@react-navigation/native' import useTracking from '@holi/core/tracking/hooks/useTracking' import { useFeedStats } from '@holi/core/screens/homeFeed/helpers/useFeedStats' import ChallengesCarousel from '@holi-apps/challenges/components/feed/ChallengesCarousel' +import { useFeatureFlag } from '@holi/core/featureFlags/hooks/useFeatureFlag' const surveyUrl = 'https://tally.so/r/nrdGxX' const HomeFeed = () => { @@ -49,6 +50,8 @@ const HomeFeed = () => { setLastViewedIndex((prev) => Math.max(prev, index)) }, []) const displayFeedbackLink = useFeatureFlagWithMaintenance(FeatureFlagKey.FEEDBACK_LINK).isOn + const displayChallengesCarousel = useFeatureFlag(FeatureFlagKey.CHALLENGES_CAROUSEL) + const { initialLoading, canLoadMore, combinedFeedData, fetchMore, refetch, refreshing, insightsCreators } = useFeedQuery() @@ -118,11 +121,11 @@ const HomeFeed = () => { <HoliTransition.FadeDown visible> <View style={styles.listHeader}> <HomeFeedHeader /> - <ChallengesCarousel /> + {displayChallengesCarousel[0] && <ChallengesCarousel />} </View> </HoliTransition.FadeDown> ), - [] + [displayChallengesCarousel] ) const listItemTrackingEvent: ListItemTrackingEvent<FeedItem> = (item) => {