Skip to content

Commit

Permalink
feat(suite-native): tweak receive flow and navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
yanascz committed Jan 6, 2025
1 parent e8ab5a0 commit 413e5ba
Show file tree
Hide file tree
Showing 15 changed files with 12 additions and 168 deletions.
1 change: 0 additions & 1 deletion suite-native/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
"@suite-native/module-device-settings": "workspace:*",
"@suite-native/module-home": "workspace:*",
"@suite-native/module-onboarding": "workspace:*",
"@suite-native/module-receive": "workspace:*",
"@suite-native/module-send": "workspace:*",
"@suite-native/module-settings": "workspace:*",
"@suite-native/module-staking-management": "workspace:*",
Expand Down
2 changes: 0 additions & 2 deletions suite-native/app/src/navigation/AppTabNavigator.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { BottomTabBarProps, createBottomTabNavigator } from '@react-navigation/bottom-tabs';

import { ReceiveStackNavigator } from '@suite-native/module-receive';
import { HomeStackNavigator } from '@suite-native/module-home';
import { AccountsStackNavigator } from '@suite-native/module-accounts-management';
import { SettingsScreen } from '@suite-native/module-settings';
Expand All @@ -27,7 +26,6 @@ export const AppTabNavigator = () => {
>
<Tab.Screen name={AppTabsRoutes.HomeStack} component={HomeStackNavigator} />
<Tab.Screen name={AppTabsRoutes.AccountsStack} component={AccountsStackNavigator} />
<Tab.Screen name={AppTabsRoutes.ReceiveStack} component={ReceiveStackNavigator} />
<Tab.Screen name={AppTabsRoutes.Settings} component={SettingsScreen} />
</Tab.Navigator>
);
Expand Down
8 changes: 0 additions & 8 deletions suite-native/app/src/navigation/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,6 @@ const accountsStack = enhanceTabOption({
},
});

const receiveStack = enhanceTabOption({
routeName: AppTabsRoutes.ReceiveStack,
label: 'Receive',
iconName: 'arrowLineDown',
focusedIconName: 'arrowLineDown',
});

