Skip to content

Commit

Permalink
refactor(send): merge send flow feature gates (#4629)
Browse files Browse the repository at this point in the history
### Description

Remove use_new_recipient_screen gate and replace with use_new_send_flow

### Test plan

Manually by overriding the gate to both true and false and going through
the flow

### Related issues

N/A

### Backwards compatibility

Yes
  • Loading branch information
satish-ravi authored Dec 13, 2023
1 parent b7927a5 commit fc9ade3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
8 changes: 4 additions & 4 deletions src/home/ActionsCarousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ function ActionsCarousel() {
title: t('homeActions.send'),
icon: <QuickActionsSend color={Colors.successDark} />,
onPress: () => {
const shouldShowSelectRecipient = getFeatureGate(
StatsigFeatureGates.USE_NEW_RECIPIENT_SCREEN
navigate(
getFeatureGate(StatsigFeatureGates.USE_NEW_SEND_FLOW)
? Screens.SendSelectRecipient
: Screens.Send
)
const sendScreen = shouldShowSelectRecipient ? Screens.SendSelectRecipient : Screens.Send
navigate(sendScreen)
},
},
{
Expand Down
12 changes: 5 additions & 7 deletions src/send/useFetchRecipientVerificationStatus.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
import { useEffect, useState } from 'react'
import { useDispatch } from 'react-redux'
import { fetchAddressesAndValidate, fetchAddressVerification } from 'src/identity/actions'
import { phoneNumberVerifiedSelector } from 'src/app/selectors'
import { fetchAddressVerification, fetchAddressesAndValidate } from 'src/identity/actions'
import {
e164NumberToAddressSelector,
addressToVerificationStatusSelector,
e164NumberToAddressSelector,
} from 'src/identity/selectors'
import { RecipientVerificationStatus } from 'src/identity/types'
import { getRecipientVerificationStatus, Recipient } from 'src/recipients/recipient'
import { Recipient, getRecipientVerificationStatus } from 'src/recipients/recipient'
import useSelector from 'src/redux/useSelector'
import { getFeatureGate } from 'src/statsig'
import { StatsigFeatureGates } from 'src/statsig/types'
import { phoneNumberVerifiedSelector } from 'src/app/selectors'

const useFetchRecipientVerificationStatus = () => {
const [recipient, setRecipient] = useState<Recipient | null>(null)
const [recipientVerificationStatus, setRecipientVerificationStatus] = useState(
RecipientVerificationStatus.UNKNOWN
)

const useNewAddressVerificationBehavior = getFeatureGate(
StatsigFeatureGates.USE_NEW_RECIPIENT_SCREEN
)
const useNewAddressVerificationBehavior = getFeatureGate(StatsigFeatureGates.USE_NEW_SEND_FLOW)

const e164NumberToAddress = useSelector(e164NumberToAddressSelector)
const addressToVerificationStatus = useSelector(addressToVerificationStatusSelector)
Expand Down
1 change: 0 additions & 1 deletion src/statsig/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export const FeatureGates = {
[StatsigFeatureGates.RESTRICT_SUPERCHARGE_FOR_CLAIM_ONLY]: false,
[StatsigFeatureGates.USE_VIEM_FOR_SWAP]: false,
[StatsigFeatureGates.USE_VIEM_FOR_WALLETCONNECT_TRANSACTIONS]: false,
[StatsigFeatureGates.USE_NEW_RECIPIENT_SCREEN]: false,
[StatsigFeatureGates.USE_NEW_SEND_FLOW]: false,
[StatsigFeatureGates.SHOW_IMPORT_TOKENS_FLOW]: false,
[StatsigFeatureGates.SHOW_HIDE_HOME_BALANCES_TOGGLE]: false,
Expand Down
1 change: 0 additions & 1 deletion src/statsig/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export enum StatsigFeatureGates {
RESTRICT_SUPERCHARGE_FOR_CLAIM_ONLY = 'restrict_supercharge_for_claim_only',
USE_VIEM_FOR_SWAP = 'use_viem_for_swap',
USE_VIEM_FOR_WALLETCONNECT_TRANSACTIONS = 'use_viem_for_walletconnect_transactions',
USE_NEW_RECIPIENT_SCREEN = 'use_new_recipient_screen',
USE_NEW_SEND_FLOW = 'use_new_send_flow',
SHOW_IMPORT_TOKENS_FLOW = 'show_import_tokens_flow',
SHOW_HIDE_HOME_BALANCES_TOGGLE = 'show_hide_home_balances_toggle',
Expand Down

0 comments on commit fc9ade3

Please sign in to comment.