diff --git a/babel.config.js b/babel.config.js index 8408012a5..8029e1c0f 100644 --- a/babel.config.js +++ b/babel.config.js @@ -20,16 +20,14 @@ const baseConfig = { '@helium/crypto': './node_modules/@helium/crypto-react-native', '@assets': './src/assets', '@components': './src/components', - '@constants': './src/constants', '@hooks': './src/hooks', - '@theme': './src/theme', '@utils': './src/utils', - '@storage': './src/storage', + '@config': './src/config', '@types': './src/types', '@features': './src/features', - '@services': './src/services', + '@services': './src/app/services', '@store': './src/store', - '@/solana': './src/solana', + '@app': './src/app', }, extensions: ['.ios.js', '.android.js', '.js', '.ts', '.tsx', '.json'], root: ['./src'], diff --git a/index.js b/index.js index 172ef565a..0807a1438 100644 --- a/index.js +++ b/index.js @@ -8,12 +8,12 @@ import 'react-native-url-polyfill/auto' import { Provider as ReduxProvider } from 'react-redux' import { PersistGate } from 'redux-persist/integration/react' import { name as appName } from './app.json' -import App from './src/App' +import App from './src/app/App' import { GlobalError } from './src/components/GlobalError' -import AccountStorageProvider from './src/storage/AccountStorageProvider' -import AppStorageProvider from './src/storage/AppStorageProvider' -import LanguageProvider from './src/storage/LanguageProvider' -import NotificationStorageProvider from './src/storage/NotificationStorageProvider' +import AccountStorageProvider from './src/config/storage/AccountStorageProvider' +import AppStorageProvider from './src/config/storage/AppStorageProvider' +import LanguageProvider from './src/config/storage/LanguageProvider' +import NotificationStorageProvider from './src/config/storage/NotificationStorageProvider' import { persistor } from './src/store/persistence' import store from './src/store/store' import './src/utils/i18n' diff --git a/project-structure.md b/project-structure.md new file mode 100644 index 000000000..be789f711 --- /dev/null +++ b/project-structure.md @@ -0,0 +1,69 @@ +# 🗄️ Project Structure + +Most of the code lives in the `src` folder and looks something like this: + +```sh +src +| ++-- app # application layer containing: +| | # this folder might differ based on the meta framework used +| +-- services # application services. The super app top level navigation is defined as a set of services +| +-- RootNavigator.tsx # Main navigator for the app that determines the initial route. Either app onboarding UI or the top level service navigator +| +-- App.tsx # main application component ++-- assets # assets folder can contain all the static files such as images, fonts, etc. +| ++-- components # shared components used across the entire application +| ++-- config # global configurations, exported env variables etc. +| ++-- features # feature based modules +| ++-- hooks # shared hooks used across the entire application +| ++-- lib # reusable libraries preconfigured for the application +| ++-- stores # global state stores +| ++-- testing # test utilities and mocks +| ++-- types # shared types used across the application +| ++-- utils # shared utility functions +``` + +A service could have the following structure: + +```sh +src/services/srcful +| ++-- pages # pages scoped to a specific service +| ++-- index.tsx # service entry point +``` + +For easy scalability and maintenance, organize most of the code within the features folder. Each feature folder should contain code specific to that feature, keeping things neatly separated. This approach helps prevent mixing feature-related code with shared components, making it simpler to manage and maintain the codebase compared to having many files in a flat folder structure. By adopting this method, you can enhance collaboration, readability, and scalability in the application's architecture. + +A feature could have the following structure: + +```sh +src/features/awesome-feature +| ++-- api # exported API request declarations and api hooks related to a specific feature +| ++-- assets # assets folder can contain all the static files for a specific feature +| ++-- components # components scoped to a specific feature +| ++-- hooks # hooks scoped to a specific feature +| ++-- stores # state stores for a specific feature +| ++-- types # typescript types used within the feature +| ++-- utils # utility functions for a specific feature +``` + +NOTE: You don't need all of these folders for every feature. Only include the ones that are necessary for the feature. + +By following these practices, you can ensure that your codebase is well-organized, scalable, and maintainable. This will help you and your team to work more efficiently and effectively on the project. +This approach can also make it easier to apply similar architecture to apps built with Next.js, Remix or React Native. diff --git a/src/App.tsx b/src/app/App.tsx similarity index 83% rename from src/App.tsx rename to src/app/App.tsx index b7208fc88..5e3bd0983 100644 --- a/src/App.tsx +++ b/src/app/App.tsx @@ -4,11 +4,11 @@ import { PortalProvider } from '@gorhom/portal' import { OnboardingProvider as HotspotOnboardingProvider } from '@helium/react-native-sdk' import { DarkTheme, NavigationContainer } from '@react-navigation/native' import { ThemeProvider } from '@shopify/restyle' -import { ModalProvider } from '@storage/ModalsProvider' -import TokensProvider from '@storage/TokensProvider' +import { ModalProvider } from '@config/storage/ModalsProvider' +import TokensProvider from '@config/storage/TokensProvider' import { QueryClient, QueryClientProvider } from '@tanstack/react-query' -import globalStyles from '@theme/globalStyles' -import { darkTheme } from '@theme/theme' +import globalStyles from '@config/theme/globalStyles' +import { darkTheme } from '@config/theme/theme' import * as SplashLib from 'expo-splash-screen' import React, { useMemo } from 'react' import Mapbox from '@rnmapbox/maps' @@ -19,24 +19,24 @@ import { GestureHandlerRootView } from 'react-native-gesture-handler' import { OneSignal } from 'react-native-onesignal' import { SafeAreaProvider } from 'react-native-safe-area-context' import 'text-encoding-polyfill' -import SplashScreen from './components/SplashScreen' -import WalletConnectProvider from './features/dappLogin/WalletConnectProvider' -import LockScreen from './features/lock/LockScreen' -import InsufficientSolConversionModal from './features/modals/InsufficientSolConversionModal' -import WalletOnboardingProvider from './features/onboarding/OnboardingProvider' -import SecurityScreen from './features/security/SecurityScreen' -import useMount from './hooks/useMount' -import { navigationRef } from './navigation/NavigationHelper' -import RootNavigator from './navigation/RootNavigator' -import './polyfill' -import SolanaProvider from './solana/SolanaProvider' -import WalletSignProvider from './solana/WalletSignProvider' -import { useAccountStorage } from './storage/AccountStorageProvider' -import { GovernanceProvider } from './storage/GovernanceProvider' -import { useNotificationStorage } from './storage/NotificationStorageProvider' -import { BalanceProvider } from './utils/Balance' -import { useDeepLinking } from './utils/linking' -import KeystoneOnboardingProvider from './features/keystone/KeystoneOnboardingProvider' +import SolanaProvider from '@features/solana/SolanaProvider' +import WalletSignProvider from '@features/solana/WalletSignProvider' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' +import { GovernanceProvider } from '@config/storage/GovernanceProvider' +import { useNotificationStorage } from '@config/storage/NotificationStorageProvider' +import { BalanceProvider } from '@utils/Balance' +import { useDeepLinking } from '@utils/linking' +import KeystoneOnboardingProvider from '@features/keystone/KeystoneOnboardingProvider' +import SplashScreen from '../components/SplashScreen' +import WalletConnectProvider from '../features/dappLogin/WalletConnectProvider' +import LockScreen from '../features/lock/LockScreen' +import InsufficientSolConversionModal from '../features/modals/InsufficientSolConversionModal' +import WalletOnboardingProvider from '../features/onboarding/OnboardingProvider' +import SecurityScreen from '../features/security/SecurityScreen' +import useMount from '../hooks/useMount' +import { navigationRef } from './NavigationHelper' +import RootNavigator from './RootNavigator' +import '../polyfill' SplashLib.preventAutoHideAsync().catch(() => { /* reloading the app might trigger some race conditions, ignore them */ diff --git a/src/navigation/NavigationHelper.ts b/src/app/NavigationHelper.ts similarity index 84% rename from src/navigation/NavigationHelper.ts rename to src/app/NavigationHelper.ts index 65783beb2..e887d1886 100644 --- a/src/navigation/NavigationHelper.ts +++ b/src/app/NavigationHelper.ts @@ -1,5 +1,5 @@ import { createNavigationContainerRef } from '@react-navigation/native' -import { AccountsServiceStackParamList } from '@services/AccountsService' +import { AccountsServiceStackParamList } from 'src/app/services/AccountsService' import { RootStackParamList } from './rootTypes' export const navigationRef = createNavigationContainerRef() diff --git a/src/navigation/RootNavigator.tsx b/src/app/RootNavigator.tsx similarity index 77% rename from src/navigation/RootNavigator.tsx rename to src/app/RootNavigator.tsx index f9cbeecd1..1535cdc85 100644 --- a/src/navigation/RootNavigator.tsx +++ b/src/app/RootNavigator.tsx @@ -2,19 +2,19 @@ import { StackNavigationOptions, createStackNavigator, } from '@react-navigation/stack' -import { useColors } from '@theme/themeHooks' +import { useColors } from '@config/theme/themeHooks' import React, { memo, useEffect, useMemo } from 'react' import changeNavigationBarColor from 'react-native-navigation-bar-color' import ServiceSheetNavigator from '@services/ServiceSheetNavigator' -import { useAccountStorage } from '@storage/AccountStorageProvider' -import ScanQrCodeScreen from '../features/keystone/ScanQrCodeScreen' -import SelectKeystoneAccountsScreen from '../features/keystone/SelectKeystoneAccountsScreen' -import DappLoginScreen from '../features/dappLogin/DappLoginScreen' -import OnboardingNavigator from '../features/onboarding/OnboardingNavigator' -import ImportPrivateKey from '../features/onboarding/import/ImportPrivateKey' -import PaymentScreen from '../features/payment/PaymentScreen' -import LinkWallet from '../features/txnDelegation/LinkWallet' -import SignHotspot from '../features/txnDelegation/SignHotspot' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' +import ScanQrCodeScreen from '@features/keystone/ScanQrCodeScreen' +import SelectKeystoneAccountsScreen from '@features/keystone/SelectKeystoneAccountsScreen' +import DappLoginScreen from '@features/dappLogin/DappLoginScreen' +import OnboardingNavigator from '@features/onboarding/OnboardingNavigator' +import ImportPrivateKey from '@features/onboarding/import/ImportPrivateKey' +import PaymentScreen from '@features/payment/PaymentScreen' +import LinkWallet from '@features/txnDelegation/LinkWallet' +import SignHotspot from '@features/txnDelegation/SignHotspot' import { RootStackParamList } from './rootTypes' const screenOptions = { headerShown: false } as StackNavigationOptions diff --git a/src/navigation/rootTypes.ts b/src/app/rootTypes.ts similarity index 93% rename from src/navigation/rootTypes.ts rename to src/app/rootTypes.ts index f74bac82f..95b145444 100644 --- a/src/navigation/rootTypes.ts +++ b/src/app/rootTypes.ts @@ -1,7 +1,7 @@ import { LinkWalletRequest, SignHotspotRequest } from '@helium/wallet-link' import { StackNavigationProp } from '@react-navigation/stack' import { KeystoneAccountType } from 'src/features/keystone/SelectKeystoneAccountsScreen' -import { PaymentRouteParam } from '@services/WalletService' +import { PaymentRouteParam } from 'src/app/services/WalletService' export type RootStackParamList = { OnboardingNavigator: undefined diff --git a/src/services/AccountsService/accountServiceTypes.ts b/src/app/services/AccountsService/accountServiceTypes.ts similarity index 100% rename from src/services/AccountsService/accountServiceTypes.ts rename to src/app/services/AccountsService/accountServiceTypes.ts diff --git a/src/services/AccountsService/index.tsx b/src/app/services/AccountsService/index.tsx similarity index 97% rename from src/services/AccountsService/index.tsx rename to src/app/services/AccountsService/index.tsx index 866a6f30a..b2aea7e1d 100644 --- a/src/services/AccountsService/index.tsx +++ b/src/app/services/AccountsService/index.tsx @@ -4,7 +4,7 @@ import { StackNavigationProp, createStackNavigator, } from '@react-navigation/stack' -import { useColors } from '@theme/themeHooks' +import { useColors } from '@config/theme/themeHooks' import AddNewAccountNavigator from '@features/home/addNewAccount/AddNewAccountNavigator' import AccountAssignScreen from '@features/onboarding/AccountAssignScreen' import { RouteAccount } from '@features/onboarding/create/createAccountNavTypes' diff --git a/src/services/AccountsService/pages/YourWalletsPage.tsx b/src/app/services/AccountsService/pages/YourWalletsPage.tsx similarity index 96% rename from src/services/AccountsService/pages/YourWalletsPage.tsx rename to src/app/services/AccountsService/pages/YourWalletsPage.tsx index d2cbf8e3e..395af534b 100644 --- a/src/services/AccountsService/pages/YourWalletsPage.tsx +++ b/src/app/services/AccountsService/pages/YourWalletsPage.tsx @@ -5,30 +5,30 @@ import { ReAnimatedBox } from '@components/AnimatedBox' import { FadeIn } from 'react-native-reanimated' import Box from '@components/Box' import { Image, SectionList } from 'react-native' -import { useAccountStorage } from '@storage/AccountStorageProvider' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' import { NetTypes } from '@helium/address' -import { CSAccount } from '@storage/cloudStorage' +import { CSAccount } from '@config/storage/cloudStorage' import TouchableContainer from '@components/TouchableContainer' import AccountIcon from '@components/AccountIcon' import { ellipsizeAddress } from '@utils/accountUtils' -import { useColors, useSpacing } from '@theme/themeHooks' -import SmallAdd from '@assets/images/smallAdd.svg' -import BigAdd from '@assets/images/bigAdd.svg' -import Checkmark from '@assets/images/checkmark.svg' +import { useColors, useSpacing } from '@config/theme/themeHooks' +import SmallAdd from '@assets/svgs/smallAdd.svg' +import BigAdd from '@assets/svgs/bigAdd.svg' +import Checkmark from '@assets/svgs/checkmark.svg' import { useNavigation } from '@react-navigation/native' import { HELIUM_DERIVATION, keypairFromSeed, solanaDerivation, } from '@hooks/useDerivationAccounts' -import { getSecureAccount } from '@storage/secureStorage' +import { getSecureAccount } from '@config/storage/secureStorage' import * as bip39 from 'bip39' import { useOnboarding } from '@features/onboarding/OnboardingProvider' import Toast from 'react-native-simple-toast' import { useSafeAreaInsets } from 'react-native-safe-area-context' import TouchableOpacityBox from '@components/TouchableOpacityBox' import useLayoutHeight from '@hooks/useLayoutHeight' -import { ServiceSheetNavigationProp } from '@services/serviceSheetTypes' +import { ServiceSheetNavigationProp } from 'src/app/services/serviceSheetTypes' import CircleLoader from '@components/CircleLoader' import ScrollBox from '@components/ScrollBox' import { AccountsServiceNavigationProp } from '../accountServiceTypes' diff --git a/src/services/BrowserService/index.tsx b/src/app/services/BrowserService/index.tsx similarity index 100% rename from src/services/BrowserService/index.tsx rename to src/app/services/BrowserService/index.tsx diff --git a/src/services/GovernanceService/index.tsx b/src/app/services/GovernanceService/index.tsx similarity index 100% rename from src/services/GovernanceService/index.tsx rename to src/app/services/GovernanceService/index.tsx diff --git a/src/services/HotspotService/index.tsx b/src/app/services/HotspotService/index.tsx similarity index 72% rename from src/services/HotspotService/index.tsx rename to src/app/services/HotspotService/index.tsx index 99a3a1d99..502959672 100644 --- a/src/services/HotspotService/index.tsx +++ b/src/app/services/HotspotService/index.tsx @@ -1,19 +1,19 @@ import React, { useMemo } from 'react' -import Hotspot from '@assets/images/hotspot.svg' -import Map from '@assets/images/map.svg' -import Add from '@assets/images/add.svg' -import Coin from '@assets/images/coin.svg' +import Hotspot from '@assets/svgs/hotspot.svg' +import Map from '@assets/svgs/map.svg' +import Add from '@assets/svgs/add.svg' +import Coin from '@assets/svgs/coin.svg' import ServiceSheetPage, { ServiceNavBarOption, } from '@components/ServiceSheetPage' import { StackNavigationProp } from '@react-navigation/stack' import { PortalHost } from '@gorhom/portal' import Box from '@components/Box' -import { HotspotWithPendingRewards } from '../../types/solana' -import HotspotPage from './HotspotPage' -import ExplorerPage from './ExplorerPage' -import AddHotspotPage from './AddHotspotPage' -import ClaimTokensPage from './ClaimTokensPage' +import { HotspotWithPendingRewards } from '../../../types/solana' +import HotspotPage from './pages/HotspotPage' +import ExplorerPage from './pages/ExplorerPage' +import AddHotspotPage from './pages/AddHotspotPage' +import ClaimTokensPage from './pages/ClaimTokensPage' export type HotspotServiceStackParamList = { Hotspot: { diff --git a/src/services/HotspotService/AddHotspotPage/index.tsx b/src/app/services/HotspotService/pages/AddHotspotPage.tsx similarity index 89% rename from src/services/HotspotService/AddHotspotPage/index.tsx rename to src/app/services/HotspotService/pages/AddHotspotPage.tsx index c23306a4e..3a3237a42 100644 --- a/src/services/HotspotService/AddHotspotPage/index.tsx +++ b/src/app/services/HotspotService/pages/AddHotspotPage.tsx @@ -4,13 +4,16 @@ import Text from '@components/Text' import React, { useCallback, useMemo, useRef } from 'react' import { useTranslation } from 'react-i18next' import { Image } from 'react-native' -import Add from '@assets/images/add.svg' -import { useColors, useSpacing } from '@theme/themeHooks' -import RightArrow from '@assets/images/rightArrow.svg' +import Add from '@assets/svgs/add.svg' +import { useColors, useSpacing } from '@config/theme/themeHooks' +import RightArrow from '@assets/svgs/rightArrow.svg' import ScrollBox from '@components/ScrollBox' import { NavBarHeight } from '@components/ServiceNavBar' import { useSafeAreaInsets } from 'react-native-safe-area-context' -import OnboardingSheet, { OnboardingSheetRef } from './OnboardingSheet' +import { + OnboardingSheetWrapper, + OnboardingSheetRef, +} from '@features/hotspot-onboarding/OnboardingSheet' const AddHotspotPage = () => { const { t } = useTranslation() @@ -95,7 +98,7 @@ const AddHotspotPage = () => { - + ) } diff --git a/src/services/HotspotService/ClaimTokensPage/index.tsx b/src/app/services/HotspotService/pages/ClaimTokensPage.tsx similarity index 96% rename from src/services/HotspotService/ClaimTokensPage/index.tsx rename to src/app/services/HotspotService/pages/ClaimTokensPage.tsx index 09cdfe1ec..d8d346402 100644 --- a/src/services/HotspotService/ClaimTokensPage/index.tsx +++ b/src/app/services/HotspotService/pages/ClaimTokensPage.tsx @@ -2,12 +2,12 @@ import Box from '@components/Box' import ButtonPressable from '@components/ButtonPressable' import ScrollBox from '@components/ScrollBox' import Text from '@components/Text' -import { useColors, useSpacing } from '@theme/themeHooks' +import { useColors, useSpacing } from '@config/theme/themeHooks' import React, { useCallback, useMemo } from 'react' import { useTranslation } from 'react-i18next' import { Image, RefreshControl } from 'react-native' -import MobileIcon from '@assets/images/mobileIconNew.svg' -import IotIcon from '@assets/images/iotIconNew.svg' +import MobileIcon from '@assets/svgs/mobileIconNew.svg' +import IotIcon from '@assets/svgs/iotIconNew.svg' import TouchableContainer from '@components/TouchableContainer' import BalanceText from '@components/BalanceText' import useHotspots from '@hooks/useHotspots' @@ -22,7 +22,7 @@ import { useBN } from '@hooks/useBN' import { useSolOwnedAmount } from '@helium/helium-react-hooks' import { useCurrentWallet } from '@hooks/useCurrentWallet' import { BN } from 'bn.js' -import { useModal } from '@storage/ModalsProvider' +import { useModal } from '@config/storage/ModalsProvider' import ProgressBar from '@components/ProgressBar' import { ReAnimatedBox } from '@components/AnimatedBox' import { FadeIn, FadeOut } from 'react-native-reanimated' diff --git a/src/services/HotspotService/ExplorerPage/index.tsx b/src/app/services/HotspotService/pages/ExplorerPage.tsx similarity index 96% rename from src/services/HotspotService/ExplorerPage/index.tsx rename to src/app/services/HotspotService/pages/ExplorerPage.tsx index 8723001d4..2e701c14b 100644 --- a/src/services/HotspotService/ExplorerPage/index.tsx +++ b/src/app/services/HotspotService/pages/ExplorerPage.tsx @@ -10,8 +10,8 @@ import { UserLocation, } from '@rnmapbox/maps' import React, { useCallback, useState } from 'react' -import TotalHotspotPuck from '@assets/images/totalHotspotPuck.svg' -import { useSpacing } from '@theme/themeHooks' +import TotalHotspotPuck from '@assets/svgs/totalHotspotPuck.svg' +import { useSpacing } from '@config/theme/themeHooks' import Text from '@components/Text' import { ReAnimatedBox } from '@components/AnimatedBox' import { FadeIn, FadeOut } from 'react-native-reanimated' diff --git a/src/app/services/HotspotService/pages/HotspotPage.tsx b/src/app/services/HotspotService/pages/HotspotPage.tsx new file mode 100644 index 000000000..89b0ad3fe --- /dev/null +++ b/src/app/services/HotspotService/pages/HotspotPage.tsx @@ -0,0 +1,96 @@ +import { + StackNavigationOptions, + StackNavigationProp, + createStackNavigator, +} from '@react-navigation/stack' +import { HotspotBleProvider } from '@helium/react-native-sdk' +import React, { useMemo } from 'react' +import { useColors } from '@config/theme/themeHooks' +import AssertLocationScreen from '@features/hotspots/AssertLocationScreen' +import TransferCollectableScreen from '@features/collectables/TransferCollectableScreen' +import ChangeRewardsRecipientScreen from '@features/hotspots/ChangeRewardsRecipientScreen' +import AntennaSetupScreen from '@features/hotspots/AntennaSetupScreen' +import Diagnostics from '@features/hotspots/Diagnostics' +import ModifyWifiScreen from '@features/hotspots/ModifyWifiScreen' +import HotspotPage from '@features/hotspots/HotspotPage' +import HotspotDetails from '@features/hotspots/HotspotDetails' +import HotspotConfig from '@features/hotspots/HotspotConfig' +import { HotspotWithPendingRewards } from '../../../../types/solana' + +export type HotspotStackParamList = { + HotspotPage: undefined + HotspotDetails: { + hotspot: HotspotWithPendingRewards + } + HotspotConfig: { + hotspot: HotspotWithPendingRewards + hotspotAddress: string + } + AssertLocationScreen: { + collectable: HotspotWithPendingRewards + } + TransferCollectableScreen: { + collectable: HotspotWithPendingRewards + } + ChangeRewardsRecipientScreen: { + hotspot: HotspotWithPendingRewards + } + AntennaSetupScreen: { + collectable: HotspotWithPendingRewards + } + DiagnosticsScreen: { + collectable: HotspotWithPendingRewards + } + ModifyWifiScreen: { + collectable: HotspotWithPendingRewards + } +} + +export type HotspotNavigationProp = StackNavigationProp + +const HotspotStack = createStackNavigator() + +const HotspotPageNavigator = () => { + const colors = useColors() + const navigatorScreenOptions = useMemo( + () => + ({ + headerShown: false, + cardStyle: { backgroundColor: colors.primaryBackground }, + } as StackNavigationOptions), + [colors], + ) + + return ( + + + + + + + + + + + + + + ) +} + +export default HotspotPageNavigator diff --git a/src/services/NotificationsService/index.tsx b/src/app/services/NotificationsService/index.tsx similarity index 100% rename from src/services/NotificationsService/index.tsx rename to src/app/services/NotificationsService/index.tsx diff --git a/src/services/ServiceSheet.tsx b/src/app/services/ServiceSheet.tsx similarity index 98% rename from src/services/ServiceSheet.tsx rename to src/app/services/ServiceSheet.tsx index ab49c7a50..6267d42ed 100644 --- a/src/services/ServiceSheet.tsx +++ b/src/app/services/ServiceSheet.tsx @@ -6,7 +6,7 @@ import { useBorderRadii, useColors, useSpacing, -} from '@theme/themeHooks' +} from '@config/theme/themeHooks' import { FadeIn, FadeOut, @@ -23,10 +23,10 @@ import SideDrawer from '@components/SideDrawer' import MenuButton from '@components/MenuButton' import { useNavigation } from '@react-navigation/native' import { ThemeProvider } from '@shopify/restyle' -import { lightTheme } from '@theme/theme' +import { lightTheme } from '@config/theme/theme' import HeliumBottomSheet from '@components/HeliumBottomSheet' import { useSafeAreaInsets } from 'react-native-safe-area-context' -import { useAccountStorage } from '@storage/AccountStorageProvider' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' import changeNavigationBarColor from 'react-native-navigation-bar-color' import { Platform, StyleProp, ViewStyle } from 'react-native' import { wh } from '@utils/layout' diff --git a/src/services/ServiceSheetNavigator.tsx b/src/app/services/ServiceSheetNavigator.tsx similarity index 98% rename from src/services/ServiceSheetNavigator.tsx rename to src/app/services/ServiceSheetNavigator.tsx index 04a372e58..4fb7d3652 100644 --- a/src/services/ServiceSheetNavigator.tsx +++ b/src/app/services/ServiceSheetNavigator.tsx @@ -1,6 +1,6 @@ import React, { useCallback, useMemo, useState } from 'react' import { createNativeStackNavigator } from '@react-navigation/native-stack' -import { useBorderRadii, useColors } from '@theme/themeHooks' +import { useBorderRadii, useColors } from '@config/theme/themeHooks' import { StackNavigationOptions } from '@react-navigation/stack' import { useAppDispatch } from '@store/store' import { appSlice } from '@store/slices/appSlice' diff --git a/src/services/SettingsService/index.tsx b/src/app/services/SettingsService/index.tsx similarity index 100% rename from src/services/SettingsService/index.tsx rename to src/app/services/SettingsService/index.tsx diff --git a/src/services/WalletService/index.tsx b/src/app/services/WalletService/index.tsx similarity index 85% rename from src/services/WalletService/index.tsx rename to src/app/services/WalletService/index.tsx index 439aa93df..bb7528592 100644 --- a/src/services/WalletService/index.tsx +++ b/src/app/services/WalletService/index.tsx @@ -1,9 +1,9 @@ import React, { useMemo } from 'react' -import Wallet from '@assets/images/wallet.svg' -import Receive from '@assets/images/receive.svg' -import Send from '@assets/images/send.svg' -import Swap from '@assets/images/swap.svg' -import Transactions from '@assets/images/transactionsTabIcon.svg' +import Wallet from '@assets/svgs/wallet.svg' +import Receive from '@assets/svgs/receive.svg' +import Send from '@assets/svgs/send.svg' +import Swap from '@assets/svgs/swap.svg' +import Transactions from '@assets/svgs/transactionsTabIcon.svg' import ServiceSheetPage, { ServiceNavBarOption, } from '@components/ServiceSheetPage' diff --git a/src/services/WalletService/pages/ReceivePage/index.tsx b/src/app/services/WalletService/pages/ReceivePage/index.tsx similarity index 96% rename from src/services/WalletService/pages/ReceivePage/index.tsx rename to src/app/services/WalletService/pages/ReceivePage/index.tsx index 163afa2de..078419993 100644 --- a/src/services/WalletService/pages/ReceivePage/index.tsx +++ b/src/app/services/WalletService/pages/ReceivePage/index.tsx @@ -6,8 +6,8 @@ import React, { useCallback } from 'react' import { useTranslation } from 'react-i18next' import { Image } from 'react-native' import QRCode from 'react-native-qrcode-svg' -import CarotRight from '@assets/images/carot-right.svg' -import { useColors } from '@theme/themeHooks' +import CarotRight from '@assets/svgs/carot-right.svg' +import { useColors } from '@config/theme/themeHooks' import useCopyText from '@hooks/useCopyText' import TouchableContainer from '@components/TouchableContainer' import { ReAnimatedBox } from '@components/AnimatedBox' diff --git a/src/services/WalletService/pages/SendPage/SentPageNavigator.tsx b/src/app/services/WalletService/pages/SendPage/index.tsx similarity index 61% rename from src/services/WalletService/pages/SendPage/SentPageNavigator.tsx rename to src/app/services/WalletService/pages/SendPage/index.tsx index 34eee8c98..4c6ff0387 100644 --- a/src/services/WalletService/pages/SendPage/SentPageNavigator.tsx +++ b/src/app/services/WalletService/pages/SendPage/index.tsx @@ -4,10 +4,12 @@ import { createStackNavigator, } from '@react-navigation/stack' import React, { useMemo } from 'react' -import { useColors } from '@theme/themeHooks' +import { useColors } from '@config/theme/themeHooks' import PaymentScreen from '@features/payment/PaymentScreen' import AddressBookNavigator from '@features/addressBook/AddressBookNavigator' -import { PaymentRouteParam } from '@services/WalletService' +import { PaymentRouteParam } from 'src/app/services/WalletService' +import { ReAnimatedBox } from '@components/AnimatedBox' +import { FadeIn } from 'react-native-reanimated' export type SendStackParamList = { PaymentScreen: undefined | PaymentRouteParam @@ -30,10 +32,12 @@ const SendPageNavigator = () => { ) return ( - - - - + + + + + + ) } diff --git a/src/services/WalletService/pages/SwapPage/index.tsx b/src/app/services/WalletService/pages/SwapPage/index.tsx similarity index 100% rename from src/services/WalletService/pages/SwapPage/index.tsx rename to src/app/services/WalletService/pages/SwapPage/index.tsx diff --git a/src/services/WalletService/pages/TransactionsPage/index.tsx b/src/app/services/WalletService/pages/TransactionsPage/index.tsx similarity index 100% rename from src/services/WalletService/pages/TransactionsPage/index.tsx rename to src/app/services/WalletService/pages/TransactionsPage/index.tsx diff --git a/src/services/WalletService/pages/WalletPage/WalletPageNavigator.tsx b/src/app/services/WalletService/pages/WalletPage/index.tsx similarity index 89% rename from src/services/WalletService/pages/WalletPage/WalletPageNavigator.tsx rename to src/app/services/WalletService/pages/WalletPage/index.tsx index 4b1714e9b..5d38b2801 100644 --- a/src/services/WalletService/pages/WalletPage/WalletPageNavigator.tsx +++ b/src/app/services/WalletService/pages/WalletPage/index.tsx @@ -4,20 +4,20 @@ import { createStackNavigator, } from '@react-navigation/stack' import React, { useMemo } from 'react' -import AccountTokenScreen from '@features/account/AccountTokenScreen' -import { useColors } from '@theme/themeHooks' -import AirdropScreen from '@features/account/AirdropScreen' +import AccountTokenScreen from '@features/wallet/AccountTokenScreen' +import { useColors } from '@config/theme/themeHooks' +import AirdropScreen from '@features/wallet/AirdropScreen' import ConfirmPinScreen from '@components/ConfirmPinScreen' import BurnScreen from '@features/burn/BurnScreen' -import AccountManageTokenListScreen from '@features/account/AccountManageTokenListScreen' +import AccountManageTokenListScreen from '@features/wallet/AccountManageTokenListScreen' import PaymentQrScanner from '@features/payment/PaymentQrScanner' import NftDetailsScreen from '@features/collectables/NftDetailsScreen' import CollectionScreen from '@features/collectables/CollectionScreen' import ManageCollectables from '@features/collectables/ManageCollectables' import TransferCollectableScreen from '@features/collectables/TransferCollectableScreen' import TransferCompleteScreen from '@features/collectables/TransferCompleteScreen' -import { CompressedNFT } from '../../../../types/solana' -import TokensTabs from './TokensTabs' +import TokensTabs from '@features/wallet/TokensTabs' +import { CompressedNFT } from '../../../../../types/solana' export type BurnRouteParam = { address: string diff --git a/src/services/serviceSheetTypes.ts b/src/app/services/serviceSheetTypes.ts similarity index 100% rename from src/services/serviceSheetTypes.ts rename to src/app/services/serviceSheetTypes.ts diff --git a/src/assets/images/CloseCircle.svg b/src/assets/svgs/CloseCircle.svg similarity index 100% rename from src/assets/images/CloseCircle.svg rename to src/assets/svgs/CloseCircle.svg diff --git a/src/assets/images/activeCircle.svg b/src/assets/svgs/activeCircle.svg similarity index 100% rename from src/assets/images/activeCircle.svg rename to src/assets/svgs/activeCircle.svg diff --git a/src/assets/images/add.svg b/src/assets/svgs/add.svg similarity index 100% rename from src/assets/images/add.svg rename to src/assets/svgs/add.svg diff --git a/src/assets/images/addDapp.svg b/src/assets/svgs/addDapp.svg similarity index 100% rename from src/assets/images/addDapp.svg rename to src/assets/svgs/addDapp.svg diff --git a/src/assets/images/addressIcon.svg b/src/assets/svgs/addressIcon.svg similarity index 100% rename from src/assets/images/addressIcon.svg rename to src/assets/svgs/addressIcon.svg diff --git a/src/assets/images/airdrop.svg b/src/assets/svgs/airdrop.svg similarity index 100% rename from src/assets/images/airdrop.svg rename to src/assets/svgs/airdrop.svg diff --git a/src/assets/images/alert.svg b/src/assets/svgs/alert.svg similarity index 100% rename from src/assets/images/alert.svg rename to src/assets/svgs/alert.svg diff --git a/src/assets/images/anchorAccount.svg b/src/assets/svgs/anchorAccount.svg similarity index 100% rename from src/assets/images/anchorAccount.svg rename to src/assets/svgs/anchorAccount.svg diff --git a/src/assets/images/arrowDown.svg b/src/assets/svgs/arrowDown.svg similarity index 100% rename from src/assets/images/arrowDown.svg rename to src/assets/svgs/arrowDown.svg diff --git a/src/assets/images/arrowRight.svg b/src/assets/svgs/arrowRight.svg similarity index 100% rename from src/assets/images/arrowRight.svg rename to src/assets/svgs/arrowRight.svg diff --git a/src/assets/images/arrowUp.svg b/src/assets/svgs/arrowUp.svg similarity index 100% rename from src/assets/images/arrowUp.svg rename to src/assets/svgs/arrowUp.svg diff --git a/src/assets/images/backArrow.svg b/src/assets/svgs/backArrow.svg similarity index 100% rename from src/assets/images/backArrow.svg rename to src/assets/svgs/backArrow.svg diff --git a/src/assets/images/backspace.svg b/src/assets/svgs/backspace.svg similarity index 100% rename from src/assets/images/backspace.svg rename to src/assets/svgs/backspace.svg diff --git a/src/assets/images/bigAdd.svg b/src/assets/svgs/bigAdd.svg similarity index 100% rename from src/assets/images/bigAdd.svg rename to src/assets/svgs/bigAdd.svg diff --git a/src/assets/images/blueCheck.svg b/src/assets/svgs/blueCheck.svg similarity index 100% rename from src/assets/images/blueCheck.svg rename to src/assets/svgs/blueCheck.svg diff --git a/src/assets/images/bluetooth.svg b/src/assets/svgs/bluetooth.svg similarity index 100% rename from src/assets/images/bluetooth.svg rename to src/assets/svgs/bluetooth.svg diff --git a/src/assets/images/bookmark.svg b/src/assets/svgs/bookmark.svg similarity index 100% rename from src/assets/images/bookmark.svg rename to src/assets/svgs/bookmark.svg diff --git a/src/assets/images/bookmarkFilled.svg b/src/assets/svgs/bookmarkFilled.svg similarity index 100% rename from src/assets/images/bookmarkFilled.svg rename to src/assets/svgs/bookmarkFilled.svg diff --git a/src/assets/images/browseVoters.svg b/src/assets/svgs/browseVoters.svg similarity index 100% rename from src/assets/images/browseVoters.svg rename to src/assets/svgs/browseVoters.svg diff --git a/src/assets/images/cameraCheck.svg b/src/assets/svgs/cameraCheck.svg similarity index 100% rename from src/assets/images/cameraCheck.svg rename to src/assets/svgs/cameraCheck.svg diff --git a/src/assets/images/cancelledCircle.svg b/src/assets/svgs/cancelledCircle.svg similarity index 100% rename from src/assets/images/cancelledCircle.svg rename to src/assets/svgs/cancelledCircle.svg diff --git a/src/assets/images/carot-down.svg b/src/assets/svgs/carot-down.svg similarity index 100% rename from src/assets/images/carot-down.svg rename to src/assets/svgs/carot-down.svg diff --git a/src/assets/images/carot-right.svg b/src/assets/svgs/carot-right.svg similarity index 100% rename from src/assets/images/carot-right.svg rename to src/assets/svgs/carot-right.svg diff --git a/src/assets/images/carotDownFull.svg b/src/assets/svgs/carotDownFull.svg similarity index 100% rename from src/assets/images/carotDownFull.svg rename to src/assets/svgs/carotDownFull.svg diff --git a/src/assets/images/checkIco.svg b/src/assets/svgs/checkIco.svg similarity index 100% rename from src/assets/images/checkIco.svg rename to src/assets/svgs/checkIco.svg diff --git a/src/assets/images/checkmark.svg b/src/assets/svgs/checkmark.svg similarity index 100% rename from src/assets/images/checkmark.svg rename to src/assets/svgs/checkmark.svg diff --git a/src/assets/images/checkmarkCircle.svg b/src/assets/svgs/checkmarkCircle.svg similarity index 100% rename from src/assets/images/checkmarkCircle.svg rename to src/assets/svgs/checkmarkCircle.svg diff --git a/src/assets/images/checkmarkFill.svg b/src/assets/svgs/checkmarkFill.svg similarity index 100% rename from src/assets/images/checkmarkFill.svg rename to src/assets/svgs/checkmarkFill.svg diff --git a/src/assets/images/chevronDown.svg b/src/assets/svgs/chevronDown.svg similarity index 100% rename from src/assets/images/chevronDown.svg rename to src/assets/svgs/chevronDown.svg diff --git a/src/assets/images/circleLoader.svg b/src/assets/svgs/circleLoader.svg similarity index 100% rename from src/assets/images/circleLoader.svg rename to src/assets/svgs/circleLoader.svg diff --git a/src/assets/images/clock.svg b/src/assets/svgs/clock.svg similarity index 100% rename from src/assets/images/clock.svg rename to src/assets/svgs/clock.svg diff --git a/src/assets/images/close.svg b/src/assets/svgs/close.svg similarity index 100% rename from src/assets/images/close.svg rename to src/assets/svgs/close.svg diff --git a/src/assets/images/closeCircleFilled.svg b/src/assets/svgs/closeCircleFilled.svg similarity index 100% rename from src/assets/images/closeCircleFilled.svg rename to src/assets/svgs/closeCircleFilled.svg diff --git a/src/assets/images/closeModal.svg b/src/assets/svgs/closeModal.svg similarity index 100% rename from src/assets/images/closeModal.svg rename to src/assets/svgs/closeModal.svg diff --git a/src/assets/images/coin.svg b/src/assets/svgs/coin.svg similarity index 100% rename from src/assets/images/coin.svg rename to src/assets/svgs/coin.svg diff --git a/src/assets/images/collectables.svg b/src/assets/svgs/collectables.svg similarity index 100% rename from src/assets/images/collectables.svg rename to src/assets/svgs/collectables.svg diff --git a/src/assets/images/config.svg b/src/assets/svgs/config.svg similarity index 100% rename from src/assets/images/config.svg rename to src/assets/svgs/config.svg diff --git a/src/assets/images/copyAddress.svg b/src/assets/svgs/copyAddress.svg similarity index 100% rename from src/assets/images/copyAddress.svg rename to src/assets/svgs/copyAddress.svg diff --git a/src/assets/images/createAccount.svg b/src/assets/svgs/createAccount.svg similarity index 100% rename from src/assets/images/createAccount.svg rename to src/assets/svgs/createAccount.svg diff --git a/src/assets/images/crowdspot.svg b/src/assets/svgs/crowdspot.svg similarity index 100% rename from src/assets/images/crowdspot.svg rename to src/assets/svgs/crowdspot.svg diff --git a/src/assets/images/crown.svg b/src/assets/svgs/crown.svg similarity index 100% rename from src/assets/images/crown.svg rename to src/assets/svgs/crown.svg diff --git a/src/assets/images/customWarning.svg b/src/assets/svgs/customWarning.svg similarity index 100% rename from src/assets/images/customWarning.svg rename to src/assets/svgs/customWarning.svg diff --git a/src/assets/images/dapp-ellipsis.svg b/src/assets/svgs/dapp-ellipsis.svg similarity index 100% rename from src/assets/images/dapp-ellipsis.svg rename to src/assets/svgs/dapp-ellipsis.svg diff --git a/src/assets/images/detailArrow.svg b/src/assets/svgs/detailArrow.svg similarity index 100% rename from src/assets/images/detailArrow.svg rename to src/assets/svgs/detailArrow.svg diff --git a/src/assets/images/dots.svg b/src/assets/svgs/dots.svg similarity index 100% rename from src/assets/images/dots.svg rename to src/assets/svgs/dots.svg diff --git a/src/assets/images/downArrow.svg b/src/assets/svgs/downArrow.svg similarity index 100% rename from src/assets/images/downArrow.svg rename to src/assets/svgs/downArrow.svg diff --git a/src/assets/images/dripLogo.svg b/src/assets/svgs/dripLogo.svg similarity index 100% rename from src/assets/images/dripLogo.svg rename to src/assets/svgs/dripLogo.svg diff --git a/src/assets/images/electricity.svg b/src/assets/svgs/electricity.svg similarity index 100% rename from src/assets/images/electricity.svg rename to src/assets/svgs/electricity.svg diff --git a/src/assets/images/error.svg b/src/assets/svgs/error.svg similarity index 100% rename from src/assets/images/error.svg rename to src/assets/svgs/error.svg diff --git a/src/assets/images/expand.svg b/src/assets/svgs/expand.svg similarity index 100% rename from src/assets/images/expand.svg rename to src/assets/svgs/expand.svg diff --git a/src/assets/images/externalLink.svg b/src/assets/svgs/externalLink.svg similarity index 100% rename from src/assets/images/externalLink.svg rename to src/assets/svgs/externalLink.svg diff --git a/src/assets/images/eyeIcon.svg b/src/assets/svgs/eyeIcon.svg similarity index 100% rename from src/assets/images/eyeIcon.svg rename to src/assets/svgs/eyeIcon.svg diff --git a/src/assets/images/face.svg b/src/assets/svgs/face.svg similarity index 100% rename from src/assets/images/face.svg rename to src/assets/svgs/face.svg diff --git a/src/assets/images/fail.svg b/src/assets/svgs/fail.svg similarity index 100% rename from src/assets/images/fail.svg rename to src/assets/svgs/fail.svg diff --git a/src/assets/images/filter.svg b/src/assets/svgs/filter.svg similarity index 100% rename from src/assets/images/filter.svg rename to src/assets/svgs/filter.svg diff --git a/src/assets/images/flag.svg b/src/assets/svgs/flag.svg similarity index 100% rename from src/assets/images/flag.svg rename to src/assets/svgs/flag.svg diff --git a/src/assets/images/globe.svg b/src/assets/svgs/globe.svg similarity index 100% rename from src/assets/images/globe.svg rename to src/assets/svgs/globe.svg diff --git a/src/assets/images/helium.svg b/src/assets/svgs/helium.svg similarity index 100% rename from src/assets/images/helium.svg rename to src/assets/svgs/helium.svg diff --git a/src/assets/images/heliumUpdateIcon.svg b/src/assets/svgs/heliumUpdateIcon.svg similarity index 100% rename from src/assets/images/heliumUpdateIcon.svg rename to src/assets/svgs/heliumUpdateIcon.svg diff --git a/src/assets/images/hex.svg b/src/assets/svgs/hex.svg similarity index 100% rename from src/assets/images/hex.svg rename to src/assets/svgs/hex.svg diff --git a/src/assets/images/hnt.svg b/src/assets/svgs/hnt.svg similarity index 100% rename from src/assets/images/hnt.svg rename to src/assets/svgs/hnt.svg diff --git a/src/assets/images/hotspot.svg b/src/assets/svgs/hotspot.svg similarity index 100% rename from src/assets/images/hotspot.svg rename to src/assets/svgs/hotspot.svg diff --git a/src/assets/images/hotspotMarker.svg b/src/assets/svgs/hotspotMarker.svg similarity index 100% rename from src/assets/images/hotspotMarker.svg rename to src/assets/svgs/hotspotMarker.svg diff --git a/src/assets/images/importIcon.svg b/src/assets/svgs/importIcon.svg similarity index 100% rename from src/assets/images/importIcon.svg rename to src/assets/svgs/importIcon.svg diff --git a/src/assets/images/indentArrow.svg b/src/assets/svgs/indentArrow.svg similarity index 100% rename from src/assets/images/indentArrow.svg rename to src/assets/svgs/indentArrow.svg diff --git a/src/assets/images/info.svg b/src/assets/svgs/info.svg similarity index 100% rename from src/assets/images/info.svg rename to src/assets/svgs/info.svg diff --git a/src/assets/images/infoError.svg b/src/assets/svgs/infoError.svg similarity index 100% rename from src/assets/images/infoError.svg rename to src/assets/svgs/infoError.svg diff --git a/src/assets/images/infoIcon.svg b/src/assets/svgs/infoIcon.svg similarity index 100% rename from src/assets/images/infoIcon.svg rename to src/assets/svgs/infoIcon.svg diff --git a/src/assets/images/iot.svg b/src/assets/svgs/iot.svg similarity index 100% rename from src/assets/images/iot.svg rename to src/assets/svgs/iot.svg diff --git a/src/assets/images/iotIconNew.svg b/src/assets/svgs/iotIconNew.svg similarity index 100% rename from src/assets/images/iotIconNew.svg rename to src/assets/svgs/iotIconNew.svg diff --git a/src/assets/images/iotSymbol.svg b/src/assets/svgs/iotSymbol.svg similarity index 100% rename from src/assets/images/iotSymbol.svg rename to src/assets/svgs/iotSymbol.svg diff --git a/src/assets/images/kabob.svg b/src/assets/svgs/kabob.svg similarity index 100% rename from src/assets/images/kabob.svg rename to src/assets/svgs/kabob.svg diff --git a/src/assets/images/keystoneLogo.svg b/src/assets/svgs/keystoneLogo.svg similarity index 100% rename from src/assets/images/keystoneLogo.svg rename to src/assets/svgs/keystoneLogo.svg diff --git a/src/assets/images/ledger-circle.svg b/src/assets/svgs/ledger-circle.svg similarity index 100% rename from src/assets/images/ledger-circle.svg rename to src/assets/svgs/ledger-circle.svg diff --git a/src/assets/images/ledger.svg b/src/assets/svgs/ledger.svg similarity index 100% rename from src/assets/images/ledger.svg rename to src/assets/svgs/ledger.svg diff --git a/src/assets/images/lightningBolt.svg b/src/assets/svgs/lightningBolt.svg similarity index 100% rename from src/assets/images/lightningBolt.svg rename to src/assets/svgs/lightningBolt.svg diff --git a/src/assets/images/link.svg b/src/assets/svgs/link.svg similarity index 100% rename from src/assets/images/link.svg rename to src/assets/svgs/link.svg diff --git a/src/assets/images/listItemRight.svg b/src/assets/svgs/listItemRight.svg similarity index 100% rename from src/assets/images/listItemRight.svg rename to src/assets/svgs/listItemRight.svg diff --git a/src/assets/images/locationCheckmark.svg b/src/assets/svgs/locationCheckmark.svg similarity index 100% rename from src/assets/images/locationCheckmark.svg rename to src/assets/svgs/locationCheckmark.svg diff --git a/src/assets/images/lock.svg b/src/assets/svgs/lock.svg similarity index 100% rename from src/assets/images/lock.svg rename to src/assets/svgs/lock.svg diff --git a/src/assets/images/lockClosed.svg b/src/assets/svgs/lockClosed.svg similarity index 100% rename from src/assets/images/lockClosed.svg rename to src/assets/svgs/lockClosed.svg diff --git a/src/assets/images/majorityCircle.svg b/src/assets/svgs/majorityCircle.svg similarity index 100% rename from src/assets/images/majorityCircle.svg rename to src/assets/svgs/majorityCircle.svg diff --git a/src/assets/images/map.svg b/src/assets/svgs/map.svg similarity index 100% rename from src/assets/images/map.svg rename to src/assets/svgs/map.svg diff --git a/src/assets/images/mapPin.svg b/src/assets/svgs/mapPin.svg similarity index 100% rename from src/assets/images/mapPin.svg rename to src/assets/svgs/mapPin.svg diff --git a/src/assets/images/mapUserLocation.svg b/src/assets/svgs/mapUserLocation.svg similarity index 100% rename from src/assets/images/mapUserLocation.svg rename to src/assets/svgs/mapUserLocation.svg diff --git a/src/assets/images/menu.svg b/src/assets/svgs/menu.svg similarity index 100% rename from src/assets/images/menu.svg rename to src/assets/svgs/menu.svg diff --git a/src/assets/images/minorityCircle.svg b/src/assets/svgs/minorityCircle.svg similarity index 100% rename from src/assets/images/minorityCircle.svg rename to src/assets/svgs/minorityCircle.svg diff --git a/src/assets/images/mobile.svg b/src/assets/svgs/mobile.svg similarity index 100% rename from src/assets/images/mobile.svg rename to src/assets/svgs/mobile.svg diff --git a/src/assets/images/mobileIcon.svg b/src/assets/svgs/mobileIcon.svg similarity index 100% rename from src/assets/images/mobileIcon.svg rename to src/assets/svgs/mobileIcon.svg diff --git a/src/assets/images/mobileIconNew.svg b/src/assets/svgs/mobileIconNew.svg similarity index 100% rename from src/assets/images/mobileIconNew.svg rename to src/assets/svgs/mobileIconNew.svg diff --git a/src/assets/images/mobileSymbol.svg b/src/assets/svgs/mobileSymbol.svg similarity index 100% rename from src/assets/images/mobileSymbol.svg rename to src/assets/svgs/mobileSymbol.svg diff --git a/src/assets/images/mobileTextLogo.svg b/src/assets/svgs/mobileTextLogo.svg similarity index 100% rename from src/assets/images/mobileTextLogo.svg rename to src/assets/svgs/mobileTextLogo.svg diff --git a/src/assets/images/modalBackButton.svg b/src/assets/svgs/modalBackButton.svg similarity index 100% rename from src/assets/images/modalBackButton.svg rename to src/assets/svgs/modalBackButton.svg diff --git a/src/assets/images/modalCheckButton.svg b/src/assets/svgs/modalCheckButton.svg similarity index 100% rename from src/assets/images/modalCheckButton.svg rename to src/assets/svgs/modalCheckButton.svg diff --git a/src/assets/images/modalCheckOnDarkButton.svg b/src/assets/svgs/modalCheckOnDarkButton.svg similarity index 100% rename from src/assets/images/modalCheckOnDarkButton.svg rename to src/assets/svgs/modalCheckOnDarkButton.svg diff --git a/src/assets/images/modalForwardButton.svg b/src/assets/svgs/modalForwardButton.svg similarity index 100% rename from src/assets/images/modalForwardButton.svg rename to src/assets/svgs/modalForwardButton.svg diff --git a/src/assets/images/noCamera.svg b/src/assets/svgs/noCamera.svg similarity index 100% rename from src/assets/images/noCamera.svg rename to src/assets/svgs/noCamera.svg diff --git a/src/assets/images/payment.svg b/src/assets/svgs/payment.svg similarity index 100% rename from src/assets/images/payment.svg rename to src/assets/svgs/payment.svg diff --git a/src/assets/images/paymentArrow.svg b/src/assets/svgs/paymentArrow.svg similarity index 100% rename from src/assets/images/paymentArrow.svg rename to src/assets/svgs/paymentArrow.svg diff --git a/src/assets/images/paymentFailure.svg b/src/assets/svgs/paymentFailure.svg similarity index 100% rename from src/assets/images/paymentFailure.svg rename to src/assets/svgs/paymentFailure.svg diff --git a/src/assets/images/paymentSuccess.svg b/src/assets/svgs/paymentSuccess.svg similarity index 100% rename from src/assets/images/paymentSuccess.svg rename to src/assets/svgs/paymentSuccess.svg diff --git a/src/assets/images/pending.svg b/src/assets/svgs/pending.svg similarity index 100% rename from src/assets/images/pending.svg rename to src/assets/svgs/pending.svg diff --git a/src/assets/images/person.svg b/src/assets/svgs/person.svg similarity index 100% rename from src/assets/images/person.svg rename to src/assets/svgs/person.svg diff --git a/src/assets/images/plus.svg b/src/assets/svgs/plus.svg similarity index 100% rename from src/assets/images/plus.svg rename to src/assets/svgs/plus.svg diff --git a/src/assets/images/qr.svg b/src/assets/svgs/qr.svg similarity index 100% rename from src/assets/images/qr.svg rename to src/assets/svgs/qr.svg diff --git a/src/assets/images/questionMark.svg b/src/assets/svgs/questionMark.svg similarity index 100% rename from src/assets/images/questionMark.svg rename to src/assets/svgs/questionMark.svg diff --git a/src/assets/images/receive.svg b/src/assets/svgs/receive.svg similarity index 100% rename from src/assets/images/receive.svg rename to src/assets/svgs/receive.svg diff --git a/src/assets/images/refresh.svg b/src/assets/svgs/refresh.svg similarity index 100% rename from src/assets/images/refresh.svg rename to src/assets/svgs/refresh.svg diff --git a/src/assets/images/remixArrowRight.svg b/src/assets/svgs/remixArrowRight.svg similarity index 100% rename from src/assets/images/remixArrowRight.svg rename to src/assets/svgs/remixArrowRight.svg diff --git a/src/assets/images/remixCancel.svg b/src/assets/svgs/remixCancel.svg similarity index 100% rename from src/assets/images/remixCancel.svg rename to src/assets/svgs/remixCancel.svg diff --git a/src/assets/images/remixChevronDown.svg b/src/assets/svgs/remixChevronDown.svg similarity index 100% rename from src/assets/images/remixChevronDown.svg rename to src/assets/svgs/remixChevronDown.svg diff --git a/src/assets/images/remixChevronUp.svg b/src/assets/svgs/remixChevronUp.svg similarity index 100% rename from src/assets/images/remixChevronUp.svg rename to src/assets/svgs/remixChevronUp.svg diff --git a/src/assets/images/remove.svg b/src/assets/svgs/remove.svg similarity index 100% rename from src/assets/images/remove.svg rename to src/assets/svgs/remove.svg diff --git a/src/assets/images/rightArrow.svg b/src/assets/svgs/rightArrow.svg similarity index 100% rename from src/assets/images/rightArrow.svg rename to src/assets/svgs/rightArrow.svg diff --git a/src/assets/images/rotateIcon.svg b/src/assets/svgs/rotateIcon.svg similarity index 100% rename from src/assets/images/rotateIcon.svg rename to src/assets/svgs/rotateIcon.svg diff --git a/src/assets/images/search.svg b/src/assets/svgs/search.svg similarity index 100% rename from src/assets/images/search.svg rename to src/assets/svgs/search.svg diff --git a/src/assets/images/searchIcon.svg b/src/assets/svgs/searchIcon.svg similarity index 100% rename from src/assets/images/searchIcon.svg rename to src/assets/svgs/searchIcon.svg diff --git a/src/assets/images/send.svg b/src/assets/svgs/send.svg similarity index 100% rename from src/assets/images/send.svg rename to src/assets/svgs/send.svg diff --git a/src/assets/images/settings.svg b/src/assets/svgs/settings.svg similarity index 100% rename from src/assets/images/settings.svg rename to src/assets/svgs/settings.svg diff --git a/src/assets/images/shareAddress.svg b/src/assets/svgs/shareAddress.svg similarity index 100% rename from src/assets/images/shareAddress.svg rename to src/assets/svgs/shareAddress.svg diff --git a/src/assets/images/smallAdd.svg b/src/assets/svgs/smallAdd.svg similarity index 100% rename from src/assets/images/smallAdd.svg rename to src/assets/svgs/smallAdd.svg diff --git a/src/assets/images/stake.svg b/src/assets/svgs/stake.svg similarity index 100% rename from src/assets/images/stake.svg rename to src/assets/svgs/stake.svg diff --git a/src/assets/images/swap.svg b/src/assets/svgs/swap.svg similarity index 100% rename from src/assets/images/swap.svg rename to src/assets/svgs/swap.svg diff --git a/src/assets/images/swaps.svg b/src/assets/svgs/swaps.svg similarity index 100% rename from src/assets/images/swaps.svg rename to src/assets/svgs/swaps.svg diff --git a/src/assets/images/swipeIcon.svg b/src/assets/svgs/swipeIcon.svg similarity index 100% rename from src/assets/images/swipeIcon.svg rename to src/assets/svgs/swipeIcon.svg diff --git a/src/assets/images/terminal.svg b/src/assets/svgs/terminal.svg similarity index 100% rename from src/assets/images/terminal.svg rename to src/assets/svgs/terminal.svg diff --git a/src/assets/images/tokenHNT.svg b/src/assets/svgs/tokenHNT.svg similarity index 100% rename from src/assets/images/tokenHNT.svg rename to src/assets/svgs/tokenHNT.svg diff --git a/src/assets/images/tokenSOL.svg b/src/assets/svgs/tokenSOL.svg similarity index 100% rename from src/assets/images/tokenSOL.svg rename to src/assets/svgs/tokenSOL.svg diff --git a/src/assets/images/tokens.svg b/src/assets/svgs/tokens.svg similarity index 100% rename from src/assets/images/tokens.svg rename to src/assets/svgs/tokens.svg diff --git a/src/assets/images/totalHotspotPuck.svg b/src/assets/svgs/totalHotspotPuck.svg similarity index 100% rename from src/assets/images/totalHotspotPuck.svg rename to src/assets/svgs/totalHotspotPuck.svg diff --git a/src/assets/images/transactions.svg b/src/assets/svgs/transactions.svg similarity index 100% rename from src/assets/images/transactions.svg rename to src/assets/svgs/transactions.svg diff --git a/src/assets/images/transactionsTabIcon.svg b/src/assets/svgs/transactionsTabIcon.svg similarity index 100% rename from src/assets/images/transactionsTabIcon.svg rename to src/assets/svgs/transactionsTabIcon.svg diff --git a/src/assets/images/txnReceive.svg b/src/assets/svgs/txnReceive.svg similarity index 100% rename from src/assets/images/txnReceive.svg rename to src/assets/svgs/txnReceive.svg diff --git a/src/assets/images/txnSend.svg b/src/assets/svgs/txnSend.svg similarity index 100% rename from src/assets/images/txnSend.svg rename to src/assets/svgs/txnSend.svg diff --git a/src/assets/images/unknownAccount.svg b/src/assets/svgs/unknownAccount.svg similarity index 100% rename from src/assets/images/unknownAccount.svg rename to src/assets/svgs/unknownAccount.svg diff --git a/src/assets/images/userShare.svg b/src/assets/svgs/userShare.svg similarity index 100% rename from src/assets/images/userShare.svg rename to src/assets/svgs/userShare.svg diff --git a/src/assets/images/userStar.svg b/src/assets/svgs/userStar.svg similarity index 100% rename from src/assets/images/userStar.svg rename to src/assets/svgs/userStar.svg diff --git a/src/assets/images/userX.svg b/src/assets/svgs/userX.svg similarity index 100% rename from src/assets/images/userX.svg rename to src/assets/svgs/userX.svg diff --git a/src/assets/images/visibility.svg b/src/assets/svgs/visibility.svg similarity index 100% rename from src/assets/images/visibility.svg rename to src/assets/svgs/visibility.svg diff --git a/src/assets/images/visibilityOff.svg b/src/assets/svgs/visibilityOff.svg similarity index 100% rename from src/assets/images/visibilityOff.svg rename to src/assets/svgs/visibilityOff.svg diff --git a/src/assets/images/voteChevron.svg b/src/assets/svgs/voteChevron.svg similarity index 100% rename from src/assets/images/voteChevron.svg rename to src/assets/svgs/voteChevron.svg diff --git a/src/assets/images/wallet.svg b/src/assets/svgs/wallet.svg similarity index 100% rename from src/assets/images/wallet.svg rename to src/assets/svgs/wallet.svg diff --git a/src/assets/images/walletUpdateIcon.svg b/src/assets/svgs/walletUpdateIcon.svg similarity index 100% rename from src/assets/images/walletUpdateIcon.svg rename to src/assets/svgs/walletUpdateIcon.svg diff --git a/src/assets/images/warning.svg b/src/assets/svgs/warning.svg similarity index 100% rename from src/assets/images/warning.svg rename to src/assets/svgs/warning.svg diff --git a/src/assets/images/warning2.svg b/src/assets/svgs/warning2.svg similarity index 100% rename from src/assets/images/warning2.svg rename to src/assets/svgs/warning2.svg diff --git a/src/assets/images/warningKeystone.svg b/src/assets/svgs/warningKeystone.svg similarity index 100% rename from src/assets/images/warningKeystone.svg rename to src/assets/svgs/warningKeystone.svg diff --git a/src/components/AccountButton.tsx b/src/components/AccountButton.tsx index 15ff99e3a..2ae04d9a5 100644 --- a/src/components/AccountButton.tsx +++ b/src/components/AccountButton.tsx @@ -1,10 +1,10 @@ /* eslint-disable react/jsx-props-no-spreading */ import React, { memo, useCallback, useMemo } from 'react' -import ChevronDown from '@assets/images/chevronDown.svg' +import ChevronDown from '@assets/svgs/chevronDown.svg' import { Keyboard, StyleSheet } from 'react-native' import { BoxProps } from '@shopify/restyle' -import { useColors, useHitSlop } from '@theme/themeHooks' -import { Color, Theme } from '@theme/theme' +import { useColors, useHitSlop } from '@config/theme/themeHooks' +import { Color, Theme } from '@config/theme/theme' import useHaptic from '@hooks/useHaptic' import AccountIcon from './AccountIcon' import Box from './Box' diff --git a/src/components/AccountIcon.tsx b/src/components/AccountIcon.tsx index 976ef7292..72dc47872 100644 --- a/src/components/AccountIcon.tsx +++ b/src/components/AccountIcon.tsx @@ -1,6 +1,6 @@ import React, { memo, useMemo } from 'react' import Jazzicon, { IJazziconProps } from 'react-native-jazzicon' -import { useAccountStorage } from '@storage/AccountStorageProvider' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' import { useAsync } from 'react-async-hook' import { getJazzSeed } from '../utils/accountUtils' import { ImageBox } from '.' diff --git a/src/components/AccountListItem.tsx b/src/components/AccountListItem.tsx index d32565a9f..cc7584e05 100644 --- a/src/components/AccountListItem.tsx +++ b/src/components/AccountListItem.tsx @@ -1,13 +1,13 @@ import React, { memo, useCallback, useMemo } from 'react' -import Checkmark from '@assets/images/checkIco.svg' -import { useColors } from '@theme/themeHooks' +import Checkmark from '@assets/svgs/checkIco.svg' +import { useColors } from '@config/theme/themeHooks' import { BoxProps } from '@shopify/restyle' -import { Theme } from '@theme/theme' +import { Theme } from '@config/theme/theme' +import { CSAccount } from '@config/storage/cloudStorage' import Text from './Text' import Box from './Box' import AccountIcon from './AccountIcon' import { ellipsizeAddress, formatAccountAlias } from '../utils/accountUtils' -import { CSAccount } from '../storage/cloudStorage' import TouchableContainer from './TouchableContainer' type Props = { diff --git a/src/components/AccountSelector.tsx b/src/components/AccountSelector.tsx index 0bb69cec7..9ae2b3d16 100644 --- a/src/components/AccountSelector.tsx +++ b/src/components/AccountSelector.tsx @@ -16,12 +16,12 @@ import { BottomSheetModalProvider, } from '@gorhom/bottom-sheet' import { GestureResponderEvent } from 'react-native' -import { useColors, useOpacity, useSpacing } from '@theme/themeHooks' +import { useColors, useOpacity, useSpacing } from '@config/theme/themeHooks' import useBackHandler from '@hooks/useBackHandler' -import { useAccountStorage } from '../storage/AccountStorageProvider' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' +import { CSAccount } from '@config/storage/cloudStorage' import { AccountNetTypeOpt } from '../utils/accountUtils' import AccountListItem from './AccountListItem' -import { CSAccount } from '../storage/cloudStorage' export type AccountSelectorRef = { show: (_type?: AccountNetTypeOpt | GestureResponderEvent) => void diff --git a/src/components/ActivityIndicator.tsx b/src/components/ActivityIndicator.tsx index 52c3f6dc5..308ed26f9 100644 --- a/src/components/ActivityIndicator.tsx +++ b/src/components/ActivityIndicator.tsx @@ -3,8 +3,8 @@ import { ActivityIndicatorProps, ActivityIndicator as RNActivityIndicator, } from 'react-native' -import { Color } from '@theme/theme' -import { useColors } from '@theme/themeHooks' +import { Color } from '@config/theme/theme' +import { useColors } from '@config/theme/themeHooks' type Props = { color?: Color } & ActivityIndicatorProps const ActivityIndicator = ({ color, ...props }: Props) => { diff --git a/src/components/AddressBookSelector.tsx b/src/components/AddressBookSelector.tsx index 218e2e566..5013d4ede 100644 --- a/src/components/AddressBookSelector.tsx +++ b/src/components/AddressBookSelector.tsx @@ -14,12 +14,12 @@ import BottomSheet, { } from '@gorhom/bottom-sheet' import { useNavigation } from '@react-navigation/native' import { BoxProps, ThemeProvider } from '@shopify/restyle' -import { lightTheme, Theme } from '@theme/theme' +import { lightTheme, Theme } from '@config/theme/theme' import ContactsList from '@features/addressBook/ContactsList' -import { CSAccount } from '@storage/cloudStorage' +import { CSAccount } from '@config/storage/cloudStorage' import { Portal } from '@gorhom/portal' import { useTranslation } from 'react-i18next' -import { SendNavigationProp } from '@services/WalletService/pages/SendPage/SentPageNavigator' +import { SendNavigationProp } from 'src/app/services/WalletService/pages/SendPage' import { AddressBookNavigationProp } from '@features/addressBook/addressBookTypes' import HeliumBottomSheet from './HeliumBottomSheet' import { SafeAreaBox, Text } from '.' diff --git a/src/components/AutoGasBanner.tsx b/src/components/AutoGasBanner.tsx index 7285a7822..4da2fd99d 100644 --- a/src/components/AutoGasBanner.tsx +++ b/src/components/AutoGasBanner.tsx @@ -1,5 +1,5 @@ -import CloseCircle from '@assets/images/closeCircleFilled.svg' -import Warning from '@assets/images/warning.svg' +import CloseCircle from '@assets/svgs/closeCircleFilled.svg' +import Warning from '@assets/svgs/warning.svg' import { useMint, useOwnedAmount, @@ -13,8 +13,8 @@ import { VersionedTransaction, sendAndConfirmRawTransaction, } from '@solana/web3.js' -import { useAppStorage } from '@storage/AppStorageProvider' -import { Theme } from '@theme/theme' +import { useAppStorage } from '@config/storage/AppStorageProvider' +import { Theme } from '@config/theme/theme' import { MIN_BALANCE_THRESHOLD } from '@utils/constants' import axios from 'axios' import BN from 'bn.js' @@ -29,9 +29,9 @@ import { useSafeAreaInsets, } from 'react-native-safe-area-context' import { useDispatch } from 'react-redux' -import { useSolana } from '../solana/SolanaProvider' -import { useWalletSign } from '../solana/WalletSignProvider' -import { WalletStandardMessageTypes } from '../solana/walletSignBottomSheetTypes' +import { useSolana } from '@features/solana/SolanaProvider' +import { useWalletSign } from '@features/solana/WalletSignProvider' +import { WalletStandardMessageTypes } from '@features/solana/walletSignBottomSheetTypes' import { appSlice } from '../store/slices/appSlice' import { ReAnimatedBox } from './AnimatedBox' import Box from './Box' diff --git a/src/components/BackButton.tsx b/src/components/BackButton.tsx index e419bcbc9..5ea1808f1 100644 --- a/src/components/BackButton.tsx +++ b/src/components/BackButton.tsx @@ -2,9 +2,9 @@ import React from 'react' import { BoxProps } from '@shopify/restyle' import { Insets } from 'react-native' -import BackArrow from '@assets/images/backArrow.svg' -import { Color, Spacing, Theme } from '@theme/theme' -import { useColors } from '@theme/themeHooks' +import BackArrow from '@assets/svgs/backArrow.svg' +import { Color, Spacing, Theme } from '@config/theme/theme' +import { useColors } from '@config/theme/themeHooks' import Box from './Box' import IconPressedContainer from './IconPressedContainer' diff --git a/src/components/BackScreen.tsx b/src/components/BackScreen.tsx index d2396a58b..e9a0a2715 100644 --- a/src/components/BackScreen.tsx +++ b/src/components/BackScreen.tsx @@ -5,8 +5,8 @@ import React, { memo, useCallback, useMemo } from 'react' import { LayoutChangeEvent, Platform } from 'react-native' import { Edge } from 'react-native-safe-area-context' import { SvgProps } from 'react-native-svg' -import { Color, Spacing, Theme } from '@theme/theme' -import { useColors, useHitSlop } from '@theme/themeHooks' +import { Color, Spacing, Theme } from '@config/theme/theme' +import { useColors, useHitSlop } from '@config/theme/themeHooks' import BackButton from './BackButton' import Box from './Box' import CloseButton from './CloseButton' diff --git a/src/components/BackgroundFill.tsx b/src/components/BackgroundFill.tsx index 889f7ddb6..a5e47b8a4 100644 --- a/src/components/BackgroundFill.tsx +++ b/src/components/BackgroundFill.tsx @@ -1,7 +1,7 @@ import { BoxProps } from '@shopify/restyle' import React, { memo } from 'react' import { StyleSheet } from 'react-native' -import { Theme } from '@theme/theme' +import { Theme } from '@config/theme/theme' import Box from './Box' type Props = BoxProps diff --git a/src/components/BalanceText.tsx b/src/components/BalanceText.tsx index 443fe7921..018ad72c0 100644 --- a/src/components/BalanceText.tsx +++ b/src/components/BalanceText.tsx @@ -1,5 +1,5 @@ import React, { memo, useMemo } from 'react' -import { TextVariant } from '@theme/theme' +import { TextVariant } from '@config/theme/theme' import Box from './Box' import Text from './Text' diff --git a/src/components/BlurActionSheet.tsx b/src/components/BlurActionSheet.tsx index 6afbcf4b7..5997bf82e 100644 --- a/src/components/BlurActionSheet.tsx +++ b/src/components/BlurActionSheet.tsx @@ -4,9 +4,9 @@ import { useSafeAreaInsets } from 'react-native-safe-area-context' import { useAsync } from 'react-async-hook' import { Portal } from '@gorhom/portal' import { ThemeProvider } from '@shopify/restyle' -import { lightTheme } from '@theme/theme' +import { lightTheme } from '@config/theme/theme' import { useTranslation } from 'react-i18next' -import { useSpacing } from '@theme/themeHooks' +import { useSpacing } from '@config/theme/themeHooks' import HeliumBottomSheet from './HeliumBottomSheet' import Text from './Text' import Box from './Box' diff --git a/src/components/BlurBox.tsx b/src/components/BlurBox.tsx index 5b2f9c8f7..57feae9b3 100644 --- a/src/components/BlurBox.tsx +++ b/src/components/BlurBox.tsx @@ -2,7 +2,7 @@ import React from 'react' import { createBox } from '@shopify/restyle' import { BlurView, BlurViewProps } from '@react-native-community/blur' -import { Theme } from '@theme/theme' +import { Theme } from '@config/theme/theme' const BlurBox = createBox< Theme, diff --git a/src/components/Box.tsx b/src/components/Box.tsx index 0d175fbfe..4a667b3df 100644 --- a/src/components/Box.tsx +++ b/src/components/Box.tsx @@ -1,5 +1,5 @@ import { createBox } from '@shopify/restyle' -import { Theme } from '@theme/theme' +import { Theme } from '@config/theme/theme' const Box = createBox() diff --git a/src/components/ButtonPressAnimation.tsx b/src/components/ButtonPressAnimation.tsx index f37f35279..13e962e36 100644 --- a/src/components/ButtonPressAnimation.tsx +++ b/src/components/ButtonPressAnimation.tsx @@ -1,6 +1,6 @@ import useHaptic from '@hooks/useHaptic' import { BoxProps } from '@shopify/restyle' -import { Theme } from '@theme/theme' +import { Theme } from '@config/theme/theme' import React from 'react' import { GestureResponderEvent, diff --git a/src/components/ButtonPressable.tsx b/src/components/ButtonPressable.tsx index 76eec3fb9..92a579f13 100644 --- a/src/components/ButtonPressable.tsx +++ b/src/components/ButtonPressable.tsx @@ -4,8 +4,8 @@ import React, { FC, memo, useState, useMemo } from 'react' import { GestureResponderEvent, ViewStyle } from 'react-native' import { SvgProps } from 'react-native-svg' import { useDebouncedCallback } from 'use-debounce' -import { Color, FontWeight, Theme } from '@theme/theme' -import { useCreateOpacity } from '@theme/themeHooks' +import { Color, FontWeight, Theme } from '@config/theme/theme' +import { useCreateOpacity } from '@config/theme/themeHooks' import Box from './Box' import ButtonPressAnimation from './ButtonPressAnimation' import Text from './Text' diff --git a/src/components/Card.tsx b/src/components/Card.tsx index eb38c6845..122f1e531 100644 --- a/src/components/Card.tsx +++ b/src/components/Card.tsx @@ -4,7 +4,7 @@ import { createVariant, } from '@shopify/restyle' -import { Theme } from '@theme/theme' +import { Theme } from '@config/theme/theme' import Box from './Box' const Card = createRestyleComponent< diff --git a/src/components/CircleLoader.tsx b/src/components/CircleLoader.tsx index fe1f1ba93..032f42568 100644 --- a/src/components/CircleLoader.tsx +++ b/src/components/CircleLoader.tsx @@ -2,9 +2,9 @@ import React, { memo, useRef, useEffect } from 'react' import { Animated, Easing } from 'react-native' import { BoxProps } from '@shopify/restyle' -import CircleLoaderSvg from '@assets/images/circleLoader.svg' -import { Color, Theme } from '@theme/theme' -import { useColors } from '@theme/themeHooks' +import CircleLoaderSvg from '@assets/svgs/circleLoader.svg' +import { Color, Theme } from '@config/theme/theme' +import { useColors } from '@config/theme/themeHooks' import Box from './Box' import Text from './Text' diff --git a/src/components/CloseButton.tsx b/src/components/CloseButton.tsx index db0a8292c..1127ac765 100644 --- a/src/components/CloseButton.tsx +++ b/src/components/CloseButton.tsx @@ -1,10 +1,10 @@ /* eslint-disable react/jsx-props-no-spreading */ import React, { memo } from 'react' -import Close from '@assets/images/closeModal.svg' +import Close from '@assets/svgs/closeModal.svg' import { GestureResponderEvent, Insets } from 'react-native' import { BoxProps } from '@shopify/restyle' -import { useColors } from '@theme/themeHooks' -import { Color, Theme } from '@theme/theme' +import { useColors } from '@config/theme/themeHooks' +import { Color, Theme } from '@config/theme/theme' import IconPressedContainer from './IconPressedContainer' import Box from './Box' diff --git a/src/components/ConfirmPinScreen.tsx b/src/components/ConfirmPinScreen.tsx index 079814a76..c37c1b859 100644 --- a/src/components/ConfirmPinScreen.tsx +++ b/src/components/ConfirmPinScreen.tsx @@ -3,10 +3,10 @@ import { useTranslation } from 'react-i18next' import { RouteProp, useRoute, useNavigation } from '@react-navigation/native' import { useAsync } from 'react-async-hook' import * as LocalAuthentication from 'expo-local-authentication' -import { WalletStackParamList } from '@services/WalletService/pages/WalletPage/WalletPageNavigator' -import { SendNavigationProp } from '@services/WalletService/pages/SendPage/SentPageNavigator' +import { WalletStackParamList } from '@services/WalletService/pages/WalletPage' +import { SendNavigationProp } from '@services/WalletService/pages/SendPage' +import { useAppStorage } from '@config/storage/AppStorageProvider' import ConfirmPinView from './ConfirmPinView' -import { useAppStorage } from '../storage/AppStorageProvider' type Route = RouteProp diff --git a/src/components/CopyAddress.tsx b/src/components/CopyAddress.tsx index 2ec6860c5..f56f46c0b 100644 --- a/src/components/CopyAddress.tsx +++ b/src/components/CopyAddress.tsx @@ -4,10 +4,10 @@ import { BoxProps } from '@shopify/restyle' import { useTranslation } from 'react-i18next' import Clipboard from '@react-native-community/clipboard' import Toast from 'react-native-simple-toast' -import CopyAddressIcon from '@assets/images/copyAddress.svg' -import { Theme } from '@theme/theme' +import CopyAddressIcon from '@assets/svgs/copyAddress.svg' +import { Theme } from '@config/theme/theme' import useHaptic from '@hooks/useHaptic' -import { useColors } from '@theme/themeHooks' +import { useColors } from '@config/theme/themeHooks' import TouchableOpacityBox from './TouchableOpacityBox' import Text from './Text' import { ellipsizeAddress } from '../utils/accountUtils' diff --git a/src/components/CopyAddressPill.tsx b/src/components/CopyAddressPill.tsx index 2563c8f3a..e44964de3 100644 --- a/src/components/CopyAddressPill.tsx +++ b/src/components/CopyAddressPill.tsx @@ -1,13 +1,13 @@ import React, { memo, useCallback, useMemo } from 'react' import useCopyText from '@hooks/useCopyText' -import { useAccountStorage } from '@storage/AccountStorageProvider' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' import useHaptic from '@hooks/useHaptic' import { ellipsizeAddress } from '@utils/accountUtils' import { ViewStyle } from 'react-native' -import { useColors, useSpacing } from '@theme/themeHooks' +import { useColors, useSpacing } from '@config/theme/themeHooks' import { BoxProps } from '@shopify/restyle' -import { Theme } from '@theme/theme' -import CopyAddress from '@assets/images/copyAddress.svg' +import { Theme } from '@config/theme/theme' +import CopyAddress from '@assets/svgs/copyAddress.svg' import ButtonPressAnimation from './ButtonPressAnimation' import Text from './Text' import Box from './Box' diff --git a/src/components/CountdownTimer.tsx b/src/components/CountdownTimer.tsx index 9704c2e84..d3112ba10 100644 --- a/src/components/CountdownTimer.tsx +++ b/src/components/CountdownTimer.tsx @@ -9,13 +9,13 @@ import React, { useRef, useState, } from 'react' -import Lock from '@assets/images/lockClosed.svg' +import Lock from '@assets/svgs/lockClosed.svg' import { LayoutChangeEvent } from 'react-native' import { BoxProps } from '@shopify/restyle' import { format } from 'date-fns' -import { useColors } from '@theme/themeHooks' +import { useColors } from '@config/theme/themeHooks' import useDisappear from '@hooks/useDisappear' -import { Theme } from '@theme/theme' +import { Theme } from '@config/theme/theme' import Text from './Text' import Box from './Box' diff --git a/src/components/DynamicQrScanner.tsx b/src/components/DynamicQrScanner.tsx index e3d8a3571..644180cfa 100644 --- a/src/components/DynamicQrScanner.tsx +++ b/src/components/DynamicQrScanner.tsx @@ -6,7 +6,7 @@ import { useNavigation } from '@react-navigation/native' import { useAsync } from 'react-async-hook' import { useTranslation } from 'react-i18next' import useAlert from '@hooks/useAlert' -import { useColors } from '@theme/themeHooks' +import { useColors } from '@config/theme/themeHooks' import { CameraScannerLayout } from './CameraScannerLayout' import Box from './Box' import BackScreen from './BackScreen' diff --git a/src/components/FabButton.tsx b/src/components/FabButton.tsx index dfc95620c..f58f31f14 100644 --- a/src/components/FabButton.tsx +++ b/src/components/FabButton.tsx @@ -8,26 +8,26 @@ import { StyleSheet, ViewStyle, } from 'react-native' -import ArrowDown from '@assets/images/arrowDown.svg' -import Settings from '@assets/images/settings.svg' -import FatArrowUp from '@assets/images/arrowUp.svg' -import Payment from '@assets/images/payment.svg' -import Stake from '@assets/images/stake.svg' -import Lock from '@assets/images/lock.svg' -import Plus from '@assets/images/plus.svg' -import Close from '@assets/images/close.svg' -import Dots from '@assets/images/dots.svg' -import Filter from '@assets/images/filter.svg' -import { Color, FontWeight, Theme } from '@theme/theme' -import { useColors, useCreateOpacity } from '@theme/themeHooks' -import Swaps from '@assets/images/swaps.svg' -import Airdrop from '@assets/images/airdrop.svg' -import MapUserLocation from '@assets/images/mapUserLocation.svg' -import Search from '@assets/images/search.svg' -import Info from '@assets/images/info.svg' -import QuestionMark from '@assets/images/questionMark.svg' -import BrowseVoters from '@assets/images/browseVoters.svg' -import Expand from '@assets/images/expand.svg' +import ArrowDown from '@assets/svgs/arrowDown.svg' +import Settings from '@assets/svgs/settings.svg' +import FatArrowUp from '@assets/svgs/arrowUp.svg' +import Payment from '@assets/svgs/payment.svg' +import Stake from '@assets/svgs/stake.svg' +import Lock from '@assets/svgs/lock.svg' +import Plus from '@assets/svgs/plus.svg' +import Close from '@assets/svgs/close.svg' +import Dots from '@assets/svgs/dots.svg' +import Filter from '@assets/svgs/filter.svg' +import { Color, FontWeight, Theme } from '@config/theme/theme' +import { useColors, useCreateOpacity } from '@config/theme/themeHooks' +import Swaps from '@assets/svgs/swaps.svg' +import Airdrop from '@assets/svgs/airdrop.svg' +import MapUserLocation from '@assets/svgs/mapUserLocation.svg' +import Search from '@assets/svgs/search.svg' +import Info from '@assets/svgs/info.svg' +import QuestionMark from '@assets/svgs/questionMark.svg' +import BrowseVoters from '@assets/svgs/browseVoters.svg' +import Expand from '@assets/svgs/expand.svg' import Box from './Box' import Text from './Text' import ButtonPressAnimation from './ButtonPressAnimation' diff --git a/src/components/FinePrint.tsx b/src/components/FinePrint.tsx index 683311123..f1a9e548b 100644 --- a/src/components/FinePrint.tsx +++ b/src/components/FinePrint.tsx @@ -3,9 +3,9 @@ import React, { memo, useCallback } from 'react' import { Linking, TouchableOpacity } from 'react-native' import { useTranslation } from 'react-i18next' import { BoxProps } from '@shopify/restyle' -import { Theme } from '@theme/theme' +import { Theme } from '@config/theme/theme' import Text from './Text' -import { PRIVACY_POLICY, TERMS_OF_SERVICE } from '../constants/urls' +import { PRIVACY_POLICY, TERMS_OF_SERVICE } from '../utils/constants/urls' import Box from './Box' type Props = BoxProps diff --git a/src/components/GlobalError.tsx b/src/components/GlobalError.tsx index cfac64bd8..319b99c50 100644 --- a/src/components/GlobalError.tsx +++ b/src/components/GlobalError.tsx @@ -1,4 +1,4 @@ -import CopyAddress from '@assets/images/copyAddress.svg' +import CopyAddress from '@assets/svgs/copyAddress.svg' import useCopyText from '@hooks/useCopyText' import useHaptic from '@hooks/useHaptic' import React, { useCallback } from 'react' diff --git a/src/components/HNTKeyboard.tsx b/src/components/HNTKeyboard.tsx index b597917c5..25e444c09 100644 --- a/src/components/HNTKeyboard.tsx +++ b/src/components/HNTKeyboard.tsx @@ -1,4 +1,4 @@ -import PaymentArrow from '@assets/images/paymentArrow.svg' +import PaymentArrow from '@assets/svgs/paymentArrow.svg' import BottomSheet, { BottomSheetBackdrop, BottomSheetModalProvider, @@ -14,8 +14,8 @@ import { useMetaplexMetadata } from '@hooks/useMetaplexMetadata' import { BoxProps, ThemeProvider } from '@shopify/restyle' import { NATIVE_MINT } from '@solana/spl-token' import { PublicKey } from '@solana/web3.js' -import { Theme, lightTheme } from '@theme/theme' -import { useSafeTopPaddingStyle } from '@theme/themeHooks' +import { Theme, lightTheme } from '@config/theme/theme' +import { useSafeTopPaddingStyle } from '@config/theme/themeHooks' import BN from 'bn.js' import React, { ReactNode, @@ -31,8 +31,8 @@ import React, { import { useTranslation } from 'react-i18next' import { LayoutChangeEvent } from 'react-native' import { Edge } from 'react-native-safe-area-context' -import { Payment } from '../features/payment/PaymentItem' -import { CSAccount } from '../storage/cloudStorage' +import { Payment } from '@features/payment/PaymentItem' +import { CSAccount } from '@config/storage/cloudStorage' import { decimalSeparator, groupSeparator } from '../utils/i18n' import { humanReadable } from '../utils/solanaUtils' import AccountIcon from './AccountIcon' diff --git a/src/components/HandleBasic.tsx b/src/components/HandleBasic.tsx index f097bc6d3..394e72a51 100644 --- a/src/components/HandleBasic.tsx +++ b/src/components/HandleBasic.tsx @@ -1,7 +1,7 @@ /* eslint-disable react/jsx-props-no-spreading */ import { BoxProps } from '@shopify/restyle' import React from 'react' -import { Theme } from '@theme/theme' +import { Theme } from '@config/theme/theme' import Box from './Box' type Props = BoxProps diff --git a/src/components/HeliumActionSheet.tsx b/src/components/HeliumActionSheet.tsx index ee5442d51..948bd2e24 100644 --- a/src/components/HeliumActionSheet.tsx +++ b/src/components/HeliumActionSheet.tsx @@ -10,13 +10,13 @@ import React, { useState, } from 'react' import { BoxProps } from '@shopify/restyle' -import CarotDown from '@assets/images/carot-down.svg' -import Kabob from '@assets/images/kabob.svg' +import CarotDown from '@assets/svgs/carot-down.svg' +import Kabob from '@assets/svgs/kabob.svg' import { useTranslation } from 'react-i18next' import { useSafeAreaInsets } from 'react-native-safe-area-context' import { FlatList } from 'react-native-gesture-handler' -import { Color, Theme } from '@theme/theme' -import { useColors, useHitSlop } from '@theme/themeHooks' +import { Color, Theme } from '@config/theme/theme' +import { useColors, useHitSlop } from '@config/theme/themeHooks' import HeliumActionSheetItem, { HeliumActionSheetItemHeight, HeliumActionSheetItemType, diff --git a/src/components/HeliumActionSheetItem.tsx b/src/components/HeliumActionSheetItem.tsx index 45860b4d4..0db5945f7 100644 --- a/src/components/HeliumActionSheetItem.tsx +++ b/src/components/HeliumActionSheetItem.tsx @@ -1,7 +1,7 @@ import React, { memo, useMemo } from 'react' import { SvgProps } from 'react-native-svg' -import { Color } from '@theme/theme' -import { useColors } from '@theme/themeHooks' +import { Color } from '@config/theme/theme' +import { useColors } from '@config/theme/themeHooks' import Text from './Text' import TouchableOpacityBox from './TouchableOpacityBox' diff --git a/src/components/HeliumBottomActionSheet.tsx b/src/components/HeliumBottomActionSheet.tsx index 91a3caecc..bc455c7ae 100644 --- a/src/components/HeliumBottomActionSheet.tsx +++ b/src/components/HeliumBottomActionSheet.tsx @@ -1,14 +1,14 @@ import React, { memo, useCallback, useEffect } from 'react' import { BoxProps } from '@shopify/restyle' -import Close from '@assets/images/close.svg' +import Close from '@assets/svgs/close.svg' import { Modal } from 'react-native' import { useAnimatedStyle, useSharedValue, withSpring, } from 'react-native-reanimated' -import { Theme } from '@theme/theme' -import { useColors } from '@theme/themeHooks' +import { Theme } from '@config/theme/theme' +import { useColors } from '@config/theme/themeHooks' import useDisappear from '@hooks/useDisappear' import Text from './Text' import Box from './Box' diff --git a/src/components/HeliumBottomSheet.tsx b/src/components/HeliumBottomSheet.tsx index 781e17f72..7c12781c3 100644 --- a/src/components/HeliumBottomSheet.tsx +++ b/src/components/HeliumBottomSheet.tsx @@ -5,7 +5,7 @@ import { useBorderRadii, useColors, useSpacing, -} from '@theme/themeHooks' +} from '@config/theme/themeHooks' import { wh } from '@utils/layout' import { Platform, StyleProp, ViewStyle } from 'react-native' import { useSharedValue } from 'react-native-reanimated' diff --git a/src/components/IconPressedContainer.tsx b/src/components/IconPressedContainer.tsx index 93f75ffb4..045f83fec 100644 --- a/src/components/IconPressedContainer.tsx +++ b/src/components/IconPressedContainer.tsx @@ -10,7 +10,7 @@ import { } from 'react-native' import { useAnimatedStyle, withSpring } from 'react-native-reanimated' import useHaptic from '@hooks/useHaptic' -import { Theme } from '@theme/theme' +import { Theme } from '@config/theme/theme' import { ReAnimatedBox } from './AnimatedBox' export const ICON_CONTAINER_SIZE = 44 diff --git a/src/components/ImageBox.tsx b/src/components/ImageBox.tsx index e633db0cd..ca70bad29 100644 --- a/src/components/ImageBox.tsx +++ b/src/components/ImageBox.tsx @@ -1,7 +1,7 @@ import { createBox } from '@shopify/restyle' import { Image, ImageProps } from 'react-native' -import { Theme } from '@theme/theme' +import { Theme } from '@config/theme/theme' const ImageBox = createBox(Image) diff --git a/src/components/IndeterminateProgressBar.tsx b/src/components/IndeterminateProgressBar.tsx index 0e3d579a0..8d170952d 100644 --- a/src/components/IndeterminateProgressBar.tsx +++ b/src/components/IndeterminateProgressBar.tsx @@ -9,7 +9,7 @@ import { withRepeat, withTiming, } from 'react-native-reanimated' -import { Theme } from '@theme/theme' +import { Theme } from '@config/theme/theme' import { ReAnimatedBox } from './AnimatedBox' import Box from './Box' diff --git a/src/components/Keypad.tsx b/src/components/Keypad.tsx index 3339d3891..46e86af24 100644 --- a/src/components/Keypad.tsx +++ b/src/components/Keypad.tsx @@ -1,7 +1,7 @@ import React, { memo, useCallback } from 'react' import { BoxProps } from '@shopify/restyle' import useHaptic from '@hooks/useHaptic' -import { Theme } from '@theme/theme' +import { Theme } from '@config/theme/theme' import Box from './Box' import KeypadButton, { KeypadCustomInput, KeypadInput } from './KeypadButton' diff --git a/src/components/KeypadButton.tsx b/src/components/KeypadButton.tsx index 8f081c0d8..24dba2ce0 100644 --- a/src/components/KeypadButton.tsx +++ b/src/components/KeypadButton.tsx @@ -1,9 +1,9 @@ /* eslint-disable react/jsx-props-no-spreading */ import React, { useCallback } from 'react' import { Pressable } from 'react-native' -import Backspace from '@assets/images/backspace.svg' +import Backspace from '@assets/svgs/backspace.svg' import { useTranslation } from 'react-i18next' -import { useColors, useHitSlop, useOpacity } from '@theme/themeHooks' +import { useColors, useHitSlop, useOpacity } from '@config/theme/themeHooks' import Box from './Box' import Text from './Text' import { decimalSeparator } from '../utils/i18n' diff --git a/src/components/ListItem.tsx b/src/components/ListItem.tsx index a03410b62..ab3cbfd72 100644 --- a/src/components/ListItem.tsx +++ b/src/components/ListItem.tsx @@ -1,7 +1,7 @@ import React from 'react' -import CheckMarkFill from '@assets/images/checkmarkFill.svg' -import { useColors } from '@theme/themeHooks' -import { Color, Theme } from '@theme/theme' +import CheckMarkFill from '@assets/svgs/checkmarkFill.svg' +import { useColors } from '@config/theme/themeHooks' +import { Color, Theme } from '@config/theme/theme' import { Insets } from 'react-native' import { BoxProps } from '@shopify/restyle' import Box from './Box' diff --git a/src/components/ListSeperator.tsx b/src/components/ListSeperator.tsx index 1355f2352..b93c707b3 100644 --- a/src/components/ListSeperator.tsx +++ b/src/components/ListSeperator.tsx @@ -1,6 +1,6 @@ import { BoxProps } from '@shopify/restyle' import React from 'react' -import { Theme } from '@theme/theme' +import { Theme } from '@config/theme/theme' import Box from './Box' const ListSeparator = (props: BoxProps) => ( diff --git a/src/components/MakerHotspotImage.tsx b/src/components/MakerHotspotImage.tsx index fe4acbdab..bb3fe993c 100644 --- a/src/components/MakerHotspotImage.tsx +++ b/src/components/MakerHotspotImage.tsx @@ -1,6 +1,6 @@ import React, { useCallback } from 'react' import { BoxProps } from '@shopify/restyle' -import { Theme } from '@theme/theme' +import { Theme } from '@config/theme/theme' import ImageBox from './ImageBox' const MakerHotspotImage = ({ diff --git a/src/components/Markdown.tsx b/src/components/Markdown.tsx index 9fd69f2b7..e9e2fbe6f 100644 --- a/src/components/Markdown.tsx +++ b/src/components/Markdown.tsx @@ -1,5 +1,5 @@ import { useTheme } from '@shopify/restyle' -import { Theme } from '@theme/theme' +import { Theme } from '@config/theme/theme' import React from 'react' import MarkdownDisplay from 'react-native-markdown-display' diff --git a/src/components/MemoInput.tsx b/src/components/MemoInput.tsx index b6b584c29..bf367c615 100644 --- a/src/components/MemoInput.tsx +++ b/src/components/MemoInput.tsx @@ -1,7 +1,7 @@ import { BoxProps } from '@shopify/restyle' import React, { memo, useMemo } from 'react' import { useTranslation } from 'react-i18next' -import { Theme } from '@theme/theme' +import { Theme } from '@config/theme/theme' import Box from './Box' import Text from './Text' import TextInput from './TextInput' diff --git a/src/services/HotspotService/HotspotPage/MiniMap.tsx b/src/components/MiniMap.tsx similarity index 93% rename from src/services/HotspotService/HotspotPage/MiniMap.tsx rename to src/components/MiniMap.tsx index 7feec0132..b7be0ed25 100644 --- a/src/services/HotspotService/HotspotPage/MiniMap.tsx +++ b/src/components/MiniMap.tsx @@ -7,11 +7,11 @@ import Mapbox, { } from '@rnmapbox/maps' import { Box, FabButton, ImageBox } from '@components/index' import React, { useCallback, useRef, useState } from 'react' -import { useSpacing } from '@theme/themeHooks' +import { useSpacing } from '@config/theme/themeHooks' import { useNavigation } from '@react-navigation/native' import Map from '@components/Map' -import HotspotMarker from '@assets/images/hotspotMarker.svg' -import { HotspotServiceNavigationProp } from '..' +import HotspotMarker from '@assets/svgs/hotspotMarker.svg' +import { HotspotServiceNavigationProp } from '../app/services/HotspotService' type MiniMapProps = { hasExpandButton?: boolean diff --git a/src/components/NavBar.tsx b/src/components/NavBar.tsx index 5ac2e949b..d9ad44cd3 100644 --- a/src/components/NavBar.tsx +++ b/src/components/NavBar.tsx @@ -13,7 +13,7 @@ import Animated, { withSpring, } from 'react-native-reanimated' import { SvgProps } from 'react-native-svg' -import { useColors, useVerticalHitSlop } from '@theme/themeHooks' +import { useColors, useVerticalHitSlop } from '@config/theme/themeHooks' import Box from './Box' import TouchableOpacityBox, { TouchableOpacityBoxProps, diff --git a/src/components/Pill.tsx b/src/components/Pill.tsx index cb1c2bd60..ac0efcdd3 100644 --- a/src/components/Pill.tsx +++ b/src/components/Pill.tsx @@ -1,6 +1,6 @@ import Box from '@components/Box' import { TextProps } from '@shopify/restyle' -import { Theme } from '@theme/theme' +import { Theme } from '@config/theme/theme' import React, { memo } from 'react' import { SvgProps } from 'react-native-svg' import Text from './Text' diff --git a/src/components/PinDisplay.tsx b/src/components/PinDisplay.tsx index 3ddde1d3f..6f8e64b09 100644 --- a/src/components/PinDisplay.tsx +++ b/src/components/PinDisplay.tsx @@ -1,7 +1,7 @@ /* eslint-disable react/jsx-props-no-spreading */ import { BoxProps } from '@shopify/restyle' import React, { memo } from 'react' -import { Theme } from '@theme/theme' +import { Theme } from '@config/theme/theme' import Box from './Box' import Dot from './Dot' diff --git a/src/components/ProgressBar.tsx b/src/components/ProgressBar.tsx index 0710bf448..a695f24af 100644 --- a/src/components/ProgressBar.tsx +++ b/src/components/ProgressBar.tsx @@ -1,5 +1,5 @@ import { BoxProps } from '@shopify/restyle' -import { Theme } from '@theme/theme' +import { Theme } from '@config/theme/theme' import React, { useCallback, useEffect, useMemo, useState } from 'react' import { LayoutChangeEvent, LayoutRectangle } from 'react-native' import { diff --git a/src/components/RevealWords.tsx b/src/components/RevealWords.tsx index 386c27d59..294303b9d 100644 --- a/src/components/RevealWords.tsx +++ b/src/components/RevealWords.tsx @@ -6,8 +6,8 @@ import { ReAnimatedBox } from '@components/AnimatedBox' import Box from '@components/Box' import ButtonPressable from '@components/ButtonPressable' import { FlatList } from 'react-native' -import { useColors, useSpacing } from '@theme/themeHooks' -import CopyAddress from '@assets/images/copyAddress.svg' +import { useColors, useSpacing } from '@config/theme/themeHooks' +import CopyAddress from '@assets/svgs/copyAddress.svg' import TouchableOpacityBox from '@components/TouchableOpacityBox' import useCopyText from '@hooks/useCopyText' import useHaptic from '@hooks/useHaptic' diff --git a/src/components/RewardItem.tsx b/src/components/RewardItem.tsx index a76c4d650..197d06330 100644 --- a/src/components/RewardItem.tsx +++ b/src/components/RewardItem.tsx @@ -2,7 +2,7 @@ import { useMint } from '@helium/helium-react-hooks' import { useMetaplexMetadata } from '@hooks/useMetaplexMetadata' import { BoxProps } from '@shopify/restyle' import { PublicKey } from '@solana/web3.js' -import { Theme } from '@theme/theme' +import { Theme } from '@config/theme/theme' import { humanReadable } from '@utils/solanaUtils' import BN from 'bn.js' import React, { memo, useMemo } from 'react' diff --git a/src/components/SafeAreaBox.tsx b/src/components/SafeAreaBox.tsx index 1b33c79af..9b4aa7f6d 100644 --- a/src/components/SafeAreaBox.tsx +++ b/src/components/SafeAreaBox.tsx @@ -1,7 +1,7 @@ import { createBox } from '@shopify/restyle' import { Platform } from 'react-native' import { Edge, SafeAreaView } from 'react-native-safe-area-context' -import { Theme } from '@theme/theme' +import { Theme } from '@config/theme/theme' const SafeAreaBox = createBox>( SafeAreaView, diff --git a/src/components/ScrollBox.tsx b/src/components/ScrollBox.tsx index 8ae28b0aa..1e4d64abf 100644 --- a/src/components/ScrollBox.tsx +++ b/src/components/ScrollBox.tsx @@ -1,6 +1,6 @@ import { createBox } from '@shopify/restyle' import { ReactNode } from 'react' -import { Theme } from '@theme/theme' +import { Theme } from '@config/theme/theme' import { ScrollViewProps } from 'react-native' import { ScrollView } from 'react-native-gesture-handler' diff --git a/src/components/Search.tsx b/src/components/Search.tsx index fef487166..8d203fb6d 100644 --- a/src/components/Search.tsx +++ b/src/components/Search.tsx @@ -1,8 +1,8 @@ import React from 'react' -import SearchIcon from '@assets/images/searchIcon.svg' +import SearchIcon from '@assets/svgs/searchIcon.svg' import { BoxProps } from '@shopify/restyle' -import { Theme } from '@theme/theme' -import { useColors, useTextVariants } from '@theme/themeHooks' +import { Theme } from '@config/theme/theme' +import { useColors, useTextVariants } from '@config/theme/themeHooks' import { TextInput } from 'react-native' import Box from './Box' diff --git a/src/components/SearchInput.tsx b/src/components/SearchInput.tsx index 0fe871714..24ad2a66a 100644 --- a/src/components/SearchInput.tsx +++ b/src/components/SearchInput.tsx @@ -1,8 +1,8 @@ /* eslint-disable react/jsx-props-no-spreading */ -import Search from '@assets/images/search.svg' +import Search from '@assets/svgs/search.svg' import { BoxProps } from '@shopify/restyle' -import { BorderRadii, Spacing, Theme } from '@theme/theme' -import { useColors, useInputVariants } from '@theme/themeHooks' +import { BorderRadii, Spacing, Theme } from '@config/theme/theme' +import { useColors, useInputVariants } from '@config/theme/themeHooks' import React, { useCallback } from 'react' import { TextInputProps } from 'react-native' import Box from './Box' diff --git a/src/components/SecretKeyWarningScreen.tsx b/src/components/SecretKeyWarningScreen.tsx index b1ab78c48..b860f840e 100644 --- a/src/components/SecretKeyWarningScreen.tsx +++ b/src/components/SecretKeyWarningScreen.tsx @@ -1,6 +1,6 @@ import React, { memo, ReactNode, useCallback, useEffect, useState } from 'react' import { View } from 'react-native' -import InfoWarning from '@assets/images/customWarning.svg' +import InfoWarning from '@assets/svgs/customWarning.svg' import { useTranslation } from 'react-i18next' import Animated, { runOnJS, @@ -8,8 +8,8 @@ import Animated, { useSharedValue, withTiming, } from 'react-native-reanimated' -import globalStyles from '@theme/globalStyles' -import { useColors } from '@theme/themeHooks' +import globalStyles from '@config/theme/globalStyles' +import { useColors } from '@config/theme/themeHooks' import Text from './Text' import Box from './Box' import ButtonPressable from './ButtonPressable' diff --git a/src/components/SegmentedControl.tsx b/src/components/SegmentedControl.tsx index 26a5aa2ec..4fdd8bb04 100644 --- a/src/components/SegmentedControl.tsx +++ b/src/components/SegmentedControl.tsx @@ -11,9 +11,9 @@ import React, { import { BoxProps } from '@shopify/restyle' import { GestureResponderEvent, LayoutChangeEvent } from 'react-native' import { SvgProps } from 'react-native-svg' -import { useColors } from '@theme/themeHooks' +import { useColors } from '@config/theme/themeHooks' import { useAnimatedStyle, withTiming } from 'react-native-reanimated' -import { Theme } from '../theme/theme' +import { Theme } from '../config/theme/theme' import { Box, ReAnimatedBox, Text } from '.' import TouchableOpacityBox from './TouchableOpacityBox' diff --git a/src/components/Select.tsx b/src/components/Select.tsx index 5287da81a..5c3a93062 100644 --- a/src/components/Select.tsx +++ b/src/components/Select.tsx @@ -1,7 +1,7 @@ -import { useColors } from '@theme/themeHooks' -import ChevronDown from '@assets/images/chevronDown.svg' +import { useColors } from '@config/theme/themeHooks' +import ChevronDown from '@assets/svgs/chevronDown.svg' import { BoxProps } from '@shopify/restyle' -import { Theme } from '@theme/theme' +import { Theme } from '@config/theme/theme' import React, { useCallback, useMemo, useState } from 'react' import { useTranslation } from 'react-i18next' import { FlatList } from 'react-native' diff --git a/src/components/ServiceNavBar.tsx b/src/components/ServiceNavBar.tsx index f30813286..ffe8abbed 100644 --- a/src/components/ServiceNavBar.tsx +++ b/src/components/ServiceNavBar.tsx @@ -13,7 +13,7 @@ import Animated, { withSpring, } from 'react-native-reanimated' import { SvgProps } from 'react-native-svg' -import { useColors, useVerticalHitSlop } from '@theme/themeHooks' +import { useColors, useVerticalHitSlop } from '@config/theme/themeHooks' import Box from './Box' import TouchableOpacityBox, { TouchableOpacityBoxProps, diff --git a/src/components/ServiceSheetPage.tsx b/src/components/ServiceSheetPage.tsx index 261a9471d..1462a5844 100644 --- a/src/components/ServiceSheetPage.tsx +++ b/src/components/ServiceSheetPage.tsx @@ -5,11 +5,11 @@ import { createBottomTabNavigator, } from '@react-navigation/bottom-tabs' import { useSafeAreaInsets } from 'react-native-safe-area-context' -import { Color } from '@theme/theme' +import { Color } from '@config/theme/theme' import Box from '@components/Box' import useEnrichedTransactions from '@hooks/useEnrichedTransactions' import useHaptic from '@hooks/useHaptic' -import { useColors } from '@theme/themeHooks' +import { useColors } from '@config/theme/themeHooks' import ServiceNavBar from './ServiceNavBar' const Tab = createBottomTabNavigator() diff --git a/src/components/SplashScreen.tsx b/src/components/SplashScreen.tsx index f4258ab29..2afebb050 100644 --- a/src/components/SplashScreen.tsx +++ b/src/components/SplashScreen.tsx @@ -6,10 +6,10 @@ import Animated, { useSharedValue, withTiming, } from 'react-native-reanimated' -import globalStyles from '@theme/globalStyles' -import { useColors } from '@theme/themeHooks' -import { useAccountStorage } from '../storage/AccountStorageProvider' -import { useAppStorage } from '../storage/AppStorageProvider' +import globalStyles from '@config/theme/globalStyles' +import { useColors } from '@config/theme/themeHooks' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' +import { useAppStorage } from '@config/storage/AppStorageProvider' import { ReAnimatedBox } from './AnimatedBox' const SplashScreen = ({ children }: { children: ReactNode }) => { diff --git a/src/components/SubmitButton.tsx b/src/components/SubmitButton.tsx index b0d8caa7c..d2731812e 100644 --- a/src/components/SubmitButton.tsx +++ b/src/components/SubmitButton.tsx @@ -1,9 +1,9 @@ import { BoxProps } from '@shopify/restyle' import React, { memo, useMemo } from 'react' import SwipeButton from 'rn-swipe-button' -import SwipeIcon from '@assets/images/swipeIcon.svg' -import { Font, Theme } from '@theme/theme' -import { useColors } from '@theme/themeHooks' +import SwipeIcon from '@assets/svgs/swipeIcon.svg' +import { Font, Theme } from '@config/theme/theme' +import { useColors } from '@config/theme/themeHooks' import Box from './Box' type Props = { diff --git a/src/components/Surface.tsx b/src/components/Surface.tsx index a27d6523d..dd29b0783 100644 --- a/src/components/Surface.tsx +++ b/src/components/Surface.tsx @@ -2,8 +2,8 @@ import { BoxProps } from '@shopify/restyle' import React, { memo, useMemo } from 'react' import { StyleProp, ViewStyle } from 'react-native' -import { Color, Theme } from '@theme/theme' -import { useColorScheme, useCreateOpacity } from '@theme/themeHooks' +import { Color, Theme } from '@config/theme/theme' +import { useColorScheme, useCreateOpacity } from '@config/theme/themeHooks' import Box from './Box' type Props = BoxProps & { diff --git a/src/components/TabBar.tsx b/src/components/TabBar.tsx index f9238677d..5d5f8022a 100644 --- a/src/components/TabBar.tsx +++ b/src/components/TabBar.tsx @@ -14,8 +14,8 @@ import Animated, { } from 'react-native-reanimated' import { SvgProps } from 'react-native-svg' import useHaptic from '@hooks/useHaptic' -import { Color } from '@theme/theme' -import { useColors, useVerticalHitSlop } from '@theme/themeHooks' +import { Color } from '@config/theme/theme' +import { useColors, useVerticalHitSlop } from '@config/theme/themeHooks' import Box from './Box' import Text from './Text' import TouchableOpacityBox, { diff --git a/src/components/Text.tsx b/src/components/Text.tsx index 63309d83c..39a3bb59c 100644 --- a/src/components/Text.tsx +++ b/src/components/Text.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { Theme } from '@theme/theme' +import { Theme } from '@config/theme/theme' import createText from './createText' const Text = createText() diff --git a/src/components/TextInput.tsx b/src/components/TextInput.tsx index 77b2bd075..305823b6e 100644 --- a/src/components/TextInput.tsx +++ b/src/components/TextInput.tsx @@ -8,8 +8,12 @@ import { import { TextInput, TextStyle } from 'react-native' import tinycolor from 'tinycolor2' import { SvgProps } from 'react-native-svg' -import { Color, darkTheme, Theme } from '@theme/theme' -import { useColors, useInputVariants, useTextVariants } from '@theme/themeHooks' +import { Color, darkTheme, Theme } from '@config/theme/theme' +import { + useColors, + useInputVariants, + useTextVariants, +} from '@config/theme/themeHooks' import Box from './Box' import Text from './Text' import TouchableOpacityBox, { diff --git a/src/components/TextInputNew.tsx b/src/components/TextInputNew.tsx index faed387fb..85d3b1ed9 100644 --- a/src/components/TextInputNew.tsx +++ b/src/components/TextInputNew.tsx @@ -1,7 +1,7 @@ import React from 'react' import { BoxProps } from '@shopify/restyle' -import { Theme } from '@theme/theme' -import { useColors, useTextVariants } from '@theme/themeHooks' +import { Theme } from '@config/theme/theme' +import { useColors, useTextVariants } from '@config/theme/themeHooks' import { TextInput, TextInputProps } from 'react-native' import Box from './Box' import Text from './Text' diff --git a/src/components/TextTransform.tsx b/src/components/TextTransform.tsx index f7111c401..dcdb625cb 100644 --- a/src/components/TextTransform.tsx +++ b/src/components/TextTransform.tsx @@ -4,7 +4,7 @@ import React, { useMemo } from 'react' import { Trans } from 'react-i18next' import { ResponsiveValue, TextProps } from '@shopify/restyle' -import { TextVariant, Theme } from '@theme/theme' +import { TextVariant, Theme } from '@config/theme/theme' import Text from './Text' const getComponents = (variant?: ResponsiveValue) => ({ diff --git a/src/components/TokenButton.tsx b/src/components/TokenButton.tsx index d4bf252cf..c2e5349a0 100644 --- a/src/components/TokenButton.tsx +++ b/src/components/TokenButton.tsx @@ -1,10 +1,10 @@ -import ChevronDown from '@assets/images/chevronDown.svg' +import ChevronDown from '@assets/svgs/chevronDown.svg' import useHaptic from '@hooks/useHaptic' import { useMetaplexMetadata } from '@hooks/useMetaplexMetadata' import { BoxProps } from '@shopify/restyle' import { PublicKey } from '@solana/web3.js' -import { Color, Theme } from '@theme/theme' -import { useColors, useHitSlop } from '@theme/themeHooks' +import { Color, Theme } from '@config/theme/theme' +import { useColors, useHitSlop } from '@config/theme/themeHooks' import React, { memo, useCallback, useMemo } from 'react' import { Keyboard } from 'react-native' import Box from './Box' diff --git a/src/components/TokenPill.tsx b/src/components/TokenPill.tsx index 49b7b7789..32be579d3 100644 --- a/src/components/TokenPill.tsx +++ b/src/components/TokenPill.tsx @@ -3,11 +3,11 @@ import Text from '@components/Text' import TokenIcon from '@components/TokenIcon' import { useMetaplexMetadata } from '@hooks/useMetaplexMetadata' import { PublicKey } from '@solana/web3.js' -import { useColors, useCreateOpacity } from '@theme/themeHooks' +import { useColors, useCreateOpacity } from '@config/theme/themeHooks' import React, { memo, useCallback } from 'react' import { Pressable, ViewStyle } from 'react-native' -import { Color } from '@theme/theme' -import CarotDown from '../assets/images/carotDownFull.svg' +import { Color } from '@config/theme/theme' +import CarotDown from '../assets/svgs/carotDownFull.svg' export const TokenPill = memo( ({ diff --git a/src/components/TokenSelector.tsx b/src/components/TokenSelector.tsx index 8a841d096..0dce6b465 100644 --- a/src/components/TokenSelector.tsx +++ b/src/components/TokenSelector.tsx @@ -7,8 +7,8 @@ import BottomSheet, { import { useMetaplexMetadata } from '@hooks/useMetaplexMetadata' import { BoxProps, ThemeProvider } from '@shopify/restyle' import { PublicKey } from '@solana/web3.js' -import { Theme, lightTheme } from '@theme/theme' -import { useSpacing } from '@theme/themeHooks' +import { Theme, lightTheme } from '@config/theme/theme' +import { useSpacing } from '@config/theme/themeHooks' import React, { Ref, forwardRef, diff --git a/src/components/TotalFiatBalance.tsx b/src/components/TotalFiatBalance.tsx index eceb0d50b..905df6289 100644 --- a/src/components/TotalFiatBalance.tsx +++ b/src/components/TotalFiatBalance.tsx @@ -1,6 +1,6 @@ import React, { memo, useEffect, useMemo, useState } from 'react' import AnimatedNumbers from 'react-native-animated-numbers' -import { useTextVariants } from '@theme/themeHooks' +import { useTextVariants } from '@config/theme/themeHooks' import { Easing } from 'react-native-reanimated' import { useBalance } from '@utils/Balance' import { useTheme } from '@shopify/restyle' diff --git a/src/components/TouchableContainer.tsx b/src/components/TouchableContainer.tsx index 9f6528e95..fa9fea27d 100644 --- a/src/components/TouchableContainer.tsx +++ b/src/components/TouchableContainer.tsx @@ -1,7 +1,7 @@ import useHaptic from '@hooks/useHaptic' import { BoxProps } from '@shopify/restyle' -import { Theme } from '@theme/theme' -import { useCreateOpacity } from '@theme/themeHooks' +import { Theme } from '@config/theme/theme' +import { useCreateOpacity } from '@config/theme/themeHooks' import React, { useCallback } from 'react' import { GestureResponderEvent, diff --git a/src/components/TouchableHighlightBox.tsx b/src/components/TouchableHighlightBox.tsx index 7f17a997d..29a48fdce 100644 --- a/src/components/TouchableHighlightBox.tsx +++ b/src/components/TouchableHighlightBox.tsx @@ -1,7 +1,7 @@ import React from 'react' import { createBox } from '@shopify/restyle' import { TouchableHighlight, TouchableHighlightProps } from 'react-native' -import { Theme } from '@theme/theme' +import { Theme } from '@config/theme/theme' import WithDebounce from './WithDebounce' const TouchableHighlightBox = createBox< diff --git a/src/components/TouchableOpacityBox.tsx b/src/components/TouchableOpacityBox.tsx index b08a43d30..053bb4bdb 100644 --- a/src/components/TouchableOpacityBox.tsx +++ b/src/components/TouchableOpacityBox.tsx @@ -1,7 +1,7 @@ import React from 'react' import { createBox } from '@shopify/restyle' import { TouchableOpacity, TouchableOpacityProps } from 'react-native' -import { Theme } from '@theme/theme' +import { Theme } from '@config/theme/theme' import WithDebounce from './WithDebounce' const TouchableOpacityBox = createBox< diff --git a/src/components/TouchableWithoutFeedbackBox.tsx b/src/components/TouchableWithoutFeedbackBox.tsx index e0e0188cc..6e5510465 100644 --- a/src/components/TouchableWithoutFeedbackBox.tsx +++ b/src/components/TouchableWithoutFeedbackBox.tsx @@ -4,7 +4,7 @@ import { TouchableWithoutFeedback, TouchableWithoutFeedbackProps, } from 'react-native' -import { Theme } from '@theme/theme' +import { Theme } from '@config/theme/theme' import WithDebounce from './WithDebounce' const TouchableWithoutFeedbackBox = createBox< diff --git a/src/components/TreasuryWarningScreen.tsx b/src/components/TreasuryWarningScreen.tsx index 280bc0d43..9c1d30adb 100644 --- a/src/components/TreasuryWarningScreen.tsx +++ b/src/components/TreasuryWarningScreen.tsx @@ -7,7 +7,7 @@ import React, { useState, } from 'react' import { View } from 'react-native' -import InfoWarning from '@assets/images/warning.svg' +import InfoWarning from '@assets/svgs/warning.svg' import { useTranslation } from 'react-i18next' import Animated, { runOnJS, @@ -15,8 +15,8 @@ import Animated, { useSharedValue, withTiming, } from 'react-native-reanimated' -import globalStyles from '@theme/globalStyles' -import { useColors } from '@theme/themeHooks' +import globalStyles from '@config/theme/globalStyles' +import { useColors } from '@config/theme/themeHooks' import Text from './Text' import Box from './Box' import ButtonPressable from './ButtonPressable' diff --git a/src/components/WarningBanner.tsx b/src/components/WarningBanner.tsx index 9b12fa7fb..5e5efcb93 100644 --- a/src/components/WarningBanner.tsx +++ b/src/components/WarningBanner.tsx @@ -7,10 +7,10 @@ import { initialWindowMetrics, } from 'react-native-safe-area-context' import { useDispatch, useSelector } from 'react-redux' -import InfoWarning from '@assets/images/warning.svg' -import CloseCircle from '@assets/images/closeCircleFilled.svg' +import InfoWarning from '@assets/svgs/warning.svg' +import CloseCircle from '@assets/svgs/closeCircleFilled.svg' import { BoxProps } from '@shopify/restyle' -import { Theme } from '@theme/theme' +import { Theme } from '@config/theme/theme' import { LayoutChangeEvent } from 'react-native' import useSolanaHealth from '@hooks/useSolanaHealth' import { RootState } from '../store/rootReducer' diff --git a/src/components/WarningPill.tsx b/src/components/WarningPill.tsx index 24b465f25..a504bfc9e 100644 --- a/src/components/WarningPill.tsx +++ b/src/components/WarningPill.tsx @@ -1,4 +1,4 @@ -import Alert from '@assets/images/alert.svg' +import Alert from '@assets/svgs/alert.svg' import React, { memo } from 'react' import { Pill } from './Pill' diff --git a/src/locales/en.ts b/src/config/locales/en.ts similarity index 100% rename from src/locales/en.ts rename to src/config/locales/en.ts diff --git a/src/storage/AccountStorageProvider.tsx b/src/config/storage/AccountStorageProvider.tsx similarity index 98% rename from src/storage/AccountStorageProvider.tsx rename to src/config/storage/AccountStorageProvider.tsx index 7ab50afa9..415caf048 100644 --- a/src/storage/AccountStorageProvider.tsx +++ b/src/config/storage/AccountStorageProvider.tsx @@ -15,16 +15,16 @@ import React, { import { useAsync } from 'react-async-hook' import Config from 'react-native-config' import { cloneDeep } from 'lodash' -import { authSlice } from '../store/slices/authSlice' -import { useAppDispatch } from '../store/store' +import { authSlice } from '@store/slices/authSlice' +import { useAppDispatch } from '@store/store' import { accountNetType, AccountNetTypeOpt, heliumAddressToSolAddress, solAddressToHelium, -} from '../utils/accountUtils' -import makeApiToken from '../utils/makeApiToken' -import { getSessionKey } from '../utils/walletApiV2' +} from '@utils/accountUtils' +import makeApiToken from '@utils/makeApiToken' +import { getSessionKey } from '@utils/walletApiV2' import { useAppStorage } from './AppStorageProvider' import { CSAccount, diff --git a/src/storage/AppStorageProvider.tsx b/src/config/storage/AppStorageProvider.tsx similarity index 99% rename from src/storage/AppStorageProvider.tsx rename to src/config/storage/AppStorageProvider.tsx index 46c76eeff..01eec2160 100644 --- a/src/storage/AppStorageProvider.tsx +++ b/src/config/storage/AppStorageProvider.tsx @@ -8,7 +8,7 @@ import React, { import { useAsync } from 'react-async-hook' import AsyncStorage from '@react-native-async-storage/async-storage' import { Cluster, PublicKey } from '@solana/web3.js' -import { Intervals } from '../features/settings/useAuthIntervals' +import { Intervals } from '@features/settings/useAuthIntervals' import { getSecureItem, SecureStorageKeys, diff --git a/src/storage/GovernanceProvider.tsx b/src/config/storage/GovernanceProvider.tsx similarity index 98% rename from src/storage/GovernanceProvider.tsx rename to src/config/storage/GovernanceProvider.tsx index a3cc5a81c..b878131a4 100644 --- a/src/storage/GovernanceProvider.tsx +++ b/src/config/storage/GovernanceProvider.tsx @@ -17,8 +17,8 @@ import React, { FC, ReactNode, createContext, useContext, useMemo } from 'react' import { useAsync } from 'react-async-hook' import Config from 'react-native-config' import { useSelector } from 'react-redux' -import { useSolana } from '../solana/SolanaProvider' -import { RootState } from '../store/rootReducer' +import { useSolana } from '@features/solana/SolanaProvider' +import { RootState } from '@store/rootReducer' import { useAccountStorage } from './AccountStorageProvider' type GovNetwork = 'hnt' | 'mobile' | 'iot' diff --git a/src/storage/JupiterProvider.tsx b/src/config/storage/JupiterProvider.tsx similarity index 98% rename from src/storage/JupiterProvider.tsx rename to src/config/storage/JupiterProvider.tsx index d51c85198..6f8730f14 100644 --- a/src/storage/JupiterProvider.tsx +++ b/src/config/storage/JupiterProvider.tsx @@ -17,7 +17,7 @@ import React, { } from 'react' import { useTranslation } from 'react-i18next' import Config from 'react-native-config' -import * as Logger from '../utils/logger' +import * as Logger from '@utils/logger' interface IJupiterContextState { loading: boolean diff --git a/src/storage/LanguageProvider.tsx b/src/config/storage/LanguageProvider.tsx similarity index 92% rename from src/storage/LanguageProvider.tsx rename to src/config/storage/LanguageProvider.tsx index 4e8bca3ba..408802335 100644 --- a/src/storage/LanguageProvider.tsx +++ b/src/config/storage/LanguageProvider.tsx @@ -1,5 +1,5 @@ import React, { createContext, ReactNode, useContext } from 'react' -import { useLanguage } from '../utils/i18n' +import { useLanguage } from '@utils/i18n' const initialState = { language: 'en', changeLanguage: async () => undefined } diff --git a/src/storage/ModalsProvider.tsx b/src/config/storage/ModalsProvider.tsx similarity index 100% rename from src/storage/ModalsProvider.tsx rename to src/config/storage/ModalsProvider.tsx diff --git a/src/storage/NotificationStorageProvider.tsx b/src/config/storage/NotificationStorageProvider.tsx similarity index 93% rename from src/storage/NotificationStorageProvider.tsx rename to src/config/storage/NotificationStorageProvider.tsx index 7a56672df..df8592d67 100644 --- a/src/storage/NotificationStorageProvider.tsx +++ b/src/config/storage/NotificationStorageProvider.tsx @@ -14,13 +14,13 @@ import { orderBy, without } from 'lodash' import { HELIUM_UPDATES_ITEM, WALLET_UPDATES_ITEM, -} from '../features/notifications/notificationTypes' -import { useAppDispatch } from '../store/store' -import { getNotifications } from '../store/slices/notificationsSlice' -import usePrevious from '../hooks/usePrevious' -import { RootState } from '../store/rootReducer' +} from '@features/notifications/notificationTypes' +import { useAppDispatch } from '@store/store' +import { getNotifications } from '@store/slices/notificationsSlice' +import usePrevious from '@hooks/usePrevious' +import { RootState } from '@store/rootReducer' +import { Notification } from '@utils/walletApiV2' import { useAccountStorage } from './AccountStorageProvider' -import { Notification } from '../utils/walletApiV2' const useNotificationStorageHook = () => { const [selectedList, setSelectedList] = useState() diff --git a/src/storage/TokensProvider.tsx b/src/config/storage/TokensProvider.tsx similarity index 98% rename from src/storage/TokensProvider.tsx rename to src/config/storage/TokensProvider.tsx index cf751e3a4..d140b1afe 100644 --- a/src/storage/TokensProvider.tsx +++ b/src/config/storage/TokensProvider.tsx @@ -9,7 +9,7 @@ import React, { useState, } from 'react' import { useAsync } from 'react-async-hook' -import * as Logger from '../utils/logger' +import * as Logger from '@utils/logger' import { useAccountStorage } from './AccountStorageProvider' import { CSToken, diff --git a/src/storage/cloudStorage.ts b/src/config/storage/cloudStorage.ts similarity index 100% rename from src/storage/cloudStorage.ts rename to src/config/storage/cloudStorage.ts diff --git a/src/storage/oneSignalStorage.ts b/src/config/storage/oneSignalStorage.ts similarity index 100% rename from src/storage/oneSignalStorage.ts rename to src/config/storage/oneSignalStorage.ts diff --git a/src/storage/secureStorage.ts b/src/config/storage/secureStorage.ts similarity index 97% rename from src/storage/secureStorage.ts rename to src/config/storage/secureStorage.ts index 8753ffe70..f2158923c 100644 --- a/src/storage/secureStorage.ts +++ b/src/config/storage/secureStorage.ts @@ -10,9 +10,9 @@ import * as bip39 from 'bip39' import * as SecureStore from 'expo-secure-store' import { Alert } from 'react-native' import Config from 'react-native-config' -import { navToImportAccount } from '../navigation/NavigationHelper' -import { ellipsizeAddress } from '../utils/accountUtils' -import i18n from '../utils/i18n' +import { ellipsizeAddress } from '@utils/accountUtils' +import i18n from '@utils/i18n' +import { navToImportAccount } from '../../app/NavigationHelper' import { CSAccount } from './cloudStorage' export enum SecureStorageKeys { diff --git a/src/theme/globalStyles.ts b/src/config/theme/globalStyles.ts similarity index 100% rename from src/theme/globalStyles.ts rename to src/config/theme/globalStyles.ts diff --git a/src/theme/theme.ts b/src/config/theme/theme.ts similarity index 100% rename from src/theme/theme.ts rename to src/config/theme/theme.ts diff --git a/src/theme/themeHooks.ts b/src/config/theme/themeHooks.ts similarity index 98% rename from src/theme/themeHooks.ts rename to src/config/theme/themeHooks.ts index ad41624bc..fa9b25cff 100644 --- a/src/theme/themeHooks.ts +++ b/src/config/theme/themeHooks.ts @@ -3,7 +3,7 @@ import tinycolor from 'tinycolor2' import { Platform, ViewStyle } from 'react-native' import { useCallback, useMemo } from 'react' import { useSafeAreaInsets } from 'react-native-safe-area-context' -import { Color, Spacing, Theme } from '@theme/theme' +import { Color, Spacing, Theme } from 'src/config/theme/theme' import { ww } from '@utils/layout' const colorScheme = 'dark' as 'dark' | 'light' diff --git a/src/features/StatusPage/StatusBanner.tsx b/src/features/StatusPage/StatusBanner.tsx index 0fc83bb87..2bdbdc27d 100644 --- a/src/features/StatusPage/StatusBanner.tsx +++ b/src/features/StatusPage/StatusBanner.tsx @@ -7,9 +7,9 @@ import FlashMessage, { import { Linking } from 'react-native' import { formatDistanceToNow, parseISO } from 'date-fns' import { useTranslation } from 'react-i18next' -import Close from '@assets/images/closeModal.svg' +import Close from '@assets/svgs/closeModal.svg' import TouchableOpacityBox from '@components/TouchableOpacityBox' -import { useColors, useHitSlop } from '@theme/themeHooks' +import { useColors, useHitSlop } from '@config/theme/themeHooks' import useStatusPage from './useStatusPage' import { HELIUM_STATUS_URL } from './statusPageTypes' import shortLocale from '../../utils/formatDistance' diff --git a/src/features/activity/ActivityDetailsScreen.tsx b/src/features/activity/ActivityDetailsScreen.tsx index 56983c6c4..007ee08b5 100644 --- a/src/features/activity/ActivityDetailsScreen.tsx +++ b/src/features/activity/ActivityDetailsScreen.tsx @@ -1,6 +1,6 @@ -import Error from '@assets/images/error.svg' -import Receive from '@assets/images/receive.svg' -import Send from '@assets/images/send.svg' +import Error from '@assets/svgs/error.svg' +import Receive from '@assets/svgs/receive.svg' +import Send from '@assets/svgs/send.svg' import BackScreen from '@components/BackScreen' import BlurActionSheet from '@components/BlurActionSheet' import Box from '@components/Box' @@ -14,14 +14,14 @@ import { useCurrentWallet } from '@hooks/useCurrentWallet' import useHaptic from '@hooks/useHaptic' import { RouteProp, useRoute } from '@react-navigation/native' import { ConfirmedSignatureInfo } from '@solana/web3.js' -import { useColors } from '@theme/themeHooks' +import { useColors } from '@config/theme/themeHooks' import React, { useCallback, useMemo, useState } from 'react' import { useTranslation } from 'react-i18next' import { Linking } from 'react-native' import { NavBarHeight } from '@components/ServiceNavBar' import { useSafeAreaInsets } from 'react-native-safe-area-context' import ScrollBox from '@components/ScrollBox' -import { useCreateExplorerUrl } from '../../constants/urls' +import { useCreateExplorerUrl } from '../../utils/constants/urls' import { EnrichedTransaction } from '../../types/solana' import { ellipsizeAddress, solAddressIsValid } from '../../utils/accountUtils' import AddressActivityItem from './AddressActivityItem' diff --git a/src/features/activity/ActivityListItem.tsx b/src/features/activity/ActivityListItem.tsx index 6521e347d..28e849343 100644 --- a/src/features/activity/ActivityListItem.tsx +++ b/src/features/activity/ActivityListItem.tsx @@ -1,13 +1,13 @@ -import Send from '@assets/images/send.svg' -import Receive from '@assets/images/receive.svg' -import Error from '@assets/images/error.svg' +import Send from '@assets/svgs/send.svg' +import Receive from '@assets/svgs/receive.svg' +import Error from '@assets/svgs/error.svg' import Box from '@components/Box' import Text from '@components/Text' import TouchableContainer from '@components/TouchableContainer' import { TouchableOpacityBoxProps } from '@components/TouchableOpacityBox' import { useCurrentWallet } from '@hooks/useCurrentWallet' import { ConfirmedSignatureInfo } from '@solana/web3.js' -import { useColors } from '@theme/themeHooks' +import { useColors } from '@config/theme/themeHooks' import { ellipsizeAddress, solAddressIsValid } from '@utils/accountUtils' import React, { useMemo } from 'react' import { useTranslation } from 'react-i18next' diff --git a/src/features/activity/ActivityScreen.tsx b/src/features/activity/ActivityScreen.tsx index 7846006a3..fabd8a027 100644 --- a/src/features/activity/ActivityScreen.tsx +++ b/src/features/activity/ActivityScreen.tsx @@ -11,7 +11,7 @@ import useEnrichedTransactions from '@hooks/useEnrichedTransactions' import CircleLoader from '@components/CircleLoader' import FadeInOut from '@components/FadeInOut' import useHaptic from '@hooks/useHaptic' -import { useColors, useSpacing } from '@theme/themeHooks' +import { useColors, useSpacing } from '@config/theme/themeHooks' import { NavBarHeight } from '@components/ServiceNavBar' import ScrollBox from '@components/ScrollBox' import { ActivityNavigationProp } from './activityTypes' diff --git a/src/features/activity/AddressActivityItem.tsx b/src/features/activity/AddressActivityItem.tsx index c1bff8bf8..bf8c18635 100644 --- a/src/features/activity/AddressActivityItem.tsx +++ b/src/features/activity/AddressActivityItem.tsx @@ -2,14 +2,14 @@ import React from 'react' import { StyleSheet } from 'react-native' import { useTranslation } from 'react-i18next' import { BoxProps } from '@shopify/restyle' -import Menu from '@assets/images/menu.svg' +import Menu from '@assets/svgs/menu.svg' import Box from '@components/Box' import Text from '@components/Text' -import { useColors } from '@theme/themeHooks' +import { useColors } from '@config/theme/themeHooks' import AccountIcon from '@components/AccountIcon' -import { Theme } from '@theme/theme' +import { Theme } from '@config/theme/theme' import TouchableOpacityBox from '@components/TouchableOpacityBox' -import { useAccountStorage } from '../../storage/AccountStorageProvider' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' import { ellipsizeAddress } from '../../utils/accountUtils' export const LIST_ITEM_HEIGHT = 70 diff --git a/src/features/addressBook/AddressBook.tsx b/src/features/addressBook/AddressBook.tsx index 72288d816..57403a3b2 100644 --- a/src/features/addressBook/AddressBook.tsx +++ b/src/features/addressBook/AddressBook.tsx @@ -2,7 +2,7 @@ import React, { memo, useCallback } from 'react' import { useNavigation } from '@react-navigation/native' import { useTranslation } from 'react-i18next' import Box from '@components/Box' -import { CSAccount } from '@storage/cloudStorage' +import { CSAccount } from '@config/storage/cloudStorage' import BackScreen from '@components/BackScreen' import ScrollBox from '@components/ScrollBox' import ContactsList from './ContactsList' diff --git a/src/features/addressBook/AddressBookNavigator.tsx b/src/features/addressBook/AddressBookNavigator.tsx index 428d809ee..875500689 100644 --- a/src/features/addressBook/AddressBookNavigator.tsx +++ b/src/features/addressBook/AddressBookNavigator.tsx @@ -1,5 +1,5 @@ import React, { memo, useMemo } from 'react' -import { useColors } from '@theme/themeHooks' +import { useColors } from '@config/theme/themeHooks' import { createStackNavigator, StackNavigationOptions, diff --git a/src/features/addressBook/AddressExtra.tsx b/src/features/addressBook/AddressExtra.tsx index a999a8d6d..e654d3e10 100644 --- a/src/features/addressBook/AddressExtra.tsx +++ b/src/features/addressBook/AddressExtra.tsx @@ -1,8 +1,8 @@ import React, { memo } from 'react' import { ActivityIndicator } from 'react-native' -import QR from '@assets/images/qr.svg' -import Checkmark from '@assets/images/checkmark.svg' -import { useColors, useHitSlop } from '@theme/themeHooks' +import QR from '@assets/svgs/qr.svg' +import Checkmark from '@assets/svgs/checkmark.svg' +import { useColors, useHitSlop } from '@config/theme/themeHooks' import TouchableOpacityBox from '@components/TouchableOpacityBox' type AddressExtraProps = { diff --git a/src/features/addressBook/AddressQrScanner.tsx b/src/features/addressBook/AddressQrScanner.tsx index f87dda2ee..4d899940c 100644 --- a/src/features/addressBook/AddressQrScanner.tsx +++ b/src/features/addressBook/AddressQrScanner.tsx @@ -4,8 +4,8 @@ import { useNavigation } from '@react-navigation/native' import useHaptic from '@hooks/useHaptic' import useAlert from '@hooks/useAlert' import QrScanner from '@components/QrScanner' -import { WalletNavigationProp } from '@services/WalletService/pages/WalletPage/WalletPageNavigator' -import { useAppStorage } from '../../storage/AppStorageProvider' +import { WalletNavigationProp } from '@services/WalletService/pages/WalletPage' +import { useAppStorage } from '@config/storage/AppStorageProvider' import { parsePaymentLink } from '../../utils/linking' import { solAddressIsValid } from '../../utils/accountUtils' diff --git a/src/features/addressBook/ContactDetails.tsx b/src/features/addressBook/ContactDetails.tsx index febe41a69..f1ab9981d 100644 --- a/src/features/addressBook/ContactDetails.tsx +++ b/src/features/addressBook/ContactDetails.tsx @@ -15,10 +15,10 @@ import { TextInput as RNTextInput, Platform, } from 'react-native' -import Checkmark from '@assets/images/checkmark.svg' +import Checkmark from '@assets/svgs/checkmark.svg' import Box from '@components/Box' import Text from '@components/Text' -import { useColors, useSpacing } from '@theme/themeHooks' +import { useColors, useSpacing } from '@config/theme/themeHooks' import TextInput from '@components/TextInput' import ButtonPressable from '@components/ButtonPressable' import AccountIcon from '@components/AccountIcon' @@ -31,15 +31,15 @@ import BackScreen from '@components/BackScreen' import { NavBarHeight } from '@components/ServiceNavBar' import { useSafeAreaInsets } from 'react-native-safe-area-context' import ScrollBox from '@components/ScrollBox' -import { useAccountStorage } from '../../storage/AccountStorageProvider' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' +import { useAppStorage } from '@config/storage/AppStorageProvider' +import { CSAccount } from '@config/storage/cloudStorage' +import { useSolana } from '@features/solana/SolanaProvider' +import AddressExtra from './AddressExtra' import { AddressBookNavigationProp, AddressBookStackParamList, } from './addressBookTypes' -import { useAppStorage } from '../../storage/AppStorageProvider' -import AddressExtra from './AddressExtra' -import { CSAccount } from '../../storage/cloudStorage' -import { useSolana } from '../../solana/SolanaProvider' import { solAddressToHelium } from '../../utils/accountUtils' const BUTTON_HEIGHT = 55 diff --git a/src/features/addressBook/ContactsList.tsx b/src/features/addressBook/ContactsList.tsx index 726534d2a..3b24231a3 100644 --- a/src/features/addressBook/ContactsList.tsx +++ b/src/features/addressBook/ContactsList.tsx @@ -8,14 +8,14 @@ import { sortBy, unionBy } from 'lodash' import Box from '@components/Box' import Text from '@components/Text' import TouchableOpacityBox from '@components/TouchableOpacityBox' -import { useAccountStorage } from '@storage/AccountStorageProvider' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' import FabButton from '@components/FabButton' import SearchInput from '@components/SearchInput' import AccountListItem from '@components/AccountListItem' -import { useSpacing } from '@theme/themeHooks' +import { useSpacing } from '@config/theme/themeHooks' import { NavBarHeight } from '@components/ServiceNavBar' import { useSafeAreaInsets } from 'react-native-safe-area-context' -import { CSAccount } from '../../storage/cloudStorage' +import { CSAccount } from '@config/storage/cloudStorage' type Props = { onAddNew: () => void diff --git a/src/features/addressBook/addressBookTypes.ts b/src/features/addressBook/addressBookTypes.ts index 99537317a..c3dbc33ba 100644 --- a/src/features/addressBook/addressBookTypes.ts +++ b/src/features/addressBook/addressBookTypes.ts @@ -1,5 +1,5 @@ import { StackNavigationProp } from '@react-navigation/stack' -import { CSAccount } from '../../storage/cloudStorage' +import { CSAccount } from '@config/storage/cloudStorage' export type AddressBookStackParamList = { AddressBook: undefined diff --git a/src/features/browser/BrowserNavigator.tsx b/src/features/browser/BrowserNavigator.tsx index 83044c109..425c30b2d 100644 --- a/src/features/browser/BrowserNavigator.tsx +++ b/src/features/browser/BrowserNavigator.tsx @@ -3,11 +3,11 @@ import { createNativeStackNavigator, NativeStackNavigationOptions, } from '@react-navigation/native-stack' -import { useAppStorage } from '@storage/AppStorageProvider' +import { useAppStorage } from '@config/storage/AppStorageProvider' +import { useSolana } from '@features/solana/SolanaProvider' import BrowserScreen from './BrowserScreen' import { BrowserWrapper } from './BrowserWebViewScreen' import DAppTutorial from './DAppTutorial' -import { useSolana } from '../../solana/SolanaProvider' const BrowserStack = createNativeStackNavigator() diff --git a/src/features/browser/BrowserScreen.tsx b/src/features/browser/BrowserScreen.tsx index 1b25f3bb7..b98f0ef58 100644 --- a/src/features/browser/BrowserScreen.tsx +++ b/src/features/browser/BrowserScreen.tsx @@ -6,22 +6,22 @@ import { TextInput as RNTextInput, TextInputSubmitEditingEventData, } from 'react-native' -import CloseCircle from '@assets/images/CloseCircle.svg' +import CloseCircle from '@assets/svgs/CloseCircle.svg' import { useNavigation } from '@react-navigation/native' import { useTranslation } from 'react-i18next' import FadeInOut from '@components/FadeInOut' import TextInput from '@components/TextInput' import Box from '@components/Box' import { ReAnimatedBox } from '@components/AnimatedBox' -import { useColors, useOpacity, useSpacing } from '@theme/themeHooks' +import { useColors, useOpacity, useSpacing } from '@config/theme/themeHooks' import TouchableOpacityBox from '@components/TouchableOpacityBox' import Text from '@components/Text' import useBrowser from '@hooks/useBrowser' import { prependHttp } from '@utils/url' import { useAsync } from 'react-async-hook' +import { useSolana } from '@features/solana/SolanaProvider' import { BrowserNavigationProp } from './browserTypes' import BrowserListItem from './BrowserListItem' -import { useSolana } from '../../solana/SolanaProvider' import { getRecommendedDapps } from '../../utils/walletApiV2' const BrowserScreen = () => { diff --git a/src/features/browser/BrowserWebViewScreen.tsx b/src/features/browser/BrowserWebViewScreen.tsx index 697911189..fa47f69ee 100644 --- a/src/features/browser/BrowserWebViewScreen.tsx +++ b/src/features/browser/BrowserWebViewScreen.tsx @@ -1,15 +1,15 @@ -import BackArrow from '@assets/images/backArrow.svg' -import Bookmark from '@assets/images/bookmark.svg' -import BookmarkFilled from '@assets/images/bookmarkFilled.svg' -import Close from '@assets/images/close.svg' -import Refresh from '@assets/images/refresh.svg' +import BackArrow from '@assets/svgs/backArrow.svg' +import Bookmark from '@assets/svgs/bookmark.svg' +import BookmarkFilled from '@assets/svgs/bookmarkFilled.svg' +import Close from '@assets/svgs/close.svg' +import Refresh from '@assets/svgs/refresh.svg' import { RouteProp, useNavigation, useRoute } from '@react-navigation/native' import { SolanaSignAndSendTransactionInput, SolanaSignMessageInput, } from '@solana/wallet-standard-features' import { Transaction, VersionedTransaction } from '@solana/web3.js' -import { useColors, useSpacing } from '@theme/themeHooks' +import { useColors, useSpacing } from '@config/theme/themeHooks' import bs58 from 'bs58' import React, { useCallback, useMemo, useRef, useState } from 'react' import { Platform, StyleSheet } from 'react-native' @@ -19,18 +19,18 @@ import { WebViewMessageEvent, WebViewNavigation, } from 'react-native-webview' +import SolanaProvider, { useSolana } from '@features/solana/SolanaProvider' +import WalletSignBottomSheet from '@features/solana/WalletSignBottomSheet' +import { + WalletSignBottomSheetRef, + WalletStandardMessageTypes, +} from '@features/solana/walletSignBottomSheetTypes' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' import Box from '../../components/Box' import SafeAreaBox from '../../components/SafeAreaBox' import Text from '../../components/Text' import TouchableOpacityBox from '../../components/TouchableOpacityBox' import useBrowser from '../../hooks/useBrowser' -import SolanaProvider, { useSolana } from '../../solana/SolanaProvider' -import WalletSignBottomSheet from '../../solana/WalletSignBottomSheet' -import { - WalletSignBottomSheetRef, - WalletStandardMessageTypes, -} from '../../solana/walletSignBottomSheetTypes' -import { useAccountStorage } from '../../storage/AccountStorageProvider' import * as Logger from '../../utils/logger' import { BrowserNavigationProp, BrowserStackParamList } from './browserTypes' import injectWalletStandard from './walletStandard' diff --git a/src/features/browser/DAppTutorial.tsx b/src/features/browser/DAppTutorial.tsx index 6baf02cd7..f5aa845ce 100644 --- a/src/features/browser/DAppTutorial.tsx +++ b/src/features/browser/DAppTutorial.tsx @@ -8,16 +8,16 @@ import ImageBox from '@components/ImageBox' import SafeAreaBox from '@components/SafeAreaBox' import Text from '@components/Text' import TextTransform from '@components/TextTransform' -import { useAppStorage } from '@storage/AppStorageProvider' -import { Spacing } from '@theme/theme' -import { useColors, useSpacing } from '@theme/themeHooks' +import { useAppStorage } from '@config/storage/AppStorageProvider' +import { Spacing } from '@config/theme/theme' +import { useColors, useSpacing } from '@config/theme/themeHooks' import { wp } from '@utils/layout' import ButtonPressable from '@components/ButtonPressable' import { ReAnimatedBox } from '@components/AnimatedBox' import { DelayedFadeIn } from '@components/FadeInOut' import { NativeViewGestureHandler } from 'react-native-gesture-handler' +import { useSolana } from '@features/solana/SolanaProvider' import { BrowserNavigationProp } from './browserTypes' -import { useSolana } from '../../solana/SolanaProvider' type CarouselItem = { titleKey: string diff --git a/src/features/burn/BurnScreen.tsx b/src/features/burn/BurnScreen.tsx index 3b11c1fcc..065c90806 100644 --- a/src/features/burn/BurnScreen.tsx +++ b/src/features/burn/BurnScreen.tsx @@ -1,5 +1,5 @@ -import Close from '@assets/images/close.svg' -import QR from '@assets/images/qr.svg' +import Close from '@assets/svgs/close.svg' +import QR from '@assets/svgs/qr.svg' import AccountButton from '@components/AccountButton' import AccountSelector, { AccountSelectorRef, @@ -28,7 +28,7 @@ import { useCurrentWallet } from '@hooks/useCurrentWallet' import { useMetaplexMetadata } from '@hooks/useMetaplexMetadata' import { RouteProp, useNavigation, useRoute } from '@react-navigation/native' import { PublicKey } from '@solana/web3.js' -import { useColors, useHitSlop } from '@theme/themeHooks' +import { useColors, useHitSlop } from '@config/theme/themeHooks' import { BN } from 'bn.js' import React, { memo as reactMemo, @@ -46,15 +46,15 @@ import { useSelector } from 'react-redux' import { WalletNavigationProp, WalletStackParamList, -} from '@services/WalletService/pages/WalletPage/WalletPageNavigator' +} from '@services/WalletService/pages/WalletPage' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' +import { CSAccount } from '@config/storage/cloudStorage' import AddressBookSelector, { AddressBookRef, } from '../../components/AddressBookSelector' import HNTKeyboard, { HNTKeyboardRef } from '../../components/HNTKeyboard' import IconPressedContainer from '../../components/IconPressedContainer' import useSubmitTxn from '../../hooks/useSubmitTxn' -import { useAccountStorage } from '../../storage/AccountStorageProvider' -import { CSAccount } from '../../storage/cloudStorage' import { RootState } from '../../store/rootReducer' import { useBalance } from '../../utils/Balance' import { diff --git a/src/features/collectables/CollectablesNavigator.tsx b/src/features/collectables/CollectablesNavigator.tsx deleted file mode 100644 index 1c27c7d87..000000000 --- a/src/features/collectables/CollectablesNavigator.tsx +++ /dev/null @@ -1,129 +0,0 @@ -import { - StackNavigationOptions, - createStackNavigator, -} from '@react-navigation/stack' -import React, { memo, useMemo } from 'react' -import { useColors } from '@theme/themeHooks' -import AddNewContact from '../addressBook/AddNewContact' -import AddressBookNavigator from '../addressBook/AddressBookNavigator' -import AddressQrScanner from '../addressBook/AddressQrScanner' -import OnboardingNav from '../hotspot-onboarding/OnboardingNav' -import PaymentQrScanner from '../payment/PaymentQrScanner' -import PaymentScreen from '../payment/PaymentScreen' -import AntennaSetupScreen from './AntennaSetupScreen' -import ClaimAllRewardsScreen from './ClaimAllRewardsScreen' -import ClaimRewardsScreen from './ClaimRewardsScreen' -import ClaimingRewardsScreen from './ClaimingRewardsScreen' -import CollectionScreen from './CollectionScreen' -import NftDetailsScreen from './NftDetailsScreen' -import SettingUpAntennaScreen from './SettingUpAntennaScreen' -import TransferCollectableScreen from './TransferCollectableScreen' -import TransferCompleteScreen from './TransferCompleteScreen' -import HotspotMapScreen from './HotspotMapScreen' -import AssertLocationScreen from './AssertLocationScreen' -import ChangeRewardsRecipientScreen from './ChangeRewardsRecipientScreen' -import HotspotList from './HotspotList' - -const CollectablesStack = createStackNavigator() - -const CollectablesStackScreen = () => { - const colors = useColors() - const screenOptions: StackNavigationOptions = useMemo( - () => ({ - headerShown: false, - cardStyle: { backgroundColor: colors.primaryBackground }, - }), - [colors], - ) - - return ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ) -} - -export default memo(CollectablesStackScreen) diff --git a/src/features/collectables/CollectionItem.tsx b/src/features/collectables/CollectionItem.tsx index ea338bd87..58a446fa2 100644 --- a/src/features/collectables/CollectionItem.tsx +++ b/src/features/collectables/CollectionItem.tsx @@ -1,12 +1,12 @@ import Box from '@components/Box' import Text from '@components/Text' import { BoxProps } from '@shopify/restyle' -import { Theme } from '@theme/theme' -import { useColors, useSpacing } from '@theme/themeHooks' +import { Theme } from '@config/theme/theme' +import { useColors, useSpacing } from '@config/theme/themeHooks' import React, { useCallback, useState } from 'react' import { Image, Switch } from 'react-native' import { useDispatch } from 'react-redux' -import VisibilityOff from '@assets/images/visibilityOff.svg' +import VisibilityOff from '@assets/svgs/visibilityOff.svg' import { collectables as collectablesSli } from '@store/slices/collectablesSlice' export type Collection = { diff --git a/src/features/collectables/CollectionScreen.tsx b/src/features/collectables/CollectionScreen.tsx index 224588836..9b3a1ef3c 100644 --- a/src/features/collectables/CollectionScreen.tsx +++ b/src/features/collectables/CollectionScreen.tsx @@ -8,8 +8,8 @@ import TouchableOpacityBox from '@components/TouchableOpacityBox' import { DelayedFadeIn } from '@components/FadeInOut' import { ReAnimatedBox } from '@components/AnimatedBox' import useHaptic from '@hooks/useHaptic' -import globalStyles from '@theme/globalStyles' -import { useBorderRadii } from '@theme/themeHooks' +import globalStyles from '@config/theme/globalStyles' +import { useBorderRadii } from '@config/theme/themeHooks' import ScrollBox from '@components/ScrollBox' import { CollectableNavigationProp, diff --git a/src/features/collectables/HotspotCompressedListItem.tsx b/src/features/collectables/HotspotCompressedListItem.tsx deleted file mode 100644 index 8b74f0880..000000000 --- a/src/features/collectables/HotspotCompressedListItem.tsx +++ /dev/null @@ -1,251 +0,0 @@ -import IotSymbol from '@assets/images/iotSymbol.svg' -import MobileSymbol from '@assets/images/mobileSymbol.svg' -import { ReAnimatedBox } from '@components/AnimatedBox' -import Box from '@components/Box' -import ImageBox from '@components/ImageBox' -import Text from '@components/Text' -import TouchableOpacityBox from '@components/TouchableOpacityBox' -import { useMint } from '@helium/helium-react-hooks' -import { IOT_MINT, MOBILE_MINT, toNumber } from '@helium/spl-utils' -import { useHotspotAddress } from '@hooks/useHotspotAddress' -import { BoxProps } from '@shopify/restyle' -import { Theme } from '@theme/theme' -import { ellipsizeAddress, formatLargeNumber } from '@utils/accountUtils' -import BigNumber from 'bignumber.js' -import BN from 'bn.js' -import React, { useMemo } from 'react' -import { FadeIn, FadeOut } from 'react-native-reanimated' -import { useColors, useOpacity } from '@theme/themeHooks' -import { PublicKey } from '@solana/web3.js' -import { useCurrentWallet } from '@hooks/useCurrentWallet' -import { useTranslation } from 'react-i18next' -import { HotspotWithPendingRewards } from '../../types/solana' -import { Mints } from '../../utils/constants' -import { removeDashAndCapitalize } from '../../utils/hotspotNftsUtils' - -export type HotspotListItemProps = { - hotspot: HotspotWithPendingRewards - onPress: (hotspot: HotspotWithPendingRewards) => void -} & BoxProps - -const HotspotListItem = ({ - hotspot, - onPress, - ...rest -}: HotspotListItemProps) => { - const { - content: { metadata }, - } = hotspot - const { t } = useTranslation() - const colors = useColors() - const wallet = useCurrentWallet() - const { backgroundStyle: flamecoOpaque } = useOpacity('orange.500', 0.1) - const streetAddress = useHotspotAddress(hotspot) - - const { info: iotMint } = useMint(IOT_MINT) - const { info: mobileMint } = useMint(MOBILE_MINT) - - const pendingIotRewards = useMemo( - () => hotspot.pendingRewards && new BN(hotspot.pendingRewards[Mints.IOT]), - [hotspot], - ) - - const pendingIotRewardsString = useMemo(() => { - if (!hotspot.pendingRewards) return - const num = toNumber( - new BN(hotspot.pendingRewards[Mints.IOT]), - iotMint?.decimals || 6, - ) - return formatLargeNumber(new BigNumber(num)) - }, [hotspot, iotMint]) - - const pendingMobileRewards = useMemo( - () => - hotspot.pendingRewards && new BN(hotspot.pendingRewards[Mints.MOBILE]), - [hotspot.pendingRewards], - ) - - const pendingMobileRewardsString = useMemo(() => { - if (!hotspot.pendingRewards) return - const num = toNumber( - new BN(hotspot.pendingRewards[Mints.MOBILE]), - mobileMint?.decimals || 6, - ) - return formatLargeNumber(new BigNumber(num)) - }, [hotspot, mobileMint]) - - const eccCompact = useMemo(() => { - if (!metadata || !metadata?.attributes?.length) { - return undefined - } - - return metadata.attributes.find( - (attr: any) => attr?.trait_type === 'ecc_compact', - )?.value - }, [metadata]) - - const hasIotRewards = useMemo( - () => pendingIotRewards && pendingIotRewards.gt(new BN(0)), - [pendingIotRewards], - ) - const hasMobileRewards = useMemo( - () => pendingMobileRewards && pendingMobileRewards.gt(new BN(0)), - [pendingMobileRewards], - ) - - const mobileRecipient = useMemo( - () => hotspot?.rewardRecipients?.[Mints.MOBILE], - [hotspot], - ) - - const iotRecipient = useMemo( - () => hotspot?.rewardRecipients?.[Mints.IOT], - [hotspot], - ) - - const hasIotRecipient = useMemo( - () => - iotRecipient?.destination && - wallet && - !new PublicKey(iotRecipient.destination).equals(wallet) && - !new PublicKey(iotRecipient.destination).equals(PublicKey.default), - [iotRecipient, wallet], - ) - - const hasMobileRecipient = useMemo( - () => - mobileRecipient?.destination && - wallet && - !new PublicKey(mobileRecipient.destination).equals(wallet) && - !new PublicKey(mobileRecipient.destination).equals(PublicKey.default), - [mobileRecipient, wallet], - ) - - const hasRecipientSet = useMemo( - () => hasIotRecipient || hasMobileRecipient, - [hasIotRecipient, hasMobileRecipient], - ) - - return ( - - onPress(hotspot)} - > - {hasRecipientSet && ( - - - - {t('changeRewardsRecipientScreen.set')} - - - - )} - - - - {metadata?.name && ( - - {removeDashAndCapitalize(metadata.name)} - - )} - - {streetAddress && ( - - {streetAddress} - - )} - - {eccCompact ? ellipsizeAddress(eccCompact) : ''} - - - - {!!hasMobileRewards && ( - - - - {pendingMobileRewardsString} - - - )} - {!!hasIotRewards && ( - - - - {pendingIotRewardsString} - - - )} - - - - - ) -} - -export default HotspotListItem diff --git a/src/features/collectables/HotspotList.tsx b/src/features/collectables/HotspotList.tsx deleted file mode 100644 index ea79fa37d..000000000 --- a/src/features/collectables/HotspotList.tsx +++ /dev/null @@ -1,322 +0,0 @@ -import Plus from '@assets/images/plus.svg' -import Globe from '@assets/images/globe.svg' -import Box from '@components/Box' -import ButtonPressable from '@components/ButtonPressable' -import CircleLoader from '@components/CircleLoader' -import Text from '@components/Text' -import TokenIcon from '@components/TokenIcon' -import { useMint } from '@helium/helium-react-hooks' -import { IOT_MINT, MOBILE_MINT, toNumber } from '@helium/spl-utils' -import useHaptic from '@hooks/useHaptic' -import useHotspots from '@hooks/useHotspots' -import { useMetaplexMetadata } from '@hooks/useMetaplexMetadata' -import { useIsFocused, useNavigation } from '@react-navigation/native' -import { PublicKey } from '@solana/web3.js' -import { useColors, useSpacing } from '@theme/themeHooks' -import BigNumber from 'bignumber.js' -import BN from 'bn.js' -import { times } from 'lodash' -import React, { useCallback, useEffect } from 'react' -import { useTranslation } from 'react-i18next' -import { RefreshControl } from 'react-native' -import { FlatList } from 'react-native-gesture-handler' -import { useSafeAreaInsets } from 'react-native-safe-area-context' -import ScrollBox from '@components/ScrollBox' -import { CompressedNFT, HotspotWithPendingRewards } from '../../types/solana' -import { formatLargeNumber } from '../../utils/accountUtils' -import HotspotCompressedListItem from './HotspotCompressedListItem' -import { NFTSkeleton } from './NftListItem' -import { CollectableNavigationProp } from './collectablesTypes' - -export const DEFAULT_PAGE_AMOUNT = 20 - -function RewardItem({ - mint, - amount, - hasMore, -}: { - mint: PublicKey - amount: BN | undefined - hasMore: boolean -}) { - const decimals = useMint(mint)?.info?.decimals - const { json, symbol } = useMetaplexMetadata(mint) - let realAmount = '' - if (amount) { - const num = toNumber(amount, decimals || 6) - realAmount = formatLargeNumber(new BigNumber(num)) - } - - return ( - - - - {realAmount} - {hasMore ? '+' : ''} - - - {symbol} - - - ) -} - -const HotspotList = () => { - const navigation = useNavigation() - const { t } = useTranslation() - const isFocused = useIsFocused() - const { primaryText } = useColors() - const { triggerImpact } = useHaptic() - const spacing = useSpacing() - const { bottom } = useSafeAreaInsets() - - const { - hotspots, - hotspotsWithMeta, - loading: loadingHotspots, - refresh, - fetchMore, - fetchingMore, - pendingIotRewards, - pendingMobileRewards, - onEndReached, - totalHotspots, - } = useHotspots() - - const pageAmount = 20 - const handleOnEndReached = useCallback(() => { - if (!fetchingMore && isFocused && !onEndReached) { - fetchMore(pageAmount) - } - }, [fetchingMore, isFocused, fetchMore, pageAmount, onEndReached]) - - const handleNavigateToHotspot = useCallback( - (hotspot: HotspotWithPendingRewards) => { - if (hotspot.content.metadata) { - triggerImpact('light') - const { iot, mobile } = hotspot.content.metadata.hotspot_infos || {} - navigation.navigate('HotspotMapScreen', { - hotspot, - network: iot?.location - ? 'IOT' - : mobile?.location - ? 'MOBILE' - : undefined, - }) - } - }, - [navigation, triggerImpact], - ) - - const handleNavigateToClaimRewards = useCallback(() => { - navigation.navigate('ClaimAllRewardsScreen') - }, [navigation]) - - const handleNavigateToMap = useCallback(() => { - navigation.navigate('HotspotMapScreen') - }, [navigation]) - - const handleNavigateToHotspotOnboard = useCallback(() => { - navigation.navigate('OnboardingNavigator') - }, [navigation]) - - const renderHeader = useCallback(() => { - return ( - - - - } - title={t('collectablesScreen.hotspots.openMap')} - titleColor="base.white" - fontSize={14} - onPress={handleNavigateToMap} - /> - - } - title={t('collectablesScreen.hotspots.connect')} - titleColor="base.black" - fontSize={14} - onPress={handleNavigateToHotspotOnboard} - /> - - - - - - You own - - - {totalHotspots} hotspots - - - - - - - ) - }, [t, handleNavigateToMap, handleNavigateToHotspotOnboard, totalHotspots]) - - const renderCollectable = useCallback( - // eslint-disable-next-line react/no-unused-prop-types - ({ item }: { item: HotspotWithPendingRewards }) => { - return ( - - ) - }, - [handleNavigateToHotspot], - ) - - const renderEmptyComponent = useCallback(() => { - if (!loadingHotspots) return null - - if (loadingHotspots && hotspots) { - return ( - - {times(hotspots.length).map((i) => ( - - ))} - - ) - } - - return null - }, [hotspots, loadingHotspots]) - - const keyExtractor = useCallback((item: CompressedNFT) => { - return item.id - }, []) - - const Footer = useCallback( - () => ( - - {fetchingMore ? : } - - ), - [fetchingMore], - ) - - const handleRefresh = useCallback(() => { - refresh(pageAmount) - }, [pageAmount, refresh]) - - useEffect(() => { - return navigation.addListener('focus', () => { - refresh() - }) - }, [navigation, refresh]) - - return ( - <> - - } - > - - - - - - - - - - - ) -} - -export default HotspotList diff --git a/src/features/collectables/HotspotListItem.tsx b/src/features/collectables/HotspotListItem.tsx deleted file mode 100644 index 2ff84989c..000000000 --- a/src/features/collectables/HotspotListItem.tsx +++ /dev/null @@ -1,173 +0,0 @@ -import React, { useMemo } from 'react' -import { FadeIn, FadeOut } from 'react-native-reanimated' -import { BoxProps } from '@shopify/restyle' -import IotSymbol from '@assets/images/iotSymbol.svg' -import MobileSymbol from '@assets/images/mobileSymbol.svg' -import BN from 'bn.js' -import Text from '@components/Text' -import TouchableOpacityBox from '@components/TouchableOpacityBox' -import Box from '@components/Box' -import { ReAnimatedBox } from '@components/AnimatedBox' -import ImageBox from '@components/ImageBox' -import { Theme } from '@theme/theme' -import { IOT_MINT, MOBILE_MINT, toNumber } from '@helium/spl-utils' -import { useMint } from '@helium/helium-react-hooks' -import BigNumber from 'bignumber.js' -import { useColors } from '@theme/themeHooks' -import { removeDashAndCapitalize } from '../../utils/hotspotNftsUtils' -import { ww } from '../../utils/layout' -import { formatLargeNumber } from '../../utils/accountUtils' -import { Mints } from '../../utils/constants' -import { HotspotWithPendingRewards } from '../../types/solana' - -export type HotspotListItemProps = { - hotspot: HotspotWithPendingRewards - onPress: (hotspot: HotspotWithPendingRewards) => void -} & BoxProps - -const HotspotListItem = ({ - hotspot, - onPress, - ...rest -}: HotspotListItemProps) => { - const colors = useColors() - const COLLECTABLE_HEIGHT = ww / 2 - const { - content: { metadata }, - } = hotspot - - const { info: iotMint } = useMint(IOT_MINT) - const { info: mobileMint } = useMint(MOBILE_MINT) - - const pendingIotRewards = useMemo( - () => hotspot.pendingRewards && new BN(hotspot.pendingRewards[Mints.IOT]), - [hotspot.pendingRewards], - ) - const pendingIotRewardsString = useMemo(() => { - if (!hotspot.pendingRewards) return - const num = toNumber( - new BN(hotspot.pendingRewards[Mints.IOT]), - iotMint?.decimals || 6, - ) - return formatLargeNumber(new BigNumber(num)) - }, [iotMint, hotspot]) - - const pendingMobileRewards = useMemo( - () => - hotspot.pendingRewards && new BN(hotspot.pendingRewards[Mints.MOBILE]), - [hotspot.pendingRewards], - ) - - const pendingMobileRewardsString = useMemo(() => { - if (!hotspot.pendingRewards) return - const num = toNumber( - new BN(hotspot.pendingRewards[Mints.MOBILE]), - mobileMint?.decimals || 6, - ) - return formatLargeNumber(new BigNumber(num)) - }, [hotspot, mobileMint]) - - const hasIotRewards = useMemo( - () => pendingIotRewards && pendingIotRewards.gt(new BN(0)), - [pendingIotRewards], - ) - const hasMobileRewards = useMemo( - () => pendingMobileRewards && pendingMobileRewards.gt(new BN(0)), - [pendingMobileRewards], - ) - - return ( - - onPress(hotspot)} - > - - {!!hasMobileRewards && ( - - - {pendingMobileRewardsString} - - - - )} - {!!hasIotRewards && ( - - - {pendingIotRewardsString} - - - - )} - - {metadata?.name && ( - - {removeDashAndCapitalize(metadata.name)} - - )} - - ) -} - -export default HotspotListItem diff --git a/src/features/collectables/ManageCollectables.tsx b/src/features/collectables/ManageCollectables.tsx index ecc61adf1..798a5d550 100644 --- a/src/features/collectables/ManageCollectables.tsx +++ b/src/features/collectables/ManageCollectables.tsx @@ -3,7 +3,7 @@ import ScrollBox from '@components/ScrollBox' import { NavBarHeight } from '@components/ServiceNavBar' import useCollectables from '@hooks/useCollectables' import { RootState } from '@store/rootReducer' -import { useColors } from '@theme/themeHooks' +import { useColors } from '@config/theme/themeHooks' import { heliumNFTs } from '@utils/solanaUtils' import React, { useCallback } from 'react' import { useAsync } from 'react-async-hook' diff --git a/src/features/collectables/NftDetailsScreen.tsx b/src/features/collectables/NftDetailsScreen.tsx index 186914bdb..ba24b1028 100644 --- a/src/features/collectables/NftDetailsScreen.tsx +++ b/src/features/collectables/NftDetailsScreen.tsx @@ -3,24 +3,24 @@ import { RouteProp, useNavigation, useRoute } from '@react-navigation/native' import { useSafeAreaInsets } from 'react-native-safe-area-context' import 'text-encoding-polyfill' import { useTranslation } from 'react-i18next' -import Face from '@assets/images/face.svg' -import ArrowRight from '@assets/images/arrowRight.svg' +import Face from '@assets/svgs/face.svg' +import ArrowRight from '@assets/svgs/arrowRight.svg' import { DelayedFadeIn } from '@components/FadeInOut' -import globalStyles from '@theme/globalStyles' +import globalStyles from '@config/theme/globalStyles' import Box from '@components/Box' import ImageBox from '@components/ImageBox' import Text from '@components/Text' import BackScreen from '@components/BackScreen' -import { useSpacing } from '@theme/themeHooks' +import { useSpacing } from '@config/theme/themeHooks' import { ReAnimatedBox } from '@components/AnimatedBox' import ScrollBox from '@components/ScrollBox' import { WalletNavigationProp, WalletStackParamList, -} from '@services/WalletService/pages/WalletPage/WalletPageNavigator' +} from '@services/WalletService/pages/WalletPage' import { NavBarHeight } from '@components/ServiceNavBar' import ButtonPressable from '@components/ButtonPressable' -import { useAccountStorage } from '@storage/AccountStorageProvider' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' import NftMetadata from './NftMetadata' import { ww } from '../../utils/layout' import { CompressedNFT } from '../../types/solana' diff --git a/src/features/collectables/NftList.tsx b/src/features/collectables/NftList.tsx index 65d1e8b17..e4ed8c853 100644 --- a/src/features/collectables/NftList.tsx +++ b/src/features/collectables/NftList.tsx @@ -4,14 +4,14 @@ import { FlatList } from 'react-native-gesture-handler' import { RefreshControl } from 'react-native' import Box from '@components/Box' import useCollectables from '@hooks/useCollectables' -import { useColors, useSpacing } from '@theme/themeHooks' +import { useColors, useSpacing } from '@config/theme/themeHooks' import { useNavigation } from '@react-navigation/native' import { NavBarHeight } from '@components/ServiceNavBar' import { useSafeAreaInsets } from 'react-native-safe-area-context' import TouchableOpacityBox from '@components/TouchableOpacityBox' -import Config from '@assets/images/config.svg' +import Config from '@assets/svgs/config.svg' import Text from '@components/Text' -import { WalletNavigationProp } from '@services/WalletService/pages/WalletPage/WalletPageNavigator' +import { WalletNavigationProp } from '@services/WalletService/pages/WalletPage' import ScrollBox from '@components/ScrollBox' import { useSelector } from 'react-redux' import { RootState } from '@store/rootReducer' diff --git a/src/features/collectables/NftListItem.tsx b/src/features/collectables/NftListItem.tsx index e31c9f1b7..a22b1af6c 100644 --- a/src/features/collectables/NftListItem.tsx +++ b/src/features/collectables/NftListItem.tsx @@ -8,7 +8,7 @@ import TouchableOpacityBox from '@components/TouchableOpacityBox' import CircleLoader from '@components/CircleLoader' import { ReAnimatedBox } from '@components/AnimatedBox' import useHaptic from '@hooks/useHaptic' -import { useBorderRadii } from '@theme/themeHooks' +import { useBorderRadii } from '@config/theme/themeHooks' import useLayoutWidth from '@hooks/useLayoutWidth' import { ww } from '../../utils/layout' import { Collectable } from '../../types/solana' diff --git a/src/features/collectables/NftMetadata.tsx b/src/features/collectables/NftMetadata.tsx index cad7c6a08..96353d5af 100644 --- a/src/features/collectables/NftMetadata.tsx +++ b/src/features/collectables/NftMetadata.tsx @@ -3,7 +3,7 @@ import { useTranslation } from 'react-i18next' import Box from '@components/Box' import Text from '@components/Text' import { BoxProps } from '@shopify/restyle' -import { Theme } from '@theme/theme' +import { Theme } from '@config/theme/theme' function stringify( s: boolean | string | string[] | undefined, diff --git a/src/features/collectables/TransferCollectableScreen.tsx b/src/features/collectables/TransferCollectableScreen.tsx index 8756dbab5..30953b08a 100644 --- a/src/features/collectables/TransferCollectableScreen.tsx +++ b/src/features/collectables/TransferCollectableScreen.tsx @@ -1,4 +1,4 @@ -import ArrowRight from '@assets/images/arrowRight.svg' +import ArrowRight from '@assets/svgs/arrowRight.svg' import AddressBookSelector, { AddressBookRef, } from '@components/AddressBookSelector' @@ -12,7 +12,7 @@ import ImageBox from '@components/ImageBox' import Text from '@components/Text' import TextInput from '@components/TextInput' import { RouteProp, useNavigation, useRoute } from '@react-navigation/native' -import { useColors, useSpacing } from '@theme/themeHooks' +import { useColors, useSpacing } from '@config/theme/themeHooks' import React, { memo, useCallback, useMemo, useRef, useState } from 'react' import { useTranslation } from 'react-i18next' import { @@ -27,10 +27,10 @@ import ScrollBox from '@components/ScrollBox' import { Asset } from '@helium/spl-utils' import { NavBarHeight } from '@components/ServiceNavBar' import TouchableOpacityBox from '@components/TouchableOpacityBox' -import AddressIcon from '@assets/images/addressIcon.svg' -import { WalletNavigationProp } from '@services/WalletService/pages/WalletPage/WalletPageNavigator' +import AddressIcon from '@assets/svgs/addressIcon.svg' +import { WalletNavigationProp } from '@services/WalletService/pages/WalletPage' +import { CSAccount } from '@config/storage/cloudStorage' import useSubmitTxn from '../../hooks/useSubmitTxn' -import { CSAccount } from '../../storage/cloudStorage' import { solAddressIsValid } from '../../utils/accountUtils' import { ww } from '../../utils/layout' import * as Logger from '../../utils/logger' diff --git a/src/features/collectables/TransferCompleteScreen.tsx b/src/features/collectables/TransferCompleteScreen.tsx index 80cd82703..c77da09f3 100644 --- a/src/features/collectables/TransferCompleteScreen.tsx +++ b/src/features/collectables/TransferCompleteScreen.tsx @@ -1,4 +1,4 @@ -import BackArrow from '@assets/images/backArrow.svg' +import BackArrow from '@assets/svgs/backArrow.svg' import { ReAnimatedBox } from '@components/AnimatedBox' import BackScreen from '@components/BackScreen' import Box from '@components/Box' @@ -11,7 +11,7 @@ import { useSolOwnedAmount } from '@helium/helium-react-hooks' import { useBN } from '@hooks/useBN' import { useCurrentWallet } from '@hooks/useCurrentWallet' import { RouteProp, useNavigation, useRoute } from '@react-navigation/native' -import { useColors, useSpacing } from '@theme/themeHooks' +import { useColors, useSpacing } from '@config/theme/themeHooks' import { parseTransactionError } from '@utils/solanaUtils' import React, { memo, useCallback, useMemo } from 'react' import { useTranslation } from 'react-i18next' @@ -22,7 +22,7 @@ import 'text-encoding-polyfill' import ScrollBox from '@components/ScrollBox' import { NavBarHeight } from '@components/ServiceNavBar' import { useSafeAreaInsets } from 'react-native-safe-area-context' -import { WalletNavigationProp } from '@services/WalletService/pages/WalletPage/WalletPageNavigator' +import { WalletNavigationProp } from '@services/WalletService/pages/WalletPage' import { RootState } from '../../store/rootReducer' import { CompressedNFT } from '../../types/solana' import { ww } from '../../utils/layout' diff --git a/src/features/dappLogin/DappAccount.tsx b/src/features/dappLogin/DappAccount.tsx index 42f2434fb..f36ca8d16 100644 --- a/src/features/dappLogin/DappAccount.tsx +++ b/src/features/dappLogin/DappAccount.tsx @@ -1,8 +1,8 @@ import React, { memo, useCallback, useEffect, useMemo, useRef } from 'react' import { useTranslation } from 'react-i18next' -import Crowdspot from '@assets/images/crowdspot.svg' -import AddDapp from '@assets/images/addDapp.svg' -import DappEllipsis from '@assets/images/dapp-ellipsis.svg' +import Crowdspot from '@assets/svgs/crowdspot.svg' +import AddDapp from '@assets/svgs/addDapp.svg' +import DappEllipsis from '@assets/svgs/dapp-ellipsis.svg' import { NetTypes as NetType, NetTypes } from '@helium/address' import { ActivityIndicator } from 'react-native' import AccountButton from '@components/AccountButton' @@ -12,9 +12,9 @@ import AccountSelector, { import Box from '@components/Box' import Text from '@components/Text' import TouchableOpacityBox from '@components/TouchableOpacityBox' -import { useAccountStorage } from '@storage/AccountStorageProvider' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' import AccountIcon from '@components/AccountIcon' -import { useColors } from '@theme/themeHooks' +import { useColors } from '@config/theme/themeHooks' type Props = { onLogin: () => void diff --git a/src/features/dappLogin/DappConnect.tsx b/src/features/dappLogin/DappConnect.tsx index 2d5267ad2..f512072e6 100644 --- a/src/features/dappLogin/DappConnect.tsx +++ b/src/features/dappLogin/DappConnect.tsx @@ -1,11 +1,11 @@ import React, { memo, useMemo } from 'react' import { useTranslation } from 'react-i18next' -import Crowdspot from '@assets/images/crowdspot.svg' -import AddDapp from '@assets/images/addDapp.svg' +import Crowdspot from '@assets/svgs/crowdspot.svg' +import AddDapp from '@assets/svgs/addDapp.svg' import Box from '@components/Box' import Text from '@components/Text' import TouchableOpacityBox from '@components/TouchableOpacityBox' -import { useColors } from '@theme/themeHooks' +import { useColors } from '@config/theme/themeHooks' type Props = { appName: string; onApprove: () => void; onDeny: () => void } const DappConnect = ({ appName, onApprove, onDeny }: Props) => { diff --git a/src/features/dappLogin/DappLoginScreen.tsx b/src/features/dappLogin/DappLoginScreen.tsx index 0624cfea9..fa6a37fb0 100644 --- a/src/features/dappLogin/DappLoginScreen.tsx +++ b/src/features/dappLogin/DappLoginScreen.tsx @@ -1,23 +1,20 @@ -import Close from '@assets/images/close.svg' +import Close from '@assets/svgs/close.svg' import SafeAreaBox from '@components/SafeAreaBox' import TouchableOpacityBox from '@components/TouchableOpacityBox' import Address from '@helium/address' import { TokenBurnV1 } from '@helium/transactions' import useAlert from '@hooks/useAlert' import { RouteProp, useNavigation, useRoute } from '@react-navigation/native' -import { useColors } from '@theme/themeHooks' +import { useColors } from '@config/theme/themeHooks' import React, { memo, useCallback, useEffect, useMemo, useRef } from 'react' import { useAsync } from 'react-async-hook' import { useTranslation } from 'react-i18next' import { ActivityIndicator, Linking } from 'react-native' import { useDebouncedCallback } from 'use-debounce' -import { WalletNavigationProp } from '@services/WalletService/pages/WalletPage/WalletPageNavigator' -import { - RootNavigationProp, - RootStackParamList, -} from '../../navigation/rootTypes' -import { useAccountStorage } from '../../storage/AccountStorageProvider' -import { getKeypair } from '../../storage/secureStorage' +import { WalletNavigationProp } from '@services/WalletService/pages/WalletPage' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' +import { getKeypair } from '@config/storage/secureStorage' +import { RootNavigationProp, RootStackParamList } from '../../app/rootTypes' import DappAccount from './DappAccount' import DappConnect from './DappConnect' import { useWalletConnect } from './WalletConnectProvider' diff --git a/src/features/governance/AssignProxyScreen.tsx b/src/features/governance/AssignProxyScreen.tsx index f8aed8f32..208458404 100644 --- a/src/features/governance/AssignProxyScreen.tsx +++ b/src/features/governance/AssignProxyScreen.tsx @@ -22,7 +22,7 @@ import { usePublicKey } from '@hooks/usePublicKey' import Slider from '@react-native-community/slider' import { RouteProp, useNavigation, useRoute } from '@react-navigation/native' import { PublicKey, TransactionInstruction } from '@solana/web3.js' -import { useGovernance } from '@storage/GovernanceProvider' +import { useGovernance } from '@config/storage/GovernanceProvider' import { MAX_TRANSACTIONS_PER_SIGNATURE_BATCH } from '@utils/constants' import sleep from '@utils/sleep' import { getBasePriorityFee } from '@utils/walletApiV2' @@ -31,9 +31,9 @@ import React, { useCallback, useMemo, useState } from 'react' import { useTranslation } from 'react-i18next' import { FlatList } from 'react-native' import { Edge } from 'react-native-safe-area-context' -import { useSolana } from '../../solana/SolanaProvider' -import { useWalletSign } from '../../solana/WalletSignProvider' -import { WalletStandardMessageTypes } from '../../solana/walletSignBottomSheetTypes' +import { useSolana } from '@features/solana/SolanaProvider' +import { useWalletSign } from '@features/solana/WalletSignProvider' +import { WalletStandardMessageTypes } from '@features/solana/walletSignBottomSheetTypes' import { PositionPreview } from './PositionPreview' import { ProxySearch } from './ProxySearch' import { diff --git a/src/features/governance/ClaimingRewardsModal.tsx b/src/features/governance/ClaimingRewardsModal.tsx index 4a1ff7629..682152d8b 100644 --- a/src/features/governance/ClaimingRewardsModal.tsx +++ b/src/features/governance/ClaimingRewardsModal.tsx @@ -8,7 +8,7 @@ import Box from '@components/Box' import { Edge } from 'react-native-safe-area-context' import AccountIcon from '@components/AccountIcon' import { useTranslation } from 'react-i18next' -import { useAccountStorage } from '@storage/AccountStorageProvider' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' import { Status } from '@helium/spl-utils' import ProgressBar from '@components/ProgressBar' diff --git a/src/features/governance/GovernanceNavigator.tsx b/src/features/governance/GovernanceNavigator.tsx index 3ebfb6952..33bf4eeff 100644 --- a/src/features/governance/GovernanceNavigator.tsx +++ b/src/features/governance/GovernanceNavigator.tsx @@ -3,9 +3,9 @@ import { StackNavigationOptions, createStackNavigator, } from '@react-navigation/stack' -import { useAppStorage } from '@storage/AppStorageProvider' +import { useAppStorage } from '@config/storage/AppStorageProvider' import React, { memo, useMemo } from 'react' -import { useColors } from '@theme/themeHooks' +import { useColors } from '@config/theme/themeHooks' import AssignProxyScreen from './AssignProxyScreen' import GovernanceTutorialScreen from './GovernanceTutorialScreen' import PositionsScreen from './PositionsScreen' diff --git a/src/features/governance/GovernanceTutorialScreen.tsx b/src/features/governance/GovernanceTutorialScreen.tsx index 62358b3bb..076d5526c 100644 --- a/src/features/governance/GovernanceTutorialScreen.tsx +++ b/src/features/governance/GovernanceTutorialScreen.tsx @@ -7,9 +7,9 @@ import Box from '@components/Box' import ImageBox from '@components/ImageBox' import Text from '@components/Text' import TextTransform from '@components/TextTransform' -import { useAppStorage } from '@storage/AppStorageProvider' -import { Spacing } from '@theme/theme' -import { useColors, useSpacing } from '@theme/themeHooks' +import { useAppStorage } from '@config/storage/AppStorageProvider' +import { Spacing } from '@config/theme/theme' +import { useColors, useSpacing } from '@config/theme/themeHooks' import { wp } from '@utils/layout' import ButtonPressable from '@components/ButtonPressable' import { NativeViewGestureHandler } from 'react-native-gesture-handler' diff --git a/src/features/governance/GovernanceWrapper.tsx b/src/features/governance/GovernanceWrapper.tsx index a44fe253d..e470b50de 100644 --- a/src/features/governance/GovernanceWrapper.tsx +++ b/src/features/governance/GovernanceWrapper.tsx @@ -1,17 +1,17 @@ /* eslint-disable @typescript-eslint/no-shadow */ -import Flag from '@assets/images/flag.svg' -import LightningBolt from '@assets/images/lightningBolt.svg' -import UserStar from '@assets/images/userStar.svg' +import Flag from '@assets/svgs/flag.svg' +import LightningBolt from '@assets/svgs/lightningBolt.svg' +import UserStar from '@assets/svgs/userStar.svg' import { ReAnimatedBox } from '@components/AnimatedBox' import Box from '@components/Box' import CircleLoader from '@components/CircleLoader' import { Select } from '@components/Select' import { RouteProp, useNavigation, useRoute } from '@react-navigation/native' -import { useGovernance } from '@storage/GovernanceProvider' +import { useGovernance } from '@config/storage/GovernanceProvider' import React, { useEffect, useMemo, useRef } from 'react' import { Animated } from 'react-native' import { FadeIn } from 'react-native-reanimated' -import { useColors } from '@theme/themeHooks' +import { useColors } from '@config/theme/themeHooks' import { GovernanceNavigationProp, GovernanceStackParamList, diff --git a/src/features/governance/LockTokensModal.tsx b/src/features/governance/LockTokensModal.tsx index 729c2f117..f424f3b2f 100644 --- a/src/features/governance/LockTokensModal.tsx +++ b/src/features/governance/LockTokensModal.tsx @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ -import Close from '@assets/images/close.svg' -import InfoIcon from '@assets/images/info.svg' +import Close from '@assets/svgs/close.svg' +import InfoIcon from '@assets/svgs/info.svg' import { ReAnimatedBox } from '@components/AnimatedBox' import BackScreen from '@components/BackScreen' import Box from '@components/Box' @@ -17,7 +17,7 @@ import { useMint } from '@helium/helium-react-hooks' import { HNT_MINT, toBN, toNumber } from '@helium/spl-utils' import { SubDaoWithMeta, useSubDaos } from '@helium/voter-stake-registry-hooks' import { PublicKey } from '@solana/web3.js' -import { useAccountStorage } from '@storage/AccountStorageProvider' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' import { getFormattedStringFromDays, yearsToDays } from '@utils/dateTools' import { getMintMinAmountAsDecimal, precision } from '@utils/formatting' import { TXN_FEE_IN_LAMPORTS } from '@utils/solanaUtils' @@ -30,9 +30,9 @@ import { TouchableWithoutFeedback, } from 'react-native' import { Edge } from 'react-native-safe-area-context' -import HntIcon from '@assets/images/helium.svg' +import HntIcon from '@assets/svgs/helium.svg' import ScrollBox from '@components/ScrollBox' -import { useColors } from '@theme/themeHooks' +import { useColors } from '@config/theme/themeHooks' const SOL_TXN_FEE = new BN(TXN_FEE_IN_LAMPORTS) export const defaultLockupPeriods = [ diff --git a/src/features/governance/NetworkTabs.tsx b/src/features/governance/NetworkTabs.tsx index e7a4992fb..99e64d0e9 100644 --- a/src/features/governance/NetworkTabs.tsx +++ b/src/features/governance/NetworkTabs.tsx @@ -4,9 +4,9 @@ import { PublicKey } from '@solana/web3.js' import React, { useCallback, useMemo } from 'react' import SegmentedControl from '@components/SegmentedControl' import { Mints } from '@utils/constants' -import IOT from '@assets/images/iotSymbol.svg' -import MOBILE from '@assets/images/mobileIcon.svg' -import HNT from '@assets/images/tokenHNT.svg' +import IOT from '@assets/svgs/iotSymbol.svg' +import MOBILE from '@assets/svgs/mobileIcon.svg' +import HNT from '@assets/svgs/tokenHNT.svg' import { GovernanceNavigationProp } from './governanceTypes' export const NetworkTabs: React.FC = () => { diff --git a/src/features/governance/PositionCard.tsx b/src/features/governance/PositionCard.tsx index c7e12db01..7b63ef11c 100644 --- a/src/features/governance/PositionCard.tsx +++ b/src/features/governance/PositionCard.tsx @@ -40,9 +40,9 @@ import { useMetaplexMetadata } from '@hooks/useMetaplexMetadata' import { useNavigation } from '@react-navigation/native' import { BoxProps } from '@shopify/restyle' import { Keypair, PublicKey, TransactionInstruction } from '@solana/web3.js' -import { useGovernance } from '@storage/GovernanceProvider' -import { Theme } from '@theme/theme' -import { useCreateOpacity } from '@theme/themeHooks' +import { useGovernance } from '@config/storage/GovernanceProvider' +import { Theme } from '@config/theme/theme' +import { useCreateOpacity } from '@config/theme/themeHooks' import { MAX_TRANSACTIONS_PER_SIGNATURE_BATCH } from '@utils/constants' import { daysToSecs, @@ -58,10 +58,10 @@ import React, { useCallback, useMemo, useRef, useState } from 'react' import { useAsync } from 'react-async-hook' import { useTranslation } from 'react-i18next' import { FadeIn, FadeOut } from 'react-native-reanimated' -import { MessagePreview } from '../../solana/MessagePreview' -import { useSolana } from '../../solana/SolanaProvider' -import { useWalletSign } from '../../solana/WalletSignProvider' -import { WalletStandardMessageTypes } from '../../solana/walletSignBottomSheetTypes' +import { MessagePreview } from '@features/solana/MessagePreview' +import { useSolana } from '@features/solana/SolanaProvider' +import { useWalletSign } from '@features/solana/WalletSignProvider' +import { WalletStandardMessageTypes } from '@features/solana/walletSignBottomSheetTypes' import { DelegateTokensModal } from './DelegateTokensModal' import LockTokensModal, { LockTokensModalFormValues } from './LockTokensModal' import { TransferTokensModal } from './TransferTokensModal' diff --git a/src/features/governance/PositionPreview.tsx b/src/features/governance/PositionPreview.tsx index c0593de0a..46843de6c 100644 --- a/src/features/governance/PositionPreview.tsx +++ b/src/features/governance/PositionPreview.tsx @@ -1,13 +1,13 @@ -import Hnt from '@assets/images/hnt.svg' -import Iot from '@assets/images/iot.svg' -import Mobile from '@assets/images/mobile.svg' +import Hnt from '@assets/svgs/hnt.svg' +import Iot from '@assets/svgs/iot.svg' +import Mobile from '@assets/svgs/mobile.svg' import Box from '@components/Box' import Text from '@components/Text' import TouchableContainer, { ButtonPressAnimationProps, } from '@components/TouchableContainer' import { PositionWithMeta } from '@helium/voter-stake-registry-hooks' -import { useGovernance } from '@storage/GovernanceProvider' +import { useGovernance } from '@config/storage/GovernanceProvider' import { getMinDurationFmt } from '@utils/dateTools' import { humanReadable } from '@utils/formatting' import BN from 'bn.js' diff --git a/src/features/governance/PositionsList.tsx b/src/features/governance/PositionsList.tsx index 79faec187..28699f9c6 100644 --- a/src/features/governance/PositionsList.tsx +++ b/src/features/governance/PositionsList.tsx @@ -1,4 +1,4 @@ -import LightningBolt from '@assets/images/transactions.svg' +import LightningBolt from '@assets/svgs/transactions.svg' import Box from '@components/Box' import { CardSkeleton } from '@components/CardSkeleton' import Text from '@components/Text' @@ -7,9 +7,9 @@ import { useSubDaos, } from '@helium/voter-stake-registry-hooks' import { BoxProps } from '@shopify/restyle' -import { useGovernance } from '@storage/GovernanceProvider' -import { Theme } from '@theme/theme' -import { useColors } from '@theme/themeHooks' +import { useGovernance } from '@config/storage/GovernanceProvider' +import { Theme } from '@config/theme/theme' +import { useColors } from '@config/theme/themeHooks' import { times } from 'lodash' import React, { useCallback, useMemo } from 'react' import { useTranslation } from 'react-i18next' diff --git a/src/features/governance/PositionsScreen.tsx b/src/features/governance/PositionsScreen.tsx index 02019c3c6..313072c1b 100644 --- a/src/features/governance/PositionsScreen.tsx +++ b/src/features/governance/PositionsScreen.tsx @@ -23,7 +23,7 @@ import { import { useCurrentWallet } from '@hooks/useCurrentWallet' import { useMetaplexMetadata } from '@hooks/useMetaplexMetadata' import { Keypair, TransactionInstruction } from '@solana/web3.js' -import { useGovernance } from '@storage/GovernanceProvider' +import { useGovernance } from '@config/storage/GovernanceProvider' import { MAX_TRANSACTIONS_PER_SIGNATURE_BATCH } from '@utils/constants' import { daysToSecs, getFormattedStringFromDays } from '@utils/dateTools' import { getBasePriorityFee } from '@utils/walletApiV2' @@ -31,12 +31,12 @@ import BN from 'bn.js' import React, { useCallback, useMemo, useState } from 'react' import { useTranslation } from 'react-i18next' import { useSafeAreaInsets } from 'react-native-safe-area-context' -import { useSpacing } from '@theme/themeHooks' +import { useSpacing } from '@config/theme/themeHooks' import ScrollBox from '@components/ScrollBox' -import { MessagePreview } from '../../solana/MessagePreview' -import { useSolana } from '../../solana/SolanaProvider' -import { useWalletSign } from '../../solana/WalletSignProvider' -import { WalletStandardMessageTypes } from '../../solana/walletSignBottomSheetTypes' +import { MessagePreview } from '@features/solana/MessagePreview' +import { useSolana } from '@features/solana/SolanaProvider' +import { useWalletSign } from '@features/solana/WalletSignProvider' +import { WalletStandardMessageTypes } from '@features/solana/walletSignBottomSheetTypes' import { ClaimingRewardsModal } from './ClaimingRewardsModal' import GovernanceWrapper from './GovernanceWrapper' import LockTokensModal, { LockTokensModalFormValues } from './LockTokensModal' diff --git a/src/features/governance/ProposalCard.tsx b/src/features/governance/ProposalCard.tsx index 3c42dea4d..e8e3ce40c 100644 --- a/src/features/governance/ProposalCard.tsx +++ b/src/features/governance/ProposalCard.tsx @@ -9,8 +9,8 @@ import { } from '@helium/modular-governance-hooks' import { BoxProps } from '@shopify/restyle' import { PublicKey } from '@solana/web3.js' -import { useGovernance } from '@storage/GovernanceProvider' -import { Theme } from '@theme/theme' +import { useGovernance } from '@config/storage/GovernanceProvider' +import { Theme } from '@config/theme/theme' import { humanReadable } from '@utils/formatting' import axios from 'axios' import BN from 'bn.js' @@ -20,7 +20,7 @@ import { useAsync } from 'react-async-hook' import { FadeIn, FadeOut } from 'react-native-reanimated' import { useTranslation } from 'react-i18next' import { getTimeFromNowFmt } from '@utils/dateTools' -import { useAccountStorage } from '@storage/AccountStorageProvider' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' import { getDerivedProposalState } from '@utils/governanceUtils' import { ProposalFilter, ProposalV0 } from './governanceTypes' import { ProposalTags } from './ProposalTags' diff --git a/src/features/governance/ProposalScreen.tsx b/src/features/governance/ProposalScreen.tsx index 8dbb61cd5..7dbde690d 100644 --- a/src/features/governance/ProposalScreen.tsx +++ b/src/features/governance/ProposalScreen.tsx @@ -1,4 +1,4 @@ -import BrowseVoters from '@assets/images/browseVoters.svg' +import BrowseVoters from '@assets/svgs/browseVoters.svg' import { ReAnimatedBox } from '@components/AnimatedBox' import BackScreen from '@components/BackScreen' import Box from '@components/Box' @@ -27,9 +27,9 @@ import { } from '@helium/voter-stake-registry-hooks' import { RouteProp, useNavigation, useRoute } from '@react-navigation/native' import { PublicKey, TransactionInstruction } from '@solana/web3.js' -import { useAccountStorage } from '@storage/AccountStorageProvider' -import { useGovernance } from '@storage/GovernanceProvider' -import globalStyles from '@theme/globalStyles' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' +import { useGovernance } from '@config/storage/GovernanceProvider' +import globalStyles from '@config/theme/globalStyles' import { MAX_TRANSACTIONS_PER_SIGNATURE_BATCH } from '@utils/constants' import { getTimeFromNowFmt } from '@utils/dateTools' import { humanReadable } from '@utils/formatting' @@ -42,11 +42,11 @@ import { useAsync } from 'react-async-hook' import { useTranslation } from 'react-i18next' import { Edge } from 'react-native-safe-area-context' import ScrollBox from '@components/ScrollBox' -import { useColors } from '@theme/themeHooks' -import { MessagePreview } from '../../solana/MessagePreview' -import { useSolana } from '../../solana/SolanaProvider' -import { useWalletSign } from '../../solana/WalletSignProvider' -import { WalletStandardMessageTypes } from '../../solana/walletSignBottomSheetTypes' +import { useColors } from '@config/theme/themeHooks' +import { MessagePreview } from '@features/solana/MessagePreview' +import { useSolana } from '@features/solana/SolanaProvider' +import { useWalletSign } from '@features/solana/WalletSignProvider' +import { WalletStandardMessageTypes } from '@features/solana/walletSignBottomSheetTypes' import { VoteOption } from './VoteOption' import { GovernanceNavigationProp, diff --git a/src/features/governance/ProposalsList.tsx b/src/features/governance/ProposalsList.tsx index fb9a41abd..1018f71c5 100644 --- a/src/features/governance/ProposalsList.tsx +++ b/src/features/governance/ProposalsList.tsx @@ -7,9 +7,9 @@ import TouchableOpacityBox from '@components/TouchableOpacityBox' import { useOrganizationProposals } from '@helium/modular-governance-hooks' import { useNavigation } from '@react-navigation/native' import { BoxProps } from '@shopify/restyle' -import { useAccountStorage } from '@storage/AccountStorageProvider' -import { useGovernance } from '@storage/GovernanceProvider' -import { Theme } from '@theme/theme' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' +import { useGovernance } from '@config/storage/GovernanceProvider' +import { Theme } from '@config/theme/theme' import { getDerivedProposalState } from '@utils/governanceUtils' import React, { useCallback, useMemo, useState } from 'react' import { useAsync } from 'react-async-hook' diff --git a/src/features/governance/ProxySearch.tsx b/src/features/governance/ProxySearch.tsx index 826389d9f..a8af52514 100644 --- a/src/features/governance/ProxySearch.tsx +++ b/src/features/governance/ProxySearch.tsx @@ -1,4 +1,4 @@ -import BrowseVoters from '@assets/images/browseVoters.svg' +import BrowseVoters from '@assets/svgs/browseVoters.svg' import Box from '@components/Box' import ButtonPressable from '@components/ButtonPressable' import CircleLoader from '@components/CircleLoader' @@ -9,14 +9,14 @@ import { proxiesQuery } from '@helium/voter-stake-registry-hooks' import { EnhancedProxy } from '@helium/voter-stake-registry-sdk' import { useNavigation } from '@react-navigation/native' import { PublicKey } from '@solana/web3.js' -import { useGovernance } from '@storage/GovernanceProvider' +import { useGovernance } from '@config/storage/GovernanceProvider' import { useInfiniteQuery } from '@tanstack/react-query' import { shortenAddress } from '@utils/formatting' import React, { useCallback, useMemo, useState } from 'react' import { useTranslation } from 'react-i18next' import { FlatList } from 'react-native' import { useDebounce } from 'use-debounce' -import { useColors } from '@theme/themeHooks' +import { useColors } from '@config/theme/themeHooks' import { GovernanceNavigationProp } from './governanceTypes' export const ProxySearch: React.FC<{ diff --git a/src/features/governance/RevokeProxyScreen.tsx b/src/features/governance/RevokeProxyScreen.tsx index 59d8d4c29..250351a27 100644 --- a/src/features/governance/RevokeProxyScreen.tsx +++ b/src/features/governance/RevokeProxyScreen.tsx @@ -21,7 +21,7 @@ import { import { usePublicKey } from '@hooks/usePublicKey' import { RouteProp, useNavigation, useRoute } from '@react-navigation/native' import { PublicKey, TransactionInstruction } from '@solana/web3.js' -import { useGovernance } from '@storage/GovernanceProvider' +import { useGovernance } from '@config/storage/GovernanceProvider' import { MAX_TRANSACTIONS_PER_SIGNATURE_BATCH } from '@utils/constants' import sleep from '@utils/sleep' import { getBasePriorityFee } from '@utils/walletApiV2' @@ -29,9 +29,9 @@ import React, { useCallback, useMemo, useState } from 'react' import { useTranslation } from 'react-i18next' import { FlatList } from 'react-native' import { Edge } from 'react-native-safe-area-context' -import { useSolana } from '../../solana/SolanaProvider' -import { useWalletSign } from '../../solana/WalletSignProvider' -import { WalletStandardMessageTypes } from '../../solana/walletSignBottomSheetTypes' +import { useSolana } from '@features/solana/SolanaProvider' +import { useWalletSign } from '@features/solana/WalletSignProvider' +import { WalletStandardMessageTypes } from '@features/solana/walletSignBottomSheetTypes' import { PositionPreview } from './PositionPreview' import { ProxySearch } from './ProxySearch' import { diff --git a/src/features/governance/TransferTokensModal.tsx b/src/features/governance/TransferTokensModal.tsx index 0a85fec2d..7be76d9a4 100644 --- a/src/features/governance/TransferTokensModal.tsx +++ b/src/features/governance/TransferTokensModal.tsx @@ -12,7 +12,7 @@ import { useMint, useSolanaUnixNow } from '@helium/helium-react-hooks' import { getMintMinAmountAsDecimal, precision } from '@utils/formatting' import { Keyboard } from 'react-native' import HNTKeyboard, { HNTKeyboardRef } from '@components/HNTKeyboard' -import { useAccountStorage } from '@storage/AccountStorageProvider' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' import BN from 'bn.js' import { humanReadable, toBN, toNumber } from '@helium/spl-utils' import CircleLoader from '@components/CircleLoader' diff --git a/src/features/governance/VoteHistory.tsx b/src/features/governance/VoteHistory.tsx index 595240ef6..824fb7857 100644 --- a/src/features/governance/VoteHistory.tsx +++ b/src/features/governance/VoteHistory.tsx @@ -1,5 +1,5 @@ -import ActiveCircle from '@assets/images/activeCircle.svg' -import CancelledCircle from '@assets/images/cancelledCircle.svg' +import ActiveCircle from '@assets/svgs/activeCircle.svg' +import CancelledCircle from '@assets/svgs/cancelledCircle.svg' import Box from '@components/Box' import { CardSkeleton } from '@components/CardSkeleton' import { Pill } from '@components/Pill' @@ -10,9 +10,9 @@ import { ProposalWithVotes } from '@helium/voter-stake-registry-sdk' import { useProposalStatus } from '@hooks/useProposalStatus' import { useNavigation } from '@react-navigation/native' import { PublicKey } from '@solana/web3.js' -import { useGovernance } from '@storage/GovernanceProvider' +import { useGovernance } from '@config/storage/GovernanceProvider' import { useInfiniteQuery } from '@tanstack/react-query' -import { useColors } from '@theme/themeHooks' +import { useColors } from '@config/theme/themeHooks' import { getTimeFromNowFmt } from '@utils/dateTools' import BN from 'bn.js' import { times } from 'lodash' diff --git a/src/features/governance/VoteOption.tsx b/src/features/governance/VoteOption.tsx index 91780ceef..4e8d8e69a 100644 --- a/src/features/governance/VoteOption.tsx +++ b/src/features/governance/VoteOption.tsx @@ -5,8 +5,8 @@ import TouchableOpacityBox from '@components/TouchableOpacityBox' import { useKnownProxy } from '@helium/voter-stake-registry-hooks' import { BoxProps } from '@shopify/restyle' import { PublicKey } from '@solana/web3.js' -import { Color, Theme } from '@theme/theme' -import { useColors } from '@theme/themeHooks' +import { Color, Theme } from '@config/theme/theme' +import { useColors } from '@config/theme/themeHooks' import { shortenAddress } from '@utils/formatting' import BN from 'bn.js' import React from 'react' diff --git a/src/features/governance/VoterCardStat.tsx b/src/features/governance/VoterCardStat.tsx index 775273012..075801fe4 100644 --- a/src/features/governance/VoterCardStat.tsx +++ b/src/features/governance/VoterCardStat.tsx @@ -2,7 +2,7 @@ import Box from '@components/Box' import Text from '@components/Text' import React from 'react' import { BoxProps } from '@shopify/restyle' -import { Theme } from '@theme/theme' +import { Theme } from '@config/theme/theme' export const VoterCardStat: React.FC< { diff --git a/src/features/governance/VoterScreen.tsx b/src/features/governance/VoterScreen.tsx index 8a5c81fae..58fad36cc 100644 --- a/src/features/governance/VoterScreen.tsx +++ b/src/features/governance/VoterScreen.tsx @@ -1,5 +1,5 @@ -import UserShare from '@assets/images/userShare.svg' -import UserX from '@assets/images/userX.svg' +import UserShare from '@assets/svgs/userShare.svg' +import UserX from '@assets/svgs/userX.svg' import BackScreen from '@components/BackScreen' import Box from '@components/Box' import ButtonPressable from '@components/ButtonPressable' @@ -11,7 +11,7 @@ import { proxyQuery, useProxiedTo } from '@helium/voter-stake-registry-hooks' import { PartialEnhancedProxy } from '@helium/voter-stake-registry-sdk' import { RouteProp, useNavigation, useRoute } from '@react-navigation/native' import { PublicKey } from '@solana/web3.js' -import { useGovernance } from '@storage/GovernanceProvider' +import { useGovernance } from '@config/storage/GovernanceProvider' import { useQuery } from '@tanstack/react-query' import { humanReadable, shortenAddress } from '@utils/formatting' import BN from 'bn.js' diff --git a/src/features/governance/VotersScreen.tsx b/src/features/governance/VotersScreen.tsx index 1b09068f0..1eccfa3a4 100644 --- a/src/features/governance/VotersScreen.tsx +++ b/src/features/governance/VotersScreen.tsx @@ -1,7 +1,7 @@ -import BlueCheck from '@assets/images/blueCheck.svg' -import MajorityCircle from '@assets/images/majorityCircle.svg' -import MinorityCircle from '@assets/images/minorityCircle.svg' -import Warning from '@assets/images/warning2.svg' +import BlueCheck from '@assets/svgs/blueCheck.svg' +import MajorityCircle from '@assets/svgs/majorityCircle.svg' +import MinorityCircle from '@assets/svgs/minorityCircle.svg' +import Warning from '@assets/svgs/warning2.svg' import Box from '@components/Box' import { CardSkeleton } from '@components/CardSkeleton' import { Pill } from '@components/Pill' @@ -11,9 +11,9 @@ import TouchableContainer from '@components/TouchableContainer' import { proxiesQuery } from '@helium/voter-stake-registry-hooks' import { EnhancedProxy } from '@helium/voter-stake-registry-sdk' import { useNavigation } from '@react-navigation/native' -import { useGovernance } from '@storage/GovernanceProvider' +import { useGovernance } from '@config/storage/GovernanceProvider' import { useInfiniteQuery } from '@tanstack/react-query' -import { useColors } from '@theme/themeHooks' +import { useColors } from '@config/theme/themeHooks' import { humanReadable, shortenAddress } from '@utils/formatting' import BN from 'bn.js' import { times } from 'lodash' diff --git a/src/features/governance/VotingPowerCard.tsx b/src/features/governance/VotingPowerCard.tsx index 3e7d87b2d..bc5ee3875 100644 --- a/src/features/governance/VotingPowerCard.tsx +++ b/src/features/governance/VotingPowerCard.tsx @@ -1,4 +1,4 @@ -import LightningBolt from '@assets/images/transactions.svg' +import LightningBolt from '@assets/svgs/transactions.svg' import { ReAnimatedBox } from '@components/AnimatedBox' import Box from '@components/Box' import FadeInOut from '@components/FadeInOut' @@ -9,9 +9,9 @@ import { useCurrentWallet } from '@hooks/useCurrentWallet' import { useMetaplexMetadata } from '@hooks/useMetaplexMetadata' import { BoxProps } from '@shopify/restyle' import { PublicKey } from '@solana/web3.js' -import { useGovernance } from '@storage/GovernanceProvider' -import { Theme } from '@theme/theme' -import { useColors } from '@theme/themeHooks' +import { useGovernance } from '@config/storage/GovernanceProvider' +import { Theme } from '@config/theme/theme' +import { useColors } from '@config/theme/themeHooks' import { humanReadable } from '@utils/formatting' import BN from 'bn.js' import React, { useCallback } from 'react' diff --git a/src/features/governance/governanceTypes.ts b/src/features/governance/governanceTypes.ts index df917353b..6bfc6ff27 100644 --- a/src/features/governance/governanceTypes.ts +++ b/src/features/governance/governanceTypes.ts @@ -1,7 +1,7 @@ import { IdlAccounts } from '@coral-xyz/anchor' import { Proposal } from '@helium/modular-governance-idls/lib/types/proposal' import { StackNavigationProp } from '@react-navigation/stack' -import { Color } from '@theme/theme' +import { Color } from 'src/config/theme/theme' export type ProposalV0 = IdlAccounts['proposalV0'] export type VoteChoice = IdlAccounts['proposalV0']['choices'][0] diff --git a/src/features/governance/useSetTab.tsx b/src/features/governance/useSetTab.tsx index cc5152e6e..9560ef60f 100644 --- a/src/features/governance/useSetTab.tsx +++ b/src/features/governance/useSetTab.tsx @@ -1,5 +1,5 @@ import { useNavigation } from '@react-navigation/native' -import { useGovernance } from '@storage/GovernanceProvider' +import { useGovernance } from '@config/storage/GovernanceProvider' import { useCallback } from 'react' import { GovernanceNavigationProp } from './governanceTypes' diff --git a/src/features/home/addNewAccount/AddNewAccountNavigator.tsx b/src/features/home/addNewAccount/AddNewAccountNavigator.tsx index 54cbc80cb..9e0b7e5d3 100644 --- a/src/features/home/addNewAccount/AddNewAccountNavigator.tsx +++ b/src/features/home/addNewAccount/AddNewAccountNavigator.tsx @@ -3,7 +3,7 @@ import { createStackNavigator, StackNavigationOptions, } from '@react-navigation/stack' -import { useColors } from '@theme/themeHooks' +import { useColors } from '@config/theme/themeHooks' import KeystoneNavigator from '../../keystone/KeystoneNavigator' import AddNewAccountScreen from './AddNewAccountScreen' import LedgerNavigator from '../../ledger/LedgerNavigator' diff --git a/src/features/home/addNewAccount/AddNewAccountScreen.tsx b/src/features/home/addNewAccount/AddNewAccountScreen.tsx index 79878693e..e9175e6a3 100644 --- a/src/features/home/addNewAccount/AddNewAccountScreen.tsx +++ b/src/features/home/addNewAccount/AddNewAccountScreen.tsx @@ -5,7 +5,7 @@ import { useSafeAreaInsets } from 'react-native-safe-area-context' import Box from '@components/Box' import FadeInOut from '@components/FadeInOut' import TabBar from '@components/TabBar' -import globalStyles from '@theme/globalStyles' +import globalStyles from '@config/theme/globalStyles' import ScrollBox from '@components/ScrollBox' import BackScreen from '@components/BackScreen' import ConnectKeystoneStart from '../../keystone/ConnectKeystoneStartScreen' diff --git a/src/features/hotspot-onboarding/OnboardingNav.tsx b/src/features/hotspot-onboarding/OnboardingNav.tsx deleted file mode 100644 index 4b2980cae..000000000 --- a/src/features/hotspot-onboarding/OnboardingNav.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import { - createNativeStackNavigator, - NativeStackNavigationOptions, -} from '@react-navigation/native-stack' -import * as React from 'react' -import { useColors } from '@theme/themeHooks' -import SelectDevice from './SelectDevice' - -const Stack = createNativeStackNavigator() - -export default React.memo(function OnboardingNav() { - const colors = useColors() - - const screenOptions = React.useMemo( - () => - ({ - headerShown: false, - contentStyle: { - backgroundColor: colors.primaryBackground, - }, - } as NativeStackNavigationOptions), - [colors], - ) - - return ( - - - - ) -}) diff --git a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/index.tsx b/src/features/hotspot-onboarding/OnboardingSheet.tsx similarity index 84% rename from src/services/HotspotService/AddHotspotPage/OnboardingSheet/index.tsx rename to src/features/hotspot-onboarding/OnboardingSheet.tsx index 45aac2373..e56abddff 100644 --- a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/index.tsx +++ b/src/features/hotspot-onboarding/OnboardingSheet.tsx @@ -13,12 +13,12 @@ import React, { useState, } from 'react' import BottomSheet from '@gorhom/bottom-sheet/lib/typescript/components/bottomSheet/BottomSheet' -import { useSpacing } from '@theme/themeHooks' +import { useSpacing } from '@config/theme/themeHooks' import { Platform } from 'react-native' import { wh, wp } from '@utils/layout' import { useSafeAreaInsets } from 'react-native-safe-area-context' import { Carousel } from 'react-native-snap-carousel' -import BackButton from '@assets/images/modalBackButton.svg' +import BackButton from '@assets/svgs/modalBackButton.svg' import Box from '@components/Box' import TouchableOpacityBox from '@components/TouchableOpacityBox' import { appSlice } from '@store/slices/appSlice' @@ -27,7 +27,8 @@ import Config from 'react-native-config' import { useAsyncCallback } from 'react-async-hook' import { Portal } from '@gorhom/portal' import { ThemeProvider } from '@shopify/restyle' -import { lightTheme } from '@theme/theme' +import { lightTheme } from '@config/theme/theme' +import { HotspotBleProvider } from '@helium/react-native-sdk' import SelectNetworkScreen from './screens/SelectNetworkScreen' import SelectDeviceScreen from './screens/mobile/SelectDeviceScreen' import KeepYourBoxScreen from './screens/mobile/KeepYourBoxScreen' @@ -40,7 +41,8 @@ import SetDirectionScreen from './screens/mobile/SetDirectionScreen' import AddToWalletScreenMobile from './screens/mobile/AddToWalletScreen' import AddToWalletScreenIot from './screens/iot/AddToWalletScreen' import ManualEntryScreen from './screens/mobile/ManualEntryScreen' -import OnboardingV3Client, { +import { + OnboardingV3Client, DeviceInfo, HmhOnboardParams, VendorSlugs, @@ -372,52 +374,54 @@ const HotspotOnboardingProvider = forwardRef( ) return ( - - {visible && ( - - setCurrentIndex(index)} - /> - + + {visible && ( + - - - - - - )} - + setCurrentIndex(index)} + /> + + + + + + + )} + + ) }, ) @@ -442,6 +446,8 @@ const OnboardingSheetWrapper = forwardRef((_, ref: Ref) => { ) }) -export { useHotspotOnboarding, HotspotOnboardingProvider } - -export default OnboardingSheetWrapper +export { + useHotspotOnboarding, + HotspotOnboardingProvider, + OnboardingSheetWrapper, +} diff --git a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/OnboardingV3Client.ts b/src/features/hotspot-onboarding/OnboardingV3Client.ts similarity index 99% rename from src/services/HotspotService/AddHotspotPage/OnboardingSheet/OnboardingV3Client.ts rename to src/features/hotspot-onboarding/OnboardingV3Client.ts index 11e7c56d8..7334edb81 100644 --- a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/OnboardingV3Client.ts +++ b/src/features/hotspot-onboarding/OnboardingV3Client.ts @@ -79,7 +79,7 @@ export type HmhOnboardParams = { const shouldMock = Config.MOCK_HMH === 'true' -export default class OnboardingV3Client { +export class OnboardingV3Client { private axios!: AxiosInstance constructor(baseURL: string, authKey: string) { diff --git a/src/features/hotspot-onboarding/SelectDevice.tsx b/src/features/hotspot-onboarding/SelectDevice.tsx deleted file mode 100644 index 04efd2a3a..000000000 --- a/src/features/hotspot-onboarding/SelectDevice.tsx +++ /dev/null @@ -1,91 +0,0 @@ -import BackScreen from '@components/BackScreen' -import Bluetooth from '@assets/images/bluetooth.svg' -import ImageBox from '@components/ImageBox' -import Text from '@components/Text' -import TouchableOpacityBox from '@components/TouchableOpacityBox' -import { useNavigation } from '@react-navigation/native' -import React from 'react' -import { useTranslation } from 'react-i18next' -import { FlatList } from 'react-native' -import { OnboardableDevice, OnboardingNavProp } from './navTypes' - -const data: OnboardableDevice[] = [ - { - name: 'Bluetooth Enabled Hotspot', - type: 'IotBle', - icon: , - options: { - bleInstructions: - 'Power on your Hotspot. Follow manufacturer instructions for enabling bluetooth discovery on the Hotspot.', - }, - }, -] - -const SelectOnboardableDevice = () => { - const { t } = useTranslation() - const navigation = useNavigation() - const renderItem = React.useCallback( - // eslint-disable-next-line react/no-unused-prop-types - ({ item, index }: { item: OnboardableDevice; index: number }) => { - return ( - { - navigation.push(item.type, item.options) - }} - alignItems="center" - padding="2" - flexDirection="row" - borderTopWidth={index === 0 ? 0 : 1} - borderColor="gray.900" - borderBottomWidth={1} - > - {item.image && ( - - )} - {item.icon && item.icon} - - {item.name} - - - ) - }, - [navigation], - ) - - const keyExtractor = React.useCallback( - ({ name }: OnboardableDevice) => name, - [], - ) - - return ( - - - {t('hotspotOnboarding.selectOnboardingMethod.subtitle')} - - - - ) -} - -export default SelectOnboardableDevice diff --git a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/components/CheckButton.tsx b/src/features/hotspot-onboarding/components/CheckButton.tsx similarity index 91% rename from src/services/HotspotService/AddHotspotPage/OnboardingSheet/components/CheckButton.tsx rename to src/features/hotspot-onboarding/components/CheckButton.tsx index d8fb4b4c5..6c615817b 100644 --- a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/components/CheckButton.tsx +++ b/src/features/hotspot-onboarding/components/CheckButton.tsx @@ -2,8 +2,8 @@ import React, { useCallback } from 'react' import { ReAnimatedBox } from '@components/AnimatedBox' import { FadeIn, FadeOut } from 'react-native-reanimated' import TouchableContainer from '@components/TouchableContainer' -import ModalCheckButton from '@assets/images/modalCheckButton.svg' -import ModalOnDarkCheckButton from '@assets/images/modalCheckOnDarkButton.svg' +import ModalCheckButton from '@assets/svgs/modalCheckButton.svg' +import ModalOnDarkCheckButton from '@assets/svgs/modalCheckOnDarkButton.svg' import TouchableOpacityBox from '@components/TouchableOpacityBox' export type CheckButtonProps = { diff --git a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/components/ForwardButton.tsx b/src/features/hotspot-onboarding/components/ForwardButton.tsx similarity index 93% rename from src/services/HotspotService/AddHotspotPage/OnboardingSheet/components/ForwardButton.tsx rename to src/features/hotspot-onboarding/components/ForwardButton.tsx index 18f060283..89242b99b 100644 --- a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/components/ForwardButton.tsx +++ b/src/features/hotspot-onboarding/components/ForwardButton.tsx @@ -1,5 +1,5 @@ import React, { useCallback } from 'react' -import ModalForwardButton from '@assets/images/modalForwardButton.svg' +import ModalForwardButton from '@assets/svgs/modalForwardButton.svg' import { ReAnimatedBox } from '@components/AnimatedBox' import { FadeIn, FadeOut } from 'react-native-reanimated' import TouchableContainer from '@components/TouchableContainer' diff --git a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/components/Loading.tsx b/src/features/hotspot-onboarding/components/Loading.tsx similarity index 100% rename from src/services/HotspotService/AddHotspotPage/OnboardingSheet/components/Loading.tsx rename to src/features/hotspot-onboarding/components/Loading.tsx diff --git a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/components/WalletButton.tsx b/src/features/hotspot-onboarding/components/WalletButton.tsx similarity index 93% rename from src/services/HotspotService/AddHotspotPage/OnboardingSheet/components/WalletButton.tsx rename to src/features/hotspot-onboarding/components/WalletButton.tsx index 497dbd33a..9cbfd54dd 100644 --- a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/components/WalletButton.tsx +++ b/src/features/hotspot-onboarding/components/WalletButton.tsx @@ -2,18 +2,18 @@ import React, { useCallback } from 'react' import Box from '@components/Box' import Text from '@components/Text' import TouchableContainer from '@components/TouchableContainer' -import RightArrow from '@assets/images/rightArrow.svg' +import RightArrow from '@assets/svgs/rightArrow.svg' import AccountIcon from '@components/AccountIcon' -import { useColors } from '@theme/themeHooks' +import { useColors } from '@config/theme/themeHooks' import { useCurrentWallet } from '@hooks/useCurrentWallet' import { ReAnimatedBox } from '@components/AnimatedBox' import { FadeIn, FadeOut } from 'react-native-reanimated' import { useTranslation } from 'react-i18next' import { useBottomSheet } from '@gorhom/bottom-sheet' import { useNavigation } from '@react-navigation/native' -import { HotspotServiceNavigationProp } from '@services/HotspotService' +import { HotspotServiceNavigationProp } from 'src/app/services/HotspotService' import Loading from './Loading' -import { useHotspotOnboarding } from '../index' +import { useHotspotOnboarding } from '../OnboardingSheet' import { HmhOnboardParams } from '../OnboardingV3Client' const WalletButton = () => { diff --git a/src/features/hotspot-onboarding/navTypes.tsx b/src/features/hotspot-onboarding/navTypes.tsx deleted file mode 100644 index 8c01db29a..000000000 --- a/src/features/hotspot-onboarding/navTypes.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import { NativeStackNavigationProp } from '@react-navigation/native-stack' - -export type IotBleOptions = { - bleInstructions?: string -} - -export type OnboardableDevice = { - name: string - type: 'IotBle' - image?: string - icon?: React.ReactElement - options: IotBleOptions -} - -export type OnboardingtackParamList = { - IotBle: IotBleOptions - SelectDevice: undefined -} - -export type OnboardingNavProp = - NativeStackNavigationProp diff --git a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/SelectFloorScreen.tsx b/src/features/hotspot-onboarding/screens/SelectFloorScreen.tsx similarity index 97% rename from src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/SelectFloorScreen.tsx rename to src/features/hotspot-onboarding/screens/SelectFloorScreen.tsx index 1511b48b2..7e62bd93e 100644 --- a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/SelectFloorScreen.tsx +++ b/src/features/hotspot-onboarding/screens/SelectFloorScreen.tsx @@ -5,7 +5,7 @@ import ImageBox from '@components/ImageBox' import { useTranslation } from 'react-i18next' import { Select } from '@components/Select' import CheckButton from '../components/CheckButton' -import { useHotspotOnboarding } from '../index' +import { useHotspotOnboarding } from '../OnboardingSheet' export const SelectFloorScreen = () => { const { t } = useTranslation() diff --git a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/SelectLocationScreen.tsx b/src/features/hotspot-onboarding/screens/SelectLocationScreen.tsx similarity index 98% rename from src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/SelectLocationScreen.tsx rename to src/features/hotspot-onboarding/screens/SelectLocationScreen.tsx index 1550021d8..9a9c0cf85 100644 --- a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/SelectLocationScreen.tsx +++ b/src/features/hotspot-onboarding/screens/SelectLocationScreen.tsx @@ -1,4 +1,4 @@ -import MapPin from '@assets/images/mapPin.svg' +import MapPin from '@assets/svgs/mapPin.svg' import { Box, DelayedFadeIn, FadeInOut, ReAnimatedBox, Text } from '@components' import useAlert from '@hooks/useAlert' import { useForwardGeo } from '@hooks/useForwardGeo' @@ -8,7 +8,7 @@ import { useTranslation } from 'react-i18next' import { KeyboardAvoidingView } from 'react-native' import 'text-encoding-polyfill' import { useDebounce } from 'use-debounce' -import { useColors, useSpacing } from '@theme/themeHooks' +import { useColors, useSpacing } from '@config/theme/themeHooks' import Map from '@components/Map' import { Camera, @@ -20,7 +20,7 @@ import { import { INITIAL_MAP_VIEW_STATE, MAX_MAP_ZOOM } from '@utils/mapUtils' import { Search } from '@components/Search' import CheckButton from '../components/CheckButton' -import { useHotspotOnboarding } from '../index' +import { useHotspotOnboarding } from '../OnboardingSheet' const SelectLocationScreen = () => { const { t } = useTranslation() diff --git a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/SelectNetworkScreen.tsx b/src/features/hotspot-onboarding/screens/SelectNetworkScreen.tsx similarity index 88% rename from src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/SelectNetworkScreen.tsx rename to src/features/hotspot-onboarding/screens/SelectNetworkScreen.tsx index 852045138..15bea522c 100644 --- a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/SelectNetworkScreen.tsx +++ b/src/features/hotspot-onboarding/screens/SelectNetworkScreen.tsx @@ -3,15 +3,15 @@ import Text from '@components/Text' import TouchableContainer from '@components/TouchableContainer' import React, { useCallback } from 'react' import { useTranslation } from 'react-i18next' -import MobileIcon from '@assets/images/mobileIconNew.svg' -import IotIcon from '@assets/images/iotIconNew.svg' -import CarotRight from '@assets/images/carot-right.svg' -import { useColors } from '@theme/themeHooks' -import RightArrow from '@assets/images/rightArrow.svg' +import MobileIcon from '@assets/svgs/mobileIconNew.svg' +import IotIcon from '@assets/svgs/iotIconNew.svg' +import CarotRight from '@assets/svgs/carot-right.svg' +import { useColors } from '@config/theme/themeHooks' +import RightArrow from '@assets/svgs/rightArrow.svg' import TouchableOpacityBox from '@components/TouchableOpacityBox' -import { HOTSPOT_HELP } from '@constants/urls' +import { HOTSPOT_HELP } from '@utils/constants/urls' import { Linking } from 'react-native' -import { useHotspotOnboarding, OnboardDetails } from '../index' +import { useHotspotOnboarding, OnboardDetails } from '../OnboardingSheet' const SelectNetworkScreen = () => { const { t } = useTranslation() diff --git a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/iot/AddToWalletScreen.tsx b/src/features/hotspot-onboarding/screens/iot/AddToWalletScreen.tsx similarity index 98% rename from src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/iot/AddToWalletScreen.tsx rename to src/features/hotspot-onboarding/screens/iot/AddToWalletScreen.tsx index 5e5c4ed57..46505ffb7 100644 --- a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/iot/AddToWalletScreen.tsx +++ b/src/features/hotspot-onboarding/screens/iot/AddToWalletScreen.tsx @@ -20,7 +20,7 @@ import { useImplicitBurn } from '@hooks/useImplicitBurn' import { useKeyToAsset } from '@hooks/useKeyToAsset' import { useOnboardingBalnces } from '@hooks/useOnboardingBalances' import { LAMPORTS_PER_SOL, PublicKey, Transaction } from '@solana/web3.js' -import { useAccountStorage } from '@storage/AccountStorageProvider' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' import { IOT_CONFIG_KEY, DAO_KEY } from '@utils/constants' import sleep from '@utils/sleep' import { getHotspotWithRewards, isInsufficientBal } from '@utils/solanaUtils' @@ -31,7 +31,7 @@ import { useAsync, useAsyncCallback } from 'react-async-hook' import { useTranslation } from 'react-i18next' import { Alert, Linking } from 'react-native' import ScrollBox from '@components/ScrollBox' -import { useColors, useSpacing } from '@theme/themeHooks' +import { useColors, useSpacing } from '@config/theme/themeHooks' import Map from '@components/Map' import { Camera } from '@rnmapbox/maps' import ImageBox from '@components/ImageBox' @@ -39,14 +39,14 @@ import { getAddressFromLatLng } from '@utils/location' import { FadeIn, FadeOut } from 'react-native-reanimated' import { ReAnimatedBox } from '@components/AnimatedBox' import TouchableContainer from '@components/TouchableContainer' -import RightArrow from '@assets/images/rightArrow.svg' +import RightArrow from '@assets/svgs/rightArrow.svg' import AccountIcon from '@components/AccountIcon' import { useBottomSheet } from '@gorhom/bottom-sheet' import { useNavigation } from '@react-navigation/native' -import { HotspotServiceNavigationProp } from '@services/HotspotService' +import { HotspotServiceNavigationProp } from 'src/app/services/HotspotService' +import { useSolana } from '@features/solana/SolanaProvider' import Loading from '../../components/Loading' -import { useSolana } from '../../../../../../solana/SolanaProvider' -import { useHotspotOnboarding } from '../..' +import { useHotspotOnboarding } from '../../OnboardingSheet' const REQUIRED_SOL = new BN((0.00089088 + 0.00001) * LAMPORTS_PER_SOL) const AddToWalletScreen = () => { diff --git a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/iot/HotspotConnected.tsx b/src/features/hotspot-onboarding/screens/iot/HotspotConnected.tsx similarity index 91% rename from src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/iot/HotspotConnected.tsx rename to src/features/hotspot-onboarding/screens/iot/HotspotConnected.tsx index a7b53af5e..6afb0851c 100644 --- a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/iot/HotspotConnected.tsx +++ b/src/features/hotspot-onboarding/screens/iot/HotspotConnected.tsx @@ -1,16 +1,16 @@ import React, { useCallback, useMemo } from 'react' import { useTranslation } from 'react-i18next' import ScrollBox from '@components/ScrollBox' -import CheckmarkCircle from '@assets/images/checkmarkCircle.svg' +import CheckmarkCircle from '@assets/svgs/checkmarkCircle.svg' import Text from '@components/Text' import { ReAnimatedBox } from '@components/AnimatedBox' import { FadeIn, FadeOut } from 'react-native-reanimated' import TouchableContainer from '@components/TouchableContainer' -import RightArrow from '@assets/images/rightArrow.svg' +import RightArrow from '@assets/svgs/rightArrow.svg' import Box from '@components/Box' -import { useSpacing } from '@theme/themeHooks' +import { useSpacing } from '@config/theme/themeHooks' import { StyleProp, ViewStyle } from 'react-native' -import { useHotspotOnboarding } from '../..' +import { useHotspotOnboarding } from '../../OnboardingSheet' export default function HotspotConnected() { const { t } = useTranslation() diff --git a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/iot/ScanHotspots.tsx b/src/features/hotspot-onboarding/screens/iot/ScanHotspots.tsx similarity index 96% rename from src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/iot/ScanHotspots.tsx rename to src/features/hotspot-onboarding/screens/iot/ScanHotspots.tsx index 8452dc725..a389be129 100644 --- a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/iot/ScanHotspots.tsx +++ b/src/features/hotspot-onboarding/screens/iot/ScanHotspots.tsx @@ -3,7 +3,7 @@ import TouchableOpacityBox from '@components/TouchableOpacityBox' import { Device, useHotspotBle } from '@helium/react-native-sdk' import React, { useCallback, useEffect, useMemo, useState } from 'react' import { useTranslation } from 'react-i18next' -import RightArrow from '@assets/images/rightArrow.svg' +import RightArrow from '@assets/svgs/rightArrow.svg' import { FlatList, Platform, @@ -20,13 +20,13 @@ import { request, } from 'react-native-permissions' import ScrollBox from '@components/ScrollBox' -import { useColors, useSpacing } from '@theme/themeHooks' +import { useColors, useSpacing } from '@config/theme/themeHooks' import Box from '@components/Box' import TouchableContainer from '@components/TouchableContainer' -import CarotRight from '@assets/images/carot-right.svg' +import CarotRight from '@assets/svgs/carot-right.svg' import Config from 'react-native-config' -import * as Logger from '../../../../../../utils/logger' -import { useHotspotOnboarding } from '../..' +import * as Logger from '@utils/logger' +import { useHotspotOnboarding } from '../../OnboardingSheet' const MOCK = Config.MOCK_IOT === 'true' const MOCK_DEVICES = [ diff --git a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/iot/WifiSettings.tsx b/src/features/hotspot-onboarding/screens/iot/WifiSettings.tsx similarity index 96% rename from src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/iot/WifiSettings.tsx rename to src/features/hotspot-onboarding/screens/iot/WifiSettings.tsx index 013e030f7..a9292ba1b 100644 --- a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/iot/WifiSettings.tsx +++ b/src/features/hotspot-onboarding/screens/iot/WifiSettings.tsx @@ -12,13 +12,13 @@ import { ViewStyle, } from 'react-native' import ScrollBox from '@components/ScrollBox' -import { useColors, useSpacing } from '@theme/themeHooks' +import { useColors, useSpacing } from '@config/theme/themeHooks' import Box from '@components/Box' -import RightArrow from '@assets/images/rightArrow.svg' +import RightArrow from '@assets/svgs/rightArrow.svg' import TouchableContainer from '@components/TouchableContainer' -import CarotRight from '@assets/images/carot-right.svg' +import CarotRight from '@assets/svgs/carot-right.svg' import Config from 'react-native-config' -import { useHotspotOnboarding } from '../..' +import { useHotspotOnboarding } from '../../OnboardingSheet' const MOCK = Config.MOCK_IOT === 'true' diff --git a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/iot/WifiSetup.tsx b/src/features/hotspot-onboarding/screens/iot/WifiSetup.tsx similarity index 94% rename from src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/iot/WifiSetup.tsx rename to src/features/hotspot-onboarding/screens/iot/WifiSetup.tsx index 66c63d366..9e80ff168 100644 --- a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/iot/WifiSetup.tsx +++ b/src/features/hotspot-onboarding/screens/iot/WifiSetup.tsx @@ -5,16 +5,16 @@ import { BleError, useHotspotBle } from '@helium/react-native-sdk' import React, { useCallback, useMemo, useState } from 'react' import { useTranslation } from 'react-i18next' import ScrollBox from '@components/ScrollBox' -import { useColors, useSpacing } from '@theme/themeHooks' +import { useColors, useSpacing } from '@config/theme/themeHooks' import { ViewStyle, StyleProp } from 'react-native' -import Visibility from '@assets/images/visibility.svg' -import VisibilityOff from '@assets/images/visibilityOff.svg' +import Visibility from '@assets/svgs/visibility.svg' +import VisibilityOff from '@assets/svgs/visibilityOff.svg' import TouchableOpacityBox from '@components/TouchableOpacityBox' import ImageBox from '@components/ImageBox' import { Keypair } from '@solana/web3.js' import animalName from 'angry-purple-tiger' import Config from 'react-native-config' -import { useHotspotOnboarding } from '../..' +import { useHotspotOnboarding } from '../../OnboardingSheet' import CheckButton from '../../components/CheckButton' import Loading from '../../components/Loading' diff --git a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/iot/navTypes.tsx b/src/features/hotspot-onboarding/screens/iot/navTypes.tsx similarity index 84% rename from src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/iot/navTypes.tsx rename to src/features/hotspot-onboarding/screens/iot/navTypes.tsx index 6f23acf0a..c8eaf1354 100644 --- a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/iot/navTypes.tsx +++ b/src/features/hotspot-onboarding/screens/iot/navTypes.tsx @@ -1,5 +1,8 @@ import { NativeStackNavigationProp } from '@react-navigation/native-stack' -import { IotBleOptions } from '../../../../../../features/hotspot-onboarding/navTypes' + +export type IotBleOptions = { + bleInstructions?: string +} export type HotspotBLEStackParamList = { ScanHotspots: IotBleOptions diff --git a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/iot/optionsContext.tsx b/src/features/hotspot-onboarding/screens/iot/optionsContext.tsx similarity index 83% rename from src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/iot/optionsContext.tsx rename to src/features/hotspot-onboarding/screens/iot/optionsContext.tsx index 8d52ea191..7b7f88944 100644 --- a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/iot/optionsContext.tsx +++ b/src/features/hotspot-onboarding/screens/iot/optionsContext.tsx @@ -1,5 +1,5 @@ import React, { useContext } from 'react' -import { IotBleOptions } from '../../../../../../features/hotspot-onboarding/navTypes' +import { IotBleOptions } from './navTypes' const IotBleOptionsContext = React.createContext({}) diff --git a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/mobile/AcquireLocationScreen.tsx b/src/features/hotspot-onboarding/screens/mobile/AcquireLocationScreen.tsx similarity index 96% rename from src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/mobile/AcquireLocationScreen.tsx rename to src/features/hotspot-onboarding/screens/mobile/AcquireLocationScreen.tsx index b9d294742..77127a03c 100644 --- a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/mobile/AcquireLocationScreen.tsx +++ b/src/features/hotspot-onboarding/screens/mobile/AcquireLocationScreen.tsx @@ -3,13 +3,13 @@ import Text from '@components/Text' import TouchableContainer from '@components/TouchableContainer' import React, { useCallback, useState } from 'react' import { useTranslation } from 'react-i18next' -import InfoIcon from '@assets/images/infoIcon.svg' +import InfoIcon from '@assets/svgs/infoIcon.svg' import ImageBox from '@components/ImageBox' -import MiniMap from '@services/HotspotService/HotspotPage/MiniMap' +import MiniMap from '@components/MiniMap' import { getAddressFromLatLng } from '@utils/location' import { useAsync } from 'react-async-hook' import * as Location from 'expo-location' -import { useHotspotOnboarding } from '../../index' +import { useHotspotOnboarding } from '../../OnboardingSheet' import CheckButton from '../../components/CheckButton' export const AcquireLocationScreen = () => { diff --git a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/mobile/AddToWalletScreen.tsx b/src/features/hotspot-onboarding/screens/mobile/AddToWalletScreen.tsx similarity index 98% rename from src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/mobile/AddToWalletScreen.tsx rename to src/features/hotspot-onboarding/screens/mobile/AddToWalletScreen.tsx index 5e81cf394..11536fe8c 100644 --- a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/mobile/AddToWalletScreen.tsx +++ b/src/features/hotspot-onboarding/screens/mobile/AddToWalletScreen.tsx @@ -8,7 +8,7 @@ import { Camera } from '@rnmapbox/maps' import { getAddressFromLatLng } from '@utils/location' import { useAsync } from 'react-async-hook' import AddToWalletButton from '../../components/WalletButton' -import { useHotspotOnboarding } from '../../index' +import { useHotspotOnboarding } from '../../OnboardingSheet' export const AddToWalletScreen = () => { const { t } = useTranslation() diff --git a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/mobile/ConnectEthernetScreen.tsx b/src/features/hotspot-onboarding/screens/mobile/ConnectEthernetScreen.tsx similarity index 93% rename from src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/mobile/ConnectEthernetScreen.tsx rename to src/features/hotspot-onboarding/screens/mobile/ConnectEthernetScreen.tsx index 3157319ce..f4ed05a41 100644 --- a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/mobile/ConnectEthernetScreen.tsx +++ b/src/features/hotspot-onboarding/screens/mobile/ConnectEthernetScreen.tsx @@ -4,11 +4,11 @@ import Text from '@components/Text' import { useTranslation } from 'react-i18next' import ImageBox from '@components/ImageBox' import TouchableOpacityBox from '@components/TouchableOpacityBox' -import InfoIcon from '@assets/images/infoIcon.svg' +import InfoIcon from '@assets/svgs/infoIcon.svg' import { Linking } from 'react-native' -import { HOTSPOT_HELP } from '@constants/urls' +import { HOTSPOT_HELP } from '@utils/constants/urls' import CheckButton from '../../components/CheckButton' -import { useHotspotOnboarding } from '../../index' +import { useHotspotOnboarding } from '../../OnboardingSheet' export const ConnectEthernetScreen = () => { const { t } = useTranslation() diff --git a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/mobile/ConnectToHotspotScreen.tsx b/src/features/hotspot-onboarding/screens/mobile/ConnectToHotspotScreen.tsx similarity index 92% rename from src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/mobile/ConnectToHotspotScreen.tsx rename to src/features/hotspot-onboarding/screens/mobile/ConnectToHotspotScreen.tsx index 83687048d..560e03049 100644 --- a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/mobile/ConnectToHotspotScreen.tsx +++ b/src/features/hotspot-onboarding/screens/mobile/ConnectToHotspotScreen.tsx @@ -4,15 +4,15 @@ import { useTranslation } from 'react-i18next' import ImageBox from '@components/ImageBox' import Text from '@components/Text' import TouchableContainer from '@components/TouchableContainer' -import CameraCheck from '@assets/images/cameraCheck.svg' -import NoCamera from '@assets/images/noCamera.svg' -import RightArrow from '@assets/images/rightArrow.svg' -import { useColors } from '@theme/themeHooks' +import CameraCheck from '@assets/svgs/cameraCheck.svg' +import NoCamera from '@assets/svgs/noCamera.svg' +import RightArrow from '@assets/svgs/rightArrow.svg' +import { useColors } from '@config/theme/themeHooks' import TouchableOpacityBox from '@components/TouchableOpacityBox' import { requestCameraPermission } from '@utils/camera' import { PermissionStatus } from 'react-native-permissions' -import { Color } from '@theme/theme' -import { useHotspotOnboarding } from '../../index' +import { Color } from '@config/theme/theme' +import { useHotspotOnboarding } from '../../OnboardingSheet' import CheckButton from '../../components/CheckButton' export const ConnectToHotspotScreen = () => { diff --git a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/mobile/KeepYourBoxScreen.tsx b/src/features/hotspot-onboarding/screens/mobile/KeepYourBoxScreen.tsx similarity index 95% rename from src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/mobile/KeepYourBoxScreen.tsx rename to src/features/hotspot-onboarding/screens/mobile/KeepYourBoxScreen.tsx index fe82a353b..2b1cd6874 100644 --- a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/mobile/KeepYourBoxScreen.tsx +++ b/src/features/hotspot-onboarding/screens/mobile/KeepYourBoxScreen.tsx @@ -4,7 +4,7 @@ import Text from '@components/Text' import { useTranslation } from 'react-i18next' import ImageBox from '@components/ImageBox' -import { useHotspotOnboarding } from '../../index' +import { useHotspotOnboarding } from '../../OnboardingSheet' import ForwardButton from '../../components/ForwardButton' export const KeepYourBoxScreen = () => { diff --git a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/mobile/ManualEntryScreen.tsx b/src/features/hotspot-onboarding/screens/mobile/ManualEntryScreen.tsx similarity index 98% rename from src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/mobile/ManualEntryScreen.tsx rename to src/features/hotspot-onboarding/screens/mobile/ManualEntryScreen.tsx index e5c39b631..fffd305f6 100644 --- a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/mobile/ManualEntryScreen.tsx +++ b/src/features/hotspot-onboarding/screens/mobile/ManualEntryScreen.tsx @@ -4,7 +4,7 @@ import Box from '@components/Box' import { useTranslation } from 'react-i18next' import TextInputNew from '@components/TextInputNew' import CheckButton from '../../components/CheckButton' -import { useHotspotOnboarding } from '../../index' +import { useHotspotOnboarding } from '../../OnboardingSheet' import Loading from '../../components/Loading' const ManualEntryScreen = () => { diff --git a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/mobile/ScanQRCodeScreen.tsx b/src/features/hotspot-onboarding/screens/mobile/ScanQRCodeScreen.tsx similarity index 96% rename from src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/mobile/ScanQRCodeScreen.tsx rename to src/features/hotspot-onboarding/screens/mobile/ScanQRCodeScreen.tsx index 455399895..8c5885664 100644 --- a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/mobile/ScanQRCodeScreen.tsx +++ b/src/features/hotspot-onboarding/screens/mobile/ScanQRCodeScreen.tsx @@ -4,8 +4,8 @@ import { StyleSheet } from 'react-native' import Text from '@components/Text' import { useTranslation } from 'react-i18next' import TouchableOpacityBox from '@components/TouchableOpacityBox' -import { useColors } from '@theme/themeHooks' -import RightArrow from '@assets/images/rightArrow.svg' +import { useColors } from '@config/theme/themeHooks' +import RightArrow from '@assets/svgs/rightArrow.svg' import { Camera, useCameraDevice, @@ -15,7 +15,7 @@ import useAppear from '@hooks/useAppear' import useDisappear from '@hooks/useDisappear' import useHaptic from '@hooks/useHaptic' import { useAsync } from 'react-async-hook' -import { useHotspotOnboarding } from '../../index' +import { useHotspotOnboarding } from '../../OnboardingSheet' import CheckButton from '../../components/CheckButton' import Loading from '../../components/Loading' diff --git a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/mobile/SelectDeviceScreen.tsx b/src/features/hotspot-onboarding/screens/mobile/SelectDeviceScreen.tsx similarity index 95% rename from src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/mobile/SelectDeviceScreen.tsx rename to src/features/hotspot-onboarding/screens/mobile/SelectDeviceScreen.tsx index ab8acb8f0..2d669e7bc 100644 --- a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/mobile/SelectDeviceScreen.tsx +++ b/src/features/hotspot-onboarding/screens/mobile/SelectDeviceScreen.tsx @@ -3,10 +3,10 @@ import React, { useCallback } from 'react' import { useTranslation } from 'react-i18next' import Text from '@components/Text' import TouchableContainer from '@components/TouchableContainer' -import MobileTextLogo from '@assets/images/mobileTextLogo.svg' +import MobileTextLogo from '@assets/svgs/mobileTextLogo.svg' import ImageBox from '@components/ImageBox' import TextTransform from '@components/TextTransform' -import { DeviceType, useHotspotOnboarding } from '../../index' +import { DeviceType, useHotspotOnboarding } from '../../OnboardingSheet' const SelectDeviceScreen = () => { const { t } = useTranslation() diff --git a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/mobile/SetDirectionScreen.tsx b/src/features/hotspot-onboarding/screens/mobile/SetDirectionScreen.tsx similarity index 95% rename from src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/mobile/SetDirectionScreen.tsx rename to src/features/hotspot-onboarding/screens/mobile/SetDirectionScreen.tsx index 0992ae92b..efbb7f484 100644 --- a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/mobile/SetDirectionScreen.tsx +++ b/src/features/hotspot-onboarding/screens/mobile/SetDirectionScreen.tsx @@ -2,7 +2,7 @@ import Box from '@components/Box' import React, { useCallback } from 'react' import Text from '@components/Text' import { useTranslation } from 'react-i18next' -import RotateIcon from '@assets/images/rotateIcon.svg' +import RotateIcon from '@assets/svgs/rotateIcon.svg' import Map from '@components/Map' import { Camera } from '@rnmapbox/maps' import ImageBox from '@components/ImageBox' @@ -12,7 +12,7 @@ import { ReAnimatedBox } from '@components/AnimatedBox' import { useAnimatedStyle, withSpring } from 'react-native-reanimated' import { HELIUM_WORLD_POI } from '@utils/constants' import CheckButton from '../../components/CheckButton' -import { useHotspotOnboarding } from '../../index' +import { useHotspotOnboarding } from '../../OnboardingSheet' const SetDirectionScreen = () => { const { t } = useTranslation() diff --git a/src/features/collectables/AntennaSetupScreen.tsx b/src/features/hotspots/AntennaSetupScreen.tsx similarity index 99% rename from src/features/collectables/AntennaSetupScreen.tsx rename to src/features/hotspots/AntennaSetupScreen.tsx index 24d33278f..9a65758f0 100644 --- a/src/features/collectables/AntennaSetupScreen.tsx +++ b/src/features/hotspots/AntennaSetupScreen.tsx @@ -22,7 +22,7 @@ import { DelayedFadeIn } from '@components/FadeInOut' import { CollectableNavigationProp, CollectableStackParamList, -} from './collectablesTypes' +} from './hotspotTypes' import { parseH3BNLocation } from '../../utils/h3' import * as Logger from '../../utils/logger' diff --git a/src/features/collectables/AssertLocationScreen.tsx b/src/features/hotspots/AssertLocationScreen.tsx similarity index 99% rename from src/features/collectables/AssertLocationScreen.tsx rename to src/features/hotspots/AssertLocationScreen.tsx index b714aad7b..9097c8082 100644 --- a/src/features/collectables/AssertLocationScreen.tsx +++ b/src/features/hotspots/AssertLocationScreen.tsx @@ -1,5 +1,5 @@ -import Hex from '@assets/images/hex.svg' -import MapPin from '@assets/images/mapPin.svg' +import Hex from '@assets/svgs/hex.svg' +import MapPin from '@assets/svgs/mapPin.svg' import { Box, ButtonPressable, @@ -49,7 +49,7 @@ import { } from 'react-native' import 'text-encoding-polyfill' import { useDebounce } from 'use-debounce' -import { useColors, useCreateOpacity } from '@theme/themeHooks' +import { useColors, useCreateOpacity } from '@config/theme/themeHooks' import { useSafeAreaInsets } from 'react-native-safe-area-context' import Map from '@components/Map' import { @@ -69,7 +69,7 @@ import { Search } from '@components/Search' import { CollectableNavigationProp, CollectableStackParamList, -} from './collectablesTypes' +} from './hotspotTypes' type Route = RouteProp diff --git a/src/features/collectables/ChangeRewardsRecipientScreen.tsx b/src/features/hotspots/ChangeRewardsRecipientScreen.tsx similarity index 98% rename from src/features/collectables/ChangeRewardsRecipientScreen.tsx rename to src/features/hotspots/ChangeRewardsRecipientScreen.tsx index 5b7a86fec..a2bcac50c 100644 --- a/src/features/collectables/ChangeRewardsRecipientScreen.tsx +++ b/src/features/hotspots/ChangeRewardsRecipientScreen.tsx @@ -1,4 +1,4 @@ -import Menu from '@assets/images/menu.svg' +import Menu from '@assets/svgs/menu.svg' import AddressBookSelector, { AddressBookRef, } from '@components/AddressBookSelector' @@ -8,13 +8,13 @@ import Box from '@components/Box' import ButtonPressable from '@components/ButtonPressable' import CircleLoader from '@components/CircleLoader' import { DelayedFadeIn } from '@components/FadeInOut' -import IotSymbol from '@assets/images/iotSymbol.svg' -import MobileSymbol from '@assets/images/mobileSymbol.svg' +import IotSymbol from '@assets/svgs/iotSymbol.svg' +import MobileSymbol from '@assets/svgs/mobileSymbol.svg' import Text from '@components/Text' import TextInput from '@components/TextInput' import useSubmitTxn from '@hooks/useSubmitTxn' import { RouteProp, useNavigation, useRoute } from '@react-navigation/native' -import { CSAccount } from '@storage/cloudStorage' +import { CSAccount } from '@config/storage/cloudStorage' import { ellipsizeAddress, solAddressIsValid } from '@utils/accountUtils' import React, { memo, useCallback, useMemo, useRef, useState } from 'react' import { useTranslation } from 'react-i18next' @@ -30,13 +30,13 @@ import { IOT_LAZY_KEY, MOBILE_LAZY_KEY } from '@utils/constants' import { PublicKey } from '@solana/web3.js' import TouchableOpacityBox from '@components/TouchableOpacityBox' import { useCurrentWallet } from '@hooks/useCurrentWallet' -import { useColors, useSpacing } from '@theme/themeHooks' +import { useColors, useSpacing } from '@config/theme/themeHooks' import ScrollBox from '@components/ScrollBox' import * as Logger from '../../utils/logger' import { CollectableNavigationProp, CollectableStackParamList, -} from './collectablesTypes' +} from './hotspotTypes' import { Mints } from '../../utils/constants' type Route = RouteProp< diff --git a/src/features/collectables/ClaimAllRewardsScreen.tsx b/src/features/hotspots/ClaimAllRewardsScreen.tsx similarity index 97% rename from src/features/collectables/ClaimAllRewardsScreen.tsx rename to src/features/hotspots/ClaimAllRewardsScreen.tsx index 9bb9c62cc..78bc01c55 100644 --- a/src/features/collectables/ClaimAllRewardsScreen.tsx +++ b/src/features/hotspots/ClaimAllRewardsScreen.tsx @@ -13,7 +13,7 @@ import { useCurrentWallet } from '@hooks/useCurrentWallet' import useHotspots from '@hooks/useHotspots' import useSubmitTxn from '@hooks/useSubmitTxn' import { useNavigation } from '@react-navigation/native' -import { useModal } from '@storage/ModalsProvider' +import { useModal } from '@config/storage/ModalsProvider' import { IOT_LAZY_KEY, MIN_BALANCE_THRESHOLD, @@ -22,7 +22,7 @@ import { import BN from 'bn.js' import React, { memo, useCallback, useMemo, useState } from 'react' import { useTranslation } from 'react-i18next' -import { CollectableNavigationProp } from './collectablesTypes' +import { CollectableNavigationProp } from './hotspotTypes' const ClaimAllRewardsScreen = () => { const { t } = useTranslation() diff --git a/src/features/collectables/ClaimRewardsScreen.tsx b/src/features/hotspots/ClaimRewardsScreen.tsx similarity index 99% rename from src/features/collectables/ClaimRewardsScreen.tsx rename to src/features/hotspots/ClaimRewardsScreen.tsx index 5b9e729f5..046ac8403 100644 --- a/src/features/collectables/ClaimRewardsScreen.tsx +++ b/src/features/hotspots/ClaimRewardsScreen.tsx @@ -19,7 +19,7 @@ import { Mints } from '../../utils/constants' import { CollectableNavigationProp, CollectableStackParamList, -} from './collectablesTypes' +} from './hotspotTypes' type Route = RouteProp diff --git a/src/features/collectables/ClaimingRewardsScreen.tsx b/src/features/hotspots/ClaimingRewardsScreen.tsx similarity index 96% rename from src/features/collectables/ClaimingRewardsScreen.tsx rename to src/features/hotspots/ClaimingRewardsScreen.tsx index 94f7759d5..5bbaae094 100644 --- a/src/features/collectables/ClaimingRewardsScreen.tsx +++ b/src/features/hotspots/ClaimingRewardsScreen.tsx @@ -1,4 +1,4 @@ -import BackArrow from '@assets/images/backArrow.svg' +import BackArrow from '@assets/svgs/backArrow.svg' import AccountIcon from '@components/AccountIcon' import { ReAnimatedBox } from '@components/AnimatedBox' import Box from '@components/Box' @@ -13,7 +13,7 @@ import { useBN } from '@hooks/useBN' import { useCurrentWallet } from '@hooks/useCurrentWallet' import useHotspots from '@hooks/useHotspots' import { useNavigation } from '@react-navigation/native' -import globalStyles from '@theme/globalStyles' +import globalStyles from '@config/theme/globalStyles' import { parseTransactionError } from '@utils/solanaUtils' import LottieView from 'lottie-react-native' import React, { memo, useCallback, useEffect, useRef, useState } from 'react' @@ -22,9 +22,9 @@ import Animated, { FadeIn, FadeOut } from 'react-native-reanimated' import { useSafeAreaInsets } from 'react-native-safe-area-context' import { useSelector } from 'react-redux' import 'text-encoding-polyfill' -import { useColors } from '@theme/themeHooks' -import { HotspotServiceNavigationProp } from '@services/HotspotService' -import { useAccountStorage } from '../../storage/AccountStorageProvider' +import { useColors } from '@config/theme/themeHooks' +import { HotspotServiceNavigationProp } from 'src/app/services/HotspotService' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' import { RootState } from '../../store/rootReducer' import iotMobileTokens from './animations/iot-mobile-tokens.json' import iotTokens from './animations/iot-tokens.json' diff --git a/src/features/collectables/Diagnostics.tsx b/src/features/hotspots/Diagnostics.tsx similarity index 100% rename from src/features/collectables/Diagnostics.tsx rename to src/features/hotspots/Diagnostics.tsx diff --git a/src/services/HotspotService/HotspotPage/EmptyState.tsx b/src/features/hotspots/EmptyState.tsx similarity index 93% rename from src/services/HotspotService/HotspotPage/EmptyState.tsx rename to src/features/hotspots/EmptyState.tsx index e1129b1c1..9544f3ceb 100644 --- a/src/services/HotspotService/HotspotPage/EmptyState.tsx +++ b/src/features/hotspots/EmptyState.tsx @@ -1,15 +1,15 @@ import Box from '@components/Box' import { NavBarHeight } from '@components/ServiceNavBar' -import { useColors, useSpacing } from '@theme/themeHooks' +import { useColors, useSpacing } from '@config/theme/themeHooks' import React, { useCallback } from 'react' import { useTranslation } from 'react-i18next' import { useSafeAreaInsets } from 'react-native-safe-area-context' import Text from '@components/Text' import ButtonPressable from '@components/ButtonPressable' -import AddIcon from '@assets/images/add.svg' +import AddIcon from '@assets/svgs/add.svg' import { Image, Linking } from 'react-native' import { useNavigation } from '@react-navigation/native' -import { HotspotServiceNavigationProp } from '..' +import { HotspotServiceNavigationProp } from 'src/app/services/HotspotService' const EmptyState = () => { const spacing = useSpacing() diff --git a/src/services/HotspotService/HotspotPage/HotspotConfig.tsx b/src/features/hotspots/HotspotConfig.tsx similarity index 95% rename from src/services/HotspotService/HotspotPage/HotspotConfig.tsx rename to src/features/hotspots/HotspotConfig.tsx index 0b332b00d..7aa75e43d 100644 --- a/src/services/HotspotService/HotspotPage/HotspotConfig.tsx +++ b/src/features/hotspots/HotspotConfig.tsx @@ -4,15 +4,15 @@ import Text from '@components/Text' import { useNavigation, useRoute } from '@react-navigation/native' import React, { useCallback, useMemo } from 'react' import ScrollBox from '@components/ScrollBox' -import { useColors, useSpacing } from '@theme/themeHooks' +import { useColors, useSpacing } from '@config/theme/themeHooks' import { FlatList } from 'react-native' import TouchableContainer from '@components/TouchableContainer' import useCopyText from '@hooks/useCopyText' import useHaptic from '@hooks/useHaptic' import { ellipsizeAddress } from '@utils/accountUtils' -import CarotRight from '@assets/images/carot-right.svg' -import { HotspotWithPendingRewards } from '../../../types/solana' -import { HotspotNavigationProp } from '.' +import CarotRight from '@assets/svgs/carot-right.svg' +import { HotspotNavigationProp } from '@services/HotspotService/pages/HotspotPage' +import { HotspotWithPendingRewards } from '../../types/solana' type HotspotConfigItem = { title: string diff --git a/src/services/HotspotService/HotspotPage/HotspotDetails.tsx b/src/features/hotspots/HotspotDetails.tsx similarity index 92% rename from src/services/HotspotService/HotspotPage/HotspotDetails.tsx rename to src/features/hotspots/HotspotDetails.tsx index d62a8ca9c..a5413519f 100644 --- a/src/services/HotspotService/HotspotPage/HotspotDetails.tsx +++ b/src/features/hotspots/HotspotDetails.tsx @@ -1,14 +1,14 @@ import Box from '@components/Box' import ScrollBox from '@components/ScrollBox' import React, { useCallback, useMemo } from 'react' -import { useBorderRadii, useColors, useSpacing } from '@theme/themeHooks' -import Crown from '@assets/images/crown.svg' +import { useBorderRadii, useColors, useSpacing } from '@config/theme/themeHooks' +import Crown from '@assets/svgs/crown.svg' import Text from '@components/Text' -import MapPin from '@assets/images/mapPin.svg' -import Hex from '@assets/images/hex.svg' -import Clock from '@assets/images/clock.svg' -import Person from '@assets/images/person.svg' -import Electricity from '@assets/images/electricity.svg' +import MapPin from '@assets/svgs/mapPin.svg' +import Hex from '@assets/svgs/hex.svg' +import Clock from '@assets/svgs/clock.svg' +import Person from '@assets/svgs/person.svg' +import Electricity from '@assets/svgs/electricity.svg' import FabButton from '@components/FabButton' import { useNavigation, useRoute } from '@react-navigation/native' import { PublicKey } from '@solana/web3.js' @@ -20,9 +20,9 @@ import { useAsync } from 'react-async-hook' import SkeletonPlaceholder from 'react-native-skeleton-placeholder' import { useTranslation } from 'react-i18next' import { formatDistanceToNow } from 'date-fns' -import { HotspotWithPendingRewards } from '../../../types/solana' -import MiniMap from './MiniMap' -import { HotspotNavigationProp } from '.' +import MiniMap from '@components/MiniMap' +import { HotspotNavigationProp } from '@services/HotspotService/pages/HotspotPage' +import { HotspotWithPendingRewards } from '../../types/solana' const MINI_MAP_HEIGHT = 310 diff --git a/src/features/collectables/HotspotMapHotspotDetails.tsx b/src/features/hotspots/HotspotMapHotspotDetails.tsx similarity index 98% rename from src/features/collectables/HotspotMapHotspotDetails.tsx rename to src/features/hotspots/HotspotMapHotspotDetails.tsx index e3521c8f2..a72270599 100644 --- a/src/features/collectables/HotspotMapHotspotDetails.tsx +++ b/src/features/hotspots/HotspotMapHotspotDetails.tsx @@ -1,7 +1,7 @@ -import CopyAddress from '@assets/images/copyAddress.svg' -import Hex from '@assets/images/hex.svg' -import IotSymbol from '@assets/images/iotSymbol.svg' -import MobileSymbol from '@assets/images/mobileSymbol.svg' +import CopyAddress from '@assets/svgs/copyAddress.svg' +import Hex from '@assets/svgs/hex.svg' +import IotSymbol from '@assets/svgs/iotSymbol.svg' +import MobileSymbol from '@assets/svgs/mobileSymbol.svg' import { ReAnimatedBlurBox } from '@components/AnimatedBox' import Box from '@components/Box' import CircleLoader from '@components/CircleLoader' @@ -29,7 +29,7 @@ import { MobileHotspotInfoV0, useMobileInfo } from '@hooks/useMobileInfo' import { usePublicKey } from '@hooks/usePublicKey' import { useNavigation } from '@react-navigation/native' import { PublicKey } from '@solana/web3.js' -import { useColors, useOpacity } from '@theme/themeHooks' +import { useColors, useOpacity } from '@config/theme/themeHooks' import { ellipsizeAddress, formatLargeNumber } from '@utils/accountUtils' import { removeDashAndCapitalize } from '@utils/hotspotNftsUtils' import { Explorer } from '@utils/walletApiV2' @@ -41,10 +41,10 @@ import { useTranslation } from 'react-i18next' import { Alert, AlertButton, Linking } from 'react-native' import { SvgUri } from 'react-native-svg' import SafeAreaBox from '@components/SafeAreaBox' -import { useSolana } from '../../solana/SolanaProvider' +import { useSolana } from '@features/solana/SolanaProvider' import { CompressedNFT } from '../../types/solana' import { IOT_CONFIG_KEY, MOBILE_CONFIG_KEY, Mints } from '../../utils/constants' -import { CollectableNavigationProp } from './collectablesTypes' +import { CollectableNavigationProp } from '../collectables/collectablesTypes' const IotMapDetails = ({ maker, diff --git a/src/features/collectables/HotspotMapLegend.tsx b/src/features/hotspots/HotspotMapLegend.tsx similarity index 97% rename from src/features/collectables/HotspotMapLegend.tsx rename to src/features/hotspots/HotspotMapLegend.tsx index ca5153009..70a4a2440 100644 --- a/src/features/collectables/HotspotMapLegend.tsx +++ b/src/features/hotspots/HotspotMapLegend.tsx @@ -1,7 +1,7 @@ -import Hex from '@assets/images/hex.svg' +import Hex from '@assets/svgs/hex.svg' import Box from '@components/Box' import Text from '@components/Text' -import { useColors } from '@theme/themeHooks' +import { useColors } from '@config/theme/themeHooks' import React from 'react' export const HotspotMapLegend = ({ diff --git a/src/features/collectables/HotspotMapScreen.tsx b/src/features/hotspots/HotspotMapScreen.tsx similarity index 98% rename from src/features/collectables/HotspotMapScreen.tsx rename to src/features/hotspots/HotspotMapScreen.tsx index 86a571a53..4200b77c2 100644 --- a/src/features/collectables/HotspotMapScreen.tsx +++ b/src/features/hotspots/HotspotMapScreen.tsx @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ /* eslint-disable no-restricted-properties */ -import BackArrow from '@assets/images/backArrow.svg' -import Hex from '@assets/images/hex.svg' +import BackArrow from '@assets/svgs/backArrow.svg' +import Hex from '@assets/svgs/hex.svg' import { ReAnimatedBlurBox } from '@components/AnimatedBox' import Box from '@components/Box' import CircleLoader from '@components/CircleLoader' @@ -26,7 +26,7 @@ import useHotspots from '@hooks/useHotspots' import { IotHotspotInfoV0 } from '@hooks/useIotInfo' import { MobileHotspotInfoV0 } from '@hooks/useMobileInfo' import { RouteProp, useNavigation, useRoute } from '@react-navigation/native' -import { useBackgroundStyle, useColors } from '@theme/themeHooks' +import { useBackgroundStyle, useColors } from '@config/theme/themeHooks' import { IOT_CONFIG_KEY, MOBILE_CONFIG_KEY } from '@utils/constants' import { getCachedIotInfos, @@ -37,14 +37,14 @@ import { import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react' import { useAsync } from 'react-async-hook' import { useTranslation } from 'react-i18next' -import { useSolana } from '../../solana/SolanaProvider' +import { useSolana } from '@features/solana/SolanaProvider' import { HotspotWithPendingRewards } from '../../types/solana' import { HotspotMapHotspotDetails } from './HotspotMapHotspotDetails' import { HotspotMapLegend } from './HotspotMapLegend' import { CollectableNavigationProp, CollectableStackParamList, -} from './collectablesTypes' +} from '../collectables/collectablesTypes' type Route = RouteProp diff --git a/src/services/HotspotService/HotspotPage/HotspotPage.tsx b/src/features/hotspots/HotspotPage.tsx similarity index 97% rename from src/services/HotspotService/HotspotPage/HotspotPage.tsx rename to src/features/hotspots/HotspotPage.tsx index 09e72c3d1..cb96b5767 100644 --- a/src/services/HotspotService/HotspotPage/HotspotPage.tsx +++ b/src/features/hotspots/HotspotPage.tsx @@ -4,7 +4,7 @@ import Text from '@components/Text' import TouchableContainer from '@components/TouchableContainer' import useHotspots from '@hooks/useHotspots' import { useIsFocused, useNavigation, useRoute } from '@react-navigation/native' -import { useColors, useSpacing } from '@theme/themeHooks' +import { useColors, useSpacing } from '@config/theme/themeHooks' import React, { useCallback, useMemo, useState } from 'react' import { useTranslation } from 'react-i18next' import { RefreshControl } from 'react-native' @@ -15,15 +15,15 @@ import { NavBarHeight } from '@components/ServiceNavBar' import { Search } from '@components/Search' import { Location, MarkerView } from '@rnmapbox/maps' import ImageBox from '@components/ImageBox' -import CarotRight from '@assets/images/carot-right.svg' +import CarotRight from '@assets/svgs/carot-right.svg' import { getDistance } from 'geolib' import { MOBILE_MINT, toNumber as heliumToNumber } from '@helium/spl-utils' import { BN } from '@coral-xyz/anchor' import { toNumber } from 'lodash' -import { HotspotWithPendingRewards } from '../../../types/solana' -import MiniMap from './MiniMap' +import MiniMap from '@components/MiniMap' +import { HotspotNavigationProp } from '@services/HotspotService/pages/HotspotPage' +import { HotspotWithPendingRewards } from '../../types/solana' import EmptyState from './EmptyState' -import { HotspotNavigationProp } from '.' const HotspotPage = () => { const { diff --git a/src/features/collectables/ModifyWifiScreen.tsx b/src/features/hotspots/ModifyWifiScreen.tsx similarity index 98% rename from src/features/collectables/ModifyWifiScreen.tsx rename to src/features/hotspots/ModifyWifiScreen.tsx index b6bc64c4f..e5f71cfb2 100644 --- a/src/features/collectables/ModifyWifiScreen.tsx +++ b/src/features/hotspots/ModifyWifiScreen.tsx @@ -1,6 +1,6 @@ import BackScreen from '@components/BackScreen' import Box from '@components/Box' -import { useSpacing, useColors } from '@theme/themeHooks' +import { useSpacing, useColors } from '@config/theme/themeHooks' import { BleError, Device, useHotspotBle } from '@helium/react-native-sdk' import { wp } from '@utils/layout' import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react' @@ -8,7 +8,7 @@ import Carousel from 'react-native-snap-carousel' import { useTranslation } from 'react-i18next' import TouchableContainer from '@components/TouchableContainer' import Text from '@components/Text' -import CarotRight from '@assets/images/carot-right.svg' +import CarotRight from '@assets/svgs/carot-right.svg' import { Alert, FlatList, @@ -20,7 +20,7 @@ import { } from 'react-native' import ScrollBox from '@components/ScrollBox' import TouchableOpacityBox from '@components/TouchableOpacityBox' -import RightArrow from '@assets/images/rightArrow.svg' +import RightArrow from '@assets/svgs/rightArrow.svg' import { check, PERMISSIONS, @@ -31,8 +31,8 @@ import { import * as Logger from '@utils/logger' import { useAsyncCallback } from 'react-async-hook' import { ButtonPressable, ImageBox, TextInput } from '@components/index' -import Visibility from '@assets/images/visibility.svg' -import VisibilityOff from '@assets/images/visibilityOff.svg' +import Visibility from '@assets/svgs/visibility.svg' +import VisibilityOff from '@assets/svgs/visibilityOff.svg' import { useNavigation } from '@react-navigation/native' import Config from 'react-native-config' diff --git a/src/features/collectables/SettingUpAntennaScreen.tsx b/src/features/hotspots/SettingUpAntennaScreen.tsx similarity index 96% rename from src/features/collectables/SettingUpAntennaScreen.tsx rename to src/features/hotspots/SettingUpAntennaScreen.tsx index e2a33de88..82844980d 100644 --- a/src/features/collectables/SettingUpAntennaScreen.tsx +++ b/src/features/hotspots/SettingUpAntennaScreen.tsx @@ -1,11 +1,11 @@ import React, { memo, useCallback } from 'react' import Box from '@components/Box' -import { useAccountStorage } from '@storage/AccountStorageProvider' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' import { useNavigation } from '@react-navigation/native' -import { TabBarNavigationProp } from 'src/navigation/rootTypes' +import { TabBarNavigationProp } from 'src/app/rootTypes' import { ReAnimatedBox } from '@components/AnimatedBox' import { DelayedFadeIn } from '@components/FadeInOut' -import BackArrow from '@assets/images/backArrow.svg' +import BackArrow from '@assets/svgs/backArrow.svg' import AccountIcon from '@components/AccountIcon' import { useSafeAreaInsets } from 'react-native-safe-area-context' import { useTranslation } from 'react-i18next' diff --git a/src/features/collectables/animations/iot-mobile-tokens.json b/src/features/hotspots/animations/iot-mobile-tokens.json similarity index 100% rename from src/features/collectables/animations/iot-mobile-tokens.json rename to src/features/hotspots/animations/iot-mobile-tokens.json diff --git a/src/features/collectables/animations/iot-tokens.json b/src/features/hotspots/animations/iot-tokens.json similarity index 100% rename from src/features/collectables/animations/iot-tokens.json rename to src/features/hotspots/animations/iot-tokens.json diff --git a/src/features/collectables/animations/mobile-tokens.json b/src/features/hotspots/animations/mobile-tokens.json similarity index 100% rename from src/features/collectables/animations/mobile-tokens.json rename to src/features/hotspots/animations/mobile-tokens.json diff --git a/src/features/hotspots/hotspotTypes.ts b/src/features/hotspots/hotspotTypes.ts new file mode 100644 index 000000000..0c379b575 --- /dev/null +++ b/src/features/hotspots/hotspotTypes.ts @@ -0,0 +1,60 @@ +import { StackNavigationProp } from '@react-navigation/stack' +import { + Collectable, + CompressedNFT, + HotspotWithPendingRewards, +} from '../../types/solana' + +export type PaymentRouteParam = { + collectable?: CompressedNFT +} + +export type CollectableStackParamList = { + HotspotList: undefined + HotspotMapScreen: + | undefined + | { + hotspot?: HotspotWithPendingRewards + network?: 'IOT' | 'MOBILE' + } + AssertLocationScreen: { + collectable: HotspotWithPendingRewards + } + AntennaSetupScreen: { + collectable: HotspotWithPendingRewards + } + SettingUpAntennaScreen: undefined + PaymentScreen: undefined | PaymentRouteParam + ClaimRewardsScreen: { + hotspot: HotspotWithPendingRewards + } + ClaimAllRewardsScreen: undefined + ClaimingRewardsScreen: undefined + ChangeRewardsRecipientScreen: { + hotspot: HotspotWithPendingRewards + } + CollectionScreen: { + collection: Collectable[] + } + NftDetailsScreen: { + collectable: Collectable + } + NftMetadataScreen: { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + metadata: any + } + TransferCollectableScreen: { + collectable: CompressedNFT | Collectable + } + TransferCompleteScreen: { + collectable: CompressedNFT | Collectable + } + AddNewContact: undefined + PaymentQrScanner: undefined + AddressBookNavigator: undefined + ScanAddress: undefined + OnboardingNavigator: undefined +} + +export type CollectableNavigationProp = + StackNavigationProp diff --git a/src/features/keystone/ConnectKeystoneStartScreen.tsx b/src/features/keystone/ConnectKeystoneStartScreen.tsx index 12012f174..687c74bdc 100644 --- a/src/features/keystone/ConnectKeystoneStartScreen.tsx +++ b/src/features/keystone/ConnectKeystoneStartScreen.tsx @@ -4,7 +4,7 @@ import ButtonPressable from '@components/ButtonPressable' import SafeAreaBox from '@components/SafeAreaBox' import Text from '@components/Text' import { useNavigation } from '@react-navigation/native' -import WarningKeystone from '@assets/images/warningKeystone.svg' +import WarningKeystone from '@assets/svgs/warningKeystone.svg' import React, { forwardRef, ReactNode, @@ -16,11 +16,11 @@ import React, { } from 'react' import useCamera from '@hooks/useCamera' import { BottomSheetBackdrop, BottomSheetModal } from '@gorhom/bottom-sheet' -import { useOpacity, useSpacing } from '@theme/themeHooks' +import { useOpacity, useSpacing } from '@config/theme/themeHooks' import useBackHandler from '@hooks/useBackHandler' import { useTheme } from '@shopify/restyle' import { t } from 'i18next' -import { RootNavigationProp } from 'src/navigation/rootTypes' +import { RootNavigationProp } from 'src/app/rootTypes' import { Image, Linking, Platform } from 'react-native' type CameraPermissionBottomSheetAlertRef = { diff --git a/src/features/keystone/KeystoneAccountAssignScreen.tsx b/src/features/keystone/KeystoneAccountAssignScreen.tsx index 79c0ae8c9..6ae394992 100644 --- a/src/features/keystone/KeystoneAccountAssignScreen.tsx +++ b/src/features/keystone/KeystoneAccountAssignScreen.tsx @@ -7,20 +7,20 @@ import Text from '@components/Text' import TextInput from '@components/TextInput' import CheckBox from '@react-native-community/checkbox' import { useNavigation } from '@react-navigation/native' -import { useColors, useSpacing } from '@theme/themeHooks' +import { useColors, useSpacing } from '@config/theme/themeHooks' import React, { memo, useCallback, useMemo, useState } from 'react' import { useAsyncCallback } from 'react-async-hook' import { useTranslation } from 'react-i18next' import { KeyboardAvoidingView, Platform, StyleSheet } from 'react-native' import { useSafeAreaInsets } from 'react-native-safe-area-context' import base58 from 'bs58' -import { CSAccountVersion } from '@storage/cloudStorage' +import { CSAccountVersion } from '@config/storage/cloudStorage' import { hex } from '@coral-xyz/anchor/dist/cjs/utils/bytes' import { PublicKey } from '@solana/web3.js' import Address from '@helium/address' import { ED25519_KEY_TYPE } from '@helium/address/build/KeyTypes' -import { RootNavigationProp } from '../../navigation/rootTypes' -import { useAccountStorage } from '../../storage/AccountStorageProvider' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' +import { RootNavigationProp } from '../../app/rootTypes' import { ImportAccountNavigationProp } from '../onboarding/import/importAccountNavTypes' import { CreateAccountNavigationProp } from '../onboarding/create/createAccountNavTypes' import { useKeystoneOnboarding } from './KeystoneOnboardingProvider' diff --git a/src/features/keystone/KeystoneModal.tsx b/src/features/keystone/KeystoneModal.tsx index 0236523d2..b3ba7864d 100644 --- a/src/features/keystone/KeystoneModal.tsx +++ b/src/features/keystone/KeystoneModal.tsx @@ -6,7 +6,7 @@ import { } from '@gorhom/bottom-sheet' import useBackHandler from '@hooks/useBackHandler' import { useTheme } from '@shopify/restyle' -import { useOpacity, useSpacing } from '@theme/themeHooks' +import { useOpacity, useSpacing } from '@config/theme/themeHooks' import React, { ReactNode, Ref, @@ -19,7 +19,7 @@ import React, { useState, } from 'react' import EventEmitter from 'events' -import { useAccountStorage } from '@storage/AccountStorageProvider' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' import { KeystoneSolanaSDK } from '@keystonehq/keystone-sdk' import { uuid } from '@keystonehq/keystone-sdk/dist/utils' import SignTxModal from './SignTx/SignTxModal' diff --git a/src/features/keystone/ScanQrCodeScreen.tsx b/src/features/keystone/ScanQrCodeScreen.tsx index c51e51cf7..1295e8900 100644 --- a/src/features/keystone/ScanQrCodeScreen.tsx +++ b/src/features/keystone/ScanQrCodeScreen.tsx @@ -3,7 +3,7 @@ import DynamicQrScanner from '@components/DynamicQrScanner' import SafeAreaBox from '@components/SafeAreaBox' import { URDecoder } from '@ngraveio/bc-ur' import KeystoneSDK, { MultiAccounts, UR } from '@keystonehq/keystone-sdk' -import { RootNavigationProp } from 'src/navigation/rootTypes' +import { RootNavigationProp } from 'src/app/rootTypes' import { useNavigation } from '@react-navigation/native' import { Alert } from 'react-native' import { useTranslation } from 'react-i18next' diff --git a/src/features/keystone/SelectKeystoneAccountsScreen.tsx b/src/features/keystone/SelectKeystoneAccountsScreen.tsx index 1de99393e..1dc16c746 100644 --- a/src/features/keystone/SelectKeystoneAccountsScreen.tsx +++ b/src/features/keystone/SelectKeystoneAccountsScreen.tsx @@ -6,23 +6,20 @@ import SafeAreaBox from '@components/SafeAreaBox' import Text from '@components/Text' import ButtonPressable from '@components/ButtonPressable' import { FlatList, RefreshControl } from 'react-native' -import { useColors } from '@theme/themeHooks' +import { useColors } from '@config/theme/themeHooks' import CheckBox from '@react-native-community/checkbox' import TouchableContainer from '@components/TouchableContainer' import { humanReadable } from '@helium/spl-utils' import BN from 'bn.js' import { RouteProp, useNavigation, useRoute } from '@react-navigation/native' -import { - RootNavigationProp, - RootStackParamList, -} from 'src/navigation/rootTypes' -import { useAccountStorage } from '@storage/AccountStorageProvider' +import { RootNavigationProp, RootStackParamList } from 'src/app/rootTypes' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' import { ellipsizeAddress } from '@utils/accountUtils' import base58 from 'bs58' import { retryWithBackoff } from '@utils/retryWithBackoff' import { PublicKey } from '@solana/web3.js' import { useTranslation } from 'react-i18next' -import { useSolana } from '../../solana/SolanaProvider' +import { useSolana } from '@features/solana/SolanaProvider' import { useKeystoneOnboarding } from './KeystoneOnboardingProvider' export type KeystoneAccountType = { diff --git a/src/features/keystone/SignTx/SignTxModal.tsx b/src/features/keystone/SignTx/SignTxModal.tsx index 97dc4bb2a..47e194f4c 100644 --- a/src/features/keystone/SignTx/SignTxModal.tsx +++ b/src/features/keystone/SignTx/SignTxModal.tsx @@ -1,6 +1,6 @@ import SafeAreaBox from '@components/SafeAreaBox' import React, { useEffect, useMemo, useState } from 'react' -import Keystone from '@assets/images/keystoneLogo.svg' +import Keystone from '@assets/svgs/keystoneLogo.svg' import Box from '@components/Box' import Text from '@components/Text' import ButtonPressable from '@components/ButtonPressable' @@ -19,7 +19,7 @@ import { useAsync } from 'react-async-hook' import EventEmitter from 'events' import CloseButton from '@components/CloseButton' -import { useHitSlop } from '@theme/themeHooks' +import { useHitSlop } from '@config/theme/themeHooks' import { CameraScannerLayout } from '../../../components/CameraScannerLayout' import { KeystoneSolSignRequest } from '../types/keystoneSolanaTxType' diff --git a/src/features/ledger/DeviceChooseType.tsx b/src/features/ledger/DeviceChooseType.tsx index 49508e121..792b9e013 100644 --- a/src/features/ledger/DeviceChooseType.tsx +++ b/src/features/ledger/DeviceChooseType.tsx @@ -1,11 +1,11 @@ import React, { useCallback } from 'react' import { useTranslation } from 'react-i18next' import { useNavigation } from '@react-navigation/native' -import Ledger from '@assets/images/ledger.svg' +import Ledger from '@assets/svgs/ledger.svg' import Text from '@components/Text' import Box from '@components/Box' import TouchableOpacityBox from '@components/TouchableOpacityBox' -import { useColors } from '@theme/themeHooks' +import { useColors } from '@config/theme/themeHooks' import SafeAreaBox from '@components/SafeAreaBox' import { LedgerNavigatorNavigationProp } from './ledgerNavigatorTypes' diff --git a/src/features/ledger/DeviceScan.tsx b/src/features/ledger/DeviceScan.tsx index 270861023..2e44b9728 100644 --- a/src/features/ledger/DeviceScan.tsx +++ b/src/features/ledger/DeviceScan.tsx @@ -3,9 +3,9 @@ import { useTranslation } from 'react-i18next' import { FlatList, LayoutChangeEvent } from 'react-native' import { Device } from 'react-native-ble-plx' import { RouteProp, useNavigation, useRoute } from '@react-navigation/native' -import CarotRight from '@assets/images/carot-right.svg' -import LedgerCircle from '@assets/images/ledger-circle.svg' -import Ledger from '@assets/images/ledger.svg' +import CarotRight from '@assets/svgs/carot-right.svg' +import LedgerCircle from '@assets/svgs/ledger-circle.svg' +import Ledger from '@assets/svgs/ledger.svg' import { BottomSheetBackdrop, BottomSheetModal, @@ -16,7 +16,7 @@ import BackButton from '@components/BackButton' import Text from '@components/Text' import Box from '@components/Box' import TouchableOpacityBox from '@components/TouchableOpacityBox' -import { useColors, useOpacity } from '@theme/themeHooks' +import { useColors, useOpacity } from '@config/theme/themeHooks' import useBackHandler from '@hooks/useBackHandler' import useLedgerDeviceScan from '@hooks/useLedgerDeviceScan' import LedgerConnectSteps from './LedgerConnectSteps' diff --git a/src/features/ledger/DeviceScanUsb.tsx b/src/features/ledger/DeviceScanUsb.tsx index d82f509a1..0bd2ab1a3 100644 --- a/src/features/ledger/DeviceScanUsb.tsx +++ b/src/features/ledger/DeviceScanUsb.tsx @@ -3,13 +3,13 @@ import TransportHID from '@ledgerhq/react-native-hid' import { useTranslation } from 'react-i18next' import { FlatList } from 'react-native' import { useNavigation } from '@react-navigation/native' -import CarotRight from '@assets/images/carot-right.svg' -import LedgerCircle from '@assets/images/ledger-circle.svg' -import Ledger from '@assets/images/ledger.svg' +import CarotRight from '@assets/svgs/carot-right.svg' +import LedgerCircle from '@assets/svgs/ledger-circle.svg' +import Ledger from '@assets/svgs/ledger.svg' import Text from '@components/Text' import Box from '@components/Box' import TouchableOpacityBox from '@components/TouchableOpacityBox' -import { useColors } from '@theme/themeHooks' +import { useColors } from '@config/theme/themeHooks' import SafeAreaBox from '@components/SafeAreaBox' import { LedgerNavigatorNavigationProp } from './ledgerNavigatorTypes' diff --git a/src/features/ledger/DeviceShow.tsx b/src/features/ledger/DeviceShow.tsx index a97621679..865e71e4f 100644 --- a/src/features/ledger/DeviceShow.tsx +++ b/src/features/ledger/DeviceShow.tsx @@ -3,25 +3,25 @@ import { ActivityIndicator, Image, SectionList } from 'react-native' import { RouteProp, useNavigation, useRoute } from '@react-navigation/native' import { useTranslation } from 'react-i18next' import { useAsync } from 'react-async-hook' -import Ledger from '@assets/images/ledger.svg' -import ArrowRight from '@assets/images/arrowRight.svg' +import Ledger from '@assets/svgs/ledger.svg' +import ArrowRight from '@assets/svgs/arrowRight.svg' import { TouchableOpacity } from 'react-native-gesture-handler' import Box from '@components/Box' import Text from '@components/Text' import ButtonPressable from '@components/ButtonPressable' -import { useColors, useSpacing } from '@theme/themeHooks' +import { useColors, useSpacing } from '@config/theme/themeHooks' import BackButton from '@components/BackButton' -import { CSAccountVersion, CSAccounts } from '@storage/cloudStorage' +import { CSAccountVersion, CSAccounts } from '@config/storage/cloudStorage' import useLedger, { LedgerAccount } from '@hooks/useLedger' -import { WalletNavigationProp } from '@services/WalletService/pages/WalletPage/WalletPageNavigator' +import { WalletNavigationProp } from '@services/WalletService/pages/WalletPage' +import { + useAccountStorage, + MAX_ACCOUNTS, +} from '@config/storage/AccountStorageProvider' import { LedgerNavigatorNavigationProp, LedgerNavigatorStackParamList, } from './ledgerNavigatorTypes' -import { - useAccountStorage, - MAX_ACCOUNTS, -} from '../../storage/AccountStorageProvider' import LedgerAccountListItem, { Section } from './LedgerAccountListItem' type Route = RouteProp diff --git a/src/features/ledger/LedgerAccountListItem.tsx b/src/features/ledger/LedgerAccountListItem.tsx index 47b7dbce7..d4489f2e3 100644 --- a/src/features/ledger/LedgerAccountListItem.tsx +++ b/src/features/ledger/LedgerAccountListItem.tsx @@ -5,7 +5,7 @@ import Text from '@components/Text' import { toBN } from '@helium/spl-utils' import { LedgerAccount } from '@hooks/useLedger' import CheckBox from '@react-native-community/checkbox' -import { useColors } from '@theme/themeHooks' +import { useColors } from '@config/theme/themeHooks' import { humanReadable } from '@utils/solanaUtils' import React, { memo, useCallback, useMemo } from 'react' import { ellipsizeAddress } from '../../utils/accountUtils' diff --git a/src/features/ledger/LedgerConnectSteps.tsx b/src/features/ledger/LedgerConnectSteps.tsx index 6ece8dd74..55526d5d8 100644 --- a/src/features/ledger/LedgerConnectSteps.tsx +++ b/src/features/ledger/LedgerConnectSteps.tsx @@ -1,11 +1,11 @@ import React, { memo } from 'react' import { useTranslation } from 'react-i18next' -import Check from '@assets/images/checkmark.svg' +import Check from '@assets/svgs/checkmark.svg' import { LayoutChangeEvent } from 'react-native' -import InfoError from '@assets/images/infoError.svg' +import InfoError from '@assets/svgs/infoError.svg' import Box from '@components/Box' import Text from '@components/Text' -import { useColors } from '@theme/themeHooks' +import { useColors } from '@config/theme/themeHooks' import TouchableOpacityBox from '@components/TouchableOpacityBox' type Props = { diff --git a/src/features/ledger/LedgerModal.tsx b/src/features/ledger/LedgerModal.tsx index a61cfdd4e..7d2cf9a9c 100644 --- a/src/features/ledger/LedgerModal.tsx +++ b/src/features/ledger/LedgerModal.tsx @@ -13,9 +13,9 @@ import useBackHandler from '@hooks/useBackHandler' import useLedger from '@hooks/useLedger' import { DeviceModelId } from '@ledgerhq/types-devices' import { BoxProps } from '@shopify/restyle' -import { useAccountStorage } from '@storage/AccountStorageProvider' -import { Theme } from '@theme/theme' -import { useColors, useOpacity } from '@theme/themeHooks' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' +import { Theme } from '@config/theme/theme' +import { useColors, useOpacity } from '@config/theme/themeHooks' import { signLedgerMessage, signLedgerTransaction } from '@utils/heliumLedger' import React, { ReactNode, diff --git a/src/features/ledger/PairStart.tsx b/src/features/ledger/PairStart.tsx index b52a77b57..a3b41249f 100644 --- a/src/features/ledger/PairStart.tsx +++ b/src/features/ledger/PairStart.tsx @@ -1,13 +1,13 @@ import React, { memo, useCallback } from 'react' -import Ledger from '@assets/images/ledger.svg' +import Ledger from '@assets/svgs/ledger.svg' import { useTranslation } from 'react-i18next' import { useNavigation } from '@react-navigation/native' import Box from '@components/Box' -import { useColors } from '@theme/themeHooks' +import { useColors } from '@config/theme/themeHooks' import Text from '@components/Text' import SafeAreaBox from '@components/SafeAreaBox' import ButtonPressable from '@components/ButtonPressable' -import { useAccountStorage } from '../../storage/AccountStorageProvider' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' import { AddNewAccountNavigationProp } from '../home/addNewAccount/addNewAccountTypes' const PairStart = () => { diff --git a/src/features/ledger/PairSuccess.tsx b/src/features/ledger/PairSuccess.tsx index 41a3251c3..d8b0848a4 100644 --- a/src/features/ledger/PairSuccess.tsx +++ b/src/features/ledger/PairSuccess.tsx @@ -1,14 +1,14 @@ import { useNavigation } from '@react-navigation/native' import React, { useCallback } from 'react' import { useTranslation } from 'react-i18next' -import Ledger from '@assets/images/ledger.svg' +import Ledger from '@assets/svgs/ledger.svg' import Box from '@components/Box' import Text from '@components/Text' import ButtonPressable from '@components/ButtonPressable' -import { useColors } from '@theme/themeHooks' +import { useColors } from '@config/theme/themeHooks' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' import { LedgerNavigatorNavigationProp } from './ledgerNavigatorTypes' -import { useAccountStorage } from '../../storage/AccountStorageProvider' -import { RootNavigationProp } from '../../navigation/rootTypes' +import { RootNavigationProp } from '../../app/rootTypes' const PairSuccess = () => { const { t } = useTranslation() diff --git a/src/features/ledger/ledgerNavigatorTypes.tsx b/src/features/ledger/ledgerNavigatorTypes.tsx index 070bdbaf0..6146bad3b 100644 --- a/src/features/ledger/ledgerNavigatorTypes.tsx +++ b/src/features/ledger/ledgerNavigatorTypes.tsx @@ -1,5 +1,5 @@ import { StackNavigationProp } from '@react-navigation/stack' -import { LedgerDevice } from '../../storage/cloudStorage' +import { LedgerDevice } from '@config/storage/cloudStorage' export type LedgerNavigatorStackParamList = { DeviceChooseType: undefined diff --git a/src/features/lock/LockScreen.tsx b/src/features/lock/LockScreen.tsx index 9cb4252df..8ae0284f5 100644 --- a/src/features/lock/LockScreen.tsx +++ b/src/features/lock/LockScreen.tsx @@ -9,14 +9,14 @@ import { useTranslation } from 'react-i18next' import useAppState from 'react-native-appstate-hook' import { FadeIn, FadeOutDown } from 'react-native-reanimated' import { ThemeProvider } from '@shopify/restyle' -import { darkTheme } from '@theme/theme' -import { useAccountStorage } from '../../storage/AccountStorageProvider' -import { useAppStorage } from '../../storage/AppStorageProvider' +import { darkTheme } from '@config/theme/theme' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' +import { useAppStorage } from '@config/storage/AppStorageProvider' import { deleteSecureItem, getSecureItem, storeSecureItem, -} from '../../storage/secureStorage' +} from '@config/storage/secureStorage' type Props = { children: React.ReactNode } const LockScreen = ({ children }: Props) => { diff --git a/src/features/migration/SolanaMigration.tsx b/src/features/migration/SolanaMigration.tsx index ec01119d8..bf9ef4aeb 100644 --- a/src/features/migration/SolanaMigration.tsx +++ b/src/features/migration/SolanaMigration.tsx @@ -15,15 +15,15 @@ import IndeterminateProgressBar from '@components/IndeterminateProgressBar' import Text from '@components/Text' import ButtonPressable from '@components/ButtonPressable' import BackScreen from '@components/BackScreen' -import { Theme } from '@theme/theme' +import { Theme } from '@config/theme/theme' import Config from 'react-native-config' import SafeAreaBox from '@components/SafeAreaBox' -import { useAccountStorage } from '../../storage/AccountStorageProvider' -import { useAppStorage } from '../../storage/AppStorageProvider' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' +import { useAppStorage } from '@config/storage/AppStorageProvider' +import { useSolana } from '@features/solana/SolanaProvider' import * as Logger from '../../utils/logger' import { useAppDispatch } from '../../store/store' import { fetchHotspots } from '../../store/slices/hotspotsSlice' -import { useSolana } from '../../solana/SolanaProvider' async function migrateWallet( provider: Provider, diff --git a/src/features/modals/InsufficientSolConversionModal.tsx b/src/features/modals/InsufficientSolConversionModal.tsx index b52132aa9..572ab4599 100644 --- a/src/features/modals/InsufficientSolConversionModal.tsx +++ b/src/features/modals/InsufficientSolConversionModal.tsx @@ -17,9 +17,9 @@ import { import { useEcosystemTokenSolConvert } from '@hooks/useEcosystemTokensSolConvert' import { useMetaplexMetadata } from '@hooks/useMetaplexMetadata' import { PublicKey } from '@solana/web3.js' -import { useAppStorage } from '@storage/AppStorageProvider' -import { useModal } from '@storage/ModalsProvider' -import { useVisibleTokens } from '@storage/TokensProvider' +import { useAppStorage } from '@config/storage/AppStorageProvider' +import { useModal } from '@config/storage/ModalsProvider' +import { useVisibleTokens } from '@config/storage/TokensProvider' import BN from 'bn.js' import React, { FC, @@ -32,8 +32,8 @@ import React, { import { useTranslation } from 'react-i18next' import { Switch } from 'react-native-gesture-handler' import { Edge } from 'react-native-safe-area-context' -import { useSolana } from '../../solana/SolanaProvider' -import * as Logger from '../../utils/logger' +import { useSolana } from '@features/solana/SolanaProvider' +import * as Logger from '@utils/logger' const InsufficientSolConversionModal: FC = () => { const { t } = useTranslation() diff --git a/src/features/notifications/AccountSlider.tsx b/src/features/notifications/AccountSlider.tsx index aed7118a0..01cb5c9e1 100644 --- a/src/features/notifications/AccountSlider.tsx +++ b/src/features/notifications/AccountSlider.tsx @@ -1,15 +1,15 @@ import React, { memo, useCallback, useMemo, useRef } from 'react' -import WalletUpdate from '@assets/images/walletUpdateIcon.svg' -import HeliumUpdate from '@assets/images/heliumUpdateIcon.svg' +import WalletUpdate from '@assets/svgs/walletUpdateIcon.svg' +import HeliumUpdate from '@assets/svgs/heliumUpdateIcon.svg' import { Carousel } from 'react-native-snap-carousel' import { StyleSheet } from 'react-native' import { useAsync } from 'react-async-hook' import AccountIcon from '@components/AccountIcon' import Box from '@components/Box' -import { useAccountStorage } from '../../storage/AccountStorageProvider' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' +import { useNotificationStorage } from '@config/storage/NotificationStorageProvider' import { wp } from '../../utils/layout' import AccountSliderIcon from './AccountSliderIcon' -import { useNotificationStorage } from '../../storage/NotificationStorageProvider' import { HELIUM_UPDATES_ITEM, WALLET_UPDATES_ITEM } from './notificationTypes' import { isValidAccountHash } from '../../utils/accountUtils' diff --git a/src/features/notifications/AccountSliderIcon.tsx b/src/features/notifications/AccountSliderIcon.tsx index 3a7bd7f5b..7066a4210 100644 --- a/src/features/notifications/AccountSliderIcon.tsx +++ b/src/features/notifications/AccountSliderIcon.tsx @@ -2,7 +2,7 @@ import React, { memo, useCallback, useMemo } from 'react' import TouchableOpacityBox from '@components/TouchableOpacityBox' import Box from '@components/Box' import { heliumAddressToSolAddress } from '@helium/spl-utils' -import { useNotificationStorage } from '../../storage/NotificationStorageProvider' +import { useNotificationStorage } from '@config/storage/NotificationStorageProvider' type Props = { icon: React.ReactNode diff --git a/src/features/notifications/NotificationDetailBanner.tsx b/src/features/notifications/NotificationDetailBanner.tsx index bfc2d1a22..4bef3de12 100644 --- a/src/features/notifications/NotificationDetailBanner.tsx +++ b/src/features/notifications/NotificationDetailBanner.tsx @@ -1,7 +1,7 @@ import React, { memo, useMemo } from 'react' import { Image } from 'react-native' import Box from '@components/Box' -import { useSpacing } from '@theme/themeHooks' +import { useSpacing } from '@config/theme/themeHooks' import { ww } from '../../utils/layout' const NotificationDetailBanner = ({ icon }: { icon: string }) => { diff --git a/src/features/notifications/NotificationDetails.tsx b/src/features/notifications/NotificationDetails.tsx index 9136e0369..1b715bd8e 100644 --- a/src/features/notifications/NotificationDetails.tsx +++ b/src/features/notifications/NotificationDetails.tsx @@ -8,14 +8,14 @@ import BackButton from '@components/BackButton' import usePrevious from '@hooks/usePrevious' import useMount from '@hooks/useMount' import { DelayedFadeIn } from '@components/FadeInOut' -import globalStyles from '@theme/globalStyles' +import globalStyles from '@config/theme/globalStyles' +import { useNotificationStorage } from '@config/storage/NotificationStorageProvider' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' import { NotificationsListStackParamList } from './notificationTypes' -import { useNotificationStorage } from '../../storage/NotificationStorageProvider' import NotificationDetailBanner from './NotificationDetailBanner' import parseMarkup from '../../utils/parseMarkup' import { useAppDispatch } from '../../store/store' import { markNotificationRead } from '../../store/slices/notificationsSlice' -import { useAccountStorage } from '../../storage/AccountStorageProvider' type Route = RouteProp diff --git a/src/features/notifications/NotificationsList.tsx b/src/features/notifications/NotificationsList.tsx index 5a747b2a5..c39506083 100644 --- a/src/features/notifications/NotificationsList.tsx +++ b/src/features/notifications/NotificationsList.tsx @@ -4,12 +4,12 @@ import { useTranslation } from 'react-i18next' import { SectionList } from 'react-native' import Box from '@components/Box' import Text from '@components/Text' -import { useSpacing } from '@theme/themeHooks' +import { useSpacing } from '@config/theme/themeHooks' import FadeInOut from '@components/FadeInOut' import useHaptic from '@hooks/useHaptic' import ScrollBox from '@components/ScrollBox' +import { useNotificationStorage } from '@config/storage/NotificationStorageProvider' import { NotificationsListNavigationProp } from './notificationTypes' -import { useNotificationStorage } from '../../storage/NotificationStorageProvider' import NotificationListItem from './NotificationListItem' import { Notification } from '../../utils/walletApiV2' diff --git a/src/features/notifications/NotificationsNavigator.tsx b/src/features/notifications/NotificationsNavigator.tsx index f36b62db3..f0bce4d62 100644 --- a/src/features/notifications/NotificationsNavigator.tsx +++ b/src/features/notifications/NotificationsNavigator.tsx @@ -1,6 +1,6 @@ import React, { memo } from 'react' import { createNativeStackNavigator } from '@react-navigation/native-stack' -import { useOpacity } from '@theme/themeHooks' +import { useOpacity } from '@config/theme/themeHooks' import NotificationsScreen from './NotificationsScreen' import NotificationDetails from './NotificationDetails' diff --git a/src/features/notifications/NotificationsScreen.tsx b/src/features/notifications/NotificationsScreen.tsx index 15f9574da..2273a3dd3 100644 --- a/src/features/notifications/NotificationsScreen.tsx +++ b/src/features/notifications/NotificationsScreen.tsx @@ -5,8 +5,8 @@ import Box from '@components/Box' import ButtonPressable from '@components/ButtonPressable' import { DelayedFadeIn } from '@components/FadeInOut' import { ReAnimatedBox } from '@components/AnimatedBox' +import { useNotificationStorage } from '@config/storage/NotificationStorageProvider' import AccountSlider from './AccountSlider' -import { useNotificationStorage } from '../../storage/NotificationStorageProvider' import NotificationsList from './NotificationsList' const NotificationsScreen = () => { diff --git a/src/features/onboarding/AccountAssignScreen.tsx b/src/features/onboarding/AccountAssignScreen.tsx index aee04fc8e..61f13c29b 100644 --- a/src/features/onboarding/AccountAssignScreen.tsx +++ b/src/features/onboarding/AccountAssignScreen.tsx @@ -10,9 +10,12 @@ import { heliumAddressFromSolAddress } from '@helium/spl-utils' import CheckBox from '@react-native-community/checkbox' import { RouteProp, useNavigation, useRoute } from '@react-navigation/native' import { Keypair } from '@solana/web3.js' -import { CSAccountVersion } from '@storage/cloudStorage' -import { storeSecureAccount, toSecureAccount } from '@storage/secureStorage' -import { useColors, useSpacing } from '@theme/themeHooks' +import { CSAccountVersion } from '@config/storage/cloudStorage' +import { + storeSecureAccount, + toSecureAccount, +} from '@config/storage/secureStorage' +import { useColors, useSpacing } from '@config/theme/themeHooks' import { createHash } from 'crypto' import React, { memo, useCallback, useMemo, useState } from 'react' import { useAsyncCallback } from 'react-async-hook' @@ -21,10 +24,10 @@ import { KeyboardAvoidingView, Platform, StyleSheet } from 'react-native' import { useSafeAreaInsets } from 'react-native-safe-area-context' import { accountNetType } from '@utils/accountUtils' import { ResolvedPath } from '@hooks/useDerivationAccounts' -import { AccountsServiceStackParamList } from '@services/AccountsService' -import { RootNavigationProp } from '../../navigation/rootTypes' -import { useSolana } from '../../solana/SolanaProvider' -import { useAccountStorage } from '../../storage/AccountStorageProvider' +import { AccountsServiceStackParamList } from 'src/app/services/AccountsService' +import { useSolana } from '@features/solana/SolanaProvider' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' +import { RootNavigationProp } from '../../app/rootTypes' import { CreateAccountNavigationProp } from './create/createAccountNavTypes' import { ImportAccountNavigationProp } from './import/importAccountNavTypes' import { useOnboarding } from './OnboardingProvider' diff --git a/src/features/onboarding/AccountConfirmPinScreen.tsx b/src/features/onboarding/AccountConfirmPinScreen.tsx index b5a9a7887..9710f2579 100644 --- a/src/features/onboarding/AccountConfirmPinScreen.tsx +++ b/src/features/onboarding/AccountConfirmPinScreen.tsx @@ -2,14 +2,14 @@ import ConfirmPinView from '@components/ConfirmPinView' import { heliumAddressFromSolAddress } from '@helium/spl-utils' import { RouteProp, useNavigation, useRoute } from '@react-navigation/native' import { Keypair } from '@solana/web3.js' -import { toSecureAccount } from '@storage/secureStorage' +import { toSecureAccount } from '@config/storage/secureStorage' import React, { useCallback } from 'react' import { useTranslation } from 'react-i18next' import { ThemeProvider } from '@shopify/restyle' -import { darkTheme } from '@theme/theme' -import { RootNavigationProp } from '../../navigation/rootTypes' -import { useAccountStorage } from '../../storage/AccountStorageProvider' -import { useAppStorage } from '../../storage/AppStorageProvider' +import { darkTheme } from '@config/theme/theme' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' +import { useAppStorage } from '@config/storage/AppStorageProvider' +import { RootNavigationProp } from '../../app/rootTypes' import { useOnboarding } from './OnboardingProvider' import { CreateAccountStackParamList } from './create/createAccountNavTypes' import { ImportAccountStackParamList } from './import/importAccountNavTypes' diff --git a/src/features/onboarding/AccountCreatePinScreen.tsx b/src/features/onboarding/AccountCreatePinScreen.tsx index 14bb19d8c..75c218902 100644 --- a/src/features/onboarding/AccountCreatePinScreen.tsx +++ b/src/features/onboarding/AccountCreatePinScreen.tsx @@ -7,7 +7,7 @@ import Keypad from '@components/Keypad' import Box from '@components/Box' import { KeypadInput } from '@components/KeypadButton' import { ThemeProvider } from '@shopify/restyle' -import { darkTheme } from '@theme/theme' +import { darkTheme } from '@config/theme/theme' import { CreateAccountNavigationProp, CreateAccountStackParamList, diff --git a/src/features/onboarding/CreateImportAccountScreen.tsx b/src/features/onboarding/CreateImportAccountScreen.tsx index 824a7ba07..337a46349 100644 --- a/src/features/onboarding/CreateImportAccountScreen.tsx +++ b/src/features/onboarding/CreateImportAccountScreen.tsx @@ -1,15 +1,15 @@ import { useNavigation } from '@react-navigation/native' import React, { memo, useCallback } from 'react' import { useTranslation } from 'react-i18next' -import Plus from '@assets/images/plus.svg' -import DownArrow from '@assets/images/importIcon.svg' -import Ledger from '@assets/images/ledger.svg' -import Keystone from '@assets/images/keystoneLogo.svg' +import Plus from '@assets/svgs/plus.svg' +import DownArrow from '@assets/svgs/importIcon.svg' +import Ledger from '@assets/svgs/ledger.svg' +import Keystone from '@assets/svgs/keystoneLogo.svg' import { useSafeAreaInsets } from 'react-native-safe-area-context' import Box from '@components/Box' import Text from '@components/Text' import SafeAreaBox from '@components/SafeAreaBox' -import { useColors } from '@theme/themeHooks' +import { useColors } from '@config/theme/themeHooks' import TouchableOpacityBox from '@components/TouchableOpacityBox' import BackgroundFill from '@components/BackgroundFill' import FinePrint from '@components/FinePrint' diff --git a/src/features/onboarding/NetTypeSegment.tsx b/src/features/onboarding/NetTypeSegment.tsx index 82d62c75b..b59aac73f 100644 --- a/src/features/onboarding/NetTypeSegment.tsx +++ b/src/features/onboarding/NetTypeSegment.tsx @@ -5,13 +5,13 @@ import { useCallback, useMemo } from 'react' import { useTranslation } from 'react-i18next' import { NetTypes as NetType } from '@helium/address' import { Platform, Switch } from 'react-native' -import { Theme } from '@theme/theme' +import { Theme } from '@config/theme/theme' import TouchableOpacityBox from '@components/TouchableOpacityBox' import Text from '@components/Text' import Box from '@components/Box' -import { useColors, useHitSlop, useSpacing } from '@theme/themeHooks' +import { useColors, useHitSlop, useSpacing } from '@config/theme/themeHooks' +import { useAppStorage } from '@config/storage/AppStorageProvider' import { useOnboarding } from './OnboardingProvider' -import { useAppStorage } from '../../storage/AppStorageProvider' type Props = BoxProps const NetTypeSegment = (boxProps: Props) => { diff --git a/src/features/onboarding/OnboardingNavigator.tsx b/src/features/onboarding/OnboardingNavigator.tsx index b2f1ffef8..aaef1b935 100644 --- a/src/features/onboarding/OnboardingNavigator.tsx +++ b/src/features/onboarding/OnboardingNavigator.tsx @@ -5,7 +5,7 @@ import { } from '@react-navigation/stack' import React, { memo, useMemo } from 'react' import { ThemeProvider } from '@shopify/restyle' -import { darkTheme } from '@theme/theme' +import { darkTheme } from '@config/theme/theme' import LedgerNavigator from '../ledger/LedgerNavigator' import CreateImportAccountScreen from './CreateImportAccountScreen' import CreateAccountNavigator from './create/CreateAccountNavigator' diff --git a/src/features/onboarding/OnboardingProvider.tsx b/src/features/onboarding/OnboardingProvider.tsx index 0afe6caea..822239f11 100644 --- a/src/features/onboarding/OnboardingProvider.tsx +++ b/src/features/onboarding/OnboardingProvider.tsx @@ -10,7 +10,7 @@ import React, { useMemo, useState, } from 'react' -import { CSAccount } from '../../storage/cloudStorage' +import { CSAccount } from '@config/storage/cloudStorage' type OnboardingData = { account?: CSAccount diff --git a/src/features/onboarding/cli-import/CLIAccountImportStartScreen.tsx b/src/features/onboarding/cli-import/CLIAccountImportStartScreen.tsx index 7b69b17c7..fd379fabb 100644 --- a/src/features/onboarding/cli-import/CLIAccountImportStartScreen.tsx +++ b/src/features/onboarding/cli-import/CLIAccountImportStartScreen.tsx @@ -2,7 +2,7 @@ import React, { useCallback, useMemo } from 'react' import { useNavigation } from '@react-navigation/native' import { Edge } from 'react-native-safe-area-context' import { useTranslation } from 'react-i18next' -import Terminal from '@assets/images/terminal.svg' +import Terminal from '@assets/svgs/terminal.svg' import Text from '@components/Text' import SafeAreaBox from '@components/SafeAreaBox' import ButtonPressable from '@components/ButtonPressable' diff --git a/src/features/onboarding/cli-import/CLIAccountNavigator.tsx b/src/features/onboarding/cli-import/CLIAccountNavigator.tsx index 089c2905a..525f78c8a 100644 --- a/src/features/onboarding/cli-import/CLIAccountNavigator.tsx +++ b/src/features/onboarding/cli-import/CLIAccountNavigator.tsx @@ -1,6 +1,6 @@ import * as React from 'react' import { createStackNavigator } from '@react-navigation/stack' -import { useColors } from '@theme/themeHooks' +import { useColors } from '@config/theme/themeHooks' import CLIAccountImportStartScreen from './CLIAccountImportStartScreen' import CLIPasswordScreen from './CLIPasswordScreen' import CLIQrScanner from './CLIQrScanner' diff --git a/src/features/onboarding/cli-import/CLIPasswordScreen.tsx b/src/features/onboarding/cli-import/CLIPasswordScreen.tsx index 409231ee6..c2fb5886a 100644 --- a/src/features/onboarding/cli-import/CLIPasswordScreen.tsx +++ b/src/features/onboarding/cli-import/CLIPasswordScreen.tsx @@ -1,4 +1,4 @@ -import Terminal from '@assets/images/terminal.svg' +import Terminal from '@assets/svgs/terminal.svg' import Box from '@components/Box' import ButtonPressable from '@components/ButtonPressable' import CloseButton from '@components/CloseButton' @@ -8,7 +8,7 @@ import TextInput from '@components/TextInput' import useAlert from '@hooks/useAlert' import { HELIUM_DERIVATION } from '@hooks/useDerivationAccounts' import { RouteProp, useNavigation, useRoute } from '@react-navigation/native' -import { createKeypair } from '@storage/secureStorage' +import { createKeypair } from '@config/storage/secureStorage' import React, { useCallback, useMemo, useState } from 'react' import { useTranslation } from 'react-i18next' import { TextStyle } from 'react-native' diff --git a/src/features/onboarding/create/AccountCreatePassphraseScreen.tsx b/src/features/onboarding/create/AccountCreatePassphraseScreen.tsx index 3bd07809e..d589b79a4 100644 --- a/src/features/onboarding/create/AccountCreatePassphraseScreen.tsx +++ b/src/features/onboarding/create/AccountCreatePassphraseScreen.tsx @@ -1,14 +1,17 @@ -import Close from '@assets/images/close.svg' -import InfoError from '@assets/images/infoError.svg' +import Close from '@assets/svgs/close.svg' +import InfoError from '@assets/svgs/infoError.svg' import Box from '@components/Box' import CircleLoader from '@components/CircleLoader' import RevealWords from '@components/RevealWords' import Text from '@components/Text' import TouchableOpacityBox from '@components/TouchableOpacityBox' import { useNavigation } from '@react-navigation/native' -import { useAccountStorage } from '@storage/AccountStorageProvider' -import { DEFAULT_DERIVATION_PATH, createKeypair } from '@storage/secureStorage' -import { useColors } from '@theme/themeHooks' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' +import { + DEFAULT_DERIVATION_PATH, + createKeypair, +} from '@config/storage/secureStorage' +import { useColors } from '@config/theme/themeHooks' import React, { memo, useCallback, useMemo } from 'react' import { useAsync } from 'react-async-hook' import { useTranslation } from 'react-i18next' diff --git a/src/features/onboarding/create/AccountCreateStart.tsx b/src/features/onboarding/create/AccountCreateStart.tsx index 044f9ac6e..62f90355b 100644 --- a/src/features/onboarding/create/AccountCreateStart.tsx +++ b/src/features/onboarding/create/AccountCreateStart.tsx @@ -1,14 +1,14 @@ import React, { memo, useCallback } from 'react' -import { useColors } from '@theme/themeHooks' +import { useColors } from '@config/theme/themeHooks' import { useTranslation } from 'react-i18next' -import CreateAccount from '@assets/images/createAccount.svg' +import CreateAccount from '@assets/svgs/createAccount.svg' import { useNavigation } from '@react-navigation/native' import Box from '@components/Box' import Text from '@components/Text' import ButtonPressable from '@components/ButtonPressable' import CloseButton from '@components/CloseButton' import SafeAreaBox from '@components/SafeAreaBox' -import { useAccountStorage } from '../../../storage/AccountStorageProvider' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' import { CreateAccountNavigationProp } from './createAccountNavTypes' type Props = { onCreate: () => void; inline?: boolean } diff --git a/src/features/onboarding/create/ConfirmWordsScreen.tsx b/src/features/onboarding/create/ConfirmWordsScreen.tsx index 1307ce173..1a868eb28 100644 --- a/src/features/onboarding/create/ConfirmWordsScreen.tsx +++ b/src/features/onboarding/create/ConfirmWordsScreen.tsx @@ -6,8 +6,8 @@ import Box from '@components/Box' import Text from '@components/Text' import TouchableOpacityBox from '@components/TouchableOpacityBox' import CloseButton from '@components/CloseButton' -import { Color } from '@theme/theme' -import { useColors, usePaddingStyle } from '@theme/themeHooks' +import { Color } from '@config/theme/theme' +import { useColors, usePaddingStyle } from '@config/theme/themeHooks' import { upperCase } from 'lodash' import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view' import useHaptic from '@hooks/useHaptic' diff --git a/src/features/onboarding/create/CreateAccountNavigator.tsx b/src/features/onboarding/create/CreateAccountNavigator.tsx index 215c34ccb..cfeeec13d 100644 --- a/src/features/onboarding/create/CreateAccountNavigator.tsx +++ b/src/features/onboarding/create/CreateAccountNavigator.tsx @@ -4,13 +4,13 @@ import { StackNavigationOptions, } from '@react-navigation/stack' import { memo } from 'react' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' import AccountCreatePassphraseScreen from './AccountCreatePassphraseScreen' import AccountEnterPassphraseScreen from './AccountEnterPassphraseScreen' import { CreateAccountStackParamList } from './createAccountNavTypes' import AccountAssignScreen from '../AccountAssignScreen' import AccountCreatePinScreen from '../AccountCreatePinScreen' import AccountConfirmPinScreen from '../AccountConfirmPinScreen' -import { useAccountStorage } from '../../../storage/AccountStorageProvider' import AccountCreateStartScreen from './AccountCreateStartScreen' const CreateAccountStack = createStackNavigator() diff --git a/src/features/onboarding/create/PhraseChip.tsx b/src/features/onboarding/create/PhraseChip.tsx index 4718e6b35..f99ba8987 100644 --- a/src/features/onboarding/create/PhraseChip.tsx +++ b/src/features/onboarding/create/PhraseChip.tsx @@ -1,15 +1,15 @@ /* eslint-disable react/jsx-props-no-spreading */ import React, { useState, memo, useCallback } from 'react' import { upperCase } from 'lodash' -import CheckMark from '@assets/images/checkmark.svg' -import Fail from '@assets/images/fail.svg' +import CheckMark from '@assets/svgs/checkmark.svg' +import Fail from '@assets/svgs/fail.svg' import Text from '@components/Text' import TouchableHighlightBox, { TouchableHighlightBoxProps, } from '@components/TouchableHighlightBox' -import { useColors } from '@theme/themeHooks' +import { useColors } from '@config/theme/themeHooks' import Box from '@components/Box' -import { Color } from '@theme/theme' +import { Color } from '@config/theme/theme' type Props = Omit & { title: string diff --git a/src/features/onboarding/import/AccountImportScreen.tsx b/src/features/onboarding/import/AccountImportScreen.tsx index dd2dee383..61b06008a 100644 --- a/src/features/onboarding/import/AccountImportScreen.tsx +++ b/src/features/onboarding/import/AccountImportScreen.tsx @@ -1,11 +1,11 @@ -import Close from '@assets/images/close.svg' +import Close from '@assets/svgs/close.svg' import Box from '@components/Box' import Text from '@components/Text' import TouchableOpacityBox from '@components/TouchableOpacityBox' import useAlert from '@hooks/useAlert' import { RouteProp, useNavigation, useRoute } from '@react-navigation/native' -import { Color } from '@theme/theme' -import { useColors, usePaddingStyle } from '@theme/themeHooks' +import { Color } from '@config/theme/theme' +import { useColors, usePaddingStyle } from '@config/theme/themeHooks' import { upperCase } from 'lodash' import React, { useCallback, useEffect, useRef, useState } from 'react' import { useTranslation } from 'react-i18next' @@ -13,9 +13,9 @@ import { FlatList } from 'react-native' import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view' import { MAIN_DERIVATION_PATHS } from '@hooks/useDerivationAccounts' import { Keypair } from '@solana/web3.js' -import { CSAccount } from '@storage/cloudStorage' -import { useAccountStorage } from '../../../storage/AccountStorageProvider' -import { createKeypair, toSecureAccount } from '../../../storage/secureStorage' +import { CSAccount } from '@config/storage/cloudStorage' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' +import { createKeypair, toSecureAccount } from '@config/storage/secureStorage' import { useOnboarding } from '../OnboardingProvider' import { OnboardingNavigationProp } from '../onboardingTypes' import PassphraseAutocomplete from './PassphraseAutocomplete' diff --git a/src/features/onboarding/import/AccountImportStartScreen.tsx b/src/features/onboarding/import/AccountImportStartScreen.tsx index c573c9d71..a8abb4eee 100644 --- a/src/features/onboarding/import/AccountImportStartScreen.tsx +++ b/src/features/onboarding/import/AccountImportStartScreen.tsx @@ -9,12 +9,12 @@ import ButtonPressable from '@components/ButtonPressable' import TextTransform from '@components/TextTransform' import SafeAreaBox from '@components/SafeAreaBox' import CloseButton from '@components/CloseButton' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' import { ImportAccountNavigationProp } from './importAccountNavTypes' -import { useAccountStorage } from '../../../storage/AccountStorageProvider' import { useOnboarding } from '../OnboardingProvider' import { MultiAccountStackParamList } from '../multiAccount/MultiAccountNavigatorTypes' import { AddNewAccountNavigationProp } from '../../home/addNewAccount/addNewAccountTypes' -import { RootNavigationProp } from '../../../navigation/rootTypes' +import { RootNavigationProp } from '../../../app/rootTypes' type Route = RouteProp diff --git a/src/features/onboarding/import/ImportAccountNavigator.tsx b/src/features/onboarding/import/ImportAccountNavigator.tsx index bcb0e4c47..5328d66b1 100644 --- a/src/features/onboarding/import/ImportAccountNavigator.tsx +++ b/src/features/onboarding/import/ImportAccountNavigator.tsx @@ -3,13 +3,13 @@ import { createStackNavigator, StackNavigationOptions, } from '@react-navigation/stack' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' import { ImportAccountStackParamList } from './importAccountNavTypes' import AccountImportStartScreen from './AccountImportStartScreen' import AccountImportScreen from './AccountImportScreen' import AccountAssignScreen from '../AccountAssignScreen' import AccountCreatePinScreen from '../AccountCreatePinScreen' import AccountConfirmPinScreen from '../AccountConfirmPinScreen' -import { useAccountStorage } from '../../../storage/AccountStorageProvider' import CLIAccountNavigator from '../cli-import/CLIAccountNavigator' import ImportSubAccountsScreen from './ImportSubAccountsScreen' diff --git a/src/features/onboarding/import/ImportPrivateKey.tsx b/src/features/onboarding/import/ImportPrivateKey.tsx index bd50c5bd9..c831151a0 100644 --- a/src/features/onboarding/import/ImportPrivateKey.tsx +++ b/src/features/onboarding/import/ImportPrivateKey.tsx @@ -14,12 +14,12 @@ import React, { memo, useCallback, useState } from 'react' import { useAsync, useAsyncCallback } from 'react-async-hook' import { useTranslation } from 'react-i18next' import RNSodium from 'react-native-sodium' -import { RootNavigationProp } from '../../../navigation/rootTypes' -import { useAccountStorage } from '../../../storage/AccountStorageProvider' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' import { DEFAULT_DERIVATION_PATH, createKeypair, -} from '../../../storage/secureStorage' +} from '@config/storage/secureStorage' +import { RootNavigationProp } from '../../../app/rootTypes' import * as Logger from '../../../utils/logger' import { useOnboarding } from '../OnboardingProvider' import { OnboardingStackParamList } from '../onboardingTypes' diff --git a/src/features/onboarding/import/ImportReplaceWordModal.tsx b/src/features/onboarding/import/ImportReplaceWordModal.tsx index ef1594041..35ef755a3 100644 --- a/src/features/onboarding/import/ImportReplaceWordModal.tsx +++ b/src/features/onboarding/import/ImportReplaceWordModal.tsx @@ -1,13 +1,13 @@ import React, { useCallback, useEffect, useState } from 'react' import { Modal } from 'react-native' import { useTranslation } from 'react-i18next' -import Close from '@assets/images/close.svg' -import wordlist from '@constants/wordlists/english.json' +import Close from '@assets/svgs/close.svg' +import wordlist from '@utils/constants/wordlists/english.json' import TextInput from '@components/TextInput' import Box from '@components/Box' import SafeAreaBox from '@components/SafeAreaBox' import TouchableOpacityBox from '@components/TouchableOpacityBox' -import { useColors } from '@theme/themeHooks' +import { useColors } from '@config/theme/themeHooks' import ScrollBox from '@components/ScrollBox' import MatchingWord from './MatchingWord' diff --git a/src/features/onboarding/import/ImportSubAccountsScreen.tsx b/src/features/onboarding/import/ImportSubAccountsScreen.tsx index 0dcacc49e..6deb91fe7 100644 --- a/src/features/onboarding/import/ImportSubAccountsScreen.tsx +++ b/src/features/onboarding/import/ImportSubAccountsScreen.tsx @@ -9,17 +9,17 @@ import { } from '@hooks/useDerivationAccounts' import CheckBox from '@react-native-community/checkbox' import { useNavigation } from '@react-navigation/native' -import { useAccountStorage } from '@storage/AccountStorageProvider' -import { DEFAULT_DERIVATION_PATH } from '@storage/secureStorage' -import { useColors } from '@theme/themeHooks' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' +import { DEFAULT_DERIVATION_PATH } from '@config/storage/secureStorage' +import { useColors } from '@config/theme/themeHooks' import { ellipsizeAddress } from '@utils/accountUtils' import { humanReadable } from '@utils/formatting' import BN from 'bn.js' import React, { useCallback, useEffect, useMemo } from 'react' import { useTranslation } from 'react-i18next' import { FlatList, RefreshControl } from 'react-native' -import { RootNavigationProp } from 'src/navigation/rootTypes' -import { AccountsServiceNavigationProp } from '@services/AccountsService/accountServiceTypes' +import { RootNavigationProp } from 'src/app/rootTypes' +import { AccountsServiceNavigationProp } from 'src/app/services/AccountsService/accountServiceTypes' import ScrollBox from '@components/ScrollBox' import { useOnboarding } from '../OnboardingProvider' diff --git a/src/features/onboarding/import/PassphraseAutocomplete.tsx b/src/features/onboarding/import/PassphraseAutocomplete.tsx index 5677f1aa4..52d83b595 100644 --- a/src/features/onboarding/import/PassphraseAutocomplete.tsx +++ b/src/features/onboarding/import/PassphraseAutocomplete.tsx @@ -1,12 +1,12 @@ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react' import { useTranslation } from 'react-i18next' import { upperCase } from 'lodash' -import wordlist from '@constants/wordlists/english.json' +import wordlist from '@utils/constants/wordlists/english.json' import TextInput from '@components/TextInput' import Box from '@components/Box' import FabButton from '@components/FabButton' import usePrevious from '@hooks/usePrevious' -import { Color } from '@theme/theme' +import { Color } from '@config/theme/theme' import Clipboard from '@react-native-community/clipboard' import ScrollBox from '@components/ScrollBox' import { ScrollView } from 'react-native-gesture-handler' diff --git a/src/features/payment/PaymentCard.tsx b/src/features/payment/PaymentCard.tsx index e5e515f4e..ecdf01e3d 100644 --- a/src/features/payment/PaymentCard.tsx +++ b/src/features/payment/PaymentCard.tsx @@ -5,8 +5,8 @@ import BN from 'bn.js' import React, { memo, useCallback } from 'react' import { useTranslation } from 'react-i18next' import ButtonPressable from '@components/ButtonPressable' -import { useAccountStorage } from '../../storage/AccountStorageProvider' -import { checkSecureAccount } from '../../storage/secureStorage' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' +import { checkSecureAccount } from '@config/storage/secureStorage' import { SendDetails } from '../../utils/linking' import PaymentSummary from './PaymentSummary' diff --git a/src/features/payment/PaymentError.tsx b/src/features/payment/PaymentError.tsx index 04d4badfe..c4010c487 100644 --- a/src/features/payment/PaymentError.tsx +++ b/src/features/payment/PaymentError.tsx @@ -1,4 +1,4 @@ -import FailureIcon from '@assets/images/paymentFailure.svg' +import FailureIcon from '@assets/svgs/paymentFailure.svg' import BackgroundFill from '@components/BackgroundFill' import Box from '@components/Box' import Text from '@components/Text' diff --git a/src/features/payment/PaymentItem.tsx b/src/features/payment/PaymentItem.tsx index 8b6ec1753..7bcdce2ba 100644 --- a/src/features/payment/PaymentItem.tsx +++ b/src/features/payment/PaymentItem.tsx @@ -1,5 +1,5 @@ -import AddressIcon from '@assets/images/addressIcon.svg' -import Remove from '@assets/images/remove.svg' +import AddressIcon from '@assets/svgs/addressIcon.svg' +import Remove from '@assets/svgs/remove.svg' import Box from '@components/Box' import MemoInput from '@components/MemoInput' import Text from '@components/Text' @@ -8,8 +8,8 @@ import TouchableOpacityBox from '@components/TouchableOpacityBox' import { useMint } from '@helium/helium-react-hooks' import { BoxProps } from '@shopify/restyle' import { PublicKey } from '@solana/web3.js' -import { Theme } from '@theme/theme' -import { useColors } from '@theme/themeHooks' +import { Theme } from '@config/theme/theme' +import { useColors } from '@config/theme/themeHooks' import { humanReadable } from '@utils/solanaUtils' import BN from 'bn.js' import { toUpper } from 'lodash' @@ -22,7 +22,7 @@ import { } from 'react-native' import { useDebounce } from 'use-debounce' import { shortenAddress } from '@utils/formatting' -import { CSAccount } from '../../storage/cloudStorage' +import { CSAccount } from '@config/storage/cloudStorage' import { useBalance } from '../../utils/Balance' import { accountNetType, diff --git a/src/features/payment/PaymentQrScanner.tsx b/src/features/payment/PaymentQrScanner.tsx index 6b8e938eb..74c69fd57 100644 --- a/src/features/payment/PaymentQrScanner.tsx +++ b/src/features/payment/PaymentQrScanner.tsx @@ -4,8 +4,8 @@ import { useNavigation } from '@react-navigation/native' import useHaptic from '@hooks/useHaptic' import useAlert from '@hooks/useAlert' import QrScanner from '@components/QrScanner' -import { WalletNavigationProp } from '@services/WalletService/pages/WalletPage/WalletPageNavigator' -import { SendNavigationProp } from '@services/WalletService/pages/SendPage/SentPageNavigator' +import { WalletNavigationProp } from '@services/WalletService/pages/WalletPage' +import { SendNavigationProp } from '@services/WalletService/pages/SendPage' import { parseBurn, parseDelegate, parsePaymentLink } from '../../utils/linking' const PaymentQrScanner = () => { diff --git a/src/features/payment/PaymentScreen.tsx b/src/features/payment/PaymentScreen.tsx index 2cac0e449..fadc09edc 100644 --- a/src/features/payment/PaymentScreen.tsx +++ b/src/features/payment/PaymentScreen.tsx @@ -19,7 +19,7 @@ import { usePublicKey } from '@hooks/usePublicKey' import { RouteProp, useNavigation, useRoute } from '@react-navigation/native' import { NATIVE_MINT } from '@solana/spl-token' import { PublicKey } from '@solana/web3.js' -import { useVisibleTokens } from '@storage/TokensProvider' +import { useVisibleTokens } from '@config/storage/TokensProvider' import { Mints } from '@utils/constants' import { fetchDomainOwner } from '@utils/getDomainOwner' import { @@ -43,19 +43,19 @@ import { useSafeAreaInsets } from 'react-native-safe-area-context' import Toast from 'react-native-simple-toast' import { useSelector } from 'react-redux' import { NavBarHeight } from '@components/ServiceNavBar' -import { WalletNavigationProp } from '@services/WalletService/pages/WalletPage/WalletPageNavigator' -import { PaymentRouteParam } from '@services/WalletService' +import { WalletNavigationProp } from '@services/WalletService/pages/WalletPage' +import { PaymentRouteParam } from 'src/app/services/WalletService' import ScrollBox from '@components/ScrollBox' import { SendNavigationProp, SendStackParamList, -} from '@services/WalletService/pages/SendPage/SentPageNavigator' +} from '@services/WalletService/pages/SendPage' import { useAsyncCallback } from 'react-async-hook' +import { useSolana } from '@features/solana/SolanaProvider' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' +import { CSAccount } from '@config/storage/cloudStorage' +import { RootNavigationProp } from '../../app/rootTypes' import useSubmitTxn from '../../hooks/useSubmitTxn' -import { RootNavigationProp } from '../../navigation/rootTypes' -import { useSolana } from '../../solana/SolanaProvider' -import { useAccountStorage } from '../../storage/AccountStorageProvider' -import { CSAccount } from '../../storage/cloudStorage' import { RootState } from '../../store/rootReducer' import { solanaSlice } from '../../store/slices/solanaSlice' import { useAppDispatch } from '../../store/store' diff --git a/src/features/payment/PaymentSubmit.tsx b/src/features/payment/PaymentSubmit.tsx index 3edd1e90c..7cadcc784 100644 --- a/src/features/payment/PaymentSubmit.tsx +++ b/src/features/payment/PaymentSubmit.tsx @@ -2,7 +2,7 @@ import Box from '@components/Box' import FadeInOut from '@components/FadeInOut' import { SerializedError } from '@reduxjs/toolkit' import { PublicKey } from '@solana/web3.js' -import globalStyles from '@theme/globalStyles' +import globalStyles from '@config/theme/globalStyles' import BN from 'bn.js' import React, { memo, useCallback, useEffect, useMemo, useState } from 'react' import { StyleSheet } from 'react-native' diff --git a/src/features/payment/PaymentSubmitLoading.tsx b/src/features/payment/PaymentSubmitLoading.tsx index 00d91c528..9645285d3 100644 --- a/src/features/payment/PaymentSubmitLoading.tsx +++ b/src/features/payment/PaymentSubmitLoading.tsx @@ -7,7 +7,7 @@ import Text from '@components/Text' import Box from '@components/Box' import ActivityIndicator from '@components/ActivityIndicator' import FadeInOut from '@components/FadeInOut' -import globalStyles from '@theme/globalStyles' +import globalStyles from '@config/theme/globalStyles' type Props = { onVideoEnd: () => void diff --git a/src/features/payment/PaymentSuccess.tsx b/src/features/payment/PaymentSuccess.tsx index 3abf025ef..ef81c5df9 100644 --- a/src/features/payment/PaymentSuccess.tsx +++ b/src/features/payment/PaymentSuccess.tsx @@ -1,4 +1,4 @@ -import SuccessIcon from '@assets/images/paymentSuccess.svg' +import SuccessIcon from '@assets/svgs/paymentSuccess.svg' import Box from '@components/Box' import Text from '@components/Text' import TouchableOpacityBox from '@components/TouchableOpacityBox' diff --git a/src/features/payment/usePaymentsReducer.ts b/src/features/payment/usePaymentsReducer.ts index 847bced9d..4d6d02c5e 100644 --- a/src/features/payment/usePaymentsReducer.ts +++ b/src/features/payment/usePaymentsReducer.ts @@ -3,7 +3,7 @@ import { PublicKey } from '@solana/web3.js' import BN from 'bn.js' import { useReducer } from 'react' import { NATIVE_MINT } from '@solana/spl-token' -import { CSAccount } from '../../storage/cloudStorage' +import { CSAccount } from '@config/storage/cloudStorage' import { TXN_FEE_IN_LAMPORTS } from '../../utils/solanaUtils' import { Payment } from './PaymentItem' diff --git a/src/features/settings/AutoGasManager.tsx b/src/features/settings/AutoGasManager.tsx index 26fbb8bd9..8be765507 100644 --- a/src/features/settings/AutoGasManager.tsx +++ b/src/features/settings/AutoGasManager.tsx @@ -6,8 +6,8 @@ import TokenPill from '@components/TokenPill' import { HNT_MINT, IOT_MINT, MOBILE_MINT } from '@helium/spl-utils' import { useNavigation } from '@react-navigation/native' import { PublicKey } from '@solana/web3.js' -import { useAppStorage } from '@storage/AppStorageProvider' -import { useVisibleTokens } from '@storage/TokensProvider' +import { useAppStorage } from '@config/storage/AppStorageProvider' +import { useVisibleTokens } from '@config/storage/TokensProvider' import React, { FC, useCallback, useMemo, useState } from 'react' import { useTranslation } from 'react-i18next' import { Switch } from 'react-native' diff --git a/src/features/settings/ConfirmSignoutScreen.tsx b/src/features/settings/ConfirmSignoutScreen.tsx index 1769375fe..26c93b4ff 100644 --- a/src/features/settings/ConfirmSignoutScreen.tsx +++ b/src/features/settings/ConfirmSignoutScreen.tsx @@ -4,15 +4,15 @@ import { useNavigation } from '@react-navigation/native' import { ActivityIndicator, Alert, Platform } from 'react-native' import { useAsync } from 'react-async-hook' import useAlert from '@hooks/useAlert' -import { useColors } from '@theme/themeHooks' +import { useColors } from '@config/theme/themeHooks' import Box from '@components/Box' -import { WalletNavigationProp } from '@services/WalletService/pages/WalletPage/WalletPageNavigator' -import ConfirmWordsScreen from '../onboarding/create/ConfirmWordsScreen' -import { useAccountStorage } from '../../storage/AccountStorageProvider' -import { useAppStorage } from '../../storage/AppStorageProvider' +import { WalletNavigationProp } from '@services/WalletService/pages/WalletPage' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' +import { useAppStorage } from '@config/storage/AppStorageProvider' +import { getSecureAccount } from '@config/storage/secureStorage' import { SettingsNavigationProp } from './settingsTypes' -import { getSecureAccount } from '../../storage/secureStorage' -import { RootNavigationProp } from '../../navigation/rootTypes' +import ConfirmWordsScreen from '../onboarding/create/ConfirmWordsScreen' +import { RootNavigationProp } from '../../app/rootTypes' const ConfirmSignoutScreen = () => { const { t } = useTranslation() diff --git a/src/features/settings/RevealPrivateKeyScreen.tsx b/src/features/settings/RevealPrivateKeyScreen.tsx index 22e2178c3..2f81d040a 100644 --- a/src/features/settings/RevealPrivateKeyScreen.tsx +++ b/src/features/settings/RevealPrivateKeyScreen.tsx @@ -9,8 +9,8 @@ import TouchableOpacityBox from '@components/TouchableOpacityBox' import CopyAddress from '@components/CopyAddress' import useAlert from '@hooks/useAlert' import { bs58 } from '@coral-xyz/anchor/dist/cjs/utils/bytes' -import { getSecureAccount } from '../../storage/secureStorage' -import { useAccountStorage } from '../../storage/AccountStorageProvider' +import { getSecureAccount } from '@config/storage/secureStorage' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' const RevealPrivateKeyScreen = () => { const { currentAccount } = useAccountStorage() diff --git a/src/features/settings/RevealWordsScreen.tsx b/src/features/settings/RevealWordsScreen.tsx index c6cb9b69c..ed436a114 100644 --- a/src/features/settings/RevealWordsScreen.tsx +++ b/src/features/settings/RevealWordsScreen.tsx @@ -2,11 +2,11 @@ import React, { memo, useMemo, useState } from 'react' import { useTranslation } from 'react-i18next' import { useAsync } from 'react-async-hook' import { useNavigation } from '@react-navigation/native' -import { useAccountStorage } from '@storage/AccountStorageProvider' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' import Box from '@components/Box' import BackScreen from '@components/BackScreen' import TextTransform from '@components/TextTransform' -import { getSecureAccount } from '@storage/secureStorage' +import { getSecureAccount } from '@config/storage/secureStorage' import RevealWords from '@components/RevealWords' import ScrollBox from '@components/ScrollBox' diff --git a/src/features/settings/Settings.tsx b/src/features/settings/Settings.tsx index 3e091be71..4f8b8d721 100644 --- a/src/features/settings/Settings.tsx +++ b/src/features/settings/Settings.tsx @@ -7,25 +7,25 @@ import { useAppVersion } from '@hooks/useDevice' import { useExplorer } from '@hooks/useExplorer' import { useNavigation } from '@react-navigation/native' import { Cluster } from '@solana/web3.js' -import { useColors, useSpacing } from '@theme/themeHooks' +import { useColors, useSpacing } from '@config/theme/themeHooks' import React, { ReactText, memo, useCallback, useMemo } from 'react' import { useAsync } from 'react-async-hook' import { useTranslation } from 'react-i18next' import { Alert, Linking, Platform, SectionList } from 'react-native' import deviceInfo from 'react-native-device-info' import { SvgUri } from 'react-native-svg' -import { WalletNavigationProp } from '@services/WalletService/pages/WalletPage/WalletPageNavigator' import ScrollBox from '@components/ScrollBox' -import { PRIVACY_POLICY, TERMS_OF_SERVICE } from '../../constants/urls' -import { RootNavigationProp } from '../../navigation/rootTypes' -import { useSolana } from '../../solana/SolanaProvider' -import { useAccountStorage } from '../../storage/AccountStorageProvider' -import { useAppStorage } from '../../storage/AppStorageProvider' -import { useLanguageStorage } from '../../storage/LanguageProvider' +import { useSolana } from '@features/solana/SolanaProvider' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' +import { useAppStorage } from '@config/storage/AppStorageProvider' +import { useLanguageStorage } from '@config/storage/LanguageProvider' import { checkSecureAccount, getSecureAccount, -} from '../../storage/secureStorage' +} from '@config/storage/secureStorage' +import { WalletNavigationProp } from '@services/WalletService/pages/WalletPage' +import { RootNavigationProp } from '../../app/rootTypes' +import { PRIVACY_POLICY, TERMS_OF_SERVICE } from '../../utils/constants/urls' import { persistor } from '../../store/persistence' import { SUPPORTED_LANGUAGUES } from '../../utils/i18n' import SUPPORTED_CURRENCIES from '../../utils/supportedCurrencies' diff --git a/src/features/settings/SettingsConfirmPinScreen.tsx b/src/features/settings/SettingsConfirmPinScreen.tsx index 5e8f1ffbc..f243b1ba3 100644 --- a/src/features/settings/SettingsConfirmPinScreen.tsx +++ b/src/features/settings/SettingsConfirmPinScreen.tsx @@ -3,8 +3,8 @@ import { useTranslation } from 'react-i18next' import { RouteProp, useRoute, useNavigation } from '@react-navigation/native' import ConfirmPinView from '@components/ConfirmPinView' import { ThemeProvider } from '@shopify/restyle' -import { darkTheme } from '@theme/theme' -import { useAppStorage } from '../../storage/AppStorageProvider' +import { darkTheme } from '@config/theme/theme' +import { useAppStorage } from '@config/storage/AppStorageProvider' import { SettingsNavigationProp, SettingsStackParamList } from './settingsTypes' type Route = RouteProp diff --git a/src/features/settings/SettingsCreatePinScreen.tsx b/src/features/settings/SettingsCreatePinScreen.tsx index 1ced39c85..2e6b9e5e0 100644 --- a/src/features/settings/SettingsCreatePinScreen.tsx +++ b/src/features/settings/SettingsCreatePinScreen.tsx @@ -7,7 +7,7 @@ import Keypad from '@components/Keypad' import Box from '@components/Box' import { KeypadInput } from '@components/KeypadButton' import { ThemeProvider } from '@shopify/restyle' -import { darkTheme } from '@theme/theme' +import { darkTheme } from '@config/theme/theme' import { SettingsNavigationProp } from './settingsTypes' const SettingsCreatePinScreen = () => { diff --git a/src/features/settings/SettingsListItem.tsx b/src/features/settings/SettingsListItem.tsx index ec82f5647..e2acec530 100644 --- a/src/features/settings/SettingsListItem.tsx +++ b/src/features/settings/SettingsListItem.tsx @@ -1,16 +1,16 @@ import React, { memo, ReactText, useCallback, useMemo, useRef } from 'react' import { Linking, Platform, Switch } from 'react-native' -import CarotRight from '@assets/images/carot-right.svg' -import LinkImg from '@assets/images/link.svg' +import CarotRight from '@assets/svgs/carot-right.svg' +import LinkImg from '@assets/svgs/link.svg' import { HeliumActionSheetItemType } from '@components/HeliumActionSheetItem' import Text, { TextProps } from '@components/Text' import TouchableOpacityBox from '@components/TouchableOpacityBox' -import { Color } from '@theme/theme' +import { Color } from '@config/theme/theme' import HeliumActionSheet, { HeliumActionSheetRef, } from '@components/HeliumActionSheet' import Box from '@components/Box' -import { useColors } from '@theme/themeHooks' +import { useColors } from '@config/theme/themeHooks' import { hp } from '@utils/layout' import sleep from '@utils/sleep' diff --git a/src/features/settings/SettingsNavigator.tsx b/src/features/settings/SettingsNavigator.tsx index 2769deff6..c4d2fff8e 100644 --- a/src/features/settings/SettingsNavigator.tsx +++ b/src/features/settings/SettingsNavigator.tsx @@ -1,5 +1,5 @@ import { createNativeStackNavigator } from '@react-navigation/native-stack' -import { useOpacity } from '@theme/themeHooks' +import { useOpacity } from '@config/theme/themeHooks' import React, { memo } from 'react' import SecretKeyWarningScreen from '@components/SecretKeyWarningScreen' import SolanaMigration from '../migration/SolanaMigration' diff --git a/src/features/settings/ShareAddressScreen.tsx b/src/features/settings/ShareAddressScreen.tsx index 759c5ce6c..326b9c859 100644 --- a/src/features/settings/ShareAddressScreen.tsx +++ b/src/features/settings/ShareAddressScreen.tsx @@ -1,4 +1,4 @@ -import ShareAddress from '@assets/images/shareAddress.svg' +import ShareAddress from '@assets/svgs/shareAddress.svg' import BackScreen from '@components/BackScreen' import Box from '@components/Box' import CopyAddress from '@components/CopyAddress' @@ -6,9 +6,9 @@ import Text from '@components/Text' import TouchableOpacityBox from '@components/TouchableOpacityBox' import useCopyText from '@hooks/useCopyText' import useHaptic from '@hooks/useHaptic' -import { useAccountStorage } from '@storage/AccountStorageProvider' -import { Spacing } from '@theme/theme' -import { useSpacing } from '@theme/themeHooks' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' +import { Spacing } from '@config/theme/theme' +import { useSpacing } from '@config/theme/themeHooks' import { ellipsizeAddress } from '@utils/accountUtils' import React, { memo, useCallback, useMemo, useRef } from 'react' import { useTranslation } from 'react-i18next' diff --git a/src/features/settings/UpdateAliasScreen.tsx b/src/features/settings/UpdateAliasScreen.tsx index 236a4b611..4702cd9d1 100644 --- a/src/features/settings/UpdateAliasScreen.tsx +++ b/src/features/settings/UpdateAliasScreen.tsx @@ -5,9 +5,9 @@ import { useSafeAreaInsets } from 'react-native-safe-area-context' import { useTranslation } from 'react-i18next' import Box from '@components/Box' import TextInput from '@components/TextInput' -import { useAccountStorage } from '@storage/AccountStorageProvider' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' import FabButton from '@components/FabButton' -import { useSpacing } from '@theme/themeHooks' +import { useSpacing } from '@config/theme/themeHooks' import AccountIcon from '@components/AccountIcon' import BackScreen from '@components/BackScreen' import { SettingsNavigationProp } from './settingsTypes' diff --git a/src/solana/AsyncAccountCache.ts b/src/features/solana/AsyncAccountCache.ts similarity index 100% rename from src/solana/AsyncAccountCache.ts rename to src/features/solana/AsyncAccountCache.ts diff --git a/src/solana/CollapsibleWritableAccountPreview.tsx b/src/features/solana/CollapsibleWritableAccountPreview.tsx similarity index 94% rename from src/solana/CollapsibleWritableAccountPreview.tsx rename to src/features/solana/CollapsibleWritableAccountPreview.tsx index 9210ae123..f6f10f002 100644 --- a/src/solana/CollapsibleWritableAccountPreview.tsx +++ b/src/features/solana/CollapsibleWritableAccountPreview.tsx @@ -1,9 +1,9 @@ -import Receive from '@assets/images/receive.svg' -import ChevronDown from '@assets/images/remixChevronDown.svg' -import ChevronUp from '@assets/images/remixChevronUp.svg' -import Send from '@assets/images/send.svg' -import UnknownAccount from '@assets/images/unknownAccount.svg' -import AnchorAccount from '@assets/images/anchorAccount.svg' +import Receive from '@assets/svgs/receive.svg' +import ChevronDown from '@assets/svgs/remixChevronDown.svg' +import ChevronUp from '@assets/svgs/remixChevronUp.svg' +import Send from '@assets/svgs/send.svg' +import UnknownAccount from '@assets/svgs/unknownAccount.svg' +import AnchorAccount from '@assets/svgs/anchorAccount.svg' import Box from '@components/Box' import { Pill } from '@components/Pill' import Text from '@components/Text' @@ -18,7 +18,7 @@ import { import { getMetadata, useMetaplexMetadata } from '@hooks/useMetaplexMetadata' import { NATIVE_MINT } from '@solana/spl-token' import { AccountInfo } from '@solana/web3.js' -import { useColors } from '@theme/themeHooks' +import { useColors } from '@config/theme/themeHooks' import { shortenAddress } from '@utils/formatting' import { humanReadable } from '@utils/solanaUtils' import { BN } from 'bn.js' diff --git a/src/solana/CollectablePreview.tsx b/src/features/solana/CollectablePreview.tsx similarity index 97% rename from src/solana/CollectablePreview.tsx rename to src/features/solana/CollectablePreview.tsx index a63baf0e5..8b3a3c5c3 100644 --- a/src/solana/CollectablePreview.tsx +++ b/src/features/solana/CollectablePreview.tsx @@ -1,11 +1,11 @@ -import Send from '@assets/images/send.svg' +import Send from '@assets/svgs/send.svg' import Box from '@components/Box' import { Pill } from '@components/Pill' import Text from '@components/Text' import React, { useMemo } from 'react' import ImageBox from '@components/ImageBox' import { ellipsizeAddress } from '@utils/accountUtils' -import { Collectable, CompressedNFT, isCompressedNFT } from '../types/solana' +import { Collectable, CompressedNFT, isCompressedNFT } from '../../types/solana' interface ICollectablePreviewProps { collectable: CompressedNFT | Collectable diff --git a/src/solana/MessagePreview.tsx b/src/features/solana/MessagePreview.tsx similarity index 100% rename from src/solana/MessagePreview.tsx rename to src/features/solana/MessagePreview.tsx diff --git a/src/solana/PaymentPreview.tsx b/src/features/solana/PaymentPreview.tsx similarity index 97% rename from src/solana/PaymentPreview.tsx rename to src/features/solana/PaymentPreview.tsx index eb188caea..f0ac307ca 100644 --- a/src/solana/PaymentPreview.tsx +++ b/src/features/solana/PaymentPreview.tsx @@ -1,4 +1,4 @@ -import Send from '@assets/images/send.svg' +import Send from '@assets/svgs/send.svg' import Box from '@components/Box' import { Pill } from '@components/Pill' import Text from '@components/Text' diff --git a/src/solana/SolanaProvider.tsx b/src/features/solana/SolanaProvider.tsx similarity index 95% rename from src/solana/SolanaProvider.tsx rename to src/features/solana/SolanaProvider.tsx index e296cd168..059425daa 100644 --- a/src/solana/SolanaProvider.tsx +++ b/src/features/solana/SolanaProvider.tsx @@ -30,14 +30,14 @@ import { useSelector } from 'react-redux' import nacl from 'tweetnacl' import KeystoneModal, { KeystoneModalRef, -} from '../features/keystone/KeystoneModal' -import LedgerModal, { LedgerModalRef } from '../features/ledger/LedgerModal' -import { useAccountStorage } from '../storage/AccountStorageProvider' -import { getSessionKey, getSolanaKeypair } from '../storage/secureStorage' -import { RootState } from '../store/rootReducer' -import { appSlice } from '../store/slices/appSlice' -import { useAppDispatch } from '../store/store' -import { getConnection, isVersionedTransaction } from '../utils/solanaUtils' +} from '@features/keystone/KeystoneModal' +import LedgerModal, { LedgerModalRef } from '@features/ledger/LedgerModal' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' +import { getSessionKey, getSolanaKeypair } from '@config/storage/secureStorage' +import { RootState } from '@store/rootReducer' +import { appSlice } from '@store/slices/appSlice' +import { useAppDispatch } from '@store/store' +import { getConnection, isVersionedTransaction } from '@utils/solanaUtils' import { AsyncAccountCache } from './AsyncAccountCache' const useSolanaHook = () => { diff --git a/src/solana/SwapPreview.tsx b/src/features/solana/SwapPreview.tsx similarity index 95% rename from src/solana/SwapPreview.tsx rename to src/features/solana/SwapPreview.tsx index 774c86e18..53caf576b 100644 --- a/src/solana/SwapPreview.tsx +++ b/src/features/solana/SwapPreview.tsx @@ -1,5 +1,5 @@ -import Send from '@assets/images/send.svg' -import Receive from '@assets/images/receive.svg' +import Send from '@assets/svgs/send.svg' +import Receive from '@assets/svgs/receive.svg' import Box from '@components/Box' import CircleLoader from '@components/CircleLoader' import { Pill } from '@components/Pill' @@ -9,7 +9,7 @@ import { useMint } from '@helium/helium-react-hooks' import { useMetaplexMetadata } from '@hooks/useMetaplexMetadata' import { PublicKey } from '@solana/web3.js' import React from 'react' -import { useColors } from '@theme/themeHooks' +import { useColors } from '@config/theme/themeHooks' interface ISwapPreviewProps { inputMint: PublicKey diff --git a/src/solana/WalletSIgnBottomSheetSimulated.tsx b/src/features/solana/WalletSIgnBottomSheetSimulated.tsx similarity index 97% rename from src/solana/WalletSIgnBottomSheetSimulated.tsx rename to src/features/solana/WalletSIgnBottomSheetSimulated.tsx index 9242f5ba2..b0494e4cf 100644 --- a/src/solana/WalletSIgnBottomSheetSimulated.tsx +++ b/src/features/solana/WalletSIgnBottomSheetSimulated.tsx @@ -1,9 +1,9 @@ -import Checkmark from '@assets/images/checkmark.svg' -import IndentArrow from '@assets/images/indentArrow.svg' -import InfoIcon from '@assets/images/info.svg' -import CancelIcon from '@assets/images/remixCancel.svg' -import ChevronDown from '@assets/images/remixChevronDown.svg' -import ChevronUp from '@assets/images/remixChevronUp.svg' +import Checkmark from '@assets/svgs/checkmark.svg' +import IndentArrow from '@assets/svgs/indentArrow.svg' +import InfoIcon from '@assets/svgs/info.svg' +import CancelIcon from '@assets/svgs/remixCancel.svg' +import ChevronDown from '@assets/svgs/remixChevronDown.svg' +import ChevronUp from '@assets/svgs/remixChevronUp.svg' import Box from '@components/Box' import ButtonPressable from '@components/ButtonPressable' import CircleLoader from '@components/CircleLoader' @@ -26,7 +26,7 @@ import { useAsync } from 'react-async-hook' import { useTranslation } from 'react-i18next' import { ScrollView } from 'react-native-gesture-handler' import SafeAreaBox from '@components/SafeAreaBox' -import { useColors } from '@theme/themeHooks' +import { useColors } from '@config/theme/themeHooks' import { useSolana } from './SolanaProvider' import WalletSignBottomSheetTransaction from './WalletSignBottomSheetTransaction' import { diff --git a/src/solana/WalletSignBottomSheet.tsx b/src/features/solana/WalletSignBottomSheet.tsx similarity index 97% rename from src/solana/WalletSignBottomSheet.tsx rename to src/features/solana/WalletSignBottomSheet.tsx index 1bed7aa79..654ac5207 100644 --- a/src/solana/WalletSignBottomSheet.tsx +++ b/src/features/solana/WalletSignBottomSheet.tsx @@ -5,7 +5,7 @@ import { BottomSheetModalProvider, BottomSheetScrollView, } from '@gorhom/bottom-sheet' -import { useBorderRadii } from '@theme/themeHooks' +import { useBorderRadii } from '@config/theme/themeHooks' import React, { Ref, forwardRef, @@ -17,7 +17,7 @@ import React, { useState, } from 'react' import { ThemeProvider } from '@shopify/restyle' -import { darkTheme } from '@theme/theme' +import { darkTheme } from '@config/theme/theme' import { StyleProp, ViewStyle } from 'react-native' import { WalletSignBottomSheetProps, diff --git a/src/solana/WalletSignBottomSheetCompact.tsx b/src/features/solana/WalletSignBottomSheetCompact.tsx similarity index 100% rename from src/solana/WalletSignBottomSheetCompact.tsx rename to src/features/solana/WalletSignBottomSheetCompact.tsx diff --git a/src/solana/WalletSignBottomSheetTransaction.tsx b/src/features/solana/WalletSignBottomSheetTransaction.tsx similarity index 97% rename from src/solana/WalletSignBottomSheetTransaction.tsx rename to src/features/solana/WalletSignBottomSheetTransaction.tsx index 8b58e84bb..df97a24d5 100644 --- a/src/solana/WalletSignBottomSheetTransaction.tsx +++ b/src/features/solana/WalletSignBottomSheetTransaction.tsx @@ -1,8 +1,8 @@ -import Alert from '@assets/images/alert.svg' -import ExternalLink from '@assets/images/externalLink.svg' -import ChevronDown from '@assets/images/remixChevronDown.svg' -import ChevronUp from '@assets/images/remixChevronUp.svg' -import UnknownAccount from '@assets/images/unknownAccount.svg' +import Alert from '@assets/svgs/alert.svg' +import ExternalLink from '@assets/svgs/externalLink.svg' +import ChevronDown from '@assets/svgs/remixChevronDown.svg' +import ChevronUp from '@assets/svgs/remixChevronUp.svg' +import UnknownAccount from '@assets/svgs/unknownAccount.svg' import Box from '@components/Box' import { Pill } from '@components/Pill' import Text from '@components/Text' diff --git a/src/solana/WalletSignProvider.tsx b/src/features/solana/WalletSignProvider.tsx similarity index 100% rename from src/solana/WalletSignProvider.tsx rename to src/features/solana/WalletSignProvider.tsx diff --git a/src/solana/WarningBox.tsx b/src/features/solana/WarningBox.tsx similarity index 94% rename from src/solana/WarningBox.tsx rename to src/features/solana/WarningBox.tsx index f95e239af..342c98ff5 100644 --- a/src/solana/WarningBox.tsx +++ b/src/features/solana/WarningBox.tsx @@ -1,7 +1,7 @@ import Box from '@components/Box' import Text from '@components/Text' import React from 'react' -import Alert from '@assets/images/alert.svg' +import Alert from '@assets/svgs/alert.svg' export const WarningBox = ({ header, diff --git a/src/solana/WritableAccountPreview.tsx b/src/features/solana/WritableAccountPreview.tsx similarity index 99% rename from src/solana/WritableAccountPreview.tsx rename to src/features/solana/WritableAccountPreview.tsx index 226e36092..469409d62 100644 --- a/src/solana/WritableAccountPreview.tsx +++ b/src/features/solana/WritableAccountPreview.tsx @@ -1,4 +1,4 @@ -import ArrowRight from '@assets/images/remixArrowRight.svg' +import ArrowRight from '@assets/svgs/remixArrowRight.svg' import Box from '@components/Box' import Text from '@components/Text' import { diff --git a/src/solana/walletSignBottomSheetTypes.tsx b/src/features/solana/walletSignBottomSheetTypes.tsx similarity index 100% rename from src/solana/walletSignBottomSheetTypes.tsx rename to src/features/solana/walletSignBottomSheetTypes.tsx diff --git a/src/features/swaps/SwapItem.tsx b/src/features/swaps/SwapItem.tsx index 33f7e04a6..481296fc7 100644 --- a/src/features/swaps/SwapItem.tsx +++ b/src/features/swaps/SwapItem.tsx @@ -4,8 +4,8 @@ import TokenPill from '@components/TokenPill' import { useMetaplexMetadata } from '@hooks/useMetaplexMetadata' import { BoxProps } from '@shopify/restyle' import { PublicKey } from '@solana/web3.js' -import { Theme } from '@theme/theme' -import { useCreateOpacity } from '@theme/themeHooks' +import { Theme } from '@config/theme/theme' +import { useCreateOpacity } from '@config/theme/themeHooks' import React, { memo, useCallback } from 'react' import { useTranslation } from 'react-i18next' import { GestureResponderEvent, Pressable } from 'react-native' diff --git a/src/features/swaps/SwapNavigator.tsx b/src/features/swaps/SwapNavigator.tsx index e23e95856..219a8f35e 100644 --- a/src/features/swaps/SwapNavigator.tsx +++ b/src/features/swaps/SwapNavigator.tsx @@ -2,7 +2,7 @@ import { createNativeStackNavigator, NativeStackNavigationOptions, } from '@react-navigation/native-stack' -import { JupiterProvider } from '@storage/JupiterProvider' +import { JupiterProvider } from '@config/storage/JupiterProvider' import React, { memo, useMemo } from 'react' import SwappingScreen from './SwappingScreen' import SwapScreen from './SwapScreen' diff --git a/src/features/swaps/SwapScreen.tsx b/src/features/swaps/SwapScreen.tsx index 2b595f275..a696a4949 100644 --- a/src/features/swaps/SwapScreen.tsx +++ b/src/features/swaps/SwapScreen.tsx @@ -1,5 +1,5 @@ -import Menu from '@assets/images/menu.svg' -import Plus from '@assets/images/plus.svg' +import Menu from '@assets/svgs/menu.svg' +import Plus from '@assets/svgs/plus.svg' import AddressBookSelector, { AddressBookRef, } from '@components/AddressBookSelector' @@ -37,11 +37,11 @@ import { useTreasuryPrice } from '@hooks/useTreasuryPrice' import { useNavigation } from '@react-navigation/native' import { NATIVE_MINT } from '@solana/spl-token' import { PublicKey } from '@solana/web3.js' -import { useAccountStorage } from '@storage/AccountStorageProvider' -import { useJupiter } from '@storage/JupiterProvider' -import { useVisibleTokens } from '@storage/TokensProvider' -import { CSAccount } from '@storage/cloudStorage' -import { useColors, useHitSlop, useSpacing } from '@theme/themeHooks' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' +import { useJupiter } from '@config/storage/JupiterProvider' +import { useVisibleTokens } from '@config/storage/TokensProvider' +import { CSAccount } from '@config/storage/cloudStorage' +import { useColors, useHitSlop, useSpacing } from '@config/theme/themeHooks' import { useBalance } from '@utils/Balance' import { MIN_BALANCE_THRESHOLD } from '@utils/constants' import { @@ -73,7 +73,7 @@ import SegmentedControl from '@components/SegmentedControl' import { Portal } from '@gorhom/portal' import ScrollBox from '@components/ScrollBox' import changeNavigationBarColor from 'react-native-navigation-bar-color' -import { useSolana } from '../../solana/SolanaProvider' +import { useSolana } from '@features/solana/SolanaProvider' import { solAddressIsValid } from '../../utils/accountUtils' import SwapItem from './SwapItem' import { SwapNavigationProp } from './swapTypes' diff --git a/src/features/swaps/SwappingScreen.tsx b/src/features/swaps/SwappingScreen.tsx index 52f291011..a17b0baaf 100644 --- a/src/features/swaps/SwappingScreen.tsx +++ b/src/features/swaps/SwappingScreen.tsx @@ -19,9 +19,9 @@ import Animated, { FadeIn, FadeOut } from 'react-native-reanimated' import { Edge } from 'react-native-safe-area-context' import { useSelector } from 'react-redux' import 'text-encoding-polyfill' -import ArrowRight from '../../assets/images/arrowRight.svg' -import BackArrow from '../../assets/images/backArrow.svg' -import { TabBarNavigationProp } from '../../navigation/rootTypes' +import ArrowRight from '../../assets/svgs/arrowRight.svg' +import BackArrow from '../../assets/svgs/backArrow.svg' +import { TabBarNavigationProp } from '../../app/rootTypes' import { RootState } from '../../store/rootReducer' import { SwapStackParamList } from './swapTypes' diff --git a/src/features/txnDelegation/LinkWallet.tsx b/src/features/txnDelegation/LinkWallet.tsx index 3f4de13dc..2f86b6632 100644 --- a/src/features/txnDelegation/LinkWallet.tsx +++ b/src/features/txnDelegation/LinkWallet.tsx @@ -18,14 +18,11 @@ import AccountSelector, { } from '@components/AccountSelector' import AccountButton from '@components/AccountButton' import useAlert from '@hooks/useAlert' -import { ServiceSheetNavigationProp } from '@services/serviceSheetTypes' -import { useAccountStorage } from '../../storage/AccountStorageProvider' +import { ServiceSheetNavigationProp } from 'src/app/services/serviceSheetTypes' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' +import { checkSecureAccount, getKeypair } from '@config/storage/secureStorage' import { formatAccountAlias } from '../../utils/accountUtils' -import { checkSecureAccount, getKeypair } from '../../storage/secureStorage' -import { - RootNavigationProp, - RootStackParamList, -} from '../../navigation/rootTypes' +import { RootNavigationProp, RootStackParamList } from '../../app/rootTypes' import sleep from '../../utils/sleep' type Route = RouteProp diff --git a/src/features/txnDelegation/SignHotspot.tsx b/src/features/txnDelegation/SignHotspot.tsx index 0121c7e3d..e6da5d58a 100644 --- a/src/features/txnDelegation/SignHotspot.tsx +++ b/src/features/txnDelegation/SignHotspot.tsx @@ -14,7 +14,7 @@ import { verifyWalletLinkToken, } from '@helium/wallet-link' import { RouteProp, useNavigation, useRoute } from '@react-navigation/native' -import { useColors } from '@theme/themeHooks' +import { useColors } from '@config/theme/themeHooks' import animalHash from 'angry-purple-tiger' import BN from 'bn.js' import React, { memo, useCallback, useEffect, useMemo, useState } from 'react' @@ -23,13 +23,10 @@ import { useTranslation } from 'react-i18next' import { ActivityIndicator, Linking } from 'react-native' import Config from 'react-native-config' import Toast from 'react-native-simple-toast' -import { ServiceSheetNavigationProp } from '@services/serviceSheetTypes' -import { - RootNavigationProp, - RootStackParamList, -} from '../../navigation/rootTypes' -import { useAccountStorage } from '../../storage/AccountStorageProvider' -import { getKeypair } from '../../storage/secureStorage' +import { ServiceSheetNavigationProp } from 'src/app/services/serviceSheetTypes' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' +import { getKeypair } from '@config/storage/secureStorage' +import { RootNavigationProp, RootStackParamList } from '../../app/rootTypes' import { formatAccountAlias } from '../../utils/accountUtils' import * as Logger from '../../utils/logger' import useSolTxns from './useSolTxns' diff --git a/src/features/txnDelegation/useSolTxns.ts b/src/features/txnDelegation/useSolTxns.ts index e14c1a2e9..b75b1ac64 100644 --- a/src/features/txnDelegation/useSolTxns.ts +++ b/src/features/txnDelegation/useSolTxns.ts @@ -21,8 +21,8 @@ import { useCallback, useMemo, useRef, useState } from 'react' import { useAsync } from 'react-async-hook' import { HeliumEntityManager } from '@helium/idls/lib/types/helium_entity_manager' import { IdlInstruction } from '@coral-xyz/anchor/dist/cjs/idl' -import { useSolana } from '../../solana/SolanaProvider' -import { getKeypair, getSolanaKeypair } from '../../storage/secureStorage' +import { useSolana } from '@features/solana/SolanaProvider' +import { getKeypair, getSolanaKeypair } from '@config/storage/secureStorage' import { submitSolana } from '../../utils/solanaUtils' const ValidTxnKeys = [ diff --git a/src/features/account/AccountActionBar.tsx b/src/features/wallet/AccountActionBar.tsx similarity index 96% rename from src/features/account/AccountActionBar.tsx rename to src/features/wallet/AccountActionBar.tsx index 4f211d126..43d43fb31 100644 --- a/src/features/account/AccountActionBar.tsx +++ b/src/features/wallet/AccountActionBar.tsx @@ -6,9 +6,9 @@ import { PublicKey } from '@solana/web3.js' import React, { useCallback, useMemo } from 'react' import { useTranslation } from 'react-i18next' import { LayoutChangeEvent } from 'react-native' -import { WalletServiceNavigationProp } from '@services/WalletService' -import { WalletNavigationProp } from '@services/WalletService/pages/WalletPage/WalletPageNavigator' -import { useAppStorage } from '../../storage/AppStorageProvider' +import { WalletServiceNavigationProp } from 'src/app/services/WalletService' +import { WalletNavigationProp } from 'src/app/services/WalletService/pages/WalletPage' +import { useAppStorage } from '@config/storage/AppStorageProvider' export type Action = | 'send' diff --git a/src/features/account/AccountActivityFilter.tsx b/src/features/wallet/AccountActivityFilter.tsx similarity index 100% rename from src/features/account/AccountActivityFilter.tsx rename to src/features/wallet/AccountActivityFilter.tsx diff --git a/src/features/account/AccountBalanceChart.tsx b/src/features/wallet/AccountBalanceChart.tsx similarity index 98% rename from src/features/account/AccountBalanceChart.tsx rename to src/features/wallet/AccountBalanceChart.tsx index 69f73f51f..f4849b4ae 100644 --- a/src/features/account/AccountBalanceChart.tsx +++ b/src/features/wallet/AccountBalanceChart.tsx @@ -10,7 +10,7 @@ import { Platform, processColor, ViewStyle } from 'react-native' import { ChartSelectEvent, LineChart } from 'react-native-charts-wrapper' import { ScrollView } from 'react-native-gesture-handler' import FadeInOut from '@components/FadeInOut' -import { useColors, useSpacing } from '@theme/themeHooks' +import { useColors, useSpacing } from '@config/theme/themeHooks' import useHaptic from '@hooks/useHaptic' import usePrevious from '@hooks/usePrevious' import { AccountBalance } from '../../types/balance' diff --git a/src/features/account/AccountManageTokenListScreen.tsx b/src/features/wallet/AccountManageTokenListScreen.tsx similarity index 95% rename from src/features/account/AccountManageTokenListScreen.tsx rename to src/features/wallet/AccountManageTokenListScreen.tsx index 227315c5c..2fc9f2178 100644 --- a/src/features/account/AccountManageTokenListScreen.tsx +++ b/src/features/wallet/AccountManageTokenListScreen.tsx @@ -9,9 +9,9 @@ import { useMetaplexMetadata } from '@hooks/useMetaplexMetadata' import { usePublicKey } from '@hooks/usePublicKey' import CheckBox from '@react-native-community/checkbox' import { PublicKey } from '@solana/web3.js' -import { useAccountStorage } from '@storage/AccountStorageProvider' -import { useVisibleTokens } from '@storage/TokensProvider' -import { useColors } from '@theme/themeHooks' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' +import { useVisibleTokens } from '@config/storage/TokensProvider' +import { useColors } from '@config/theme/themeHooks' import { useBalance } from '@utils/Balance' import { getSortValue, humanReadable } from '@utils/solanaUtils' import BN from 'bn.js' @@ -22,9 +22,9 @@ import { FlatList } from 'react-native-gesture-handler' import BackScreen from '@components/BackScreen' import ScrollBox from '@components/ScrollBox' import { BoxProps } from '@shopify/restyle' -import { Theme } from '@theme/theme' +import { Theme } from '@config/theme/theme' import { NavBarHeight } from '@components/ServiceNavBar' -import { useSolana } from '../../solana/SolanaProvider' +import { useSolana } from '@features/solana/SolanaProvider' import { syncTokenAccounts } from '../../store/slices/balancesSlice' import { useAppDispatch } from '../../store/store' import AccountTokenCurrencyBalance from './AccountTokenCurrencyBalance' diff --git a/src/features/account/AccountTokenBalance.tsx b/src/features/wallet/AccountTokenBalance.tsx similarity index 96% rename from src/features/account/AccountTokenBalance.tsx rename to src/features/wallet/AccountTokenBalance.tsx index 2aa378445..bef45dac2 100644 --- a/src/features/account/AccountTokenBalance.tsx +++ b/src/features/wallet/AccountTokenBalance.tsx @@ -7,8 +7,8 @@ import { useCurrentWallet } from '@hooks/useCurrentWallet' import { useMetaplexMetadata } from '@hooks/useMetaplexMetadata' import { BoxProps } from '@shopify/restyle' import { PublicKey } from '@solana/web3.js' -import { useAccountStorage } from '@storage/AccountStorageProvider' -import { TextVariant, Theme } from '@theme/theme' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' +import { TextVariant, Theme } from '@config/theme/theme' import { IOT_SUB_DAO_KEY, MOBILE_SUB_DAO_KEY } from '@utils/constants' import { getEscrowTokenAccount, humanReadable } from '@utils/solanaUtils' import BN from 'bn.js' diff --git a/src/features/account/AccountTokenCurrencyBalance.tsx b/src/features/wallet/AccountTokenCurrencyBalance.tsx similarity index 100% rename from src/features/account/AccountTokenCurrencyBalance.tsx rename to src/features/wallet/AccountTokenCurrencyBalance.tsx diff --git a/src/features/account/AccountTokenScreen.tsx b/src/features/wallet/AccountTokenScreen.tsx similarity index 96% rename from src/features/account/AccountTokenScreen.tsx rename to src/features/wallet/AccountTokenScreen.tsx index 98f3b05dd..cfa6c51c5 100644 --- a/src/features/account/AccountTokenScreen.tsx +++ b/src/features/wallet/AccountTokenScreen.tsx @@ -13,18 +13,18 @@ import { useMetaplexMetadata } from '@hooks/useMetaplexMetadata' import { usePublicKey } from '@hooks/usePublicKey' import { RouteProp, useRoute } from '@react-navigation/native' import { NATIVE_MINT } from '@solana/spl-token' -import { useModal } from '@storage/ModalsProvider' -import { useColors } from '@theme/themeHooks' +import { useModal } from '@config/storage/ModalsProvider' +import { useColors } from '@config/theme/themeHooks' import { GovMints, MIN_BALANCE_THRESHOLD } from '@utils/constants' import React, { useCallback, useMemo, useRef, useState } from 'react' import { useTranslation } from 'react-i18next' import { View } from 'react-native' import { FlatList } from 'react-native-gesture-handler' -import { WalletStackParamList } from '@services/WalletService/pages/WalletPage/WalletPageNavigator' import { PublicKey } from '@solana/web3.js' import ScrollBox from '@components/ScrollBox' -import { useSolana } from '../../solana/SolanaProvider' -import { useAccountStorage } from '../../storage/AccountStorageProvider' +import { WalletStackParamList } from 'src/app/services/WalletService/pages/WalletPage' +import { useSolana } from '@features/solana/SolanaProvider' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' import { Activity } from '../../types/activity' import AccountActionBar from './AccountActionBar' import { useActivityFilter } from './AccountActivityFilter' diff --git a/src/features/account/AccountView.tsx b/src/features/wallet/AccountView.tsx similarity index 97% rename from src/features/account/AccountView.tsx rename to src/features/wallet/AccountView.tsx index 3fd3a3d7c..da66a4cde 100644 --- a/src/features/account/AccountView.tsx +++ b/src/features/wallet/AccountView.tsx @@ -4,12 +4,12 @@ import FadeInOut from '@components/FadeInOut' import Text from '@components/Text' import useLayoutHeight from '@hooks/useLayoutHeight' import { BoxProps } from '@shopify/restyle' -import { Theme } from '@theme/theme' +import { Theme } from '@config/theme/theme' import { useLanguage } from '@utils/i18n' import { addMinutes } from 'date-fns' import React, { memo, useEffect, useState } from 'react' import { GestureResponderEvent } from 'react-native' -import { useAppStorage } from '../../storage/AppStorageProvider' +import { useAppStorage } from '@config/storage/AppStorageProvider' import { AccountBalance } from '../../types/balance' import { numberFormat, useBalance } from '../../utils/Balance' import DateModule from '../../utils/DateModule' diff --git a/src/features/account/AirdropScreen.tsx b/src/features/wallet/AirdropScreen.tsx similarity index 95% rename from src/features/account/AirdropScreen.tsx rename to src/features/wallet/AirdropScreen.tsx index 5308fe844..bc011d2e0 100644 --- a/src/features/account/AirdropScreen.tsx +++ b/src/features/wallet/AirdropScreen.tsx @@ -1,4 +1,4 @@ -import DripLogo from '@assets/images/dripLogo.svg' +import DripLogo from '@assets/svgs/dripLogo.svg' import { ReAnimatedBox } from '@components/AnimatedBox' import BackScreen from '@components/BackScreen' import Box from '@components/Box' @@ -8,7 +8,7 @@ import Text from '@components/Text' import { usePublicKey } from '@hooks/usePublicKey' import { RouteProp, useNavigation, useRoute } from '@react-navigation/native' import { NATIVE_MINT } from '@solana/spl-token' -import { useAccountStorage } from '@storage/AccountStorageProvider' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' import * as logger from '@utils/logger' import * as solUtils from '@utils/solanaUtils' import axios from 'axios' @@ -25,14 +25,14 @@ import { } from 'react-native-reanimated' import { useSafeAreaInsets } from 'react-native-safe-area-context' import ScrollBox from '@components/ScrollBox' -import HNT from '@assets/images/hnt.svg' +import HNT from '@assets/svgs/hnt.svg' import { useMetaplexMetadata } from '@hooks/useMetaplexMetadata' import { NavBarHeight } from '@components/ServiceNavBar' import { WalletNavigationProp, WalletStackParamList, -} from '@services/WalletService/pages/WalletPage/WalletPageNavigator' -import { useSolana } from '../../solana/SolanaProvider' +} from 'src/app/services/WalletService/pages/WalletPage' +import { useSolana } from '@features/solana/SolanaProvider' const DROP_HEIGHT = 79 diff --git a/src/features/account/TokenListItem.tsx b/src/features/wallet/TokenListItem.tsx similarity index 97% rename from src/features/account/TokenListItem.tsx rename to src/features/wallet/TokenListItem.tsx index d636e37e1..6a13e0cf6 100644 --- a/src/features/account/TokenListItem.tsx +++ b/src/features/wallet/TokenListItem.tsx @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-shadow */ -import Arrow from '@assets/images/listItemRight.svg' -import Lock from '@assets/images/lockClosed.svg' +import Arrow from '@assets/svgs/listItemRight.svg' +import Lock from '@assets/svgs/lockClosed.svg' import Box from '@components/Box' import FadeInOut from '@components/FadeInOut' import Text from '@components/Text' @@ -19,18 +19,18 @@ import { useMetaplexMetadata } from '@hooks/useMetaplexMetadata' import usePrevious from '@hooks/usePrevious' import { useNavigation } from '@react-navigation/native' import { PublicKey } from '@solana/web3.js' -import { useColors } from '@theme/themeHooks' +import { useColors } from '@config/theme/themeHooks' import { humanReadable } from '@utils/solanaUtils' import BN from 'bn.js' import React, { useCallback, useMemo } from 'react' import { useAsync } from 'react-async-hook' -import { ServiceSheetNavigationProp } from '@services/serviceSheetTypes' -import { WalletNavigationProp } from '@services/WalletService/pages/WalletPage/WalletPageNavigator' +import { ServiceSheetNavigationProp } from 'src/app/services/serviceSheetTypes' +import { WalletNavigationProp } from 'src/app/services/WalletService/pages/WalletPage' import useAmountLocked from '@hooks/useAmountLocked' import { BoxProps } from '@shopify/restyle' -import { Theme } from '@theme/theme' +import { Theme } from '@config/theme/theme' +import { useSolana } from '@features/solana/SolanaProvider' import AccountTokenCurrencyBalance from './AccountTokenCurrencyBalance' -import { useSolana } from '../../solana/SolanaProvider' export const ITEM_HEIGHT = 72 type Props = { diff --git a/src/services/WalletService/pages/WalletPage/TokensScreen.tsx b/src/features/wallet/TokensScreen.tsx similarity index 91% rename from src/services/WalletService/pages/WalletPage/TokensScreen.tsx rename to src/features/wallet/TokensScreen.tsx index 37b31229d..430d31018 100644 --- a/src/services/WalletService/pages/WalletPage/TokensScreen.tsx +++ b/src/features/wallet/TokensScreen.tsx @@ -4,20 +4,23 @@ import TotalFiatBalance from '@components/TotalFiatBalance' import { AppState, FlatList, Platform, RefreshControl } from 'react-native' import { useBalance } from '@utils/Balance' import { DC_MINT, truthy } from '@helium/spl-utils' -import { DEFAULT_TOKENS, useVisibleTokens } from '@storage/TokensProvider' +import { + DEFAULT_TOKENS, + useVisibleTokens, +} from '@config/storage/TokensProvider' import { PublicKey } from '@solana/web3.js' import { HeliumTokenListItem, TokenListItem, TokenSkeleton, -} from '@features/account/TokenListItem' +} from '@features/wallet/TokenListItem' import { GovMints } from '@utils/constants' -import { useColors, useSpacing } from '@theme/themeHooks' +import { useColors, useSpacing } from '@config/theme/themeHooks' import WalletAlertBanner from '@components/WalletAlertBanner' import { NavBarHeight } from '@components/ServiceNavBar' import { useSafeAreaInsets } from 'react-native-safe-area-context' import { useAsync, useAsyncCallback } from 'react-async-hook' -import { useAccountStorage } from '@storage/AccountStorageProvider' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' import { useAppDispatch } from '@store/store' import { syncTokenAccounts } from '@store/slices/balancesSlice' import { useAccountFetchCache } from '@helium/account-fetch-cache-hooks' @@ -25,20 +28,20 @@ import { getAssociatedTokenAddressSync } from '@solana/spl-token' import { times } from 'lodash' import TouchableOpacityBox from '@components/TouchableOpacityBox' import { useNavigation } from '@react-navigation/native' -import Config from '@assets/images/config.svg' +import Config from '@assets/svgs/config.svg' import Text from '@components/Text' import { useTranslation } from 'react-i18next' import { getSortValue } from '@utils/solanaUtils' -import { checkSecureAccount } from '@storage/secureStorage' +import { checkSecureAccount } from '@config/storage/secureStorage' import ScrollBox from '@components/ScrollBox' import SharedGroupPreferences from 'react-native-shared-group-preferences' -import { useAppStorage } from '@storage/AppStorageProvider' -import { CSAccount } from '@storage/cloudStorage' -import { RootNavigationProp } from 'src/navigation/rootTypes' -import { useNotificationStorage } from '@storage/NotificationStorageProvider' -import { ServiceSheetNavigationProp } from '@services/serviceSheetTypes' -import { WalletNavigationProp } from './WalletPageNavigator' -import { useSolana } from '../../../../solana/SolanaProvider' +import { useAppStorage } from '@config/storage/AppStorageProvider' +import { CSAccount } from '@config/storage/cloudStorage' +import { RootNavigationProp } from 'src/app/rootTypes' +import { useNotificationStorage } from '@config/storage/NotificationStorageProvider' +import { ServiceSheetNavigationProp } from 'src/app/services/serviceSheetTypes' +import { useSolana } from '@features/solana/SolanaProvider' +import { WalletNavigationProp } from '@services/WalletService/pages/WalletPage' const TokensScreen = () => { const widgetGroup = 'group.com.helium.mobile.wallet.widget' diff --git a/src/services/WalletService/pages/WalletPage/TokensTabs.tsx b/src/features/wallet/TokensTabs.tsx similarity index 93% rename from src/services/WalletService/pages/WalletPage/TokensTabs.tsx rename to src/features/wallet/TokensTabs.tsx index 4a507fe84..37109821c 100644 --- a/src/services/WalletService/pages/WalletPage/TokensTabs.tsx +++ b/src/features/wallet/TokensTabs.tsx @@ -2,15 +2,15 @@ import SegmentedControl, { SegmentedControlRef, } from '@components/SegmentedControl' import React, { useCallback, useMemo, useRef } from 'react' -import Tokens from '@assets/images/tokens.svg' -import Collectables from '@assets/images/collectables.svg' +import Tokens from '@assets/svgs/tokens.svg' +import Collectables from '@assets/svgs/collectables.svg' import { MaterialTopTabNavigationOptions, createMaterialTopTabNavigator, } from '@react-navigation/material-top-tabs' import { StackNavigationProp } from '@react-navigation/stack' import NftList from '@features/collectables/NftList' -import { useColors } from '@theme/themeHooks' +import { useColors } from '@config/theme/themeHooks' import { useNavigation } from '@react-navigation/native' import TokensScreen from './TokensScreen' diff --git a/src/features/account/TransactionDetail.tsx b/src/features/wallet/TransactionDetail.tsx similarity index 98% rename from src/features/account/TransactionDetail.tsx rename to src/features/wallet/TransactionDetail.tsx index 1d6170069..e741918ea 100644 --- a/src/features/account/TransactionDetail.tsx +++ b/src/features/wallet/TransactionDetail.tsx @@ -23,9 +23,9 @@ import { useTranslation } from 'react-i18next' import { LayoutChangeEvent } from 'react-native' import { Edge } from 'react-native-safe-area-context' import { BoxProps } from '@shopify/restyle' -import { Theme } from '@theme/theme' +import { Theme } from '@config/theme/theme' import { Portal } from '@gorhom/portal' -import { useCreateExplorerUrl } from '../../constants/urls' +import { useCreateExplorerUrl } from '../../utils/constants/urls' import { Activity } from '../../types/activity' import TransactionLineItem from './TransactionLineItem' import { useTxnDetails } from './useTxn' diff --git a/src/features/account/TransactionLineItem.tsx b/src/features/wallet/TransactionLineItem.tsx similarity index 95% rename from src/features/account/TransactionLineItem.tsx rename to src/features/wallet/TransactionLineItem.tsx index da2cca679..d49630f79 100644 --- a/src/features/account/TransactionLineItem.tsx +++ b/src/features/wallet/TransactionLineItem.tsx @@ -1,4 +1,4 @@ -import DetailArrow from '@assets/images/detailArrow.svg' +import DetailArrow from '@assets/svgs/detailArrow.svg' import AccountIcon from '@components/AccountIcon' import Box from '@components/Box' import Text from '@components/Text' @@ -6,12 +6,16 @@ import TouchableOpacityBox from '@components/TouchableOpacityBox' import useAlert from '@hooks/useAlert' import useCopyText from '@hooks/useCopyText' import { useNavigation } from '@react-navigation/native' -import { Color } from '@theme/theme' -import { useColors, useHitSlop, useVerticalHitSlop } from '@theme/themeHooks' +import { Color } from '@config/theme/theme' +import { + useColors, + useHitSlop, + useVerticalHitSlop, +} from '@config/theme/themeHooks' import React, { memo, useCallback, useMemo } from 'react' import { useTranslation } from 'react-i18next' import { Linking } from 'react-native' -import { useAccountStorage } from '../../storage/AccountStorageProvider' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' import { ellipsizeAddress } from '../../utils/accountUtils' import { locale } from '../../utils/i18n' import { AddressBookNavigationProp } from '../addressBook/addressBookTypes' diff --git a/src/features/account/TxnListItem.tsx b/src/features/wallet/TxnListItem.tsx similarity index 95% rename from src/features/account/TxnListItem.tsx rename to src/features/wallet/TxnListItem.tsx index c7dc47a19..00041ca66 100644 --- a/src/features/account/TxnListItem.tsx +++ b/src/features/wallet/TxnListItem.tsx @@ -1,11 +1,11 @@ -import Pending from '@assets/images/pending.svg' +import Pending from '@assets/svgs/pending.svg' import Box from '@components/Box' import Text from '@components/Text' import TouchableOpacityBox from '@components/TouchableOpacityBox' import { PublicKey } from '@solana/web3.js' import React, { memo, useCallback, useMemo } from 'react' import { BoxProps } from '@shopify/restyle' -import { Theme } from '@theme/theme' +import { Theme } from '@config/theme/theme' import { Activity } from '../../types/activity' import useTxn from './useTxn' diff --git a/src/features/account/useSolanaActivityList.tsx b/src/features/wallet/useSolanaActivityList.tsx similarity index 96% rename from src/features/account/useSolanaActivityList.tsx rename to src/features/wallet/useSolanaActivityList.tsx index 5c74b53ba..2c2e6038d 100644 --- a/src/features/account/useSolanaActivityList.tsx +++ b/src/features/wallet/useSolanaActivityList.tsx @@ -3,8 +3,8 @@ import { PublicKey } from '@solana/web3.js' import { onLogs, removeAccountChangeListener } from '@utils/solanaUtils' import { useCallback, useEffect, useMemo, useRef, useState } from 'react' import { useSelector } from 'react-redux' -import { useSolana } from '../../solana/SolanaProvider' -import { CSAccount } from '../../storage/cloudStorage' +import { useSolana } from '@features/solana/SolanaProvider' +import { CSAccount } from '@config/storage/cloudStorage' import { RootState } from '../../store/rootReducer' import { getTxns } from '../../store/slices/solanaSlice' import { useAppDispatch } from '../../store/store' diff --git a/src/features/account/useTxn.tsx b/src/features/wallet/useTxn.tsx similarity index 97% rename from src/features/account/useTxn.tsx rename to src/features/wallet/useTxn.tsx index f6d1999f6..758dc3d14 100644 --- a/src/features/account/useTxn.tsx +++ b/src/features/wallet/useTxn.tsx @@ -1,5 +1,5 @@ -import TxnReceive from '@assets/images/txnReceive.svg' -import TxnSend from '@assets/images/txnSend.svg' +import TxnReceive from '@assets/svgs/txnReceive.svg' +import TxnSend from '@assets/svgs/txnSend.svg' import { useAccounts } from '@helium/account-fetch-cache-hooks' import { truthy } from '@helium/spl-utils' import { useCurrentWallet } from '@hooks/useCurrentWallet' @@ -11,8 +11,8 @@ import { import { usePublicKey } from '@hooks/usePublicKey' import { Mint, unpackMint } from '@solana/spl-token' import { AccountInfo, LAMPORTS_PER_SOL, PublicKey } from '@solana/web3.js' -import { Color } from '@theme/theme' -import { useColors } from '@theme/themeHooks' +import { Color } from '@config/theme/theme' +import { useColors } from '@config/theme/themeHooks' import BN from 'bn.js' import { addMinutes, diff --git a/src/hooks/useAmountLocked.ts b/src/hooks/useAmountLocked.ts index bb2b45fd8..382c4daa3 100644 --- a/src/hooks/useAmountLocked.ts +++ b/src/hooks/useAmountLocked.ts @@ -7,8 +7,8 @@ import { usePositions, } from '@helium/voter-stake-registry-hooks' import { BN } from 'bn.js' +import { useSolana } from '@features/solana/SolanaProvider' import { useCurrentWallet } from './useCurrentWallet' -import { useSolana } from '../solana/SolanaProvider' const useAmountLocked = (mint: PublicKey) => { const wallet = useCurrentWallet() diff --git a/src/hooks/useBrowser.ts b/src/hooks/useBrowser.ts index 607e98278..da3d2531d 100644 --- a/src/hooks/useBrowser.ts +++ b/src/hooks/useBrowser.ts @@ -1,7 +1,7 @@ import { useSelector } from 'react-redux' import { useCallback } from 'react' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' import { RootState } from '../store/rootReducer' -import { useAccountStorage } from '../storage/AccountStorageProvider' import { BrowserDetails, browserSlice } from '../store/slices/browserSlice' import { useAppDispatch } from '../store/store' diff --git a/src/hooks/useCollectables.ts b/src/hooks/useCollectables.ts index 968211d54..5474a96e7 100644 --- a/src/hooks/useCollectables.ts +++ b/src/hooks/useCollectables.ts @@ -1,8 +1,9 @@ import { useCallback, useEffect, useRef } from 'react' import { useSelector } from 'react-redux' import { WrappedConnection } from '@utils/WrappedConnection' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' +import { useSolana } from '@features/solana/SolanaProvider' import { CompressedNFT } from '../types/solana' -import { useAccountStorage } from '../storage/AccountStorageProvider' import { RootState } from '../store/rootReducer' import { fetchCollectables, @@ -16,7 +17,6 @@ import { onLogs, removeAccountChangeListener, } from '../utils/solanaUtils' -import { useSolana } from '../solana/SolanaProvider' const useCollectables = (): WalletCollectables & { refresh: () => void diff --git a/src/hooks/useCurrentWallet.ts b/src/hooks/useCurrentWallet.ts index 40ec0bd97..966ffd118 100644 --- a/src/hooks/useCurrentWallet.ts +++ b/src/hooks/useCurrentWallet.ts @@ -1,5 +1,5 @@ import { PublicKey } from '@solana/web3.js' -import { useAccountStorage } from '@storage/AccountStorageProvider' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' import { usePublicKey } from './usePublicKey' export function useCurrentWallet(): PublicKey | undefined { diff --git a/src/hooks/useDerivationAccounts.ts b/src/hooks/useDerivationAccounts.ts index d5d7c1966..35e402a3c 100644 --- a/src/hooks/useDerivationAccounts.ts +++ b/src/hooks/useDerivationAccounts.ts @@ -13,7 +13,7 @@ import * as ed25519 from 'ed25519-hd-key' import { useEffect, useMemo, useState } from 'react' import Config from 'react-native-config' import { retryWithBackoff } from '@utils/retryWithBackoff' -import { useSolana } from '../solana/SolanaProvider' +import { useSolana } from '@features/solana/SolanaProvider' export const solanaDerivation = (account = -1, change: number | undefined) => { if (account === -1) { diff --git a/src/hooks/useEcosystemTokensSolConvert.ts b/src/hooks/useEcosystemTokensSolConvert.ts index e6200a6a3..a978be381 100644 --- a/src/hooks/useEcosystemTokensSolConvert.ts +++ b/src/hooks/useEcosystemTokensSolConvert.ts @@ -6,7 +6,7 @@ import BN from 'bn.js' import { useMemo } from 'react' import { useAsync } from 'react-async-hook' import { Config } from 'react-native-config' -import { useSolana } from '../solana/SolanaProvider' +import { useSolana } from '@features/solana/SolanaProvider' import * as logger from '../utils/logger' import { useBN } from './useBN' import { useCurrentWallet } from './useCurrentWallet' diff --git a/src/hooks/useEnrichedTransactions.ts b/src/hooks/useEnrichedTransactions.ts index a9675eb65..e617fd23a 100644 --- a/src/hooks/useEnrichedTransactions.ts +++ b/src/hooks/useEnrichedTransactions.ts @@ -1,8 +1,8 @@ import AsyncStorage from '@react-native-async-storage/async-storage' import { ConfirmedSignatureInfo } from '@solana/web3.js' import { useCallback, useEffect, useMemo, useRef, useState } from 'react' -import { useSolana } from '../solana/SolanaProvider' -import { useAccountStorage } from '../storage/AccountStorageProvider' +import { useSolana } from '@features/solana/SolanaProvider' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' import { useAppDispatch } from '../store/store' import { EnrichedTransaction } from '../types/solana' import { diff --git a/src/hooks/useExplorer.ts b/src/hooks/useExplorer.ts index 3cea70f58..3e3d0f41e 100644 --- a/src/hooks/useExplorer.ts +++ b/src/hooks/useExplorer.ts @@ -1,4 +1,4 @@ -import { useAppStorage } from '@storage/AppStorageProvider' +import { useAppStorage } from '@config/storage/AppStorageProvider' import { getExplorers, Explorer } from '@utils/walletApiV2' import { useMemo } from 'react' import { useAsync } from 'react-async-hook' diff --git a/src/hooks/useHaptic.ts b/src/hooks/useHaptic.ts index a4ec95f54..e491fe7aa 100644 --- a/src/hooks/useHaptic.ts +++ b/src/hooks/useHaptic.ts @@ -1,4 +1,4 @@ -import { useAppStorage } from '@storage/AppStorageProvider' +import { useAppStorage } from '@config/storage/AppStorageProvider' import * as Haptics from 'expo-haptics' export type FeedbackStyle = 'light' | 'medium' | 'heavy' diff --git a/src/hooks/useHotspot.tsx b/src/hooks/useHotspot.tsx index 5a4a2564d..6491fe2b8 100644 --- a/src/hooks/useHotspot.tsx +++ b/src/hooks/useHotspot.tsx @@ -3,7 +3,7 @@ import { init } from '@helium/lazy-distributor-sdk' import { PublicKey, VersionedTransaction } from '@solana/web3.js' import { useEffect, useState } from 'react' import { useAsyncCallback } from 'react-async-hook' -import { useSolana } from '../solana/SolanaProvider' +import { useSolana } from '@features/solana/SolanaProvider' import { IOT_LAZY_KEY, MOBILE_LAZY_KEY } from '../utils/constants' import * as Logger from '../utils/logger' diff --git a/src/hooks/useHotspotWithMeta.ts b/src/hooks/useHotspotWithMeta.ts index e1395342b..7e0fe80e2 100644 --- a/src/hooks/useHotspotWithMeta.ts +++ b/src/hooks/useHotspotWithMeta.ts @@ -1,7 +1,7 @@ import { PublicKey } from '@solana/web3.js' import { getHotspotWithRewards } from '@utils/solanaUtils' import { useAsync } from 'react-async-hook' -import { useSolana } from '../solana/SolanaProvider' +import { useSolana } from '@features/solana/SolanaProvider' import { CompressedNFT } from '../types/solana' export const useHotspotWithMetaAndRewards = (hotspot: CompressedNFT) => { diff --git a/src/hooks/useHotspots.ts b/src/hooks/useHotspots.ts index 64bc97cd4..c606a4ac5 100644 --- a/src/hooks/useHotspots.ts +++ b/src/hooks/useHotspots.ts @@ -1,8 +1,8 @@ import BN from 'bn.js' import { useCallback, useEffect, useMemo } from 'react' import { useSelector } from 'react-redux' -import { useSolana } from '../solana/SolanaProvider' -import { useAccountStorage } from '../storage/AccountStorageProvider' +import { useSolana } from '@features/solana/SolanaProvider' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' import { RootState } from '../store/rootReducer' import { fetchAllHotspots, diff --git a/src/hooks/useImplicitBurn.ts b/src/hooks/useImplicitBurn.ts index 251c6d7ab..3fdde9bb1 100644 --- a/src/hooks/useImplicitBurn.ts +++ b/src/hooks/useImplicitBurn.ts @@ -14,9 +14,9 @@ import BN from 'bn.js' import { Buffer } from 'buffer' import { useAsyncCallback } from 'react-async-hook' import { useTranslation } from 'react-i18next' -import { useSolana } from '../solana/SolanaProvider' -import { useWalletSign } from '../solana/WalletSignProvider' -import { WalletStandardMessageTypes } from '../solana/walletSignBottomSheetTypes' +import { useSolana } from '@features/solana/SolanaProvider' +import { useWalletSign } from '@features/solana/WalletSignProvider' +import { WalletStandardMessageTypes } from '@features/solana/walletSignBottomSheetTypes' export function useImplicitBurn(): { implicitBurn: (requiredDc: number) => void diff --git a/src/hooks/useLedger.ts b/src/hooks/useLedger.ts index 290477ae5..35150b276 100644 --- a/src/hooks/useLedger.ts +++ b/src/hooks/useLedger.ts @@ -8,8 +8,8 @@ import { bs58 } from '@coral-xyz/anchor/dist/cjs/utils/bytes' import { solAddressToHelium } from '@utils/accountUtils' import base58 from 'bs58' import { PublicKey } from '@solana/web3.js' -import { useSolana } from '../solana/SolanaProvider' -import { LedgerDevice } from '../storage/cloudStorage' +import { useSolana } from '@features/solana/SolanaProvider' +import { LedgerDevice } from '@config/storage/cloudStorage' import { runDerivationScheme } from '../utils/heliumLedger' export type LedgerAccount = { diff --git a/src/hooks/useNetworkColor.tsx b/src/hooks/useNetworkColor.tsx index 88cb8383c..d0ab6217d 100644 --- a/src/hooks/useNetworkColor.tsx +++ b/src/hooks/useNetworkColor.tsx @@ -1,6 +1,6 @@ import { useMemo } from 'react' import { NetTypes } from '@helium/address' -import { Color } from '@theme/theme' +import { Color } from '@config/theme/theme' export default ({ defaultColor, diff --git a/src/hooks/useProposalStatus.ts b/src/hooks/useProposalStatus.ts index 0db5228e1..f34cfcbb9 100644 --- a/src/hooks/useProposalStatus.ts +++ b/src/hooks/useProposalStatus.ts @@ -7,7 +7,7 @@ import { PublicKey } from '@solana/web3.js' import { getDerivedProposalState } from '@utils/governanceUtils' import BN from 'bn.js' import { useMemo } from 'react' -import { ProposalV0 } from '../features/governance/governanceTypes' +import { ProposalV0 } from '@features/governance/governanceTypes' function usePublicKey( key: string | PublicKey | undefined, diff --git a/src/hooks/useRentExempt.ts b/src/hooks/useRentExempt.ts index 052ab6609..659d82882 100644 --- a/src/hooks/useRentExempt.ts +++ b/src/hooks/useRentExempt.ts @@ -1,6 +1,6 @@ import { useAsync } from 'react-async-hook' import { LAMPORTS_PER_SOL } from '@solana/web3.js' -import { useSolana } from '../solana/SolanaProvider' +import { useSolana } from '@features/solana/SolanaProvider' import * as logger from '../utils/logger' export function useRentExempt(dataLength = 0) { diff --git a/src/hooks/useSolanaHealth.ts b/src/hooks/useSolanaHealth.ts index 49f9490ba..e7d1f93cf 100644 --- a/src/hooks/useSolanaHealth.ts +++ b/src/hooks/useSolanaHealth.ts @@ -2,7 +2,7 @@ import { WrappedConnection } from '@utils/WrappedConnection' import { useMemo, useState } from 'react' import { useAsync } from 'react-async-hook' import { useTranslation } from 'react-i18next' -import { useSolana } from '../solana/SolanaProvider' +import { useSolana } from '@features/solana/SolanaProvider' import { getCurrentTPS } from '../utils/solanaUtils' let lastUpdated = 0 diff --git a/src/hooks/useSubmitTxn.tsx b/src/hooks/useSubmitTxn.tsx index 8652fcc71..47b7b7b5d 100644 --- a/src/hooks/useSubmitTxn.tsx +++ b/src/hooks/useSubmitTxn.tsx @@ -8,19 +8,19 @@ import { toVersionedTx, } from '@helium/spl-utils' import { PublicKey, Transaction, VersionedTransaction } from '@solana/web3.js' -import { useAccountStorage } from '@storage/AccountStorageProvider' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' import i18n from '@utils/i18n' import * as solUtils from '@utils/solanaUtils' import BN from 'bn.js' import React, { useCallback } from 'react' import { ellipsizeAddress } from '@utils/accountUtils' -import { SwapPreview } from '../solana/SwapPreview' -import { CollectablePreview } from '../solana/CollectablePreview' -import { MessagePreview } from '../solana/MessagePreview' -import { PaymentPreivew } from '../solana/PaymentPreview' -import { useSolana } from '../solana/SolanaProvider' -import { useWalletSign } from '../solana/WalletSignProvider' -import { WalletStandardMessageTypes } from '../solana/walletSignBottomSheetTypes' +import { SwapPreview } from '@features/solana/SwapPreview' +import { CollectablePreview } from '@features/solana/CollectablePreview' +import { MessagePreview } from '@features/solana/MessagePreview' +import { PaymentPreivew } from '@features/solana/PaymentPreview' +import { useSolana } from '@features/solana/SolanaProvider' +import { useWalletSign } from '@features/solana/WalletSignProvider' +import { WalletStandardMessageTypes } from '@features/solana/walletSignBottomSheetTypes' import { claimAllRewards, claimRewards, diff --git a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/iot/Settings.tsx b/src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/iot/Settings.tsx deleted file mode 100644 index 8fcce79dd..000000000 --- a/src/services/HotspotService/AddHotspotPage/OnboardingSheet/screens/iot/Settings.tsx +++ /dev/null @@ -1,214 +0,0 @@ -import BackScreen from '@components/BackScreen' -import ButtonPressable from '@components/ButtonPressable' -import FabButton from '@components/FabButton' -import Text from '@components/Text' -import TouchableOpacityBox from '@components/TouchableOpacityBox' -import { keyToAssetKey } from '@helium/helium-entity-manager-sdk' -import { useHotspotBle } from '@helium/react-native-sdk' -import { useCurrentWallet } from '@hooks/useCurrentWallet' -import { useIotInfo } from '@hooks/useIotInfo' -import { useKeyToAsset } from '@hooks/useKeyToAsset' -import { useNavigation } from '@react-navigation/native' -import { PublicKey } from '@solana/web3.js' -import { useAccountStorage } from '@storage/AccountStorageProvider' -import { DAO_KEY } from '@utils/constants' -import { getHotspotWithRewards } from '@utils/solanaUtils' -import React, { useCallback, useEffect, useState } from 'react' -import { useAsync } from 'react-async-hook' -import { useTranslation } from 'react-i18next' -import { FlatList } from 'react-native' -import { useSolana } from '../../../../../../solana/SolanaProvider' -import { CollectableNavigationProp } from '../../../../../../features/collectables/collectablesTypes' -import type { HotspotBLEStackParamList, HotspotBleNavProp } from './navTypes' - -type Option = { - name: string - route: keyof HotspotBLEStackParamList -} - -const data: Option[] = [ - { - name: 'Wifi Settings', - route: 'WifiSettings', - }, - { - name: 'Diagnostics', - route: 'Diagnostics', - }, -] - -// For testing "fresh" hotspots -// export const TEST_HOTSPOT_WORDS = [ - -// ] -// let TEST_HOTSPOT: Keypair = null -// async function setTestHotspot() { -// TEST_HOTSPOT = await Keypair.fromMnemonic(new Mnemonic(TEST_HOTSPOT_WORDS)) -// } -// setTestHotspot() -// export function getTestHotspot() { -// return TEST_HOTSPOT! -// } - -const Settings = () => { - const navigation = useNavigation() - const collectNav = useNavigation() - const { t } = useTranslation() - const { - isConnected, - getOnboardingAddress, - createGatewayTxn: getCreateGatewayTxn, - } = useHotspotBle() - const [connected, setConnected] = useState(false) - const { anchorProvider } = useSolana() - const wallet = useCurrentWallet() - const { currentAccount } = useAccountStorage() - - useEffect(() => { - isConnected().then(setConnected) - }, [isConnected]) - const { - result: { address, keyToAssetK, createGatewayTx } = {} as { - address?: string - keyToAssetK?: PublicKey - createGatewayTx?: string - }, - loading: loadingAddress, - error, - } = useAsync( - async ( - c: boolean, - accountAddress?: string, - ): Promise<{ - address?: string - keyToAssetK?: PublicKey - createGatewayTx?: string - }> => { - if (c && accountAddress) { - const addr = await getOnboardingAddress() - const tx = await getCreateGatewayTxn({ - ownerAddress: accountAddress, - payerAddress: accountAddress, - }) - // For testing - // const addr = TEST_HOTSPOT.address.b58 - return { - address: addr, - keyToAssetK: keyToAssetKey(DAO_KEY, addr, 'b58')[0], - createGatewayTx: tx, - } - } - return {} - }, - [connected, currentAccount?.address], - ) - const { info: iotInfo, loading: loadingInfo } = useIotInfo(address) - const { info: keyToAsset, loading: loadingKta } = useKeyToAsset( - keyToAssetK?.toBase58(), - ) - const loading = loadingInfo || loadingAddress || loadingKta - - const navNext = useCallback(async () => { - if (iotInfo && keyToAsset && anchorProvider && wallet) { - const collectable = await getHotspotWithRewards( - keyToAsset.asset, - anchorProvider, - ) - - if (collectable.ownership.owner.toString() !== wallet.toBase58()) { - collectNav.push('HotspotList') - } - - collectNav.push('HotspotMapScreen', { - hotspot: collectable, - network: 'IOT', - }) - } else { - navigation.push('AddGatewayBle', { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - onboardingAddress: address!, - createGatewayTx, - network: 'IOT', - }) - } - }, [ - createGatewayTx, - address, - anchorProvider, - navigation, - iotInfo, - keyToAsset, - collectNav, - wallet, - ]) - - const renderItem = React.useCallback( - // eslint-disable-next-line react/no-unused-prop-types - ({ item, index }: { item: Option; index: number }) => { - return ( - { - navigation.push(item.route, {}) - }} - alignItems="center" - padding="6" - flexDirection="row" - borderTopWidth={index === 0 ? 0 : 1} - borderColor="gray.900" - borderBottomWidth={1} - > - - - {item.name} - - - ) - }, - [navigation], - ) - - const keyExtractor = useCallback((option: Option) => option.name, []) - let errorMessage = error?.message - ? error?.message.toString() - : error?.toString() - if (errorMessage === 'wait') { - errorMessage = t('hotspotOnboarding.settings.notReady') - } - - return ( - - - {error && ( - - {t('hotspotOnboarding.settings.hotspotError')} - {errorMessage} - - )} - {!loadingInfo && !loadingKta && ( - - )} - - ) -} - -export default Settings diff --git a/src/services/HotspotService/HotspotPage/index.tsx b/src/services/HotspotService/HotspotPage/index.tsx deleted file mode 100644 index bbfbab4a9..000000000 --- a/src/services/HotspotService/HotspotPage/index.tsx +++ /dev/null @@ -1,93 +0,0 @@ -import { - StackNavigationOptions, - StackNavigationProp, - createStackNavigator, -} from '@react-navigation/stack' -import React, { useMemo } from 'react' -import { useColors } from '@theme/themeHooks' -import AssertLocationScreen from '@features/collectables/AssertLocationScreen' -import TransferCollectableScreen from '@features/collectables/TransferCollectableScreen' -import ChangeRewardsRecipientScreen from '@features/collectables/ChangeRewardsRecipientScreen' -import AntennaSetupScreen from '@features/collectables/AntennaSetupScreen' -import Diagnostics from '@features/collectables/Diagnostics' -import ModifyWifiScreen from '@features/collectables/ModifyWifiScreen' -import { HotspotWithPendingRewards } from '../../../types/solana' -import HotspotPage from './HotspotPage' -import HotspotDetails from './HotspotDetails' -import HotspotConfig from './HotspotConfig' - -export type HotspotStackParamList = { - HotspotPage: undefined - HotspotDetails: { - hotspot: HotspotWithPendingRewards - } - HotspotConfig: { - hotspot: HotspotWithPendingRewards - hotspotAddress: string - } - AssertLocationScreen: { - collectable: HotspotWithPendingRewards - } - TransferCollectableScreen: { - collectable: HotspotWithPendingRewards - } - ChangeRewardsRecipientScreen: { - hotspot: HotspotWithPendingRewards - } - AntennaSetupScreen: { - collectable: HotspotWithPendingRewards - } - DiagnosticsScreen: { - collectable: HotspotWithPendingRewards - } - ModifyWifiScreen: { - collectable: HotspotWithPendingRewards - } -} - -export type HotspotNavigationProp = StackNavigationProp - -const HotspotStack = createStackNavigator() - -const HotspotPageNavigator = () => { - const colors = useColors() - const navigatorScreenOptions = useMemo( - () => - ({ - headerShown: false, - cardStyle: { backgroundColor: colors.primaryBackground }, - } as StackNavigationOptions), - [colors], - ) - - return ( - - - - - - - - - - - - ) -} - -export default HotspotPageNavigator diff --git a/src/services/WalletService/pages/SendPage/index.tsx b/src/services/WalletService/pages/SendPage/index.tsx deleted file mode 100644 index dea286d75..000000000 --- a/src/services/WalletService/pages/SendPage/index.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import React from 'react' -import { ReAnimatedBox } from '@components/AnimatedBox' -import { FadeIn } from 'react-native-reanimated' -import SendPageNavigator from './SentPageNavigator' - -const SendPage = () => { - return ( - - - - ) -} - -export default SendPage diff --git a/src/services/WalletService/pages/WalletPage/index.tsx b/src/services/WalletService/pages/WalletPage/index.tsx deleted file mode 100644 index 6eb2c8c24..000000000 --- a/src/services/WalletService/pages/WalletPage/index.tsx +++ /dev/null @@ -1,8 +0,0 @@ -import React from 'react' -import WalletPageNavigator from './WalletPageNavigator' - -const WalletPage = () => { - return -} - -export default WalletPage diff --git a/src/store/slices/balancesSlice.ts b/src/store/slices/balancesSlice.ts index db6a9fcef..7e5711193 100644 --- a/src/store/slices/balancesSlice.ts +++ b/src/store/slices/balancesSlice.ts @@ -3,7 +3,7 @@ import { PayloadAction, createAsyncThunk, createSlice } from '@reduxjs/toolkit' import { AccountLayout, TOKEN_PROGRAM_ID, getMint } from '@solana/spl-token' import { Cluster, PublicKey } from '@solana/web3.js' import { PURGE } from 'redux-persist' -import { CSAccount } from '../../storage/cloudStorage' +import { CSAccount } from '@config/storage/cloudStorage' import { AccountBalance, Prices, TokenAccount } from '../../types/balance' import { getBalanceHistory, getTokenPrices } from '../../utils/walletApiV2' diff --git a/src/store/slices/browserSlice.ts b/src/store/slices/browserSlice.ts index 0d562d5d0..0b789a719 100644 --- a/src/store/slices/browserSlice.ts +++ b/src/store/slices/browserSlice.ts @@ -1,5 +1,5 @@ import { createSlice, PayloadAction } from '@reduxjs/toolkit' -import { CSAccount } from '../../storage/cloudStorage' +import { CSAccount } from '@config/storage/cloudStorage' export type BrowserDetails = { favorites: string[] diff --git a/src/store/slices/collectablesSlice.ts b/src/store/slices/collectablesSlice.ts index aab9260c8..4a7a4d16f 100644 --- a/src/store/slices/collectablesSlice.ts +++ b/src/store/slices/collectablesSlice.ts @@ -2,7 +2,7 @@ import { createAsyncThunk, createSlice, PayloadAction } from '@reduxjs/toolkit' import { Cluster, Connection, PublicKey } from '@solana/web3.js' import { WrappedConnection } from '@utils/WrappedConnection' import { PURGE } from 'redux-persist' -import { CSAccount } from '../../storage/cloudStorage' +import { CSAccount } from '@config/storage/cloudStorage' import { CompressedNFT } from '../../types/solana' import * as solUtils from '../../utils/solanaUtils' diff --git a/src/store/slices/hotspotsSlice.ts b/src/store/slices/hotspotsSlice.ts index e5b566c95..50c1cdf41 100644 --- a/src/store/slices/hotspotsSlice.ts +++ b/src/store/slices/hotspotsSlice.ts @@ -4,10 +4,11 @@ import { createAsyncThunk, createSlice, PayloadAction } from '@reduxjs/toolkit' import { Cluster, PublicKey } from '@solana/web3.js' import { PURGE } from 'redux-persist' import { CompressedNFT } from 'src/types/solana' -import { DEFAULT_PAGE_AMOUNT } from '../../features/collectables/HotspotList' -import { CSAccount } from '../../storage/cloudStorage' +import { CSAccount } from '@config/storage/cloudStorage' import * as solUtils from '../../utils/solanaUtils' +const DEFAULT_PAGE_AMOUNT = 20 + export type WalletHotspots = { loading: boolean fetchingMore: boolean diff --git a/src/store/slices/notificationsSlice.ts b/src/store/slices/notificationsSlice.ts index 264ef01d2..8eba9822e 100644 --- a/src/store/slices/notificationsSlice.ts +++ b/src/store/slices/notificationsSlice.ts @@ -1,6 +1,6 @@ import { createAsyncThunk, createSlice } from '@reduxjs/toolkit' import { PURGE } from 'redux-persist' -import { CSAccount } from '../../storage/cloudStorage' +import { CSAccount } from '@config/storage/cloudStorage' import * as WalletApi from '../../utils/walletApiV2' type NotificationsByResource = Record diff --git a/src/store/slices/solanaSlice.ts b/src/store/slices/solanaSlice.ts index bc9004977..c779a3551 100644 --- a/src/store/slices/solanaSlice.ts +++ b/src/store/slices/solanaSlice.ts @@ -39,7 +39,7 @@ import { first, last } from 'lodash' import { PURGE } from 'redux-persist' import { LazyDistributor } from '@helium/idls/lib/types/lazy_distributor' import { HeliumEntityManager } from '@helium/idls/lib/types/helium_entity_manager' -import { CSAccount } from '../../storage/cloudStorage' +import { CSAccount } from '@config/storage/cloudStorage' import { Activity } from '../../types/activity' import { CompressedNFT, HotspotWithPendingRewards } from '../../types/solana' import * as Logger from '../../utils/logger' diff --git a/src/utils/Balance.tsx b/src/utils/Balance.tsx index 6e3863ac3..0a6302c6e 100644 --- a/src/utils/Balance.tsx +++ b/src/utils/Balance.tsx @@ -8,7 +8,7 @@ import { toNumber, } from '@helium/spl-utils' import { LAMPORTS_PER_SOL, PublicKey } from '@solana/web3.js' -import { useVisibleTokens } from '@storage/TokensProvider' +import { useVisibleTokens } from '@config/storage/TokensProvider' import BN from 'bn.js' import React, { ReactNode, @@ -21,10 +21,10 @@ import React, { } from 'react' import { useAsync } from 'react-async-hook' import { useSelector } from 'react-redux' +import { useSolana } from '@features/solana/SolanaProvider' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' +import { useAppStorage } from '@config/storage/AppStorageProvider' import usePrevious from '../hooks/usePrevious' -import { useSolana } from '../solana/SolanaProvider' -import { useAccountStorage } from '../storage/AccountStorageProvider' -import { useAppStorage } from '../storage/AppStorageProvider' import { RootState } from '../store/rootReducer' import { syncTokenAccounts } from '../store/slices/balancesSlice' import { useAppDispatch } from '../store/store' diff --git a/src/utils/StoreAtaBalance.ts b/src/utils/StoreAtaBalance.ts index 2e3717dca..04cc8f9b2 100644 --- a/src/utils/StoreAtaBalance.ts +++ b/src/utils/StoreAtaBalance.ts @@ -2,8 +2,8 @@ import { useTokenAccount } from '@helium/helium-react-hooks' import { usePublicKey } from '@hooks/usePublicKey' import { AccountLayout } from '@solana/spl-token' import { useEffect } from 'react' -import { useSolana } from '../solana/SolanaProvider' -import { useAccountStorage } from '../storage/AccountStorageProvider' +import { useSolana } from '@features/solana/SolanaProvider' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' import { balancesSlice } from '../store/slices/balancesSlice' import { useAppDispatch } from '../store/store' diff --git a/src/utils/StoreSolBalance.ts b/src/utils/StoreSolBalance.ts index 92cf74464..44aad4af7 100644 --- a/src/utils/StoreSolBalance.ts +++ b/src/utils/StoreSolBalance.ts @@ -1,7 +1,7 @@ import { useSolOwnedAmount } from '@helium/helium-react-hooks' import { usePublicKey } from '@hooks/usePublicKey' import { useEffect } from 'react' -import { useSolana } from '../solana/SolanaProvider' +import { useSolana } from '@features/solana/SolanaProvider' import { balancesSlice } from '../store/slices/balancesSlice' import { useAppDispatch } from '../store/store' diff --git a/src/utils/StoreTokenBalance.ts b/src/utils/StoreTokenBalance.ts index 25d29f74d..399aabf2c 100644 --- a/src/utils/StoreTokenBalance.ts +++ b/src/utils/StoreTokenBalance.ts @@ -2,8 +2,8 @@ import { useTokenAccount } from '@helium/helium-react-hooks' import { AccountLayout } from '@solana/spl-token' import { PublicKey } from '@solana/web3.js' import { useEffect } from 'react' -import { useSolana } from '../solana/SolanaProvider' -import { useAccountStorage } from '../storage/AccountStorageProvider' +import { useSolana } from '@features/solana/SolanaProvider' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' import { balancesSlice } from '../store/slices/balancesSlice' import { useAppDispatch } from '../store/store' diff --git a/src/constants/urls.ts b/src/utils/constants/urls.ts similarity index 95% rename from src/constants/urls.ts rename to src/utils/constants/urls.ts index dc32309c9..82f8fe92e 100644 --- a/src/constants/urls.ts +++ b/src/utils/constants/urls.ts @@ -1,5 +1,5 @@ import { useCallback } from 'react' -import { useSolana } from '../solana/SolanaProvider' +import { useSolana } from '@features/solana/SolanaProvider' export const EXPLORER_MAINNET_BASE_URL = 'https://explorer.helium.com' export const EXPLORER_TESTNET_BASE_URL = 'https://testnet-explorer.helium.com/' diff --git a/src/constants/wordlists/english.json b/src/utils/constants/wordlists/english.json similarity index 100% rename from src/constants/wordlists/english.json rename to src/utils/constants/wordlists/english.json diff --git a/src/utils/i18n.tsx b/src/utils/i18n.tsx index 5f8ae1aa8..f7a48db38 100644 --- a/src/utils/i18n.tsx +++ b/src/utils/i18n.tsx @@ -4,7 +4,7 @@ import * as RNLocalize from 'react-native-localize' import { useCallback, useState } from 'react' import AsyncStorage from '@react-native-async-storage/async-storage' import { useAsync } from 'react-async-hook' -import en from '../locales/en' +import en from '@config/locales/en' const locales = RNLocalize.getLocales() diff --git a/src/utils/linking.ts b/src/utils/linking.ts index 2b4a59828..5b6586001 100644 --- a/src/utils/linking.ts +++ b/src/utils/linking.ts @@ -5,10 +5,10 @@ import BN from 'bn.js' import * as Linking from 'expo-linking' import qs from 'qs' import queryString from 'query-string' -import { BurnRouteParam } from '@services/WalletService/pages/WalletPage/WalletPageNavigator' -import { PaymentRouteParam } from '@services/WalletService' -import { RootStackParamList } from '../navigation/rootTypes' -import { useAccountStorage } from '../storage/AccountStorageProvider' +import { BurnRouteParam } from '@services/WalletService/pages/WalletPage' +import { PaymentRouteParam } from 'src/app/services/WalletService' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' +import { RootStackParamList } from '../app/rootTypes' import { solAddressIsValid } from './accountUtils' export const APP_LINK_SCHEME = Linking.createURL('') diff --git a/src/utils/makeApiToken.ts b/src/utils/makeApiToken.ts index 60656c88a..d7358d801 100644 --- a/src/utils/makeApiToken.ts +++ b/src/utils/makeApiToken.ts @@ -1,4 +1,4 @@ -import { getKeypair } from '../storage/secureStorage' +import { getKeypair } from '@config/storage/secureStorage' const makeSignature = async (token: { address: string; time: number }) => { const stringifiedToken = JSON.stringify(token) diff --git a/src/utils/solanaUtils.ts b/src/utils/solanaUtils.ts index 5f62ac59d..88cb94a30 100644 --- a/src/utils/solanaUtils.ts +++ b/src/utils/solanaUtils.ts @@ -117,7 +117,7 @@ import { token, walletAdapterIdentity, } from '@metaplex-foundation/js' -import { getSessionKey } from '../storage/secureStorage' +import { getSessionKey } from '@config/storage/secureStorage' import { Activity, Payment } from '../types/activity' import { Collectable, diff --git a/src/utils/useBalanceHistory.tsx b/src/utils/useBalanceHistory.tsx index 029708902..8887c3f0d 100644 --- a/src/utils/useBalanceHistory.tsx +++ b/src/utils/useBalanceHistory.tsx @@ -1,12 +1,12 @@ import { useEffect, useRef } from 'react' import { AppState } from 'react-native' import { useSelector } from 'react-redux' -import { useAppStorage } from '../storage/AppStorageProvider' +import { useAppStorage } from '@config/storage/AppStorageProvider' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' +import { useSolana } from '@features/solana/SolanaProvider' import { RootState } from '../store/rootReducer' import { useAppDispatch } from '../store/store' import { readBalanceHistory } from '../store/slices/balancesSlice' -import { useAccountStorage } from '../storage/AccountStorageProvider' -import { useSolana } from '../solana/SolanaProvider' export const useBalanceHistory = () => { const { currentAccount } = useAccountStorage() diff --git a/src/utils/usePollTokenPrices.tsx b/src/utils/usePollTokenPrices.tsx index bb0a099c2..8e56e3200 100644 --- a/src/utils/usePollTokenPrices.tsx +++ b/src/utils/usePollTokenPrices.tsx @@ -1,6 +1,6 @@ import { useCallback, useEffect } from 'react' import { useSelector } from 'react-redux' -import { useAppStorage } from '../storage/AppStorageProvider' +import { useAppStorage } from '@config/storage/AppStorageProvider' import { RootState } from '../store/rootReducer' import { useAppDispatch } from '../store/store' import { readTokenPrices } from '../store/slices/balancesSlice' diff --git a/src/utils/walletApiV2.ts b/src/utils/walletApiV2.ts index 42423a534..f5b631c86 100644 --- a/src/utils/walletApiV2.ts +++ b/src/utils/walletApiV2.ts @@ -2,10 +2,10 @@ import axios from 'axios' import Config from 'react-native-config' import { Cluster } from '@solana/web3.js' import { heliumAddressFromSolAddress } from '@helium/spl-utils' -import { getSecureItem } from '../storage/secureStorage' +import { getSecureItem } from '@config/storage/secureStorage' +import { CSAccount } from '@config/storage/cloudStorage' import { AccountBalance, Prices } from '../types/balance' import makeApiToken from './makeApiToken' -import { CSAccount } from '../storage/cloudStorage' export type Notification = { title: string diff --git a/tsconfig.json b/tsconfig.json index ce20e39d7..98139a039 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -42,16 +42,15 @@ "@helium/crypto": ["./node_modules/@helium/crypto-react-native"], "@assets": ["./src/assets"], "@components/*": ["./src/components/*"], - "@constants/*": ["./src/constants/*"], "@components": ["src/components/index"], "@hooks/*": ["./src/hooks/*"], - "@theme/*": ["./src/theme/*"], "@utils/*": ["./src/utils/*"], - "@storage/*": ["./src/storage/*"], + "@config/*": ["./src/config/*"], "@types/*": ["./src/types/*"], "@features/*": ["./src/features/*"], - "@services/*": ["./src/services/*"], - "@store/*": ["./src/store/*"] + "@services/*": ["src/app/services/*"], + "@store/*": ["./src/store/*"], + "@app/*": ["./src/app/*"] } }, "exclude": [