Skip to content
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
7 changes: 3 additions & 4 deletions components/Home/NewHome/WalletActions.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useState } from 'react';
import { Platform, Pressable, StyleSheet, useWindowDimensions, View } from 'react-native';
import { Pressable, StyleSheet, useWindowDimensions, View } from 'react-native';

import HomeSend from '@/assets/images/home-send';
import HomeSwap from '@/assets/images/home-swap';
Expand Down Expand Up @@ -97,8 +97,7 @@ interface WalletActionsProps {

/**
* Home action row. No funds → full-width white "Add Funds". Funded → "Add Funds"
* plus "Swap" and "Send". Reuses the global Deposit/Swap/Send modals. Note
* SwapModal renders null on iOS, so Swap self-hides there (same as the legacy row).
* plus "Swap" and "Send". Reuses the global Deposit/Swap/Send modals.
*
* "Add Funds" has three destinations, and none of them is a destination picker:
*
Expand All @@ -117,7 +116,7 @@ const WalletActions = ({ hasFunds, hasCard }: WalletActionsProps) => {
const fundsGoToCard = Boolean(hasCard) && canDepositToCard(provider);
// Only the crowded three-pill row needs to shrink; alone, "Add Funds" always fits.
const compact = hasFunds && width > 0 && width < COMPACT_WIDTH;
const showSwap = hasFunds && Platform.OS !== 'ios';
const showSwap = hasFunds;
const addFundsTrigger = <AddFundsTrigger fullWidth={!hasFunds} compact={compact} />;
const [isCardModalOpen, setIsCardModalOpen] = useState(false);

Expand Down
7 changes: 2 additions & 5 deletions components/Rewards/EarnPointsSection.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ActivityIndicator, Platform, View } from 'react-native';
import { ActivityIndicator, View } from 'react-native';

import { Text } from '@/components/ui/text';
import { useDimension } from '@/hooks/useDimension';
Expand Down Expand Up @@ -111,10 +111,7 @@ const EarnPointsSection = () => {
];
};

// Swap is not available on iOS, so exclude it from the earning methods there.
const earningMethods = getEarningMethods().filter(
method => Platform.OS !== 'ios' || method.title !== 'Swap',
);
const earningMethods = getEarningMethods();

return (
<View className="gap-6 rounded-twice bg-card p-6 md:gap-10 md:p-10">
Expand Down
5 changes: 1 addition & 4 deletions components/Rewards/TierFeesTable.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { Platform } from 'react-native';

import { resolveTierFees } from '@/components/Rewards/NewRewards/tierFees';
import { RewardsTier, TierBenefit, TierBenefits } from '@/lib/types';

Expand All @@ -13,8 +11,7 @@ interface TierFeesTableProps {
const FEE_ROWS: { key: string; label: string; subtitle?: string }[] = [
{ key: 'virtual_card', label: 'Virtual card', subtitle: 'Issued instantly' },
{ key: 'bank_deposit', label: 'Bank deposit' },
// Swap is not available on iOS, so the swap row is omitted there.
...(Platform.OS === 'ios' ? [] : [{ key: 'swap', label: 'Swaps' }]),
{ key: 'swap', label: 'Swaps' },
{ key: 'stocks', label: 'Stocks' },
{ key: 'fx', label: 'FX conversion' },
{ key: 'offramp', label: 'Bank withdrawal' },
Expand Down
5 changes: 0 additions & 5 deletions components/Swap/SwapModal.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { ReactNode, useEffect } from 'react';
import { Platform } from 'react-native';

import { SWAP_MODAL } from '@/constants/modals';
import { useSwapState } from '@/store/swapStore';
Expand Down Expand Up @@ -34,10 +33,6 @@ const SwapModal = ({ trigger = null, defaultOpen = false }: SwapModalProps) => {
}
}, [defaultOpen, setModal]);

if (Platform.OS === 'ios') {
return null;
}

// Headless usage - the global SwapModalProvider handles the modal
if (trigger === null) {
return null;
Expand Down
8 changes: 1 addition & 7 deletions components/Swap/SwapModalProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useCallback, useMemo } from 'react';
import { Platform, View } from 'react-native';
import { View } from 'react-native';
import { useRouter } from 'expo-router';
import { useShallow } from 'zustand/react/shallow';

Expand Down Expand Up @@ -149,12 +149,6 @@ const SwapModalProvider = () => {
handleTransactionStatusPress,
]);

// Regular Swap remains unavailable on iOS. Buy FUSE can open through its
// dedicated entry points and still passes the geo and disclaimer gates.
if (Platform.OS === 'ios' && !isBuyFuse) {
return null;
}

return (
<ResponsiveModal
currentModal={currentModal}
Expand Down
5 changes: 3 additions & 2 deletions components/Swap/__tests__/SwapModalProvider.ios.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,11 @@ it('renders Buy FUSE on iOS', () => {
act(() => root.unmount());
});

it('keeps the regular Swap modal hidden on iOS', () => {
it('renders the regular Swap modal on iOS', () => {
mockCurrentModal = SWAP_MODAL.OPEN_FORM;
const root = render();
expect(root.root.findAllByType('ResponsiveModal')).toHaveLength(0);
expect(root.root.findAllByType('ResponsiveModal')).toHaveLength(1);
expect(root.root.findAllByType('SwapPair')).toHaveLength(1);
act(() => root.unmount());
});

Expand Down
4 changes: 2 additions & 2 deletions components/Wallet/WalletCard.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Platform, Pressable, View } from 'react-native';
import { Pressable, View } from 'react-native';

import WalletIcon from '@/assets/images/wallet';
import CountUp from '@/components/CountUp';
Expand Down Expand Up @@ -74,7 +74,7 @@ const WalletCard = ({ balance, className, tokens, isLoading, decimalPlaces }: Wa
content={
<Text className="max-w-[16.2rem] text-base">
Displaying top three tokens by balance. Wallet can contain any ERC-20 and native
token in Ethereum and Fuse for {Platform.OS === 'ios' ? 'Send' : 'Swap and Send'}.
token in Ethereum and Fuse for Swap and Send.
</Text>
}
/>
Expand Down
Loading