Skip to content

Commit 592e398

Browse files
committed
refactor(ui): cleanup
1 parent bab8d1a commit 592e398

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+404
-469
lines changed

Diff for: e2e/backup.e2e.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ d('Backup', () => {
6666
await rpc.generateToAddress(1, await rpc.getNewAddress());
6767
await electrum?.waitForSync();
6868

69-
await waitFor(element(by.id('NewTxPrompt')))
69+
await waitFor(element(by.id('ReceivedTransaction')))
7070
.toBeVisible()
7171
.withTimeout(10000);
72-
await element(by.id('NewTxPrompt')).swipe('down'); // close Receive screen
72+
await element(by.id('ReceivedTransaction')).swipe('down'); // close Receive screen
7373
await sleep(200); // animation
7474

7575
// set tag to new tx

Diff for: e2e/boost.e2e.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ d('Boost', () => {
6767
await rpc.sendToAddress(wAddress, '0.001');
6868
await rpc.generateToAddress(1, await rpc.getNewAddress());
6969
await electrum?.waitForSync();
70-
await waitFor(element(by.id('NewTxPrompt')))
70+
await waitFor(element(by.id('ReceivedTransaction')))
7171
.toBeVisible()
7272
.withTimeout(10000);
73-
await element(by.id('NewTxPromptButton')).tap();
73+
await element(by.id('ReceivedTransactionButton')).tap();
7474
await expect(
7575
element(by.id('MoneyText').withAncestor(by.id('TotalBalance'))),
7676
).toHaveText('100 000');
@@ -178,10 +178,10 @@ d('Boost', () => {
178178
await rpc.sendToAddress(wAddress, '0.001');
179179
await rpc.generateToAddress(1, await rpc.getNewAddress());
180180
await electrum?.waitForSync();
181-
await waitFor(element(by.id('NewTxPrompt')))
181+
await waitFor(element(by.id('ReceivedTransaction')))
182182
.toBeVisible()
183183
.withTimeout(10000);
184-
await element(by.id('NewTxPromptButton')).tap();
184+
await element(by.id('ReceivedTransactionButton')).tap();
185185
await expect(
186186
element(by.id('MoneyText').withAncestor(by.id('TotalBalance'))),
187187
).toHaveText('100 000');

Diff for: e2e/helpers.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,10 @@ export const receiveOnchainFunds = async (rpc, amount = '0.001') => {
138138
await rpc.sendToAddress(wAddress, amount);
139139
await rpc.generateToAddress(1, await rpc.getNewAddress());
140140

141-
await waitFor(element(by.id('NewTxPrompt')))
141+
await waitFor(element(by.id('ReceivedTransaction')))
142142
.toBeVisible()
143143
.withTimeout(10000);
144-
await element(by.id('NewTxPrompt')).swipe('down');
144+
await element(by.id('ReceivedTransaction')).swipe('down');
145145
await sleep(1000);
146146
};
147147

Diff for: e2e/lightning.e2e.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,10 @@ d('Lightning', () => {
131131
let { label: invoice1 } = await element(by.id('QRCode')).getAttributes();
132132
invoice1 = invoice1.replaceAll(/bitcoin.*=/gi, '').toLowerCase();
133133
await lnd.sendPaymentSync({ paymentRequest: invoice1, amt: 50000 });
134-
await waitFor(element(by.id('NewTxPrompt')))
134+
await waitFor(element(by.id('ReceivedTransaction')))
135135
.toBeVisible()
136136
.withTimeout(10000);
137-
await element(by.id('NewTxPrompt')).swipe('down');
137+
await element(by.id('ReceivedTransaction')).swipe('down');
138138
await waitFor(
139139
element(by.id('MoneyText').withAncestor(by.id('TotalBalance'))),
140140
)
@@ -163,10 +163,10 @@ d('Lightning', () => {
163163
by.id('ReceiveLightningInvoice'),
164164
).getAttributes();
165165
await lnd.sendPaymentSync({ paymentRequest: invoice2 });
166-
await waitFor(element(by.id('NewTxPrompt')))
166+
await waitFor(element(by.id('ReceivedTransaction')))
167167
.toBeVisible()
168168
.withTimeout(10000);
169-
await element(by.id('NewTxPrompt')).swipe('down');
169+
await element(by.id('ReceivedTransaction')).swipe('down');
170170
await waitFor(
171171
element(by.id('MoneyText').withAncestor(by.id('TotalBalance'))),
172172
)
@@ -360,10 +360,10 @@ d('Lightning', () => {
360360

361361
// TODO: for some reason this doen't work on github actions
362362
// wait for onchain payment to arrive
363-
// await waitFor(element(by.id('NewTxPrompt')))
363+
// await waitFor(element(by.id('ReceivedTransaction')))
364364
// .toBeVisible()
365365
// .withTimeout(60000);
366-
// await element(by.id('NewTxPrompt')).swipe('down');
366+
// await element(by.id('ReceivedTransaction')).swipe('down');
367367
// await expect(
368368
// element(by.id('MoneySign').withAncestor(by.id('ActivityShort-1'))),
369369
// ).toHaveText('+');

Diff for: e2e/lnurl.e2e.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -261,10 +261,10 @@ d('LNURL', () => {
261261
await element(by.id('DialogConfirm')).tap();
262262
await element(by.id('ContinueAmount')).tap();
263263
await element(by.id('WithdrawConfirmButton')).tap();
264-
await waitFor(element(by.id('NewTxPrompt')))
264+
await waitFor(element(by.id('ReceivedTransaction')))
265265
.toBeVisible()
266266
.withTimeout(10000);
267-
await element(by.id('NewTxPrompt')).swipe('down');
267+
await element(by.id('ReceivedTransaction')).swipe('down');
268268

269269
// test lnurl-withdraw, with min !== max amount
270270
const withdrawRequest2 = await lnurl.generateNewUrl('withdrawRequest', {
@@ -277,10 +277,10 @@ d('LNURL', () => {
277277
await element(by.id('QRInput')).replaceText(withdrawRequest2.encoded);
278278
await element(by.id('DialogConfirm')).tap();
279279
await element(by.id('WithdrawConfirmButton')).tap();
280-
await waitFor(element(by.id('NewTxPrompt')))
280+
await waitFor(element(by.id('ReceivedTransaction')))
281281
.toBeVisible()
282282
.withTimeout(10000);
283-
await element(by.id('NewTxPrompt')).swipe('down');
283+
await element(by.id('ReceivedTransaction')).swipe('down');
284284

285285
// test lnurl-auth
286286
const loginRequest1 = await lnurl.generateNewUrl('login');

Diff for: e2e/onchain.e2e.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ d('Onchain', () => {
7474
await rpc.generateToAddress(1, await rpc.getNewAddress());
7575
await electrum?.waitForSync();
7676

77-
await waitFor(element(by.id('NewTxPrompt')))
77+
await waitFor(element(by.id('ReceivedTransaction')))
7878
.toBeVisible()
7979
.withTimeout(10000);
80-
await element(by.id('NewTxPrompt')).swipe('down'); // close Receive screen
80+
await element(by.id('ReceivedTransaction')).swipe('down'); // close Receive screen
8181
await sleep(1000); // animation
8282
}
8383

@@ -201,7 +201,7 @@ d('Onchain', () => {
201201
await element(by.id('Tag-stag-delete')).tap();
202202

203203
// calendar, previous month, 0 transactions
204-
await element(by.id('TimeRangePrompt')).tap();
204+
await element(by.id('DatePicker')).tap();
205205
await expect(element(by.id('Today'))).toBeVisible();
206206
await element(by.id('PrevMonth')).tap();
207207
await expect(element(by.id('Today'))).not.toExist();
@@ -211,7 +211,7 @@ d('Onchain', () => {
211211
await expect(element(by.id('Activity-1'))).not.toExist();
212212

213213
// calendar, current date, 3 transactions
214-
await element(by.id('TimeRangePrompt')).tap();
214+
await element(by.id('DatePicker')).tap();
215215
await element(by.id('CalendarClearButton')).tap();
216216
await element(by.id('NextMonth')).tap();
217217
await element(by.id('Today')).tap();
@@ -238,10 +238,10 @@ d('Onchain', () => {
238238
// await rpc.generateToAddress(1, await rpc.getNewAddress());
239239
// await electrum?.waitForSync();
240240

241-
await waitFor(element(by.id('NewTxPrompt')))
241+
await waitFor(element(by.id('ReceivedTransaction')))
242242
.toBeVisible()
243243
.withTimeout(10000);
244-
await element(by.id('NewTxPrompt')).swipe('down'); // close Receive screen
244+
await element(by.id('ReceivedTransaction')).swipe('down'); // close Receive screen
245245
await sleep(1000); // animation
246246

247247
const coreAddress = await rpc.getNewAddress();

Diff for: e2e/security.e2e.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,10 @@ d('Settings Security And Privacy', () => {
132132
await rpc.sendToAddress(wAddress, '1');
133133
await rpc.generateToAddress(1, await rpc.getNewAddress());
134134
await electrum?.waitForSync();
135-
await waitFor(element(by.id('NewTxPrompt')))
135+
await waitFor(element(by.id('ReceivedTransaction')))
136136
.toBeVisible()
137137
.withTimeout(10000);
138-
await element(by.id('NewTxPrompt')).swipe('down'); // close Receive screen
138+
await element(by.id('ReceivedTransaction')).swipe('down'); // close Receive screen
139139

140140
// send, using FaceID
141141
const coreAddress = await rpc.getNewAddress();

Diff for: e2e/send.e2e.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,10 @@ d('Send', () => {
245245
let { label: receive } = await element(by.id('QRCode')).getAttributes();
246246
receive = receive.replaceAll(/bitcoin.*=/gi, '').toLowerCase();
247247
await lnd.sendPaymentSync({ paymentRequest: receive, amt: 50000 });
248-
await waitFor(element(by.id('NewTxPrompt')))
248+
await waitFor(element(by.id('ReceivedTransaction')))
249249
.toBeVisible()
250250
.withTimeout(10000);
251-
await element(by.id('NewTxPrompt')).swipe('down');
251+
await element(by.id('ReceivedTransaction')).swipe('down');
252252

253253
await waitFor(
254254
element(by.id('MoneyText').withAncestor(by.id('TotalBalance'))),

Diff for: e2e/slashtags.e2e.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,10 @@ d('Profile and Contacts', () => {
200200
await rpc.sendToAddress(wAddress, '1');
201201
await rpc.generateToAddress(1, await rpc.getNewAddress());
202202
await electrum?.waitForSync();
203-
await waitFor(element(by.id('NewTxPrompt')))
203+
await waitFor(element(by.id('ReceivedTransaction')))
204204
.toBeVisible()
205205
.withTimeout(10000);
206-
await element(by.id('NewTxPrompt')).swipe('down');
206+
await element(by.id('ReceivedTransaction')).swipe('down');
207207
await element(by.id('ActivitySavings')).tap();
208208
await element(by.id('Activity-1')).tap();
209209
await element(by.id('ActivityAssign')).tap();

Diff for: e2e/transfer.e2e.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ d('Transfer', () => {
7575
await rpc.generateToAddress(1, await rpc.getNewAddress());
7676
await electrum?.waitForSync();
7777

78-
await waitFor(element(by.id('NewTxPrompt')))
78+
await waitFor(element(by.id('ReceivedTransaction')))
7979
.toBeVisible()
8080
.withTimeout(20000);
81-
await element(by.id('NewTxPrompt')).swipe('down'); // close Receive screen
81+
await element(by.id('ReceivedTransaction')).swipe('down'); // close Receive screen
8282

8383
// switch to USD
8484
await element(by.id('HeaderMenu')).tap();
@@ -261,10 +261,10 @@ d('Transfer', () => {
261261
await rpc.sendToAddress(wAddress, '0.001');
262262
await rpc.generateToAddress(1, await rpc.getNewAddress());
263263

264-
await waitFor(element(by.id('NewTxPrompt')))
264+
await waitFor(element(by.id('ReceivedTransaction')))
265265
.toBeVisible()
266266
.withTimeout(20000);
267-
await element(by.id('NewTxPrompt')).swipe('down');
267+
await element(by.id('ReceivedTransaction')).swipe('down');
268268

269269
// Get LDK node id
270270
await element(by.id('HeaderMenu')).tap();

Diff for: src/AppOnboarded.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import { SlashtagsProvider } from './components/SlashtagsProvider';
66
import { useAppStateHandler } from './hooks/useAppStateHandler';
77
import { useNetworkConnectivity } from './hooks/useNetworkConnectivity';
88
import { useWalletStartup } from './hooks/useWalletStartup';
9-
import { SheetRefsProvider } from './navigation/bottom-sheet/SheetRefsProvider';
109
import DrawerNavigator from './navigation/root/DrawerNavigator';
1110
import RootNavigationContainer from './navigation/root/RootNavigationContainer';
11+
import { SheetRefsProvider } from './sheets/SheetRefsProvider';
1212

1313
const AppOnboarded = (): ReactElement => {
1414
useWalletStartup();

Diff for: src/components/BottomSheet.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { useReducedMotion } from 'react-native-reanimated';
1212
import { __E2E__ } from '../constants/env';
1313
import { useSnapPoints } from '../hooks/bottomSheet';
1414
import useColors from '../hooks/colors';
15-
import { useSheetRef } from '../navigation/bottom-sheet/SheetRefsProvider';
15+
import { useSheetRef } from '../sheets/SheetRefsProvider';
1616
import { SheetId } from '../store/types/ui';
1717
import BottomSheetBackground from './BottomSheetBackground';
1818

Diff for: src/components/PinPad.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { FadeIn, FadeOut } from 'react-native-reanimated';
66
import BitkitLogo from '../assets/bitkit-logo.svg';
77
import { PIN_ATTEMPTS } from '../constants/app';
88
import usePIN from '../hooks/pin';
9-
import { useSheetRef } from '../navigation/bottom-sheet/SheetRefsProvider';
9+
import { useSheetRef } from '../sheets/SheetRefsProvider';
1010
import { AnimatedView, View as ThemedView } from '../styles/components';
1111
import { FaceIdIcon, TouchIdIcon } from '../styles/icons';
1212
import { BodyS, Subtitle } from '../styles/text';

Diff for: src/components/Suggestions.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import Carousel from 'react-native-reanimated-carousel';
66

77
import { appName, appStoreUrl, playStoreUrl } from '../constants/app';
88
import { useAppDispatch, useAppSelector } from '../hooks/redux';
9-
import { useSheetRef } from '../navigation/bottom-sheet/SheetRefsProvider';
109
import type { RootNavigationProp } from '../navigation/types';
10+
import { useSheetRef } from '../sheets/SheetRefsProvider';
1111
import {
1212
pinSelector,
1313
quickpayIntroSeenSelector,

Diff for: src/components/TabBar.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ import { useSafeAreaInsets } from 'react-native-safe-area-context';
1414
import { receiveIcon, sendIcon } from '../assets/icons';
1515
import useColors from '../hooks/colors';
1616
import { useAppSelector } from '../hooks/redux';
17-
import { useSheetRef } from '../navigation/bottom-sheet/SheetRefsProvider';
1817
import { rootNavigation } from '../navigation/root/RootNavigationContainer';
1918
import type { RootNavigationProp } from '../navigation/types';
19+
import { useSheetRef } from '../sheets/SheetRefsProvider';
2020
import { resetSendTransaction } from '../store/actions/wallet';
2121
import { spendingOnboardingSelector } from '../store/reselect/aggregations';
2222
import { showSheet } from '../store/utils/ui';

Diff for: src/hooks/bottomSheet.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
useSafeAreaInsets,
66
} from 'react-native-safe-area-context';
77

8-
import { useAllSheetRefs } from '../navigation/bottom-sheet/SheetRefsProvider';
8+
import { useAllSheetRefs } from '../sheets/SheetRefsProvider';
99

1010
export const useSnapPoints = (
1111
size: 'small' | 'medium' | 'large' | 'calendar',

Diff for: src/navigation/root/RootNavigationContainer.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import {
77
import React, { ReactElement, useEffect } from 'react';
88
import { Linking } from 'react-native';
99

10+
import { useAllSheetRefs } from '../../sheets/SheetRefsProvider';
1011
import { processUri } from '../../utils/scanner/scanner';
11-
import { useAllSheetRefs } from '../bottom-sheet/SheetRefsProvider';
1212
import { RootStackParamList } from '../types';
1313

1414
export type NavigateScreenArgs = {

Diff for: src/navigation/root/RootNavigator.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,13 @@ import Contacts from '../../screens/Contacts/Contacts';
2929
import Profile from '../../screens/Profile/Profile';
3030
import ProfileEdit from '../../screens/Profile/ProfileEdit';
3131
import ScannerScreen from '../../screens/Scanner/MainScanner';
32-
import ForgotPIN from '../../screens/Settings/PIN/ForgotPIN';
3332
import Widget from '../../screens/Widgets/Widget';
3433
import WidgetEdit from '../../screens/Widgets/WidgetEdit';
3534
import WidgetsOnboarding from '../../screens/Widgets/WidgetsOnboarding';
3635
import WidgetsSuggestions from '../../screens/Widgets/WidgetsSuggestions';
36+
import BottomSheetsLazy from '../../sheets/BottomSheetsLazy';
37+
import ForceTransfer from '../../sheets/ForceTransfer';
38+
import ForgotPIN from '../../sheets/ForgotPIN';
3739
import { resetSendTransaction } from '../../store/actions/wallet';
3840
import { getStore } from '../../store/helpers';
3941
import { isAuthenticatedSelector } from '../../store/reselect/ui';
@@ -44,8 +46,6 @@ import { processUri } from '../../utils/scanner/scanner';
4446
import SettingsNavigator from '../SettingsNavigator';
4547
import TransferNavigator from '../TransferNavigator';
4648
import WalletNavigator from '../WalletNavigator';
47-
import BottomSheetsLazy from '../bottom-sheet/BottomSheetsLazy';
48-
import ForceTransfer from '../bottom-sheet/ForceTransfer';
4949
import type { RootStackParamList } from '../types';
5050
import { rootNavigation } from './RootNavigationContainer';
5151

Diff for: src/navigation/types/index.ts

+11-10
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@ import {
88
} from '@react-navigation/native-stack';
99

1010
import type { RecoveryStackParamList } from '../../screens/Recovery/RecoveryNavigator';
11+
import type { BackupStackParamList } from '../../sheets/BackupNavigation';
12+
import type { LNURLWithdrawStackParamList } from '../../sheets/LNURLWithdrawNavigation';
13+
import type { OrangeTicketStackParamList } from '../../sheets/OrangeTicketNavigation';
14+
import type { PinStackParamList } from '../../sheets/PINNavigation';
15+
import type { ProfileLinkStackParamList } from '../../sheets/ProfileLinkNavigation';
16+
import type { ReceiveStackParamList } from '../../sheets/ReceiveNavigation';
17+
import type { SendStackParamList } from '../../sheets/SendNavigation';
18+
import type { TreasureHuntStackParamList } from '../../sheets/TreasureHuntNavigation';
1119
import type { IActivityItem } from '../../store/types/activity';
1220
import type { TWidgetId, TWidgetOptions } from '../../store/types/widgets';
1321
import type { OnboardingStackParamList } from '../OnboardingNavigator';
1422
import type { SettingsStackParamList } from '../SettingsNavigator';
1523
import type { TransferStackParamList } from '../TransferNavigator';
1624
import type { WalletStackParamList } from '../WalletNavigator';
17-
import type { BackupStackParamList } from '../bottom-sheet/BackupNavigation';
18-
import type { LNURLWithdrawStackParamList } from '../bottom-sheet/LNURLWithdrawNavigation';
19-
import type { OrangeTicketStackParamList } from '../bottom-sheet/OrangeTicketNavigation';
20-
import type { PinStackParamList } from '../bottom-sheet/PINNavigation';
21-
import type { ProfileLinkStackParamList } from '../bottom-sheet/ProfileLinkNavigation';
22-
import type { ReceiveStackParamList } from '../bottom-sheet/ReceiveNavigation';
23-
import type { SendStackParamList } from '../bottom-sheet/SendNavigation';
24-
import type { TreasureHuntStackParamList } from '../bottom-sheet/TreasureHuntNavigation';
2525

2626
// TODO: move all navigation related types here
2727
// https://reactnavigation.org/docs/typescript#organizing-types
@@ -95,8 +95,9 @@ export type ReceiveScreenProps<T extends keyof ReceiveStackParamList> =
9595
export type SendScreenProps<T extends keyof SendStackParamList> =
9696
NativeStackScreenProps<SendStackParamList, T>;
9797

98-
export type LNURLWithdrawProps<T extends keyof LNURLWithdrawStackParamList> =
99-
NativeStackScreenProps<LNURLWithdrawStackParamList, T>;
98+
export type LNURLWithdrawScreenProps<
99+
T extends keyof LNURLWithdrawStackParamList,
100+
> = NativeStackScreenProps<LNURLWithdrawStackParamList, T>;
100101

101102
export type OrangeTicketScreenProps<
102103
T extends keyof OrangeTicketStackParamList,

Diff for: src/screens/Activity/ActivityDetail.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import Tag from '../../components/Tag';
2828
import Button from '../../components/buttons/Button';
2929
import useColors from '../../hooks/colors';
3030
import { useAppDispatch, useAppSelector } from '../../hooks/redux';
31+
import ActivityTags from '../../sheets/ActivityTags';
3132
import {
3233
EActivityType,
3334
TLightningActivityItem,
@@ -59,7 +60,6 @@ import {
5960
canBoost,
6061
getBlockExplorerLink,
6162
} from '../../utils/wallet/transactions';
62-
import ActivityTagsPrompt from './ActivityTagsPrompt';
6363

6464
import { useOnchainWallet, useSwitchUnit } from '../../hooks/wallet';
6565
import type {
@@ -1076,7 +1076,7 @@ const ActivityDetail = ({
10761076
)}
10771077
<SafeAreaInset type="bottom" minPadding={16} />
10781078
</ScrollView>
1079-
<ActivityTagsPrompt />
1079+
<ActivityTags />
10801080
</ThemedView>
10811081
);
10821082
};

0 commit comments

Comments
 (0)