Skip to content

Commit

Permalink
feat(suite-native): old onboarding module renamed to module-onboardin…
Browse files Browse the repository at this point in the history
…g-legacy
  • Loading branch information
PeKne committed Jan 14, 2025
1 parent 60d0eed commit 72a0ffc
Show file tree
Hide file tree
Showing 28 changed files with 194 additions and 67 deletions.
1 change: 1 addition & 0 deletions suite-native/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"@suite-native/module-device-settings": "workspace:*",
"@suite-native/module-home": "workspace:*",
"@suite-native/module-onboarding": "workspace:*",
"@suite-native/module-onboarding-legacy": "workspace:*",
"@suite-native/module-send": "workspace:*",
"@suite-native/module-settings": "workspace:*",
"@suite-native/module-staking-management": "workspace:*",
Expand Down
7 changes: 6 additions & 1 deletion suite-native/app/src/navigation/RootStackNavigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
import { selectIsOnboardingFinished } from '@suite-native/settings';
import { DevUtilsStackNavigator } from '@suite-native/module-dev-utils';
import { TransactionDetailScreen } from '@suite-native/transactions';
import { OnboardingStackNavigator as LegacyOnboardingStackNavigator } from '@suite-native/module-onboarding-legacy';
import { OnboardingStackNavigator } from '@suite-native/module-onboarding';
import { ReceiveModalScreen } from '@suite-native/receive';
import { AuthorizeDeviceStackNavigator } from '@suite-native/module-authorize-device';
Expand Down Expand Up @@ -44,14 +45,18 @@ export const RootStackNavigator = () => {
return RootStackRoutes.AppTabs;
}

return RootStackRoutes.Onboarding;
return RootStackRoutes.LegacyOnboarding;
};

return (
<RootStack.Navigator
initialRouteName={getInitialRouteName()}
screenOptions={stackNavigationOptionsConfig}
>
<RootStack.Screen
name={RootStackRoutes.LegacyOnboarding}
component={LegacyOnboardingStackNavigator}
/>
<RootStack.Screen
name={RootStackRoutes.Onboarding}
component={OnboardingStackNavigator}
Expand Down
158 changes: 119 additions & 39 deletions suite-native/app/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": { "outDir": "./libDev" },
"compilerOptions": {
"outDir": "./libDev"
},
"references": [
{
"path": "../../suite-common/analytics"
Expand Down Expand Up @@ -29,51 +31,126 @@
{
"path": "../../suite-common/wallet-types"
},
{ "path": "../accounts" },
{ "path": "../alerts" },
{ "path": "../analytics" },
{ "path": "../atoms" },
{ "path": "../biometrics" },
{ "path": "../coin-enabling" },
{ "path": "../config" },
{ "path": "../connection-status" },
{ "path": "../device" },
{ "path": "../device-authorization" },
{ "path": "../discovery" },
{ "path": "../icons" },
{ "path": "../intl" },
{ "path": "../message-system" },
{ "path": "../module-accounts-import" },
{
"path": "../accounts"
},
{
"path": "../alerts"
},
{
"path": "../analytics"
},
{
"path": "../atoms"
},
{
"path": "../biometrics"
},
{
"path": "../coin-enabling"
},
{
"path": "../config"
},
{
"path": "../connection-status"
},
{
"path": "../device"
},
{
"path": "../device-authorization"
},
{
"path": "../discovery"
},
{
"path": "../icons"
},
{
"path": "../intl"
},
{
"path": "../message-system"
},
{
"path": "../module-accounts-import"
},
{
"path": "../module-accounts-management"
},
{ "path": "../module-add-accounts" },
{ "path": "../module-authorize-device" },
{ "path": "../module-connect-popup" },
{ "path": "../module-dev-utils" },
{ "path": "../module-device-settings" },
{ "path": "../module-home" },
{ "path": "../module-onboarding" },
{ "path": "../module-send" },
{ "path": "../module-settings" },
{
"path": "../module-add-accounts"
},
{
"path": "../module-authorize-device"
},
{
"path": "../module-connect-popup"
},
{
"path": "../module-dev-utils"
},
{
"path": "../module-device-settings"
},
{
"path": "../module-home"
},
{
"path": "../module-onboarding"
},
{
"path": "../module-onboarding-legacy"
},
{
"path": "../module-send"
},
{
"path": "../module-settings"
},
{
"path": "../module-staking-management"
},
{ "path": "../navigation" },
{ "path": "../notifications" },
{ "path": "../receive" },
{ "path": "../settings" },
{ "path": "../state" },
{ "path": "../storage" },
{ "path": "../theme" },
{ "path": "../toasts" },
{ "path": "../transactions" },
{ "path": "../../packages/connect" },
{
"path": "../navigation"
},
{
"path": "../notifications"
},
{
"path": "../receive"
},
{
"path": "../settings"
},
{
"path": "../state"
},
{
"path": "../storage"
},
{
"path": "../theme"
},
{
"path": "../toasts"
},
{
"path": "../transactions"
},
{
"path": "../../packages/connect"
},
{
"path": "../../packages/react-native-usb"
},
{ "path": "../../packages/styles" },
{ "path": "../../packages/theme" },
{
"path": "../../packages/styles"
},
{
"path": "../../packages/theme"
},
{
"path": "../../packages/trezor-user-env-link"
},
Expand All @@ -84,5 +161,8 @@
"path": "../../packages/connect-mobile"
}
],
"include": [".", "**.json"]
}
"include": [
".",
"**.json"
]
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@suite-native/module-onboarding",
"name": "@suite-native/module-onboarding-legacy",
"version": "1.0.0",
"private": true,
"license": "See LICENSE.md in repo root",
Expand Down
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { createNativeStackNavigator } from '@react-navigation/native-stack';

