From cedad4160969ffd8230bc92e9281221280c5eb39 Mon Sep 17 00:00:00 2001 From: Jiri Zbytovsky Date: Thu, 16 Jan 2025 14:47:36 +0100 Subject: [PATCH] chore(suite-native): move SettingsSection to settings --- .../module-settings/src/components/FeaturesSettings.tsx | 7 +++---- .../module-settings/src/components/PreferencesSettings.tsx | 3 +-- .../module-settings/src/components/SupportSettings.tsx | 3 +-- .../module-settings/src/screens/SettingsAboutUsScreen.tsx | 5 ++--- suite-native/settings/package.json | 7 ++++++- .../src/components/SettingsSection.tsx | 0 .../src/components/SettingsSectionItem.tsx | 0 .../src/components/SettingsSectionItemIcon.tsx | 0 .../src/components/SettingsSectionItemText.tsx | 0 suite-native/settings/src/index.ts | 2 ++ suite-native/settings/tsconfig.json | 5 ++++- yarn.lock | 5 +++++ 12 files changed, 24 insertions(+), 13 deletions(-) rename suite-native/{module-settings => settings}/src/components/SettingsSection.tsx (100%) rename suite-native/{module-settings => settings}/src/components/SettingsSectionItem.tsx (100%) rename suite-native/{module-settings => settings}/src/components/SettingsSectionItemIcon.tsx (100%) rename suite-native/{module-settings => settings}/src/components/SettingsSectionItemText.tsx (100%) diff --git a/suite-native/module-settings/src/components/FeaturesSettings.tsx b/suite-native/module-settings/src/components/FeaturesSettings.tsx index 510ee7e4e8c..2cc301a3bbe 100644 --- a/suite-native/module-settings/src/components/FeaturesSettings.tsx +++ b/suite-native/module-settings/src/components/FeaturesSettings.tsx @@ -4,18 +4,17 @@ import { useNavigation } from '@react-navigation/core'; import { useAtomValue } from 'jotai'; import { - SettingsStackRoutes, + RootStackParamList, RootStackRoutes, + SettingsStackRoutes, StackNavigationProps, - RootStackParamList, } from '@suite-native/navigation'; import { FeatureFlag, useFeatureFlag } from '@suite-native/feature-flags'; import { Translation } from '@suite-native/intl'; import { selectHasDeviceDiscovery } from '@suite-common/wallet-core'; +import { SettingsSection, SettingsSectionItem } from '@suite-native/settings'; import { useSettingsNavigateTo } from '../navigation/useSettingsNavigateTo'; -import { SettingsSection } from './SettingsSection'; -import { SettingsSectionItem } from './SettingsSectionItem'; import { isDevButtonVisibleAtom } from './ProductionDebug'; export const FeaturesSettings = () => { diff --git a/suite-native/module-settings/src/components/PreferencesSettings.tsx b/suite-native/module-settings/src/components/PreferencesSettings.tsx index 74255554be8..533a1e18cff 100644 --- a/suite-native/module-settings/src/components/PreferencesSettings.tsx +++ b/suite-native/module-settings/src/components/PreferencesSettings.tsx @@ -1,9 +1,8 @@ import { Translation } from '@suite-native/intl'; import { SettingsStackRoutes } from '@suite-native/navigation'; +import { SettingsSection, SettingsSectionItem } from '@suite-native/settings'; import { useSettingsNavigateTo } from '../navigation/useSettingsNavigateTo'; -import { SettingsSection } from './SettingsSection'; -import { SettingsSectionItem } from './SettingsSectionItem'; export const PreferencesSettings = () => { const navigateTo = useSettingsNavigateTo(); diff --git a/suite-native/module-settings/src/components/SupportSettings.tsx b/suite-native/module-settings/src/components/SupportSettings.tsx index 70487c6d4fd..44f8d55cc46 100644 --- a/suite-native/module-settings/src/components/SupportSettings.tsx +++ b/suite-native/module-settings/src/components/SupportSettings.tsx @@ -1,10 +1,9 @@ import { SettingsStackRoutes } from '@suite-native/navigation'; import { TrezorSuiteLiteHeader } from '@suite-native/atoms'; import { Translation } from '@suite-native/intl'; +import { SettingsSection, SettingsSectionItem } from '@suite-native/settings'; import { useSettingsNavigateTo } from '../navigation/useSettingsNavigateTo'; -import { SettingsSection } from './SettingsSection'; -import { SettingsSectionItem } from './SettingsSectionItem'; export const SupportSettings = () => { const navigateTo = useSettingsNavigateTo(); diff --git a/suite-native/module-settings/src/screens/SettingsAboutUsScreen.tsx b/suite-native/module-settings/src/screens/SettingsAboutUsScreen.tsx index ac6c113cdf3..fa8c83e8183 100644 --- a/suite-native/module-settings/src/screens/SettingsAboutUsScreen.tsx +++ b/suite-native/module-settings/src/screens/SettingsAboutUsScreen.tsx @@ -1,11 +1,10 @@ import { Screen, ScreenHeader } from '@suite-native/navigation'; -import { VStack, Divider } from '@suite-native/atoms'; +import { Divider, VStack } from '@suite-native/atoms'; import { useOpenLink } from '@suite-native/link'; import { useTranslate } from '@suite-native/intl'; +import { SettingsSection, SettingsSectionItem } from '@suite-native/settings'; import { AboutUsBanners } from '../components/AboutUsBanners'; -import { SettingsSection } from '../components/SettingsSection'; -import { SettingsSectionItem } from '../components/SettingsSectionItem'; import { AppVersion } from '../components/AppVersion'; export const SettingsAboutUsScreen = () => { diff --git a/suite-native/settings/package.json b/suite-native/settings/package.json index 63b1de2a0ab..8066c365fa3 100644 --- a/suite-native/settings/package.json +++ b/suite-native/settings/package.json @@ -13,6 +13,11 @@ "@reduxjs/toolkit": "1.9.5", "@suite-common/suite-config": "workspace:*", "@suite-common/wallet-config": "workspace:*", - "@trezor/connect": "workspace:*" + "@suite-native/atoms": "workspace:*", + "@suite-native/icons": "workspace:*", + "@trezor/connect": "workspace:*", + "@trezor/styles": "workspace:*", + "react": "18.2.0", + "react-native": "0.76.1" } } diff --git a/suite-native/module-settings/src/components/SettingsSection.tsx b/suite-native/settings/src/components/SettingsSection.tsx similarity index 100% rename from suite-native/module-settings/src/components/SettingsSection.tsx rename to suite-native/settings/src/components/SettingsSection.tsx diff --git a/suite-native/module-settings/src/components/SettingsSectionItem.tsx b/suite-native/settings/src/components/SettingsSectionItem.tsx similarity index 100% rename from suite-native/module-settings/src/components/SettingsSectionItem.tsx rename to suite-native/settings/src/components/SettingsSectionItem.tsx diff --git a/suite-native/module-settings/src/components/SettingsSectionItemIcon.tsx b/suite-native/settings/src/components/SettingsSectionItemIcon.tsx similarity index 100% rename from suite-native/module-settings/src/components/SettingsSectionItemIcon.tsx rename to suite-native/settings/src/components/SettingsSectionItemIcon.tsx diff --git a/suite-native/module-settings/src/components/SettingsSectionItemText.tsx b/suite-native/settings/src/components/SettingsSectionItemText.tsx similarity index 100% rename from suite-native/module-settings/src/components/SettingsSectionItemText.tsx rename to suite-native/settings/src/components/SettingsSectionItemText.tsx diff --git a/suite-native/settings/src/index.ts b/suite-native/settings/src/index.ts index f6c8f4f1e69..32b8e7d31e5 100644 --- a/suite-native/settings/src/index.ts +++ b/suite-native/settings/src/index.ts @@ -1 +1,3 @@ export * from './settingsSlice'; +export * from './components/SettingsSection'; +export * from './components/SettingsSectionItem'; diff --git a/suite-native/settings/tsconfig.json b/suite-native/settings/tsconfig.json index 0e1f579b9b5..f17d83678fb 100644 --- a/suite-native/settings/tsconfig.json +++ b/suite-native/settings/tsconfig.json @@ -8,6 +8,9 @@ { "path": "../../suite-common/wallet-config" }, - { "path": "../../packages/connect" } + { "path": "../atoms" }, + { "path": "../icons" }, + { "path": "../../packages/connect" }, + { "path": "../../packages/styles" } ] } diff --git a/yarn.lock b/yarn.lock index 7906ab6416e..976fa863cfa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11076,7 +11076,12 @@ __metadata: "@reduxjs/toolkit": "npm:1.9.5" "@suite-common/suite-config": "workspace:*" "@suite-common/wallet-config": "workspace:*" + "@suite-native/atoms": "workspace:*" + "@suite-native/icons": "workspace:*" "@trezor/connect": "workspace:*" + "@trezor/styles": "workspace:*" + react: "npm:18.2.0" + react-native: "npm:0.76.1" languageName: unknown linkType: soft