Skip to content

Commit

Permalink
add remote config flag for trending tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
walmat committed Dec 9, 2024
1 parent 814eb1c commit 281900d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/Discover/DiscoverHome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import { TrendingTokens } from '@/components/Discover/TrendingTokens';
export const HORIZONTAL_PADDING = 20;

export default function DiscoverHome() {
const { profiles_enabled, mints_enabled, op_rewards_enabled, featured_results } = useRemoteConfig();
const { profiles_enabled, mints_enabled, op_rewards_enabled, featured_results, trending_tokens_enabled } = useRemoteConfig();
const { chainId } = useAccountSettings();
const profilesEnabledLocalFlag = useExperimentalFlag(PROFILES);
const profilesEnabledRemoteFlag = profiles_enabled;
Expand All @@ -44,7 +44,7 @@ export default function DiscoverHome() {
const mintsEnabled = (useExperimentalFlag(MINTS) || mints_enabled) && !IS_TEST;
const opRewardsLocalFlag = useExperimentalFlag(OP_REWARDS);
const opRewardsRemoteFlag = op_rewards_enabled;
const trendingTokensEnabled = useExperimentalFlag(TRENDING_TOKENS);
const trendingTokensEnabled = (useExperimentalFlag(TRENDING_TOKENS) || trending_tokens_enabled) && !IS_TEST;
const testNetwork = isTestnetChain({ chainId });
const { navigate } = useNavigation();
const isProfilesEnabled = profilesEnabledLocalFlag && profilesEnabledRemoteFlag;
Expand Down
3 changes: 3 additions & 0 deletions src/model/remoteConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export interface RainbowConfig extends Record<string, string | boolean | number>
dapp_browser: boolean;
idfa_check_enabled: boolean;
rewards_enabled: boolean;
trending_tokens_enabled: boolean;

degen_mode: boolean;
featured_results: boolean;
Expand Down Expand Up @@ -123,6 +124,7 @@ export const DEFAULT_CONFIG: RainbowConfig = {
dapp_browser: true,
idfa_check_enabled: true,
rewards_enabled: true,
trending_tokens_enabled: false,

degen_mode: true,
featured_results: true,
Expand Down Expand Up @@ -181,6 +183,7 @@ export async function fetchRemoteConfig(): Promise<RainbowConfig> {
key === 'dapp_browser' ||
key === 'idfa_check_enabled' ||
key === 'rewards_enabled' ||
key === 'trending_tokens_enabled' ||
key === 'degen_mode' ||
key === 'featured_results' ||
key === 'claimables' ||
Expand Down

0 comments on commit 281900d

Please sign in to comment.