import {
OnboardingStackParamList,
OnboardingStackRoutes,
LegacyOnboardingStackRoutes,
LegacyOnboardingStackParamList,
stackNavigationOptionsConfig,
} from '@suite-native/navigation';

Expand All @@ -12,28 +12,31 @@ import { FeatureReceiveScreen } from '../screens/FeatureReceiveScreen';
import { AnalyticsConsentScreen } from '../screens/AnalyticsConsentScreen';
import { ConnectTrezorScreen } from '../screens/ConnectTrezorScreen';

export const OnboardingStack = createNativeStackNavigator<OnboardingStackParamList>();
export const OnboardingStack = createNativeStackNavigator<LegacyOnboardingStackParamList>();

export const OnboardingStackNavigator = () => (
<OnboardingStack.Navigator
initialRouteName={OnboardingStackRoutes.Welcome}
initialRouteName={LegacyOnboardingStackRoutes.Welcome}
screenOptions={stackNavigationOptionsConfig}
>
<OnboardingStack.Screen name={OnboardingStackRoutes.Welcome} component={WelcomeScreen} />
<OnboardingStack.Screen
name={OnboardingStackRoutes.TrackBalances}
name={LegacyOnboardingStackRoutes.Welcome}
component={WelcomeScreen}
/>
<OnboardingStack.Screen
name={LegacyOnboardingStackRoutes.TrackBalances}
component={TrackBalancesScreen}
/>
<OnboardingStack.Screen
name={OnboardingStackRoutes.AboutReceiveCoinsFeature}
name={LegacyOnboardingStackRoutes.AboutReceiveCoinsFeature}
component={FeatureReceiveScreen}
/>
<OnboardingStack.Screen
name={OnboardingStackRoutes.ConnectTrezor}
name={LegacyOnboardingStackRoutes.ConnectTrezor}
component={ConnectTrezorScreen}
/>
<OnboardingStack.Screen
name={OnboardingStackRoutes.AnalyticsConsent}
name={LegacyOnboardingStackRoutes.AnalyticsConsent}
component={AnalyticsConsentScreen}
/>
</OnboardingStack.Navigator>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { CommonActions } from '@react-navigation/core';
import { setIsOnboardingFinished } from '@suite-native/settings';
import {
HomeStackRoutes,
OnboardingStackParamList,
OnboardingStackRoutes,
LegacyOnboardingStackParamList as OnboardingStackParamList,
LegacyOnboardingStackRoutes as OnboardingStackRoutes,
RootStackParamList,
RootStackRoutes,
Screen,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { Dimensions } from 'react-native';
import { useNavigation } from '@react-navigation/native';

import {
OnboardingStackParamList,
OnboardingStackRoutes,
LegacyOnboardingStackParamList as OnboardingStackParamList,
LegacyOnboardingStackRoutes as OnboardingStackRoutes,
StackNavigationProps,
} from '@suite-native/navigation';
import { Translation } from '@suite-native/intl';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { useNavigation } from '@react-navigation/native';

import { FeatureFlag, useFeatureFlag } from '@suite-native/feature-flags';
import {
OnboardingStackParamList,
OnboardingStackRoutes,
LegacyOnboardingStackParamList as OnboardingStackParamList,
LegacyOnboardingStackRoutes as OnboardingStackRoutes,
StackNavigationProps,
} from '@suite-native/navigation';
import { Box } from '@suite-native/atoms';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { useNavigation } from '@react-navigation/native';

import { FeatureFlag, useFeatureFlag } from '@suite-native/feature-flags';
import {
OnboardingStackParamList,
OnboardingStackRoutes,
LegacyOnboardingStackParamList as OnboardingStackParamList,
LegacyOnboardingStackRoutes as OnboardingStackRoutes,
StackNavigationProps,
} from '@suite-native/navigation';
import { Box } from '@suite-native/atoms';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { FeatureFlag, useFeatureFlag } from '@suite-native/feature-flags';
import { Link } from '@suite-native/link';
import { Box, Text, TrezorSuiteLiteHeader } from '@suite-native/atoms';
import {
OnboardingStackParamList,
OnboardingStackRoutes,
LegacyOnboardingStackParamList as OnboardingStackParamList,
LegacyOnboardingStackRoutes as OnboardingStackRoutes,
StackNavigationProps,
} from '@suite-native/navigation';
import { Translation } from '@suite-native/intl';
Expand Down Expand Up @@ -67,7 +67,7 @@ export const WelcomeScreen = () => {
</Box>
</Box>
<Text color="textSubdued" textAlign="center">
<Translation id="moduleOnboarding.welcomeScreen.subtitle" />
<Translation id="moduleOnboarding.welcomeScreen.subtitleLegacy" />
</Text>
</Box>
<Box flex={1} style={applyStyle(trezorLinkStyle)}>
Expand Down
16 changes: 11 additions & 5 deletions suite-native/navigation/src/navigators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
DeviceStackRoutes,
DevUtilsStackRoutes,
HomeStackRoutes,
LegacyOnboardingStackRoutes,
OnboardingStackRoutes,
ReceiveStackRoutes,
RootStackRoutes,
Expand Down Expand Up @@ -103,12 +104,16 @@ export type AppTabsParamList = {
[AppTabsRoutes.Settings]: undefined;
};

export type LegacyOnboardingStackParamList = {
[LegacyOnboardingStackRoutes.Welcome]: undefined;
[LegacyOnboardingStackRoutes.AboutReceiveCoinsFeature]: undefined;
[LegacyOnboardingStackRoutes.TrackBalances]: undefined;
[LegacyOnboardingStackRoutes.AnalyticsConsent]: undefined;
[LegacyOnboardingStackRoutes.ConnectTrezor]: undefined;
};

export type OnboardingStackParamList = {
[OnboardingStackRoutes.Welcome]: undefined;
[OnboardingStackRoutes.AboutReceiveCoinsFeature]: undefined;
[OnboardingStackRoutes.TrackBalances]: undefined;
[OnboardingStackRoutes.AnalyticsConsent]: undefined;
[OnboardingStackRoutes.ConnectTrezor]: undefined;
};

export type AccountsImportStackParamList = {
Expand Down Expand Up @@ -190,7 +195,8 @@ export type AuthorizeDeviceStackParamList = {

export type RootStackParamList = {
[RootStackRoutes.AppTabs]: NavigatorScreenParams<AppTabsParamList>;
[RootStackRoutes.Onboarding]: NavigatorScreenParams<AppTabsParamList>;
[RootStackRoutes.LegacyOnboarding]: NavigatorScreenParams<LegacyOnboardingStackParamList>;
[RootStackRoutes.Onboarding]: NavigatorScreenParams<OnboardingStackParamList>;
[RootStackRoutes.AuthorizeDeviceStack]: NavigatorScreenParams<AuthorizeDeviceStackParamList>;
[RootStackRoutes.AccountsImport]: NavigatorScreenParams<AccountsImportStackParamList>;
[RootStackRoutes.ReceiveModal]: AccountDetailParams;
Expand Down
Loading

0 comments on commit 72a0ffc

Please sign in to comment.