Skip to content

Commit

Permalink
feat: add testflag to show deposit toggle (#1223)
Browse files Browse the repository at this point in the history
  • Loading branch information
rosepuppy authored Oct 25, 2024
1 parent db1d063 commit fab7e4d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/lib/testFlags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ class TestFlags {
get onboardingRewrite() {
return !!this.queryParams.onboarding_rewrite;
}

get showInstantDepositToggle() {
return !!this.queryParams.funkit_toggle;
}
}

export const testFlags = new TestFlags();
5 changes: 4 additions & 1 deletion src/views/dialogs/DepositDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import { Dialog, DialogPlacement } from '@/components/Dialog';
import { useAppDispatch } from '@/state/appTypes';
import { closeDialog } from '@/state/dialogs';

import { testFlags } from '@/lib/testFlags';

import { DepositDialogContent } from './DepositDialog/DepositDialogContent';

enum DepositType {
Expand All @@ -32,7 +34,8 @@ export const DepositDialog = ({
const startCheckout = useFunkitBuyNobleUsdc();
const dispatch = useAppDispatch();
const ffEnableFunkit =
useStatsigGateValue(StatsigFlags.ffEnableFunkit) && import.meta.env.VITE_FUNKIT_API_KEY;
(useStatsigGateValue(StatsigFlags.ffEnableFunkit) || testFlags.showInstantDepositToggle) &&
import.meta.env.VITE_FUNKIT_API_KEY;

const {
sourceAccount: { walletInfo },
Expand Down
4 changes: 3 additions & 1 deletion src/views/forms/AccountManagementForms/DepositForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ import { dd } from '@/lib/analytics/datadog';
import { isNativeDenom, WAGMI_COSMJS_NATIVE_TOKEN_ADDRESS } from '@/lib/assetUtils';
import { MustBigNumber } from '@/lib/numbers';
import { log } from '@/lib/telemetry';
import { testFlags } from '@/lib/testFlags';
import { sleep } from '@/lib/timeUtils';
import { parseWalletError } from '@/lib/wallet';

Expand Down Expand Up @@ -114,7 +115,8 @@ export const DepositForm = ({ onDeposit, onError }: DepositFormProps) => {
const selectedDydxChainId = useAppSelector(getSelectedDydxChainId);
const { hasAcknowledgedTerms } = useAppSelector(getOnboardingGuards);
const ffEnableFunkit =
useStatsigGateValue(StatsigFlags.ffEnableFunkit) && import.meta.env.VITE_FUNKIT_API_KEY;
(useStatsigGateValue(StatsigFlags.ffEnableFunkit) || testFlags.showInstantDepositToggle) &&
import.meta.env.VITE_FUNKIT_API_KEY;

const {
dydxAddress,
Expand Down

0 comments on commit fab7e4d

Please sign in to comment.