Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature flag #1683

Merged
merged 3 commits into from
Feb 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const App = (): JSX.Element => {
const dispatch = useDispatch();
const isStrategiesEnabled = useFeatureFlag(FeatureFlags.STRATEGIES);
const isOnboardingEnabled = useFeatureFlag(FeatureFlags.ONBOARDING);
const isBobXInterlayEnabled = useFeatureFlag(FeatureFlags.BOB_X_INTERLAY);

// Detects if the connected account is a vault operator
const { error: vaultsError } = useQuery<GraphqlReturn<any>, Error>(
Expand Down Expand Up @@ -120,9 +121,11 @@ const App = (): JSX.Element => {
<Route path={PAGES.WALLET}>
<Wallet />
</Route>
<Route path={PAGES.BOB}>
<BOB />
</Route>
{isBobXInterlayEnabled && (
<Route path={PAGES.BOB}>
<BOB />
</Route>
)}
{isStrategiesEnabled && (
<>
<Route exact path={PAGES.STRATEGIES}>
Expand Down
6 changes: 4 additions & 2 deletions src/hooks/use-feature-flag.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
enum FeatureFlags {
STRATEGIES = 'strategies',
GEOBLOCK = 'geoblock',
ONBOARDING = 'onboarding'
ONBOARDING = 'onboarding',
BOB_X_INTERLAY = 'bob-x-interlay'
}

const featureFlags: Record<FeatureFlags, string | undefined> = {
[FeatureFlags.STRATEGIES]: process.env.REACT_APP_FEATURE_FLAG_STRATEGIES,
[FeatureFlags.GEOBLOCK]: process.env.REACT_APP_FEATURE_FLAG_GEOBLOCK,
[FeatureFlags.ONBOARDING]: process.env.REACT_APP_FEATURE_FLAG_ONBOARDING
[FeatureFlags.ONBOARDING]: process.env.REACT_APP_FEATURE_FLAG_ONBOARDING,
[FeatureFlags.BOB_X_INTERLAY]: process.env.REACT_APP_FEATURE_FLAG_BOB_X_INTERLAY
};

const useFeatureFlag = (feature: FeatureFlags): boolean => featureFlags[feature] === 'enabled';
Expand Down
11 changes: 7 additions & 4 deletions src/pages/BOB/BOB.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,17 @@ const BOB = (): JSX.Element => {
<TextLink external to='http://app.gobob.xyz' underlined>
BOB
</TextLink>{' '}
x Interlay exclusive NFT badge today.
x Interlay exclusive NFT badge.
</P>
<P>
Only original Interlay community members are eligible. Simply submit the EVM address you&apos;d like
to receive the NFT and sign the transaction with your Interlay account to prove your community
status. We&apos;ll let you know in Interlay Discord when the NFT will be available to claim.
status.
</P>
<P>
Submit your Ethereum address below to register. We&apos;ll let you know in Interlay Discord when the NFT
is available to claim.
</P>
<P>The claim page is only live until [DATE].</P>
</Flex>
<form onSubmit={form.handleSubmit}>
<Flex direction='column' gap='spacing8'>
Expand All @@ -171,7 +174,7 @@ const BOB = (): JSX.Element => {
</Flex>
<Flex direction='column' gap='spacing4'>
<AuthCTA type='submit' size='large'>
Claim your NFT
Register your Ethereum address
</AuthCTA>
</Flex>
</Flex>
Expand Down
Loading