const settings = enhanceTabOption({
routeName: AppTabsRoutes.Settings,
iconName: 'gear',
Expand All @@ -36,6 +29,5 @@ const settings = enhanceTabOption({
export const rootTabsOptions = {
...homeStack,
...accountsStack,
...receiveStack,
...settings,
};
1 change: 0 additions & 1 deletion suite-native/app/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
{ "path": "../module-device-settings" },
{ "path": "../module-home" },
{ "path": "../module-onboarding" },
{ "path": "../module-receive" },
{ "path": "../module-send" },
{ "path": "../module-settings" },
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,10 @@ export const TransactionListHeader = memo(
tokenContract={tokenContract}
/>
{accountHasTransactions && (
<HStack paddingHorizontal="sp16" flex={1} spacing="sp12">
<HStack paddingTop="sp8" paddingHorizontal="sp16" flex={1} spacing="sp12">
<Box flex={1}>
<Button
viewLeft="arrowLineDown"
size="large"
onPress={handleReceive}
testID="@account-detail/receive-button"
>
Expand All @@ -150,7 +149,6 @@ export const TransactionListHeader = memo(
<Box flex={1}>
<Button
viewLeft="arrowLineUp"
size="large"
onPress={handleSend}
testID="@account-detail/send-button"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,6 @@ export const useAddCoinAccount = () => {
let screen = AppTabsRoutes.HomeStack;
if (flowType === 'accounts') {
screen = AppTabsRoutes.AccountsStack;
} else if (flowType === 'receive') {
screen = AppTabsRoutes.ReceiveStack;
}

if (newAccountResult.payload === 'Passphrase is incorrect') {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,46 +1,37 @@
import { useSelector } from 'react-redux';
import { forwardRef } from 'react';

import { useNavigation } from '@react-navigation/native';

import { Box, Button, VStack } from '@suite-native/atoms';
import { Button, VStack } from '@suite-native/atoms';
import { Assets } from '@suite-native/assets';
import {
RootStackParamList,
RootStackRoutes,
StackNavigationProps,
} from '@suite-native/navigation';
import { selectIsPortfolioTrackerDevice } from '@suite-common/wallet-core';
import { Translation } from '@suite-native/intl';

import { PortfolioGraph, PortfolioGraphRef } from './PortfolioGraph';

export const PortfolioContent = forwardRef<PortfolioGraphRef>((_props, ref) => {
const navigation = useNavigation<StackNavigationProps<RootStackParamList, RootStackRoutes>>();

const isPortfolioTrackerDevice = useSelector(selectIsPortfolioTrackerDevice);

const handleReceive = () => {
navigation.navigate(RootStackRoutes.ReceiveModal, { closeActionType: 'back' });
};

return (
<VStack spacing="sp24" marginTop="sp8">
<VStack spacing="sp32" marginTop="sp8">
<PortfolioGraph ref={ref} />
<VStack spacing="sp24" marginHorizontal="sp16">
<Box>
<Assets />
</Box>
{isPortfolioTrackerDevice && (
<Button
data-testID="@home/portolio/recieve-button"
size="large"
onPress={handleReceive}
viewLeft="arrowLineDown"
>
<Translation id="moduleHome.buttons.receive" />
</Button>
)}
<Button
data-testID="@home/portolio/recieve-button"
onPress={handleReceive}
viewLeft="arrowLineDown"
>
<Translation id="moduleHome.buttons.receive" />
</Button>
<Assets />
</VStack>
</VStack>
);
Expand Down
21 changes: 0 additions & 21 deletions suite-native/module-receive/package.json

This file was deleted.

1 change: 0 additions & 1 deletion suite-native/module-receive/src/index.ts

This file was deleted.

This file was deleted.

60 changes: 0 additions & 60 deletions suite-native/module-receive/src/screens/ReceiveAccountsScreen.tsx

This file was deleted.

9 changes: 0 additions & 9 deletions suite-native/module-receive/tsconfig.json

This file was deleted.

3 changes: 1 addition & 2 deletions suite-native/navigation/src/navigators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ export type SendStackParamList = {
export type AppTabsParamList = {
[AppTabsRoutes.HomeStack]: NavigatorScreenParams<HomeStackParamList>;
[AppTabsRoutes.AccountsStack]: NavigatorScreenParams<AccountsStackParamList>;
[AppTabsRoutes.ReceiveStack]: NavigatorScreenParams<ReceiveStackParamList>;
[AppTabsRoutes.Settings]: undefined;
};

Expand Down Expand Up @@ -128,7 +127,7 @@ export type AccountsImportStackParamList = {
};
};

export type AddCoinFlowType = 'home' | 'receive' | 'accounts';
export type AddCoinFlowType = 'home' | 'accounts';

export type AddCoinAccountStackParamList = {
[AddCoinAccountStackRoutes.AddCoinAccount]: {
Expand Down
1 change: 0 additions & 1 deletion suite-native/navigation/src/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export enum RootStackRoutes {
export enum AppTabsRoutes {
HomeStack = 'HomeStack',
AccountsStack = 'AccountsStack',
ReceiveStack = 'ReceiveStack',
Settings = 'Settings',
}

Expand Down
15 changes: 0 additions & 15 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9737,7 +9737,6 @@ __metadata:
"@suite-native/module-device-settings": "workspace:*"
"@suite-native/module-home": "workspace:*"
"@suite-native/module-onboarding": "workspace:*"
"@suite-native/module-receive": "workspace:*"
"@suite-native/module-send": "workspace:*"
"@suite-native/module-settings": "workspace:*"
"@suite-native/module-staking-management": "workspace:*"
Expand Down Expand Up @@ -10551,20 +10550,6 @@ __metadata:
languageName: unknown
linkType: soft

"@suite-native/module-receive@workspace:*, @suite-native/module-receive@workspace:suite-native/module-receive":
version: 0.0.0-use.local
resolution: "@suite-native/module-receive@workspace:suite-native/module-receive"
dependencies:
"@react-navigation/native": "npm:6.1.18"
"@react-navigation/native-stack": "npm:6.11.0"
"@suite-native/accounts": "workspace:*"
"@suite-native/device-manager": "workspace:*"
"@suite-native/navigation": "workspace:*"
react: "npm:18.2.0"
react-native: "npm:0.76.1"
languageName: unknown
linkType: soft

"@suite-native/module-send@workspace:*, @suite-native/module-send@workspace:suite-native/module-send":
version: 0.0.0-use.local
resolution: "@suite-native/module-send@workspace:suite-native/module-send"
Expand Down

0 comments on commit 413e5ba

Please sign in to comment.