Skip to content

Commit

Permalink
chore: rename 'Lightning' to 'Transfer' (#2151)
Browse files Browse the repository at this point in the history
  • Loading branch information
pwltr authored Aug 22, 2024
1 parent 626732c commit 8b1aff8
Show file tree
Hide file tree
Showing 25 changed files with 60 additions and 60 deletions.
2 changes: 1 addition & 1 deletion src/components/Barrel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Subtitle } from '../styles/text';
import { TouchableOpacity } from '../styles/components';
import useColors from '../hooks/colors';
import { useDisplayValues } from '../hooks/displayValues';
import { TPackage } from '../screens/Lightning/CustomSetup';
import { TPackage } from '../screens/Transfer/CustomSetup';

const Barrel = ({
id,
Expand Down
4 changes: 2 additions & 2 deletions src/components/Suggestions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ const Suggestions = (): ReactElement => {
}

if (id === 'lightning') {
navigation.navigate('LightningRoot', { screen: 'Introduction' });
navigation.navigate('TransferRoot', { screen: 'Introduction' });
}

if (id === 'lightningSettingUp') {
navigation.navigate('LightningRoot', { screen: 'SettingUp' });
navigation.navigate('TransferRoot', { screen: 'SettingUp' });
}

if (id === 'pin') {
Expand Down
4 changes: 2 additions & 2 deletions src/navigation/root/RootNavigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import ActivityAssignContact from '../../screens/Activity/ActivityAssignContact'
import BuyBitcoin from '../../screens/BuyBitcoin';
import ScannerScreen from '../../screens/Scanner/MainScanner';
import SettingsNavigator from '../settings/SettingsNavigator';
import LightningNavigator from '../lightning/LightningNavigator';
import TransferNavigator from '../transfer/TransferNavigator';
import Profile from '../../screens/Profile/Profile';
import ProfileEdit from '../../screens/Profile/ProfileEdit';
import Contacts from '../../screens/Contacts/Contacts';
Expand Down Expand Up @@ -200,7 +200,7 @@ const RootNavigator = (): ReactElement => {
component={ScannerScreen}
options={{ animation: 'slide_from_right' }}
/>
<Stack.Screen name="LightningRoot" component={LightningNavigator} />
<Stack.Screen name="TransferRoot" component={TransferNavigator} />
<Stack.Screen name="Settings" component={SettingsNavigator} />
<Stack.Screen
name="Profile"
Expand Down
10 changes: 5 additions & 5 deletions src/navigation/settings/SettingsNavigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ import ExportToPhone from '../../screens/Settings/Backup/ExportToPhone';
import ResetAndRestore from '../../screens/Settings/Backup/ResetAndRestore';
import TagsSettings from '../../screens/Settings/Tags';
import FeeSettings from '../../screens/Settings/Fee';
import LightningNavigator, {
LightningStackParamList,
} from '../lightning/LightningNavigator';
import TransferNavigator, {
TransferStackParamList,
} from '../transfer/TransferNavigator';
import WebRelay from '../../screens/Settings/WebRelay';
import Ledger from '../../screens/Settings/Ledger';
import LedgerTransaction from '../../screens/Settings/Ledger/LedgerTransaction';
Expand Down Expand Up @@ -103,7 +103,7 @@ export type SettingsStackParamList = {
OpenConnectionSuccess: { name: string };
LightningAddConnection: undefined;
LightningAddConnectionResult: undefined;
LightningRoot: NavigatorScreenParams<LightningStackParamList>;
TransferRoot: NavigatorScreenParams<TransferStackParamList>;
TagsSettings: undefined;
WidgetSettings: undefined;
AddressViewer: undefined;
Expand Down Expand Up @@ -183,7 +183,7 @@ const SettingsNavigator = (): ReactElement => {
name="LightningAddConnectionResult"
component={AddConnectionResult}
/>
<Stack.Screen name="LightningRoot" component={LightningNavigator} />
<Stack.Screen name="TransferRoot" component={TransferNavigator} />
<Stack.Screen name="TagsSettings" component={TagsSettings} />
<Stack.Screen name="FeeSettings" component={FeeSettings} />
<Stack.Screen name="WebRelay" component={WebRelay} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,25 @@ import {
} from '@react-navigation/native-stack';
import { LNURLChannelParams } from 'js-lnurl';

import Introduction from '../../screens/Lightning/Introduction';
import Funding from '../../screens/Lightning/Funding';
import QuickSetup from '../../screens/Lightning/QuickSetup';
import QuickConfirm from '../../screens/Lightning/QuickConfirm';
import CustomSetup from '../../screens/Lightning/CustomSetup';
import CustomConfirm from '../../screens/Lightning/CustomConfirm';
import SettingUp from '../../screens/Lightning/SettingUp';
import Availability from '../../screens/Lightning/Availability';
import Interrupted from '../../screens/Lightning/Interrupted';
import Success from '../../screens/Lightning/Success';
import LNURLChannel from '../../screens/Lightning/LNURLChannel';
import LNURLChannelSuccess from '../../screens/Lightning/LNURLChannelSuccess';
import Introduction from '../../screens/Transfer/Introduction';
import Funding from '../../screens/Transfer/Funding';
import QuickSetup from '../../screens/Transfer/QuickSetup';
import QuickConfirm from '../../screens/Transfer/QuickConfirm';
import CustomSetup from '../../screens/Transfer/CustomSetup';
import CustomConfirm from '../../screens/Transfer/CustomConfirm';
import SettingUp from '../../screens/Transfer/SettingUp';
import Availability from '../../screens/Transfer/Availability';
import Interrupted from '../../screens/Transfer/Interrupted';
import Success from '../../screens/Transfer/Success';
import LNURLChannel from '../../screens/Transfer/LNURLChannel';
import LNURLChannelSuccess from '../../screens/Transfer/LNURLChannelSuccess';
import { __E2E__ } from '../../constants/env';
import { EUnit } from '../../store/types/wallet';

export type LightningNavigationProp =
NativeStackNavigationProp<LightningStackParamList>;
export type TransferNavigationProp =
NativeStackNavigationProp<TransferStackParamList>;

export type LightningStackParamList = {
export type TransferStackParamList = {
Introduction: undefined;
Funding: undefined;
QuickSetup: undefined;
Expand All @@ -47,13 +47,13 @@ export type LightningStackParamList = {
LNURLChannelSuccess: undefined;
};

const Stack = createNativeStackNavigator<LightningStackParamList>();
const Stack = createNativeStackNavigator<TransferStackParamList>();
const screenOptions: NativeStackNavigationOptions = {
headerShown: false,
animation: __E2E__ ? 'none' : 'default',
};

const LightningStack = (): ReactElement => {
const Transfer = (): ReactElement => {
return (
<Stack.Navigator
screenOptions={screenOptions}
Expand All @@ -77,4 +77,4 @@ const LightningStack = (): ReactElement => {
);
};

export default LightningStack;
export default Transfer;
8 changes: 4 additions & 4 deletions src/navigation/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type { TWidgetSettings } from '../../store/types/widgets';
import type { OnboardingStackParamList } from '../onboarding/OnboardingNavigator';
import type { RecoveryStackParamList } from '../../screens/Recovery/RecoveryNavigator';
import type { WalletStackParamList } from '../wallet/WalletNavigator';
import type { LightningStackParamList } from '../lightning/LightningNavigator';
import type { TransferStackParamList } from '../transfer/TransferNavigator';
import type { SettingsStackParamList } from '../settings/SettingsNavigator';
import type { BackupStackParamList } from '../bottom-sheet/BackupNavigation';
import type { PinStackParamList } from '../bottom-sheet/PINNavigation';
Expand All @@ -34,7 +34,7 @@ export type RootStackParamList = {
ActivityAssignContact: { txid: string };
AppUpdate: undefined;
Scanner: { onScan: (data: string) => void } | undefined;
LightningRoot: NavigatorScreenParams<LightningStackParamList>;
TransferRoot: NavigatorScreenParams<TransferStackParamList>;
Settings: NavigatorScreenParams<SettingsStackParamList>;
Profile: undefined;
ProfileEdit: undefined;
Expand Down Expand Up @@ -72,9 +72,9 @@ export type WalletScreenProps<T extends keyof WalletStackParamList> =
RootStackScreenProps<keyof RootStackParamList>
>;

export type LightningScreenProps<T extends keyof LightningStackParamList> =
export type TransferScreenProps<T extends keyof TransferStackParamList> =
CompositeScreenProps<
NativeStackScreenProps<LightningStackParamList, T>,
NativeStackScreenProps<TransferStackParamList, T>,
RootStackScreenProps<keyof RootStackParamList>
>;

Expand Down
2 changes: 1 addition & 1 deletion src/screens/Activity/ActivitySavings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const ActivitySavings = ({
const showOnboarding = onchainBalance === 0 && savingsItems.length === 0;

const onTransfer = (): void => {
navigation.navigate('LightningRoot', { screen: 'QuickSetup' });
navigation.navigate('TransferRoot', { screen: 'QuickSetup' });
};

const canTransfer = onchainBalance && !isGeoBlocked;
Expand Down
2 changes: 1 addition & 1 deletion src/screens/Activity/ActivitySpending.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const ActivitySpending = ({
const showOnboarding = lightningBalance === 0 && spendingItems.length === 0;

const onTransfer = (): void => {
navigation.navigate('LightningRoot', { screen: 'QuickSetup' });
navigation.navigate('TransferRoot', { screen: 'QuickSetup' });
};

const canTransfer = !!lightningBalance;
Expand Down
2 changes: 1 addition & 1 deletion src/screens/Settings/Lightning/Channels.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ const Channels = ({
const pendingConnections = [...pendingOrders, ...pendingChannels];

const handleAdd = useCallback((): void => {
navigation.navigate('LightningRoot', {
navigation.navigate('TransferRoot', {
screen: 'CustomSetup',
params: { spending: true },
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ import { useAppDispatch } from '../../hooks/redux';
import { refreshWallet } from '../../utils/wallet';
import { closeAllChannels } from '../../utils/lightning';
import { startCoopCloseTimer } from '../../store/slices/user';
import type { LightningScreenProps } from '../../navigation/types';
import type { TransferScreenProps } from '../../navigation/types';
import { sleep } from '../../utils/helpers';

const imageSrc = require('../../assets/illustrations/exclamation-mark.png');

const Availability = ({
navigation,
}: LightningScreenProps<'Availability'>): ReactElement => {
}: TransferScreenProps<'Availability'>): ReactElement => {
const { t } = useTranslation('lightning');
const [isLoading, setIsLoading] = useState(false);
const dispatch = useAppDispatch();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { useBalance } from '../../hooks/wallet';
import { useAppSelector } from '../../hooks/redux';
import { useCurrency, useDisplayValues } from '../../hooks/displayValues';
import NumberPadWeeks from './NumberPadWeeks';
import { LightningScreenProps } from '../../navigation/types';
import { TransferScreenProps } from '../../navigation/types';
import { sleep } from '../../utils/helpers';
import {
blocktankInfoSelector,
Expand All @@ -34,7 +34,7 @@ import {
const CustomConfirm = ({
navigation,
route,
}: LightningScreenProps<'CustomConfirm'>): ReactElement => {
}: TransferScreenProps<'CustomConfirm'>): ReactElement => {
const { t } = useTranslation('lightning');
const { spendingAmount, receivingAmount } = route.params;
const [weeks, setWeeks] = useState(DEFAULT_CHANNEL_DURATION);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import NavigationHeader from '../../components/NavigationHeader';
import TransferTextField from '../../components/TransferTextField';
import Button from '../../components/buttons/Button';
import NumberPadLightning from './NumberPadLightning';
import type { LightningScreenProps } from '../../navigation/types';
import type { TransferScreenProps } from '../../navigation/types';
import { useAppSelector } from '../../hooks/redux';
import { useDisplayValues } from '../../hooks/displayValues';
import { useBalance, useSwitchUnit } from '../../hooks/wallet';
Expand Down Expand Up @@ -94,7 +94,7 @@ const PACKAGES_RECEIVING: Omit<TPackage, 'satoshis'>[] = [
const CustomSetup = ({
navigation,
route,
}: LightningScreenProps<'CustomSetup'>): ReactElement => {
}: TransferScreenProps<'CustomSetup'>): ReactElement => {
const { spending, spendingAmount = 0 } = route.params;
const { t } = useTranslation('lightning');
const switchUnit = useSwitchUnit();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import { useBalance } from '../../hooks/wallet';
import { isGeoBlockedSelector } from '../../store/reselect/user';
import { TRANSACTION_DEFAULTS } from '../../utils/wallet/constants';
import { showBottomSheet } from '../../store/utils/ui';
import type { LightningScreenProps } from '../../navigation/types';
import type { TransferScreenProps } from '../../navigation/types';

const Funding = ({
navigation,
}: LightningScreenProps<'Funding'>): ReactElement => {
}: TransferScreenProps<'Funding'>): ReactElement => {
const { t } = useTranslation('lightning');
const { onchainBalance } = useBalance();
const isGeoBlocked = useAppSelector(isGeoBlockedSelector);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { Trans, useTranslation } from 'react-i18next';

import { BodyMB, Display } from '../../styles/text';
import InfoScreen from '../../components/InfoScreen';
import type { LightningScreenProps } from '../../navigation/types';
import type { TransferScreenProps } from '../../navigation/types';

const imageSrc = require('../../assets/illustrations/exclamation-mark.png');

const Interrupted = ({
navigation,
}: LightningScreenProps<'Interrupted'>): ReactElement => {
}: TransferScreenProps<'Interrupted'>): ReactElement => {
const { t } = useTranslation('lightning');

const onContinue = (): void => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { Trans, useTranslation } from 'react-i18next';

import { Display } from '../../styles/text';
import OnboardingScreen from '../../components/OnboardingScreen';
import type { LightningScreenProps } from '../../navigation/types';
import type { TransferScreenProps } from '../../navigation/types';

const imageSrc = require('../../assets/illustrations/lightning.png');

const Introduction = ({
navigation,
}: LightningScreenProps<'Introduction'>): ReactElement => {
}: TransferScreenProps<'Introduction'>): ReactElement => {
const { t } = useTranslation('lightning');

const onContinue = (): void => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { View as ThemedView } from '../../styles/components';
import SafeAreaInset from '../../components/SafeAreaInset';
import NavigationHeader from '../../components/NavigationHeader';
import { ellipsis } from '../../utils/helpers';
import type { LightningScreenProps } from '../../navigation/types';
import type { TransferScreenProps } from '../../navigation/types';
import {
selectedNetworkSelector,
selectedWalletSelector,
Expand All @@ -20,7 +20,7 @@ import { handleLnurlChannel } from '../../utils/lnurl';
const LNURLChannel = ({
navigation,
route,
}: LightningScreenProps<'LNURLChannel'>): ReactElement => {
}: TransferScreenProps<'LNURLChannel'>): ReactElement => {
const { cParams } = route.params;
const { t } = useTranslation('other');
const selectedWallet = useAppSelector(selectedWalletSelector);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import { Trans, useTranslation } from 'react-i18next';
import { BodyMB, Display } from '../../styles/text';
import InfoScreen from '../../components/InfoScreen';
import { getRandomOkText } from '../../utils/i18n/helpers';
import type { LightningScreenProps } from '../../navigation/types';
import type { TransferScreenProps } from '../../navigation/types';

const imageSrc = require('../../assets/illustrations/switch.png');

const LNURLChannelSuccess = ({
navigation,
}: LightningScreenProps<'LNURLChannelSuccess'>): ReactElement => {
}: TransferScreenProps<'LNURLChannelSuccess'>): ReactElement => {
const { t } = useTranslation('other');

const handleAwesome = (): void => {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import PieChart from './PieChart';
import { useBalance, useSwitchUnit } from '../../hooks/wallet';
import { useAppSelector } from '../../hooks/redux';
import { useCurrentDisplayValue } from '../../hooks/displayValues';
import type { LightningScreenProps } from '../../navigation/types';
import type { TransferScreenProps } from '../../navigation/types';
import { confirmChannelPurchase } from '../../store/utils/blocktank';
import { blocktankOrdersSelector } from '../../store/reselect/blocktank';
import {
Expand All @@ -29,7 +29,7 @@ const PIE_SHIFT = 70;
const QuickConfirm = ({
navigation,
route,
}: LightningScreenProps<'QuickConfirm'>): ReactElement => {
}: TransferScreenProps<'QuickConfirm'>): ReactElement => {
const { spendingAmount, orderId, onChangeUnitOutside } = route.params;
const { onchainBalance, lightningBalance } = useBalance();
const { t } = useTranslation('lightning');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { showToast } from '../../utils/notifications';
import { convertToSats } from '../../utils/conversion';
import { getNumberPadText } from '../../utils/numberpad';
import { getFiatDisplayValues } from '../../utils/displayValues';
import type { LightningScreenProps } from '../../navigation/types';
import type { TransferScreenProps } from '../../navigation/types';
import { lnSetupSelector } from '../../store/reselect/aggregations';
import { blocktankInfoSelector } from '../../store/reselect/blocktank';
import {
Expand All @@ -46,7 +46,7 @@ import { EUnit } from '../../store/types/wallet';

const QuickSetup = ({
navigation,
}: LightningScreenProps<'QuickSetup'>): ReactElement => {
}: TransferScreenProps<'QuickSetup'>): ReactElement => {
const { t } = useTranslation('lightning');
const switchUnit = useSwitchUnit();
const { lightningBalance } = useBalance();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import ProgressSteps from '../../components/ProgressSteps';
import Button from '../../components/buttons/Button';
import { useAppSelector } from '../../hooks/redux';
import { lightningSettingUpStepSelector } from '../../store/reselect/user';
import type { LightningScreenProps } from '../../navigation/types';
import type { TransferScreenProps } from '../../navigation/types';

const SettingUp = ({
navigation,
}: LightningScreenProps<'SettingUp'>): ReactElement => {
}: TransferScreenProps<'SettingUp'>): ReactElement => {
const { t } = useTranslation('lightning');
const lightningSettingUpStep = useAppSelector(lightningSettingUpStepSelector);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { Trans, useTranslation } from 'react-i18next';
import { BodyMB, Display } from '../../styles/text';
import InfoScreen from '../../components/InfoScreen';
import { getRandomOkText } from '../../utils/i18n/helpers';
import type { LightningScreenProps } from '../../navigation/types';
import type { TransferScreenProps } from '../../navigation/types';

const imageSrc = require('../../assets/illustrations/check.png');

const Success = ({
navigation,
route,
}: LightningScreenProps<'Success'>): ReactElement => {
}: TransferScreenProps<'Success'>): ReactElement => {
const { t } = useTranslation('lightning');
const { type } = route.params;

Expand Down
Loading

0 comments on commit 8b1aff8

Please sign in to comment.