Skip to content

Commit

Permalink
Make Stripe the default PurchaseVendor for AddFunds on mobile (#7085)
Browse files Browse the repository at this point in the history
  • Loading branch information
rickyrombo authored Jan 4, 2024
1 parent 33e1b72 commit 7dc3969
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useCallback, useState } from 'react'

import {
PurchaseVendor,
useAddFundsModal,
useUSDCManualTransferModal,
buyUSDCActions,
Expand Down Expand Up @@ -52,7 +53,7 @@ export const AddFundsDrawer = () => {
const openCardFlow = useCallback(() => {
dispatch(
buyUSDCActions.onrampOpened({
vendor: purchaseVendorState,
vendor: purchaseVendorState ?? PurchaseVendor.STRIPE,
purchaseInfo: {
desiredAmount: DEFAULT_PURCHASE_AMOUNT_CENTS
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ export const PaymentMethod = ({
icon: IconCreditCard,
content:
vendorOptions.length > 1 ? (
<CardSelectionButton selectedVendor={purchaseVendor} />
<CardSelectionButton
selectedVendor={purchaseVendor ?? vendorOptions[0]}
/>
) : null
},
{
Expand Down
10 changes: 5 additions & 5 deletions packages/mobile/src/screens/pay-and-earn-screen/USDCCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,19 @@ const useStyles = makeStyles(({ spacing, palette }) => ({
usdc: {
fontSize: spacing(5),
fontWeight: '900',
color: palette.white,
color: palette.staticWhite,
opacity: 0.8
},
balance: {
fontSize: spacing(10.5),
fontWeight: '900',
color: palette.white,
color: palette.staticWhite,
lineHeight: spacing(13)
},
buyAndSell: {
fontSize: spacing(4),
fontWeight: '500',
color: palette.white,
color: palette.staticWhite,
marginTop: spacing(2)
},
learnMore: {
Expand All @@ -84,7 +84,7 @@ const useStyles = makeStyles(({ spacing, palette }) => ({

export const USDCCard = () => {
const styles = useStyles()
const white = useColor('white')
const white = useColor('staticWhite')
const { data: balance } = useUSDCBalance()
const balanceCents = formatUSDCWeiToFloorCentsNumber(
(balance ?? new BN(0)) as BNUSDC
Expand Down Expand Up @@ -123,7 +123,7 @@ export const USDCCard = () => {
width={spacing(4)}
fill={white}
/>
<Text fontSize='small' weight='bold' color='white'>
<Text fontSize='small' weight='bold' color='staticWhite'>
{messages.learnMore}
</Text>
</TouchableOpacity>
Expand Down
6 changes: 3 additions & 3 deletions packages/mobile/src/store/purchase-vendor/slice.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { PurchaseVendor } from '@audius/common'
import type { PurchaseVendor } from '@audius/common'
import type { PayloadAction } from '@reduxjs/toolkit'
import { createSlice } from '@reduxjs/toolkit'

export type PurchaseVendorState = {
card: PurchaseVendor
card?: PurchaseVendor
}

const initialState: PurchaseVendorState = {
card: PurchaseVendor.COINFLOW
card: undefined
}

const slice = createSlice({
Expand Down

0 comments on commit 7dc3969

Please sign in to comment.