diff --git a/.github/workflows/android-macos-integration-test.yaml b/.github/workflows/android-macos-integration-test.yaml index ec4a8702e..c5589b43a 100644 --- a/.github/workflows/android-macos-integration-test.yaml +++ b/.github/workflows/android-macos-integration-test.yaml @@ -152,9 +152,9 @@ jobs: run: echo "${ANDROID_SDK_ROOT}/emulator" >> $GITHUB_PATH - name: Gradle cache - uses: gradle/actions/setup-gradle@v3 + uses: gradle/actions/setup-gradle@v4 with: - gradle-version: 8.2 + gradle-version: 8.8 build-root-directory: ./android cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/dev' }} diff --git a/.github/workflows/android-ubuntu-e2e-test-ci.yaml b/.github/workflows/android-ubuntu-e2e-test-ci.yaml index 69831c52a..62a9b0d14 100644 --- a/.github/workflows/android-ubuntu-e2e-test-ci.yaml +++ b/.github/workflows/android-ubuntu-e2e-test-ci.yaml @@ -225,7 +225,7 @@ jobs: - name: Gradle cache uses: gradle/actions/setup-gradle@v4 with: - gradle-version: 8.2 + gradle-version: 8.8 cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/dev'}} - name: Native rust cache diff --git a/.github/workflows/android-ubuntu-integration-test-ci.yaml b/.github/workflows/android-ubuntu-integration-test-ci.yaml index ac6b77661..75a892950 100644 --- a/.github/workflows/android-ubuntu-integration-test-ci.yaml +++ b/.github/workflows/android-ubuntu-integration-test-ci.yaml @@ -206,7 +206,7 @@ jobs: - name: Gradle cache uses: gradle/actions/setup-gradle@v4 with: - gradle-version: 8.2 + gradle-version: 8.8 cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/dev'}} - name: Native rust cache diff --git a/.github/workflows/old/android-e2e-test-actions.yaml b/.github/workflows/old/android-e2e-test-actions.yaml index 3fccba572..4527e0deb 100644 --- a/.github/workflows/old/android-e2e-test-actions.yaml +++ b/.github/workflows/old/android-e2e-test-actions.yaml @@ -53,7 +53,7 @@ jobs: - name: Gradle cache uses: gradle/actions/setup-gradle@v4 with: - gradle-version: 8.2 + gradle-version: 8.8 cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/dev'}} - name: Native rust cache diff --git a/.github/workflows/old/android-e2e-test-script.yaml b/.github/workflows/old/android-e2e-test-script.yaml index ca48f6621..ba61526cc 100644 --- a/.github/workflows/old/android-e2e-test-script.yaml +++ b/.github/workflows/old/android-e2e-test-script.yaml @@ -205,7 +205,7 @@ jobs: - name: Gradle cache uses: gradle/actions/setup-gradle@v4 with: - gradle-version: 8.2 + gradle-version: 8.8 cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/dev' }} - name: AVD cache diff --git a/.github/workflows/old/android-ubuntu-integration-test.yaml b/.github/workflows/old/android-ubuntu-integration-test.yaml index ea7a149fd..938d226a5 100644 --- a/.github/workflows/old/android-ubuntu-integration-test.yaml +++ b/.github/workflows/old/android-ubuntu-integration-test.yaml @@ -183,7 +183,7 @@ jobs: - name: Gradle cache uses: gradle/actions/setup-gradle@v4 with: - gradle-version: 8.2 + gradle-version: 8.8 cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/dev' }} - name: AVD cache diff --git a/.gitignore b/.gitignore index bf750aa20..d8e62b665 100644 --- a/.gitignore +++ b/.gitignore @@ -91,4 +91,6 @@ buck-out/ /**/GoogleService-Info.plist # Binaries -/rust/test_binaries/bins/ \ No newline at end of file +/rust/test_binaries/bins/ + +.cxx \ No newline at end of file diff --git a/App.tsx b/App.tsx index 2830d0fa6..1f28ac346 100644 --- a/App.tsx +++ b/App.tsx @@ -1,7 +1,7 @@ /* eslint-disable react-native/no-inline-styles */ import React, { useState } from 'react'; -import { SafeAreaView } from 'react-native'; -import { NavigationContainer } from '@react-navigation/native'; +import { SafeAreaProvider, SafeAreaView } from 'react-native-safe-area-context'; +import { DefaultTheme, NavigationContainer } from '@react-navigation/native'; import { createStackNavigator } from '@react-navigation/stack'; import { LoadedApp } from './app/LoadedApp'; @@ -42,6 +42,7 @@ const basicPalette: string[] = [ ]; const advancedTheme: ThemeType = { + ...DefaultTheme, dark: true, colors: { background: advancePalette[0], @@ -61,6 +62,7 @@ const advancedTheme: ThemeType = { }; const basicTheme: ThemeType = { + ...DefaultTheme, dark: true, colors: { background: basicPalette[0], @@ -90,25 +92,25 @@ const App: React.FunctionComponent = () => { //console.log('render App - 1'); return ( - - - - - {props => } - - - {props => } - - - - + + + + + + {props => } + + + {props => } + + + + + ); }; diff --git a/Gemfile b/Gemfile index d60b25cc7..4e30944f9 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,8 @@ source 'https://rubygems.org' # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version ruby ">= 2.6.10" -# Cocoapods 1.15 introduced a bug which break the build. We will remove the upper -# bound in the template on Cocoapods with next React Native release. -gem 'cocoapods', '>= 1.13', '< 1.15' -gem 'activesupport', '>= 6.1.7.5', '< 7.1.0' \ No newline at end of file +# Exclude problematic versions of cocoapods and activesupport that causes build failures. +gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1' +gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0' +gem 'xcodeproj', '< 1.26.0' +gem 'concurrent-ruby', '< 1.3.4' \ No newline at end of file diff --git a/__mocks__/dataMocks/mockNavigation.ts b/__mocks__/dataMocks/mockNavigation.ts index 919f90bba..2264fa1e3 100644 --- a/__mocks__/dataMocks/mockNavigation.ts +++ b/__mocks__/dataMocks/mockNavigation.ts @@ -19,5 +19,9 @@ export const mockNavigation: StackScreenProps['navigation'] = { push: jest.fn(), pop: jest.fn(), popToTop: jest.fn(), + popTo: jest.fn(), + preload: jest.fn(), + setStateForNextRouteNamesChange: jest.fn(), + navigateDeprecated: jest.fn(), // Agrega cualquier otra propiedad o método necesario para tu caso }; diff --git a/__mocks__/dataMocks/mockNetInfo.ts b/__mocks__/dataMocks/mockNetInfo.ts index 7e76a2d25..0e4bfd3fe 100644 --- a/__mocks__/dataMocks/mockNetInfo.ts +++ b/__mocks__/dataMocks/mockNetInfo.ts @@ -1,4 +1,4 @@ -import { NetInfoStateType } from '@react-native-community/netinfo'; +import { NetInfoStateType } from '@react-native-community/netinfo/src/index'; import { NetInfoType } from '../../app/AppState'; export const mockNetInfo: NetInfoType = { diff --git a/__mocks__/dataMocks/mockTheme.ts b/__mocks__/dataMocks/mockTheme.ts index 175f2e618..1bf2f84b5 100644 --- a/__mocks__/dataMocks/mockTheme.ts +++ b/__mocks__/dataMocks/mockTheme.ts @@ -1,6 +1,8 @@ +import { DefaultTheme } from '@react-navigation/native'; import { ThemeType } from '../../app/types'; export const mockTheme: ThemeType = { + ...DefaultTheme, dark: true, colors: { background: '#011401', //'#010101', diff --git a/__mocks__/react-native-gifted-charts.js b/__mocks__/react-native-gifted-charts.js new file mode 100644 index 000000000..e69de29bb diff --git a/__tests__/About.snapshot.tsx b/__tests__/About.snapshot.tsx index 6f60b4656..f33491b98 100644 --- a/__tests__/About.snapshot.tsx +++ b/__tests__/About.snapshot.tsx @@ -11,7 +11,13 @@ import { ContextAppLoadedProvider, defaultAppContextLoaded } from '../app/contex import { mockInfo } from '../__mocks__/dataMocks/mockInfo'; import { mockTotalBalance } from '../__mocks__/dataMocks/mockTotalBalance'; import { mockTranslate } from '../__mocks__/dataMocks/mockTranslate'; +import { mockTheme } from '../__mocks__/dataMocks/mockTheme'; +jest.mock('react-native-safe-area-context', () => ({ + SafeAreaProvider: ({ children }: any) => children, + SafeAreaView: ({ children }: any) => children, + useSafeAreaInsets: () => ({ top: 0, left: 0, right: 0, bottom: 0 }), +})); jest.useFakeTimers(); jest.mock('@fortawesome/react-native-fontawesome', () => ({ FontAwesomeIcon: '', @@ -25,7 +31,7 @@ jest.mock('react-native-localize', () => ({ }, })); jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper'); -jest.mock('@react-native-community/netinfo', () => { +jest.mock('@react-native-community/netinfo/src/index', () => { const RN = jest.requireActual('react-native'); RN.NativeModules.RNCNetInfo = { @@ -47,6 +53,10 @@ jest.mock('@react-native-clipboard/clipboard', () => ({ getString: jest.fn(() => Promise.resolve('mocked clipboard content')), setString: jest.fn(), })); +jest.mock('@react-navigation/native', () => ({ + ...jest.requireActual('@react-navigation/native'), + useTheme: () => (mockTheme), +})); // test suite describe('Component About - test', () => { diff --git a/__tests__/AddressBook.AbDetail.snapshot.tsx b/__tests__/AddressBook.AbDetail.snapshot.tsx index aaf7e506b..a99b4e690 100644 --- a/__tests__/AddressBook.AbDetail.snapshot.tsx +++ b/__tests__/AddressBook.AbDetail.snapshot.tsx @@ -13,6 +13,11 @@ import { mockTranslate } from '../__mocks__/dataMocks/mockTranslate'; import { mockAddressBook } from '../__mocks__/dataMocks/mockAddressBook'; import { mockTheme } from '../__mocks__/dataMocks/mockTheme'; +jest.mock('react-native-safe-area-context', () => ({ + SafeAreaProvider: ({ children }: any) => children, + SafeAreaView: ({ children }: any) => children, + useSafeAreaInsets: () => ({ top: 0, left: 0, right: 0, bottom: 0 }), +})); jest.useFakeTimers(); jest.mock('@fortawesome/react-native-fontawesome', () => ({ FontAwesomeIcon: '', @@ -26,7 +31,7 @@ jest.mock('react-native-localize', () => ({ }, })); jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper'); -jest.mock('@react-native-community/netinfo', () => { +jest.mock('@react-native-community/netinfo/src/index', () => { const RN = jest.requireActual('react-native'); RN.NativeModules.RNCNetInfo = { @@ -45,6 +50,7 @@ jest.mock('react-native', () => { return RN; }); jest.mock('@react-navigation/native', () => ({ + ...jest.requireActual('@react-navigation/native'), useScrollToTop: jest.fn(), useTheme: () => mockTheme, })); diff --git a/__tests__/AddressBook.snapshot.tsx b/__tests__/AddressBook.snapshot.tsx index 8c0287bbe..10608444b 100644 --- a/__tests__/AddressBook.snapshot.tsx +++ b/__tests__/AddressBook.snapshot.tsx @@ -12,6 +12,11 @@ import { mockAddressBook } from '../__mocks__/dataMocks/mockAddressBook'; import { mockTranslate } from '../__mocks__/dataMocks/mockTranslate'; import { mockTheme } from '../__mocks__/dataMocks/mockTheme'; +jest.mock('react-native-safe-area-context', () => ({ + SafeAreaProvider: ({ children }: any) => children, + SafeAreaView: ({ children }: any) => children, + useSafeAreaInsets: () => ({ top: 0, left: 0, right: 0, bottom: 0 }), +})); jest.useFakeTimers(); jest.mock('@fortawesome/react-native-fontawesome', () => ({ FontAwesomeIcon: '', @@ -25,7 +30,7 @@ jest.mock('react-native-localize', () => ({ }, })); jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper'); -jest.mock('@react-native-community/netinfo', () => { +jest.mock('@react-native-community/netinfo/src/index', () => { const RN = jest.requireActual('react-native'); RN.NativeModules.RNCNetInfo = { @@ -44,6 +49,7 @@ jest.mock('react-native', () => { return RN; }); jest.mock('@react-navigation/native', () => ({ + ...jest.requireActual('@react-navigation/native'), useScrollToTop: jest.fn(), useTheme: () => mockTheme, })); diff --git a/__tests__/App.snapshot.tsx b/__tests__/App.snapshot.tsx index 00c2f0c1b..0faf321a5 100644 --- a/__tests__/App.snapshot.tsx +++ b/__tests__/App.snapshot.tsx @@ -8,6 +8,11 @@ import React from 'react'; import { render } from '@testing-library/react-native'; import App from '../App'; +jest.mock('react-native-safe-area-context', () => ({ + SafeAreaProvider: ({ children }: any) => children, + SafeAreaView: ({ children }: any) => children, + useSafeAreaInsets: () => ({ top: 0, left: 0, right: 0, bottom: 0 }), +})); jest.useFakeTimers(); jest.mock('@fortawesome/react-native-fontawesome', () => ({ FontAwesomeIcon: '', @@ -26,7 +31,7 @@ jest.mock('react-native-tab-view', () => ({ })); jest.mock('react-native-option-menu', () => ''); jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper'); -jest.mock('@react-native-community/netinfo', () => { +jest.mock('@react-native-community/netinfo/src/index', () => { const RN = jest.requireActual('react-native'); RN.NativeModules.RNCNetInfo = { @@ -52,6 +57,37 @@ jest.mock('react-native-device-info', () => ({ getManufacturer: jest.fn(() => 'Mocked Manufacturer'), getModel: jest.fn(() => 'Mocked Model'), })); +// Jest setup file or in your test file +jest.mock('react-native-gesture-handler/ReanimatedDrawerLayout', () => { + const R = require('react'); + + const ReanimatedDrawerLayout = R.forwardRef((props: any, ref: any) => { + const { renderNavigationView, children } = props; + + return ( +
+
+ {renderNavigationView && renderNavigationView()} +
+
{children}
+
+ ); + }); + + // Export mock DrawerType if needed + const DrawerType = { + FRONT: 'front', + BACK: 'back', + SLIDE: 'slide', + }; + + return { + __esModule: true, + default: ReanimatedDrawerLayout, + DrawerType, + }; +}); + jest.mock('react-native-gesture-handler', () => { const RN = jest.requireActual('react-native'); @@ -97,6 +133,9 @@ jest.mock('@react-native-clipboard/clipboard', () => ({ getString: jest.fn(() => Promise.resolve('mocked clipboard content')), setString: jest.fn(), })); +jest.mock('@react-navigation/elements', () => ({ + PlatformPressable: jest.fn().mockImplementation(({ children }) => children), +})); // test suite describe('Component App - test', () => { diff --git a/__tests__/Button.snapshot.tsx b/__tests__/Button.snapshot.tsx index a2bdcd4fe..8cd39a80d 100644 --- a/__tests__/Button.snapshot.tsx +++ b/__tests__/Button.snapshot.tsx @@ -8,6 +8,12 @@ import React from 'react'; import { render } from '@testing-library/react-native'; import Button from '../components/Components/Button'; import { ButtonTypeEnum } from '../app/AppState'; +import { mockTheme } from '../__mocks__/dataMocks/mockTheme'; + +jest.mock('@react-navigation/native', () => ({ + ...jest.requireActual('@react-navigation/native'), + useTheme: () => (mockTheme), +})); // test suite describe('Component Button - test', () => { diff --git a/__tests__/ChainTypeToggle.snapshot.tsx b/__tests__/ChainTypeToggle.snapshot.tsx index 8c7e64e50..a13e54eae 100644 --- a/__tests__/ChainTypeToggle.snapshot.tsx +++ b/__tests__/ChainTypeToggle.snapshot.tsx @@ -9,11 +9,16 @@ import { render } from '@testing-library/react-native'; import ChainTypeToggle from '../components/Components/ChainTypeToggle'; import { ChainNameEnum } from '../app/AppState'; import { mockTranslate } from '../__mocks__/dataMocks/mockTranslate'; +import { mockTheme } from '../__mocks__/dataMocks/mockTheme'; jest.useFakeTimers(); jest.mock('@fortawesome/react-native-fontawesome', () => ({ FontAwesomeIcon: '', })); +jest.mock('@react-navigation/native', () => ({ + ...jest.requireActual('@react-navigation/native'), + useTheme: () => (mockTheme), +})); // test suite describe('Component ChainTypeToggle - test', () => { diff --git a/__tests__/CircularProgress.snapshot.tsx b/__tests__/CircularProgress.snapshot.tsx index 2fbd5b4bb..0181b32e9 100644 --- a/__tests__/CircularProgress.snapshot.tsx +++ b/__tests__/CircularProgress.snapshot.tsx @@ -7,6 +7,12 @@ import React from 'react'; import { render } from '@testing-library/react-native'; import CircularProgress from '../components/Components/CircularProgress'; +import { mockTheme } from '../__mocks__/dataMocks/mockTheme'; + +jest.mock('@react-navigation/native', () => ({ + ...jest.requireActual('@react-navigation/native'), + useTheme: () => (mockTheme), +})); // test suite describe('Component CircularProgress - test', () => { diff --git a/__tests__/Components.snapshot.tsx b/__tests__/Components.snapshot.tsx index d90996847..96a80e0ee 100644 --- a/__tests__/Components.snapshot.tsx +++ b/__tests__/Components.snapshot.tsx @@ -13,6 +13,7 @@ import FadeText from '../components/Components/FadeText'; import ErrorText from '../components/Components/ErrorText'; import RegText from '../components/Components/RegText'; import { CurrencyEnum, CurrencyNameEnum } from '../app/AppState'; +import { mockTheme } from '../__mocks__/dataMocks/mockTheme'; jest.mock('react-native-localize', () => ({ getNumberFormatSettings: () => { @@ -23,6 +24,10 @@ jest.mock('react-native-localize', () => ({ }, })); jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper'); +jest.mock('@react-navigation/native', () => ({ + ...jest.requireActual('@react-navigation/native'), + useTheme: () => (mockTheme), +})); // test suite describe('Component Components - test', () => { diff --git a/__tests__/Components.unit.tsx b/__tests__/Components.unit.tsx index 6b019d252..d3f2e8242 100644 --- a/__tests__/Components.unit.tsx +++ b/__tests__/Components.unit.tsx @@ -13,6 +13,7 @@ import FadeText from '../components/Components/FadeText'; import ErrorText from '../components/Components/ErrorText'; import RegText from '../components/Components/RegText'; import { CurrencyEnum, CurrencyNameEnum } from '../app/AppState'; +import { mockTheme } from '../__mocks__/dataMocks/mockTheme'; jest.mock('react-native-localize', () => ({ getNumberFormatSettings: () => { @@ -23,6 +24,10 @@ jest.mock('react-native-localize', () => ({ }, })); jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper'); +jest.mock('@react-navigation/native', () => ({ + ...jest.requireActual('@react-navigation/native'), + useTheme: () => (mockTheme), +})); // test suite describe('Component Components - test', () => { diff --git a/__tests__/DetailLine.snapshot.tsx b/__tests__/DetailLine.snapshot.tsx index 1aa1e8934..209a785be 100644 --- a/__tests__/DetailLine.snapshot.tsx +++ b/__tests__/DetailLine.snapshot.tsx @@ -8,11 +8,16 @@ import React from 'react'; import { render } from '@testing-library/react-native'; import DetailLine from '../components/Components/DetailLine'; import { View } from 'react-native'; +import { mockTheme } from '../__mocks__/dataMocks/mockTheme'; jest.mock('@react-native-clipboard/clipboard', () => ({ getString: jest.fn(() => Promise.resolve('mocked clipboard content')), setString: jest.fn(), })); +jest.mock('@react-navigation/native', () => ({ + ...jest.requireActual('@react-navigation/native'), + useTheme: () => (mockTheme), +})); // test suite describe('Component DetailLine - test', () => { diff --git a/__tests__/Header.snapshot.tsx b/__tests__/Header.snapshot.tsx index 28b9f29c1..039212452 100644 --- a/__tests__/Header.snapshot.tsx +++ b/__tests__/Header.snapshot.tsx @@ -11,7 +11,13 @@ import { ContextAppLoadedProvider, defaultAppContextLoaded } from '../app/contex import { mockTranslate } from '../__mocks__/dataMocks/mockTranslate'; import { mockInfo } from '../__mocks__/dataMocks/mockInfo'; import { mockTotalBalance } from '../__mocks__/dataMocks/mockTotalBalance'; +import { mockTheme } from '../__mocks__/dataMocks/mockTheme'; +jest.mock('react-native-safe-area-context', () => ({ + SafeAreaProvider: ({ children }: any) => children, + SafeAreaView: ({ children }: any) => children, + useSafeAreaInsets: () => ({ top: 0, left: 0, right: 0, bottom: 0 }), +})); jest.useFakeTimers(); jest.mock('@fortawesome/react-native-fontawesome', () => ({ FontAwesomeIcon: '', @@ -25,7 +31,7 @@ jest.mock('react-native-localize', () => ({ }, })); jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper'); -jest.mock('@react-native-community/netinfo', () => { +jest.mock('@react-native-community/netinfo/src/index', () => { const RN = jest.requireActual('react-native'); RN.NativeModules.RNCNetInfo = { @@ -43,6 +49,10 @@ jest.mock('react-native', () => { return RN; }); +jest.mock('@react-navigation/native', () => ({ + ...jest.requireActual('@react-navigation/native'), + useTheme: () => (mockTheme), +})); // test suite describe('Component Header - test', () => { diff --git a/__tests__/History.ValueTransferDetail.unit.tsx b/__tests__/History.ValueTransferDetail.unit.tsx index a4b1f1705..ad5efadc7 100644 --- a/__tests__/History.ValueTransferDetail.unit.tsx +++ b/__tests__/History.ValueTransferDetail.unit.tsx @@ -12,7 +12,13 @@ import { mockTranslate } from '../__mocks__/dataMocks/mockTranslate'; import { mockInfo } from '../__mocks__/dataMocks/mockInfo'; import { mockTotalBalance } from '../__mocks__/dataMocks/mockTotalBalance'; import { mockValueTransfers } from '../__mocks__/dataMocks/mockValueTransfers'; +import { mockTheme } from '../__mocks__/dataMocks/mockTheme'; +jest.mock('react-native-safe-area-context', () => ({ + SafeAreaProvider: ({ children }: any) => children, + SafeAreaView: ({ children }: any) => children, + useSafeAreaInsets: () => ({ top: 0, left: 0, right: 0, bottom: 0 }), +})); jest.useFakeTimers(); jest.mock('@fortawesome/react-native-fontawesome', () => ({ FontAwesomeIcon: '', @@ -64,7 +70,7 @@ jest.mock('react-native-gesture-handler', () => { TouchableOpacity: View, }; }); -jest.mock('@react-native-community/netinfo', () => { +jest.mock('@react-native-community/netinfo/src/index', () => { const RN = jest.requireActual('react-native'); RN.NativeModules.RNCNetInfo = { @@ -86,6 +92,10 @@ jest.mock('@react-native-clipboard/clipboard', () => ({ getString: jest.fn(() => Promise.resolve('mocked clipboard content')), setString: jest.fn(), })); +jest.mock('@react-navigation/native', () => ({ + ...jest.requireActual('@react-navigation/native'), + useTheme: () => (mockTheme), +})); // test suite describe('Component History ValueTransferDetail - test', () => { diff --git a/__tests__/History.snapshot.tsx b/__tests__/History.snapshot.tsx index 3f09fc15b..72c984ff1 100644 --- a/__tests__/History.snapshot.tsx +++ b/__tests__/History.snapshot.tsx @@ -16,6 +16,11 @@ import { mockTranslate } from '../__mocks__/dataMocks/mockTranslate'; import { mockAddresses } from '../__mocks__/dataMocks/mockAddresses'; import { mockTheme } from '../__mocks__/dataMocks/mockTheme'; +jest.mock('react-native-safe-area-context', () => ({ + SafeAreaProvider: ({ children }: any) => children, + SafeAreaView: ({ children }: any) => children, + useSafeAreaInsets: () => ({ top: 0, left: 0, right: 0, bottom: 0 }), +})); jest.useFakeTimers(); jest.mock('@fortawesome/react-native-fontawesome', () => ({ FontAwesomeIcon: '', @@ -78,17 +83,7 @@ jest.mock('react-native-gesture-handler', () => { RNGestureHandlerModule: RN, }; }); -jest.mock('@react-native-community/netinfo', () => { - const RN = jest.requireActual('react-native'); - - RN.NativeModules.RNCNetInfo = { - execute: jest.fn(() => '{}'), - }; - - return RN; -}); - -jest.mock('@react-native-community/netinfo', () => { +jest.mock('@react-native-community/netinfo/src/index', () => { const RN = jest.requireActual('react-native'); RN.NativeModules.RNCNetInfo = { @@ -107,6 +102,7 @@ jest.mock('react-native', () => { return RN; }); jest.mock('@react-navigation/native', () => ({ + ...jest.requireActual('@react-navigation/native'), useScrollToTop: jest.fn(), useTheme: () => mockTheme, })); diff --git a/__tests__/ImportUfvk.snapshot.tsx b/__tests__/ImportUfvk.snapshot.tsx index b96cb45e7..65adfd78a 100644 --- a/__tests__/ImportUfvk.snapshot.tsx +++ b/__tests__/ImportUfvk.snapshot.tsx @@ -11,7 +11,13 @@ import { ContextAppLoadedProvider, defaultAppContextLoaded } from '../app/contex import { mockTranslate } from '../__mocks__/dataMocks/mockTranslate'; import { mockInfo } from '../__mocks__/dataMocks/mockInfo'; import { mockTotalBalance } from '../__mocks__/dataMocks/mockTotalBalance'; +import { mockTheme } from '../__mocks__/dataMocks/mockTheme'; +jest.mock('react-native-safe-area-context', () => ({ + SafeAreaProvider: ({ children }: any) => children, + SafeAreaView: ({ children }: any) => children, + useSafeAreaInsets: () => ({ top: 0, left: 0, right: 0, bottom: 0 }), +})); jest.useFakeTimers(); jest.mock('@fortawesome/react-native-fontawesome', () => ({ FontAwesomeIcon: '', @@ -25,7 +31,7 @@ jest.mock('react-native-localize', () => ({ }, })); jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper'); -jest.mock('@react-native-community/netinfo', () => { +jest.mock('@react-native-community/netinfo/src/index', () => { const RN = jest.requireActual('react-native'); RN.NativeModules.RNCNetInfo = { @@ -48,6 +54,10 @@ jest.mock('@react-native-clipboard/clipboard', () => ({ getString: jest.fn(() => Promise.resolve('mocked clipboard content')), setString: jest.fn(), })); +jest.mock('@react-navigation/native', () => ({ + ...jest.requireActual('@react-navigation/native'), + useTheme: () => (mockTheme), +})); // test suite describe('Component ImportUfvk - test', () => { diff --git a/__tests__/Info.es.unit.tsx b/__tests__/Info.es.unit.tsx index 9ced20e0f..cb5de6ed0 100644 --- a/__tests__/Info.es.unit.tsx +++ b/__tests__/Info.es.unit.tsx @@ -11,7 +11,13 @@ import { ContextAppLoadedProvider, defaultAppContextLoaded } from '../app/contex import { CurrencyEnum } from '../app/AppState'; import { mockInfo } from '../__mocks__/dataMocks/mockInfo'; import { mockZecPrice } from '../__mocks__/dataMocks/mockZecPrice'; +import { mockTheme } from '../__mocks__/dataMocks/mockTheme'; +jest.mock('react-native-safe-area-context', () => ({ + SafeAreaProvider: ({ children }: any) => children, + SafeAreaView: ({ children }: any) => children, + useSafeAreaInsets: () => ({ top: 0, left: 0, right: 0, bottom: 0 }), +})); jest.useFakeTimers(); jest.mock('@fortawesome/react-native-fontawesome', () => ({ FontAwesomeIcon: '', @@ -25,7 +31,7 @@ jest.mock('react-native-localize', () => ({ }, })); jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper'); -jest.mock('@react-native-community/netinfo', () => { +jest.mock('@react-native-community/netinfo/src/index', () => { const RN = jest.requireActual('react-native'); RN.NativeModules.RNCNetInfo = { @@ -47,6 +53,10 @@ jest.mock('@react-native-clipboard/clipboard', () => ({ getString: jest.fn(() => Promise.resolve('mocked clipboard content')), setString: jest.fn(), })); +jest.mock('@react-navigation/native', () => ({ + ...jest.requireActual('@react-navigation/native'), + useTheme: () => (mockTheme), +})); // test suite describe('Component Info - test', () => { diff --git a/__tests__/Info.snapshot.tsx b/__tests__/Info.snapshot.tsx index 404bcd8bc..7566ac1b6 100644 --- a/__tests__/Info.snapshot.tsx +++ b/__tests__/Info.snapshot.tsx @@ -12,7 +12,13 @@ import { mockInfo } from '../__mocks__/dataMocks/mockInfo'; import { mockTranslate } from '../__mocks__/dataMocks/mockTranslate'; import { mockTotalBalance } from '../__mocks__/dataMocks/mockTotalBalance'; import { mockZecPrice } from '../__mocks__/dataMocks/mockZecPrice'; +import { mockTheme } from '../__mocks__/dataMocks/mockTheme'; +jest.mock('react-native-safe-area-context', () => ({ + SafeAreaProvider: ({ children }: any) => children, + SafeAreaView: ({ children }: any) => children, + useSafeAreaInsets: () => ({ top: 0, left: 0, right: 0, bottom: 0 }), +})); jest.useFakeTimers(); jest.mock('@fortawesome/react-native-fontawesome', () => ({ FontAwesomeIcon: '', @@ -26,7 +32,7 @@ jest.mock('react-native-localize', () => ({ }, })); jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper'); -jest.mock('@react-native-community/netinfo', () => { +jest.mock('@react-native-community/netinfo/src/index', () => { const RN = jest.requireActual('react-native'); RN.NativeModules.RNCNetInfo = { @@ -48,6 +54,10 @@ jest.mock('@react-native-clipboard/clipboard', () => ({ getString: jest.fn(() => Promise.resolve('mocked clipboard content')), setString: jest.fn(), })); +jest.mock('@react-navigation/native', () => ({ + ...jest.requireActual('@react-navigation/native'), + useTheme: () => (mockTheme), +})); // test suite describe('Component Info - test', () => { diff --git a/__tests__/Info.us.unit.tsx b/__tests__/Info.us.unit.tsx index cdf30a449..dd3598ed0 100644 --- a/__tests__/Info.us.unit.tsx +++ b/__tests__/Info.us.unit.tsx @@ -11,7 +11,13 @@ import { defaultAppContextLoaded, ContextAppLoadedProvider } from '../app/contex import { CurrencyEnum } from '../app/AppState'; import { mockInfo } from '../__mocks__/dataMocks/mockInfo'; import { mockZecPrice } from '../__mocks__/dataMocks/mockZecPrice'; +import { mockTheme } from '../__mocks__/dataMocks/mockTheme'; +jest.mock('react-native-safe-area-context', () => ({ + SafeAreaProvider: ({ children }: any) => children, + SafeAreaView: ({ children }: any) => children, + useSafeAreaInsets: () => ({ top: 0, left: 0, right: 0, bottom: 0 }), +})); jest.useFakeTimers(); jest.mock('@fortawesome/react-native-fontawesome', () => ({ FontAwesomeIcon: '', @@ -25,7 +31,7 @@ jest.mock('react-native-localize', () => ({ }, })); jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper'); -jest.mock('@react-native-community/netinfo', () => { +jest.mock('@react-native-community/netinfo/src/index', () => { const RN = jest.requireActual('react-native'); RN.NativeModules.RNCNetInfo = { @@ -47,6 +53,10 @@ jest.mock('@react-native-clipboard/clipboard', () => ({ getString: jest.fn(() => Promise.resolve('mocked clipboard content')), setString: jest.fn(), })); +jest.mock('@react-navigation/native', () => ({ + ...jest.requireActual('@react-navigation/native'), + useTheme: () => (mockTheme), +})); // test suite describe('Component Info - test', () => { diff --git a/__tests__/Insight.snapshot.tsx b/__tests__/Insight.snapshot.tsx index 2b6e3243f..2afd90325 100644 --- a/__tests__/Insight.snapshot.tsx +++ b/__tests__/Insight.snapshot.tsx @@ -11,14 +11,20 @@ import { defaultAppContextLoaded, ContextAppLoadedProvider } from '../app/contex import { mockTranslate } from '../__mocks__/dataMocks/mockTranslate'; import { mockInfo } from '../__mocks__/dataMocks/mockInfo'; import { mockTotalBalance } from '../__mocks__/dataMocks/mockTotalBalance'; +import { mockTheme } from '../__mocks__/dataMocks/mockTheme'; +jest.mock('react-native-safe-area-context', () => ({ + SafeAreaProvider: ({ children }: any) => children, + SafeAreaView: ({ children }: any) => children, + useSafeAreaInsets: () => ({ top: 0, left: 0, right: 0, bottom: 0 }), +})); jest.useFakeTimers(); jest.mock('@fortawesome/react-native-fontawesome', () => ({ FontAwesomeIcon: '', })); jest.mock('react-native-svg-charts'); jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper'); -jest.mock('@react-native-community/netinfo', () => { +jest.mock('@react-native-community/netinfo/src/index', () => { const RN = jest.requireActual('react-native'); RN.NativeModules.RNCNetInfo = { @@ -40,6 +46,13 @@ jest.mock('@react-native-clipboard/clipboard', () => ({ getString: jest.fn(() => Promise.resolve('mocked clipboard content')), setString: jest.fn(), })); +jest.mock('react-native-gifted-charts', () => ({ + PieChart: jest.fn(() => null), +})); +jest.mock('@react-navigation/native', () => ({ + ...jest.requireActual('@react-navigation/native'), + useTheme: () => (mockTheme), +})); // test suite describe('Component Insight - test', () => { diff --git a/__tests__/LoadedApp.snapshot.tsx b/__tests__/LoadedApp.snapshot.tsx index 738bd24fc..41f115546 100644 --- a/__tests__/LoadedApp.snapshot.tsx +++ b/__tests__/LoadedApp.snapshot.tsx @@ -30,6 +30,11 @@ jest.mock('i18n-js', () => ({ })), })); +jest.mock('react-native-safe-area-context', () => ({ + SafeAreaProvider: ({ children }: any) => children, + SafeAreaView: ({ children }: any) => children, + useSafeAreaInsets: () => ({ top: 0, left: 0, right: 0, bottom: 0 }), +})); jest.useFakeTimers(); jest.mock('@fortawesome/react-native-fontawesome', () => ({ FontAwesomeIcon: '', @@ -48,7 +53,7 @@ jest.mock('react-native-tab-view', () => ({ })); jest.mock('react-native-option-menu', () => ''); jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper'); -jest.mock('@react-native-community/netinfo', () => { +jest.mock('@react-native-community/netinfo/src/index', () => { return { addEventListener: jest.fn(), fetch: jest.fn().mockImplementation(() => @@ -81,6 +86,37 @@ jest.mock('react-native-device-info', () => ({ getManufacturer: jest.fn(() => 'Mocked Manufacturer'), getModel: jest.fn(() => 'Mocked Model'), })); +// Jest setup file or in your test file +jest.mock('react-native-gesture-handler/ReanimatedDrawerLayout', () => { + const R = require('react'); + + const ReanimatedDrawerLayout = R.forwardRef((props: any, ref: any) => { + const { renderNavigationView, children } = props; + + return ( +
+
+ {renderNavigationView && renderNavigationView()} +
+
{children}
+
+ ); + }); + + // Export mock DrawerType if needed + const DrawerType = { + FRONT: 'front', + BACK: 'back', + SLIDE: 'slide', + }; + + return { + __esModule: true, + default: ReanimatedDrawerLayout, + DrawerType, + }; +}); + jest.mock('react-native-gesture-handler', () => { const RN = jest.requireActual('react-native'); @@ -96,11 +132,8 @@ jest.mock('react-native-gesture-handler', () => { Directions: {}, }; - const DrawerLayout = jest.fn(); - return { RNGestureHandlerModule: RN, - DrawerLayout, }; }); jest.mock('react-native-keychain', () => ({ @@ -130,6 +163,13 @@ jest.mock('@react-native-clipboard/clipboard', () => ({ getString: jest.fn(() => Promise.resolve('mocked clipboard content')), setString: jest.fn(), })); +jest.mock('@react-navigation/elements', () => ({ + PlatformPressable: jest.fn().mockImplementation(({ children }) => children), +})); +jest.mock('@react-navigation/native', () => ({ + ...jest.requireActual('@react-navigation/native'), + useTheme: () => (mockTheme), +})); // test suite describe('Component LoadedApp - test', () => { diff --git a/__tests__/LoadingApp.snapshot.tsx b/__tests__/LoadingApp.snapshot.tsx index e14d51a1a..62a473404 100644 --- a/__tests__/LoadingApp.snapshot.tsx +++ b/__tests__/LoadingApp.snapshot.tsx @@ -29,6 +29,11 @@ jest.mock('i18n-js', () => ({ })), })); +jest.mock('react-native-safe-area-context', () => ({ + SafeAreaProvider: ({ children }: any) => children, + SafeAreaView: ({ children }: any) => children, + useSafeAreaInsets: () => ({ top: 0, left: 0, right: 0, bottom: 0 }), +})); jest.useFakeTimers(); jest.mock('@fortawesome/react-native-fontawesome', () => ({ FontAwesomeIcon: '', @@ -47,7 +52,7 @@ jest.mock('react-native-tab-view', () => ({ })); jest.mock('react-native-option-menu', () => ''); jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper'); -jest.mock('@react-native-community/netinfo', () => { +jest.mock('@react-native-community/netinfo/src/index', () => { return { addEventListener: jest.fn(), fetch: jest.fn().mockImplementation(() => @@ -114,6 +119,13 @@ jest.mock('@react-native-clipboard/clipboard', () => ({ getString: jest.fn(() => Promise.resolve('mocked clipboard content')), setString: jest.fn(), })); +jest.mock('@react-navigation/elements', () => ({ + PlatformPressable: jest.fn().mockImplementation(({ children }) => children), +})); +jest.mock('@react-navigation/native', () => ({ + ...jest.requireActual('@react-navigation/native'), + useTheme: () => (mockTheme), +})); // test suite describe('Component LoadingApp - test', () => { diff --git a/__tests__/Memo.snapshot.tsx b/__tests__/Memo.snapshot.tsx index f6c668688..73ac60157 100644 --- a/__tests__/Memo.snapshot.tsx +++ b/__tests__/Memo.snapshot.tsx @@ -9,7 +9,13 @@ import { render } from '@testing-library/react-native'; import Memo from '../components/Memo'; import { defaultAppContextLoaded, ContextAppLoadedProvider } from '../app/context'; import { mockTranslate } from '../__mocks__/dataMocks/mockTranslate'; +import { mockTheme } from '../__mocks__/dataMocks/mockTheme'; +jest.mock('react-native-safe-area-context', () => ({ + SafeAreaProvider: ({ children }: any) => children, + SafeAreaView: ({ children }: any) => children, + useSafeAreaInsets: () => ({ top: 0, left: 0, right: 0, bottom: 0 }), +})); jest.useFakeTimers(); jest.mock('@fortawesome/react-native-fontawesome', () => ({ FontAwesomeIcon: '', @@ -23,7 +29,7 @@ jest.mock('react-native-localize', () => ({ }, })); jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper'); -jest.mock('@react-native-community/netinfo', () => { +jest.mock('@react-native-community/netinfo/src/index', () => { const RN = jest.requireActual('react-native'); RN.NativeModules.RNCNetInfo = { @@ -41,6 +47,10 @@ jest.mock('react-native', () => { return RN; }); +jest.mock('@react-navigation/native', () => ({ + ...jest.requireActual('@react-navigation/native'), + useTheme: () => (mockTheme), +})); // test suite describe('Component Memo - test', () => { diff --git a/__tests__/Messages.snapshot.tsx b/__tests__/Messages.snapshot.tsx index 0113af79f..b883f9659 100644 --- a/__tests__/Messages.snapshot.tsx +++ b/__tests__/Messages.snapshot.tsx @@ -16,6 +16,11 @@ import { mockTranslate } from '../__mocks__/dataMocks/mockTranslate'; import { mockAddresses } from '../__mocks__/dataMocks/mockAddresses'; import { mockTheme } from '../__mocks__/dataMocks/mockTheme'; +jest.mock('react-native-safe-area-context', () => ({ + SafeAreaProvider: ({ children }: any) => children, + SafeAreaView: ({ children }: any) => children, + useSafeAreaInsets: () => ({ top: 0, left: 0, right: 0, bottom: 0 }), +})); jest.useFakeTimers(); jest.mock('@fortawesome/react-native-fontawesome', () => ({ FontAwesomeIcon: '', @@ -67,7 +72,7 @@ jest.mock('react-native-gesture-handler', () => { Swipeable: View, }; }); -jest.mock('@react-native-community/netinfo', () => { +jest.mock('@react-native-community/netinfo/src/index', () => { const RN = jest.requireActual('react-native'); RN.NativeModules.RNCNetInfo = { @@ -86,6 +91,7 @@ jest.mock('react-native', () => { return RN; }); jest.mock('@react-navigation/native', () => ({ + ...jest.requireActual('@react-navigation/native'), useScrollToTop: jest.fn(), useTheme: () => mockTheme, })); diff --git a/__tests__/MessagesAddress.snapshot.tsx b/__tests__/MessagesAddress.snapshot.tsx index b3a2faafa..63f0f0220 100644 --- a/__tests__/MessagesAddress.snapshot.tsx +++ b/__tests__/MessagesAddress.snapshot.tsx @@ -16,6 +16,11 @@ import { mockTranslate } from '../__mocks__/dataMocks/mockTranslate'; import { mockAddresses } from '../__mocks__/dataMocks/mockAddresses'; import { mockTheme } from '../__mocks__/dataMocks/mockTheme'; +jest.mock('react-native-safe-area-context', () => ({ + SafeAreaProvider: ({ children }: any) => children, + SafeAreaView: ({ children }: any) => children, + useSafeAreaInsets: () => ({ top: 0, left: 0, right: 0, bottom: 0 }), +})); jest.useFakeTimers(); jest.mock('@fortawesome/react-native-fontawesome', () => ({ FontAwesomeIcon: '', @@ -67,7 +72,7 @@ jest.mock('react-native-gesture-handler', () => { Swipeable: View, }; }); -jest.mock('@react-native-community/netinfo', () => { +jest.mock('@react-native-community/netinfo/src/index', () => { const RN = jest.requireActual('react-native'); RN.NativeModules.RNCNetInfo = { @@ -86,6 +91,7 @@ jest.mock('react-native', () => { return RN; }); jest.mock('@react-navigation/native', () => ({ + ...jest.requireActual('@react-navigation/native'), useScrollToTop: jest.fn(), useTheme: () => mockTheme, })); diff --git a/__tests__/Pools.snapshot.tsx b/__tests__/Pools.snapshot.tsx index 56604de92..0fa84b83f 100644 --- a/__tests__/Pools.snapshot.tsx +++ b/__tests__/Pools.snapshot.tsx @@ -11,7 +11,13 @@ import { defaultAppContextLoaded, ContextAppLoadedProvider } from '../app/contex import { mockTranslate } from '../__mocks__/dataMocks/mockTranslate'; import { mockInfo } from '../__mocks__/dataMocks/mockInfo'; import { mockTotalBalance } from '../__mocks__/dataMocks/mockTotalBalance'; +import { mockTheme } from '../__mocks__/dataMocks/mockTheme'; +jest.mock('react-native-safe-area-context', () => ({ + SafeAreaProvider: ({ children }: any) => children, + SafeAreaView: ({ children }: any) => children, + useSafeAreaInsets: () => ({ top: 0, left: 0, right: 0, bottom: 0 }), +})); jest.useFakeTimers(); jest.mock('@fortawesome/react-native-fontawesome', () => ({ FontAwesomeIcon: '', @@ -25,7 +31,7 @@ jest.mock('react-native-localize', () => ({ }, })); jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper'); -jest.mock('@react-native-community/netinfo', () => { +jest.mock('@react-native-community/netinfo/src/index', () => { const RN = jest.requireActual('react-native'); RN.NativeModules.RNCNetInfo = { @@ -47,6 +53,10 @@ jest.mock('@react-native-clipboard/clipboard', () => ({ getString: jest.fn(() => Promise.resolve('mocked clipboard content')), setString: jest.fn(), })); +jest.mock('@react-navigation/native', () => ({ + ...jest.requireActual('@react-navigation/native'), + useTheme: () => (mockTheme), +})); // test suite describe('Component Pools - test', () => { diff --git a/__tests__/PriceFetcher.snapshot.tsx b/__tests__/PriceFetcher.snapshot.tsx index 78dc7c0dd..8a580a89b 100644 --- a/__tests__/PriceFetcher.snapshot.tsx +++ b/__tests__/PriceFetcher.snapshot.tsx @@ -7,11 +7,16 @@ import React from 'react'; import { render } from '@testing-library/react-native'; import PriceFetcher from '../components/Components/PriceFetcher'; +import { mockTheme } from '../__mocks__/dataMocks/mockTheme'; jest.useFakeTimers(); jest.mock('@fortawesome/react-native-fontawesome', () => ({ FontAwesomeIcon: '', })); +jest.mock('@react-navigation/native', () => ({ + ...jest.requireActual('@react-navigation/native'), + useTheme: () => (mockTheme), +})); // test suite describe('Component PriceFetcher - test', () => { diff --git a/__tests__/PrivKey.snapshot.tsx b/__tests__/PrivKey.snapshot.tsx index 3a922094d..5608319e5 100644 --- a/__tests__/PrivKey.snapshot.tsx +++ b/__tests__/PrivKey.snapshot.tsx @@ -11,7 +11,13 @@ import { defaultAppContextLoaded, ContextAppLoadedProvider } from '../app/contex import { mockTranslate } from '../__mocks__/dataMocks/mockTranslate'; import { mockInfo } from '../__mocks__/dataMocks/mockInfo'; import { mockTotalBalance } from '../__mocks__/dataMocks/mockTotalBalance'; +import { mockTheme } from '../__mocks__/dataMocks/mockTheme'; +jest.mock('react-native-safe-area-context', () => ({ + SafeAreaProvider: ({ children }: any) => children, + SafeAreaView: ({ children }: any) => children, + useSafeAreaInsets: () => ({ top: 0, left: 0, right: 0, bottom: 0 }), +})); jest.useFakeTimers(); jest.mock('@fortawesome/react-native-fontawesome', () => ({ FontAwesomeIcon: '', @@ -25,7 +31,7 @@ jest.mock('react-native-localize', () => ({ }, })); jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper'); -jest.mock('@react-native-community/netinfo', () => { +jest.mock('@react-native-community/netinfo/src/index', () => { const RN = jest.requireActual('react-native'); RN.NativeModules.RNCNetInfo = { @@ -47,6 +53,10 @@ jest.mock('@react-native-clipboard/clipboard', () => ({ getString: jest.fn(() => Promise.resolve('mocked clipboard content')), setString: jest.fn(), })); +jest.mock('@react-navigation/native', () => ({ + ...jest.requireActual('@react-navigation/native'), + useTheme: () => (mockTheme), +})); // test suite describe('Component PrivKey - test', () => { diff --git a/__tests__/Receive.snapshot.tsx b/__tests__/Receive.snapshot.tsx index 8fc5e7e2d..ee9f279fd 100644 --- a/__tests__/Receive.snapshot.tsx +++ b/__tests__/Receive.snapshot.tsx @@ -12,7 +12,13 @@ import { mockAddresses } from '../__mocks__/dataMocks/mockAddresses'; import { mockTranslate } from '../__mocks__/dataMocks/mockTranslate'; import { mockInfo } from '../__mocks__/dataMocks/mockInfo'; import { mockTotalBalance } from '../__mocks__/dataMocks/mockTotalBalance'; +import { mockTheme } from '../__mocks__/dataMocks/mockTheme'; +jest.mock('react-native-safe-area-context', () => ({ + SafeAreaProvider: ({ children }: any) => children, + SafeAreaView: ({ children }: any) => children, + useSafeAreaInsets: () => ({ top: 0, left: 0, right: 0, bottom: 0 }), +})); jest.useFakeTimers(); jest.mock('@fortawesome/react-native-fontawesome', () => ({ FontAwesomeIcon: '', @@ -31,7 +37,7 @@ jest.mock('react-native-tab-view', () => ({ })); jest.mock('react-native-option-menu', () => ''); jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper'); -jest.mock('@react-native-community/netinfo', () => { +jest.mock('@react-native-community/netinfo/src/index', () => { const RN = jest.requireActual('react-native'); RN.NativeModules.RNCNetInfo = { @@ -53,6 +59,10 @@ jest.mock('@react-native-clipboard/clipboard', () => ({ getString: jest.fn(() => Promise.resolve('mocked clipboard content')), setString: jest.fn(), })); +jest.mock('@react-navigation/native', () => ({ + ...jest.requireActual('@react-navigation/native'), + useTheme: () => (mockTheme), +})); // test suite describe('Component Receive - test', () => { diff --git a/__tests__/Rescan.snapshot.tsx b/__tests__/Rescan.snapshot.tsx index 2f113bffb..e7dc37da0 100644 --- a/__tests__/Rescan.snapshot.tsx +++ b/__tests__/Rescan.snapshot.tsx @@ -12,7 +12,13 @@ import { mockTranslate } from '../__mocks__/dataMocks/mockTranslate'; import { mockInfo } from '../__mocks__/dataMocks/mockInfo'; import { mockTotalBalance } from '../__mocks__/dataMocks/mockTotalBalance'; import { mockWallet } from '../__mocks__/dataMocks/mockWallet'; +import { mockTheme } from '../__mocks__/dataMocks/mockTheme'; +jest.mock('react-native-safe-area-context', () => ({ + SafeAreaProvider: ({ children }: any) => children, + SafeAreaView: ({ children }: any) => children, + useSafeAreaInsets: () => ({ top: 0, left: 0, right: 0, bottom: 0 }), +})); jest.useFakeTimers(); jest.mock('@fortawesome/react-native-fontawesome', () => ({ FontAwesomeIcon: '', @@ -26,7 +32,7 @@ jest.mock('react-native-localize', () => ({ }, })); jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper'); -jest.mock('@react-native-community/netinfo', () => { +jest.mock('@react-native-community/netinfo/src/index', () => { const RN = jest.requireActual('react-native'); RN.NativeModules.RNCNetInfo = { @@ -44,6 +50,10 @@ jest.mock('react-native', () => { return RN; }); +jest.mock('@react-navigation/native', () => ({ + ...jest.requireActual('@react-navigation/native'), + useTheme: () => (mockTheme), +})); // test suite describe('Component Rescan - test', () => { diff --git a/__tests__/Scanner.snapshot.tsx b/__tests__/Scanner.snapshot.tsx index 2d9c7b748..adca88ee3 100644 --- a/__tests__/Scanner.snapshot.tsx +++ b/__tests__/Scanner.snapshot.tsx @@ -7,6 +7,12 @@ import React from 'react'; import { render } from '@testing-library/react-native'; import Scanner from '../components/Components/Scanner'; +import { mockTheme } from '../__mocks__/dataMocks/mockTheme'; + +jest.mock('@react-navigation/native', () => ({ + ...jest.requireActual('@react-navigation/native'), + useTheme: () => (mockTheme), +})); // test suite describe('Component Scanner - test', () => { diff --git a/__tests__/Seed.snapshot.tsx b/__tests__/Seed.snapshot.tsx index 78bec5b34..e3ab5aa27 100644 --- a/__tests__/Seed.snapshot.tsx +++ b/__tests__/Seed.snapshot.tsx @@ -18,7 +18,13 @@ import { mockTranslate } from '../__mocks__/dataMocks/mockTranslate'; import { mockWallet } from '../__mocks__/dataMocks/mockWallet'; import { mockInfo } from '../__mocks__/dataMocks/mockInfo'; import { mockTotalBalance } from '../__mocks__/dataMocks/mockTotalBalance'; +import { mockTheme } from '../__mocks__/dataMocks/mockTheme'; +jest.mock('react-native-safe-area-context', () => ({ + SafeAreaProvider: ({ children }: any) => children, + SafeAreaView: ({ children }: any) => children, + useSafeAreaInsets: () => ({ top: 0, left: 0, right: 0, bottom: 0 }), +})); jest.useFakeTimers(); jest.mock('@fortawesome/react-native-fontawesome', () => ({ FontAwesomeIcon: '', @@ -32,7 +38,7 @@ jest.mock('react-native-localize', () => ({ }, })); jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper'); -jest.mock('@react-native-community/netinfo', () => { +jest.mock('@react-native-community/netinfo/src/index', () => { const RN = jest.requireActual('react-native'); RN.NativeModules.RNCNetInfo = { @@ -54,6 +60,10 @@ jest.mock('@react-native-clipboard/clipboard', () => ({ getString: jest.fn(() => Promise.resolve('mocked clipboard content')), setString: jest.fn(), })); +jest.mock('@react-navigation/native', () => ({ + ...jest.requireActual('@react-navigation/native'), + useTheme: () => (mockTheme), +})); // test suite describe('Component Seed - test', () => { diff --git a/__tests__/Send.snapshot.tsx b/__tests__/Send.snapshot.tsx index 884369d1e..81d8ae0bf 100644 --- a/__tests__/Send.snapshot.tsx +++ b/__tests__/Send.snapshot.tsx @@ -18,6 +18,11 @@ import { mockZecPrice } from '../__mocks__/dataMocks/mockZecPrice'; import { mockTotalBalance } from '../__mocks__/dataMocks/mockTotalBalance'; import mockSendPageState from '../__mocks__/dataMocks/mockSendPageState'; +jest.mock('react-native-safe-area-context', () => ({ + SafeAreaProvider: ({ children }: any) => children, + SafeAreaView: ({ children }: any) => children, + useSafeAreaInsets: () => ({ top: 0, left: 0, right: 0, bottom: 0 }), +})); jest.useFakeTimers(); jest.mock('@fortawesome/react-native-fontawesome', () => ({ FontAwesomeIcon: '', @@ -40,7 +45,7 @@ jest.mock('react-native', () => { return RN; }); -jest.mock('@react-native-community/netinfo', () => { +jest.mock('@react-native-community/netinfo/src/index', () => { const RN = jest.requireActual('react-native'); RN.NativeModules.RNCNetInfo = { @@ -50,6 +55,7 @@ jest.mock('@react-native-community/netinfo', () => { return RN; }); jest.mock('@react-navigation/native', () => ({ + ...jest.requireActual('@react-navigation/native'), useScrollToTop: jest.fn(), useIsFocused: jest.fn(), useTheme: () => mockTheme, diff --git a/__tests__/Settings.snapshot.tsx b/__tests__/Settings.snapshot.tsx index 753a65d66..c77fbf527 100644 --- a/__tests__/Settings.snapshot.tsx +++ b/__tests__/Settings.snapshot.tsx @@ -14,7 +14,14 @@ import { mockInfo } from '../__mocks__/dataMocks/mockInfo'; import { mockTotalBalance } from '../__mocks__/dataMocks/mockTotalBalance'; import { mockServer } from '../__mocks__/dataMocks/mockServer'; import { mockWalletSettings } from '../__mocks__/dataMocks/mockWalletSettings'; +import { mockTheme } from '../__mocks__/dataMocks/mockTheme'; +jest.mock('react-native-safe-area-context', () => ({ + SafeAreaProvider: ({ children }: any) => children, + SafeAreaView: ({ children }: any) => children, + useSafeAreaInsets: () => ({ top: 0, left: 0, right: 0, bottom: 0 }), +})); +jest.useFakeTimers(); jest.mock('@fortawesome/react-native-fontawesome', () => ({ FontAwesomeIcon: '', })); @@ -27,7 +34,7 @@ jest.mock('react-native-localize', () => ({ }, })); jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper'); -jest.mock('@react-native-community/netinfo', () => { +jest.mock('@react-native-community/netinfo/src/index', () => { const RN = jest.requireActual('react-native'); RN.NativeModules.RNCNetInfo = { @@ -72,6 +79,10 @@ jest.mock('react-native-keychain', () => ({ getSupportedBiometryType: jest.fn(), })); jest.useFakeTimers(); +jest.mock('@react-navigation/native', () => ({ + ...jest.requireActual('@react-navigation/native'), + useTheme: () => (mockTheme), +})); // test suite describe('Component Settings - test', () => { diff --git a/__tests__/ShowUfvk.snapshot.tsx b/__tests__/ShowUfvk.snapshot.tsx index 59ca9448e..ce485d31f 100644 --- a/__tests__/ShowUfvk.snapshot.tsx +++ b/__tests__/ShowUfvk.snapshot.tsx @@ -13,7 +13,13 @@ import { mockTranslate } from '../__mocks__/dataMocks/mockTranslate'; import { mockInfo } from '../__mocks__/dataMocks/mockInfo'; import { mockTotalBalance } from '../__mocks__/dataMocks/mockTotalBalance'; import { mockWallet } from '../__mocks__/dataMocks/mockWallet'; +import { mockTheme } from '../__mocks__/dataMocks/mockTheme'; +jest.mock('react-native-safe-area-context', () => ({ + SafeAreaProvider: ({ children }: any) => children, + SafeAreaView: ({ children }: any) => children, + useSafeAreaInsets: () => ({ top: 0, left: 0, right: 0, bottom: 0 }), +})); jest.useFakeTimers(); jest.mock('@fortawesome/react-native-fontawesome', () => ({ FontAwesomeIcon: '', @@ -27,7 +33,7 @@ jest.mock('react-native-localize', () => ({ }, })); jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper'); -jest.mock('@react-native-community/netinfo', () => { +jest.mock('@react-native-community/netinfo/src/index', () => { const RN = jest.requireActual('react-native'); RN.NativeModules.RNCNetInfo = { @@ -49,6 +55,10 @@ jest.mock('@react-native-clipboard/clipboard', () => ({ getString: jest.fn(() => Promise.resolve('mocked clipboard content')), setString: jest.fn(), })); +jest.mock('@react-navigation/native', () => ({ + ...jest.requireActual('@react-navigation/native'), + useTheme: () => (mockTheme), +})); // test suite describe('Component ShowUfvk - test', () => { diff --git a/__tests__/SingleAddress.snapshot.tsx b/__tests__/SingleAddress.snapshot.tsx index 4901e651e..2ad44668a 100644 --- a/__tests__/SingleAddress.snapshot.tsx +++ b/__tests__/SingleAddress.snapshot.tsx @@ -8,7 +8,13 @@ import React from 'react'; import { render } from '@testing-library/react-native'; import SingleAddress from '../components/Components/SingleAddress'; import { mockAddresses } from '../__mocks__/dataMocks/mockAddresses'; +import { mockTheme } from '../__mocks__/dataMocks/mockTheme'; +jest.mock('react-native-safe-area-context', () => ({ + SafeAreaProvider: ({ children }: any) => children, + SafeAreaView: ({ children }: any) => children, + useSafeAreaInsets: () => ({ top: 0, left: 0, right: 0, bottom: 0 }), +})); jest.useFakeTimers(); jest.mock('@fortawesome/react-native-fontawesome', () => ({ FontAwesomeIcon: '', @@ -18,6 +24,10 @@ jest.mock('@react-native-clipboard/clipboard', () => ({ getString: jest.fn(() => Promise.resolve('mocked clipboard content')), setString: jest.fn(), })); +jest.mock('@react-navigation/native', () => ({ + ...jest.requireActual('@react-navigation/native'), + useTheme: () => (mockTheme), +})); // test suite describe('Component SingleAddress - test', () => { diff --git a/__tests__/Snackbars.snapshot.tsx b/__tests__/Snackbars.snapshot.tsx index 2755d68b6..949066d93 100644 --- a/__tests__/Snackbars.snapshot.tsx +++ b/__tests__/Snackbars.snapshot.tsx @@ -9,6 +9,7 @@ import { render } from '@testing-library/react-native'; import Snackbars from '../components/Components/Snackbars'; import { mockTranslate } from '../__mocks__/dataMocks/mockTranslate'; import { mockSnackbars } from '../__mocks__/dataMocks/mockSnackbars'; +import { mockTheme } from '../__mocks__/dataMocks/mockTheme'; jest.useFakeTimers(); jest.mock('@fortawesome/react-native-fontawesome', () => ({ @@ -20,6 +21,10 @@ jest.mock('react-native-snackbar', () => { show: jest.fn(), }; }); +jest.mock('@react-navigation/native', () => ({ + ...jest.requireActual('@react-navigation/native'), + useTheme: () => (mockTheme), +})); // test suite describe('Component Snackbars - test', () => { diff --git a/__tests__/SyncReport.snapshot.tsx b/__tests__/SyncReport.snapshot.tsx index de0ceb431..6057a6a37 100644 --- a/__tests__/SyncReport.snapshot.tsx +++ b/__tests__/SyncReport.snapshot.tsx @@ -14,6 +14,7 @@ import { mockInfo } from '../__mocks__/dataMocks/mockInfo'; import { mockTotalBalance } from '../__mocks__/dataMocks/mockTotalBalance'; import mockSyncingStatus from '../__mocks__/dataMocks/mockSyncingStatus'; import { mockNetInfo } from '../__mocks__/dataMocks/mockNetInfo'; +import { mockTheme } from '../__mocks__/dataMocks/mockTheme'; const NetInfoStateType = { unknown: 'unknown', @@ -27,6 +28,11 @@ const NetInfoStateType = { other: 'other', }; +jest.mock('react-native-safe-area-context', () => ({ + SafeAreaProvider: ({ children }: any) => children, + SafeAreaView: ({ children }: any) => children, + useSafeAreaInsets: () => ({ top: 0, left: 0, right: 0, bottom: 0 }), +})); jest.useFakeTimers(); jest.mock('@fortawesome/react-native-fontawesome', () => ({ FontAwesomeIcon: '', @@ -40,7 +46,7 @@ jest.mock('react-native-localize', () => ({ }, })); jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper'); -jest.mock('@react-native-community/netinfo', () => ({ +jest.mock('@react-native-community/netinfo/src/index', () => ({ RNCNetInfo: () => { const RN = jest.requireActual('react-native'); @@ -65,6 +71,10 @@ jest.mock('@react-native-clipboard/clipboard', () => ({ getString: jest.fn(() => Promise.resolve('mocked clipboard content')), setString: jest.fn(), })); +jest.mock('@react-navigation/native', () => ({ + ...jest.requireActual('@react-navigation/native'), + useTheme: () => (mockTheme), +})); // test suite describe('Component SyncReport - test', () => { diff --git a/__tests__/__snapshots__/About.snapshot.tsx.snap b/__tests__/__snapshots__/About.snapshot.tsx.snap index 6363eef06..cba72a217 100644 --- a/__tests__/__snapshots__/About.snapshot.tsx.snap +++ b/__tests__/__snapshots__/About.snapshot.tsx.snap @@ -1,23 +1,13 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Component About - test About - snapshot 1`] = ` - +[ - + , < - color="rgb(0, 122, 255)" + color="#18bd18" icon={ { "icon": [ @@ -162,7 +152,7 @@ exports[`Component About - test About - snapshot 1`] = ` - + , - - + , +] `; diff --git a/__tests__/__snapshots__/AddressBook.AbDetail.snapshot.tsx.snap b/__tests__/__snapshots__/AddressBook.AbDetail.snapshot.tsx.snap index eabbe5101..c979a2709 100644 --- a/__tests__/__snapshots__/AddressBook.AbDetail.snapshot.tsx.snap +++ b/__tests__/__snapshots__/AddressBook.AbDetail.snapshot.tsx.snap @@ -261,7 +261,7 @@ exports[`Component Address Book Details - test Address Book Datails - Add - snap } accessible={true} collapsable={false} - focusable={true} + focusable={false} onClick={[Function]} onResponderGrant={[Function]} onResponderMove={[Function]} @@ -655,7 +655,7 @@ exports[`Component Address Book Details - test Address Book Datails - Delete - s } accessible={true} collapsable={false} - focusable={true} + focusable={false} onClick={[Function]} onResponderGrant={[Function]} onResponderMove={[Function]} @@ -1219,7 +1219,7 @@ exports[`Component Address Book Details - test Address Book Datails - Modify - s } accessible={true} collapsable={false} - focusable={true} + focusable={false} onClick={[Function]} onResponderGrant={[Function]} onResponderMove={[Function]} diff --git a/__tests__/__snapshots__/AddressBook.snapshot.tsx.snap b/__tests__/__snapshots__/AddressBook.snapshot.tsx.snap index 3760de803..cfd142e7f 100644 --- a/__tests__/__snapshots__/AddressBook.snapshot.tsx.snap +++ b/__tests__/__snapshots__/AddressBook.snapshot.tsx.snap @@ -1,17 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Component Address Book - test Address Book - snapshot 1`] = ` - +[ - + , - + , - + , - - + , +] `; diff --git a/__tests__/__snapshots__/App.snapshot.tsx.snap b/__tests__/__snapshots__/App.snapshot.tsx.snap index f95cdec52..dad467c0d 100644 --- a/__tests__/__snapshots__/App.snapshot.tsx.snap +++ b/__tests__/__snapshots__/App.snapshot.tsx.snap @@ -1,30 +1,19 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Component App - test App - snapshot 1`] = ` - - - - - - + + + `; diff --git a/__tests__/__snapshots__/Button.snapshot.tsx.snap b/__tests__/__snapshots__/Button.snapshot.tsx.snap index 72c24e332..de4c5a9ba 100644 --- a/__tests__/__snapshots__/Button.snapshot.tsx.snap +++ b/__tests__/__snapshots__/Button.snapshot.tsx.snap @@ -32,8 +32,8 @@ exports[`Component Button - test Button Primary - snapshot 1`] = ` style={ { "alignItems": "center", - "backgroundColor": "rgb(0, 122, 255)", - "borderColor": "rgb(0, 122, 255)", + "backgroundColor": "#18bd18", + "borderColor": "#18bd18", "borderRadius": 10, "borderWidth": 2, "justifyContent": "center", @@ -65,7 +65,7 @@ exports[`Component Button - test Button Primary - snapshot 1`] = ` < - color="rgb(0, 122, 255)" + color="#18bd18" icon={ { "icon": [ @@ -150,7 +150,7 @@ exports[`Component ChainTypeToggle - test ChainTypeToggle - snapshot 1`] = ` style={ { "alignItems": "center", - "borderColor": undefined, + "borderColor": "#5a8c5a", "borderRadius": 5, "borderWidth": 1, "flexDirection": "row", @@ -162,7 +162,7 @@ exports[`Component ChainTypeToggle - test ChainTypeToggle - snapshot 1`] = ` diff --git a/__tests__/__snapshots__/Components.snapshot.tsx.snap b/__tests__/__snapshots__/Components.snapshot.tsx.snap index 63a3c1977..bedaeabd6 100644 --- a/__tests__/__snapshots__/Components.snapshot.tsx.snap +++ b/__tests__/__snapshots__/Components.snapshot.tsx.snap @@ -5,7 +5,7 @@ exports[`Component Components - test BoldText - snapshot 1`] = ` style={ { "backgroundColor": "red", - "color": "rgb(28, 28, 30)", + "color": "#c3c3c3", "fontSize": 18, "fontWeight": "bold", "opacity": 0.87, @@ -71,7 +71,7 @@ exports[`Component Components - test CurrencyAmount High Privacy - snapshot 1`] style={ { "backgroundColor": "red", - "color": undefined, + "color": "#ffffff", "fontSize": 20, "fontWeight": "700", } @@ -113,7 +113,7 @@ exports[`Component Components - test CurrencyAmount Normal Privacy - snapshot 1` } accessible={true} collapsable={false} - focusable={true} + focusable={false} onClick={[Function]} onResponderGrant={[Function]} onResponderMove={[Function]} @@ -139,7 +139,7 @@ exports[`Component Components - test CurrencyAmount Normal Privacy - snapshot 1` style={ { "backgroundColor": "red", - "color": undefined, + "color": "#ffffff", "fontSize": 20, "fontWeight": "700", } @@ -157,7 +157,7 @@ exports[`Component Components - test ErrorText - snapshot 1`] = ` style={ { "backgroundColor": "white", - "color": "rgb(0, 122, 255)", + "color": "#18bd18", } } > @@ -170,7 +170,7 @@ exports[`Component Components - test FadeText - snapshot 1`] = ` style={ { "backgroundColor": "red", - "color": "rgb(28, 28, 30)", + "color": "#c3c3c3", "opacity": 0.65, } } @@ -252,8 +252,8 @@ exports[`Component Components - test ZecAmount High Privacy - snapshot 1`] = ` > < + color="#5a8c5a" icon={ { "icon": [ @@ -227,7 +228,7 @@ exports[`Component Header - test Header Complex - snapshot 1`] = ` } accessible={true} collapsable={false} - focusable={true} + focusable={false} onClick={[Function]} onResponderGrant={[Function]} onResponderMove={[Function]} @@ -253,9 +254,9 @@ exports[`Component Header - test Header Complex - snapshot 1`] = ` > < - color="rgb(0, 122, 255)" + color="#18bd18" icon={ { "icon": [ @@ -490,7 +491,7 @@ exports[`Component Header - test Header Complex - snapshot 1`] = ` testID="header.drawmenu" > < - color="rgb(216, 216, 216)" + color="#ffffff" icon={ { "icon": [ @@ -563,7 +564,7 @@ exports[`Component Header - test Header Complex - snapshot 1`] = ` < - color="rgb(0, 122, 255)" + color="#18bd18" icon={ { "icon": [ @@ -750,7 +751,7 @@ exports[`Component Header - test Header Simple - snapshot 1`] = ` - + - + testID="header" + > - - + /> + + - + + + - + } + style={ + { + "borderRadius": 10, + "height": 38, + "resizeMode": "contain", + "width": 38, + } + } + /> + + + + - + + + + + + + + + < - color="rgb(0, 122, 255)" + color="#ffffff" icon={ { "icon": [ - 320, + 448, 512, - [ - 9001, - ], - "f053", - "M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z", + [], + "f029", + "M0 80C0 53.5 21.5 32 48 32l96 0c26.5 0 48 21.5 48 48l0 96c0 26.5-21.5 48-48 48l-96 0c-26.5 0-48-21.5-48-48L0 80zM64 96l0 64 64 0 0-64L64 96zM0 336c0-26.5 21.5-48 48-48l96 0c26.5 0 48 21.5 48 48l0 96c0 26.5-21.5 48-48 48l-96 0c-26.5 0-48-21.5-48-48l0-96zm64 16l0 64 64 0 0-64-64 0zM304 32l96 0c26.5 0 48 21.5 48 48l0 96c0 26.5-21.5 48-48 48l-96 0c-26.5 0-48-21.5-48-48l0-96c0-26.5 21.5-48 48-48zm80 64l-64 0 0 64 64 0 0-64zM256 304c0-8.8 7.2-16 16-16l64 0c8.8 0 16 7.2 16 16s7.2 16 16 16l32 0c8.8 0 16-7.2 16-16s7.2-16 16-16s16 7.2 16 16l0 96c0 8.8-7.2 16-16 16l-64 0c-8.8 0-16-7.2-16-16s-7.2-16-16-16s-16 7.2-16 16l0 64c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-160zM368 480a16 16 0 1 1 0-32 16 16 0 1 1 0 32zm64 0a16 16 0 1 1 0-32 16 16 0 1 1 0 32z", ], - "iconName": "chevron-left", + "iconName": "qrcode", "prefix": "fas", } } - size={30} - style={ - { - "marginHorizontal": 10, - } - } + size={35} /> - - - - - + > - - - - - - < - color="rgb(216, 216, 216)" - icon={ - { - "icon": [ - 448, - 512, - [], - "f029", - "M0 80C0 53.5 21.5 32 48 32l96 0c26.5 0 48 21.5 48 48l0 96c0 26.5-21.5 48-48 48l-96 0c-26.5 0-48-21.5-48-48L0 80zM64 96l0 64 64 0 0-64L64 96zM0 336c0-26.5 21.5-48 48-48l96 0c26.5 0 48 21.5 48 48l0 96c0 26.5-21.5 48-48 48l-96 0c-26.5 0-48-21.5-48-48l0-96zm64 16l0 64 64 0 0-64-64 0zM304 32l96 0c26.5 0 48 21.5 48 48l0 96c0 26.5-21.5 48-48 48l-96 0c-26.5 0-48-21.5-48-48l0-96c0-26.5 21.5-48 48-48zm80 64l-64 0 0 64 64 0 0-64zM256 304c0-8.8 7.2-16 16-16l64 0c8.8 0 16 7.2 16 16s7.2 16 16 16l32 0c8.8 0 16-7.2 16-16s7.2-16 16-16s16 7.2 16 16l0 96c0 8.8-7.2 16-16 16l-64 0c-8.8 0-16-7.2-16-16s-7.2-16-16-16s-16 7.2-16 16l0 64c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-160zM368 480a16 16 0 1 1 0-32 16 16 0 1 1 0 32zm64 0a16 16 0 1 1 0-32 16 16 0 1 1 0 32z", - ], - "iconName": "qrcode", - "prefix": "fas", - } - } - size={35} - /> - - + (1, --) + - - - (1, --) - - - - - + - + + + - - - + /> - + `; diff --git a/__tests__/__snapshots__/Info.snapshot.tsx.snap b/__tests__/__snapshots__/Info.snapshot.tsx.snap index fa2556876..30f1aa89e 100644 --- a/__tests__/__snapshots__/Info.snapshot.tsx.snap +++ b/__tests__/__snapshots__/Info.snapshot.tsx.snap @@ -1,23 +1,13 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Component Info - test Info - snapshot 1`] = ` - +[ - + , < - color="rgb(0, 122, 255)" + color="#18bd18" icon={ { "icon": [ @@ -162,7 +152,7 @@ exports[`Component Info - test Info - snapshot 1`] = ` - + , - - + , +] `; diff --git a/__tests__/__snapshots__/Insight.snapshot.tsx.snap b/__tests__/__snapshots__/Insight.snapshot.tsx.snap index 85c828411..beac7cebd 100644 --- a/__tests__/__snapshots__/Insight.snapshot.tsx.snap +++ b/__tests__/__snapshots__/Insight.snapshot.tsx.snap @@ -1,23 +1,13 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Component Insight - test Insight - snapshot 1`] = ` - +[ < + color="#5a8c5a" icon={ { "icon": [ @@ -165,7 +156,7 @@ exports[`Component Insight - test Insight - snapshot 1`] = ` } /> - + , < - color="rgb(0, 122, 255)" + color="#18bd18" icon={ { "icon": [ @@ -242,7 +233,7 @@ exports[`Component Insight - test Insight - snapshot 1`] = ` - + , - + , - - + , +] `; diff --git a/__tests__/__snapshots__/LoadedApp.snapshot.tsx.snap b/__tests__/__snapshots__/LoadedApp.snapshot.tsx.snap index 67063453a..fb38a0aed 100644 --- a/__tests__/__snapshots__/LoadedApp.snapshot.tsx.snap +++ b/__tests__/__snapshots__/LoadedApp.snapshot.tsx.snap @@ -1,3 +1,231 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Component LoadedApp - test LoadedApp - snapshot 1`] = `null`; +exports[`Component LoadedApp - test LoadedApp - snapshot 1`] = ` +
+
+ + + + text translated + + + + + text translated + + + text translated + + + text translated + + + text translated + + + text translated + + + text translated + + + text translated + + + text translated + + + + + + + Version : + + + text translated + + + text translatedtext translated + + +
+
+ + + + +
+
+`; diff --git a/__tests__/__snapshots__/LoadingApp.snapshot.tsx.snap b/__tests__/__snapshots__/LoadingApp.snapshot.tsx.snap index 10acb3c6f..3216506a3 100644 --- a/__tests__/__snapshots__/LoadingApp.snapshot.tsx.snap +++ b/__tests__/__snapshots__/LoadingApp.snapshot.tsx.snap @@ -1,26 +1,16 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Component LoadingApp - test LoadingApp - snapshot 1`] = ` - - - , + @@ -28,111 +18,99 @@ exports[`Component LoadingApp - test LoadingApp - snapshot 1`] = ` style={ { "alignItems": "center", - "flex": 1, "flexDirection": "column", - "justifyContent": "center", - "width": "95%", + "height": "40%", + "justifyContent": "flex-end", + "marginTop": 20, + "padding": 10, + "width": "80%", } } > - - - text translated - - - text translated - - - + - - + + + + - text translated - - + text translated + + - text translated - - + text translated + + - text translated - - + } + > + text translated +
- - + , +] `; diff --git a/__tests__/__snapshots__/Memo.snapshot.tsx.snap b/__tests__/__snapshots__/Memo.snapshot.tsx.snap index fc8b6a742..a8b84233c 100644 --- a/__tests__/__snapshots__/Memo.snapshot.tsx.snap +++ b/__tests__/__snapshots__/Memo.snapshot.tsx.snap @@ -6,7 +6,7 @@ exports[`Component Memo - test Memo - snapshot 1`] = ` style={ [ { - "backgroundColor": "rgb(242, 242, 242)", + "backgroundColor": "#011401", }, { "paddingBottom": 0, @@ -14,387 +14,375 @@ exports[`Component Memo - test Memo - snapshot 1`] = ` ] } > - + - + testID="header" + > - - + /> + + - + + + - + } + style={ + { + "borderRadius": 10, + "height": 38, + "resizeMode": "contain", + "width": 38, + } + } + /> + + + + - + + text translated + + + + + - + + + - < - color="rgb(0, 122, 255)" - icon={ - { - "icon": [ - 320, - 512, - [ - 9001, - ], - "f053", - "M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z", - ], - "iconName": "chevron-left", - "prefix": "fas", - } - } - size={30} - style={ - { - "marginHorizontal": 10, - } - } - /> - + 12 +
text translated - + > + 511 +
- - + + - - - - - - - 12 - - - text translated - - - 511 - - - - - - - - text translated - - + text translated +
- + `; diff --git a/__tests__/__snapshots__/Messages.snapshot.tsx.snap b/__tests__/__snapshots__/Messages.snapshot.tsx.snap index f26a9bf06..d211e023b 100644 --- a/__tests__/__snapshots__/Messages.snapshot.tsx.snap +++ b/__tests__/__snapshots__/Messages.snapshot.tsx.snap @@ -1,19 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Component Messages - test Messages currency USD, privacy high & mode advanced - snapshot 1`] = ` - +[ - + , - + , - + , - + />, +] `; exports[`Component Messages - test Messages no currency, privacy normal & mode basic - snapshot 1`] = ` - +[ - + , - + , - + , - + />, +] `; diff --git a/__tests__/__snapshots__/MessagesAddress.snapshot.tsx.snap b/__tests__/__snapshots__/MessagesAddress.snapshot.tsx.snap index 6cb6958a7..4f7499a7b 100644 --- a/__tests__/__snapshots__/MessagesAddress.snapshot.tsx.snap +++ b/__tests__/__snapshots__/MessagesAddress.snapshot.tsx.snap @@ -1,348 +1,279 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Component Messages Address - test Messages Address - snapshot 1`] = ` - - + - + testID="header" + > - - - + + - - + } + > - - + /> - - + - - < - color="#18bd18" - icon={ - { - "icon": [ - 320, - 512, - [ - 9001, - ], - "f053", - "M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z", - ], - "iconName": "chevron-left", - "prefix": "fas", - } - } - size={30} - style={ - { - "marginHorizontal": 10, - } - } - /> - - - text translated - - - - + + < - color="#c3c3c3" + color="#18bd18" icon={ { "icon": [ - 512, + 320, 512, [ - 62142, - "user-circle", + 9001, ], - "f2bd", - "M399 384.2C376.9 345.8 335.4 320 288 320l-64 0c-47.4 0-88.9 25.8-111 64.2c35.2 39.2 86.2 63.8 143 63.8s107.8-24.7 143-63.8zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm256 16a72 72 0 1 0 0-144 72 72 0 1 0 0 144z", + "f053", + "M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z", ], - "iconName": "circle-user", + "iconName": "chevron-left", "prefix": "fas", } } - size={40} + size={30} style={ { - "marginLeft": 5, - "marginRight": 5, - "marginTop": 0, + "marginHorizontal": 10, } } /> + + text translated + + + + + + + + < + color="#c3c3c3" + icon={ + { + "icon": [ + 512, + 512, + [ + 62142, + "user-circle", + ], + "f2bd", + "M399 384.2C376.9 345.8 335.4 320 288 320l-64 0c-47.4 0-88.9 25.8-111 64.2c35.2 39.2 86.2 63.8 143 63.8s107.8-24.7 143-63.8zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm256 16a72 72 0 1 0 0-144 72 72 0 1 0 0 144z", + ], + "iconName": "circle-user", + "prefix": "fas", + } + } + size={40} + style={ + { + "marginLeft": 5, + "marginRight": 5, + "marginTop": 0, + } + } + /> + + - - - - - UA-1234...4567890 - - - - - < - color="#18bd18" - icon={ - { - "icon": [ - 640, - 512, - [], - "f234", - "M96 128a128 128 0 1 1 256 0A128 128 0 1 1 96 128zM0 482.3C0 383.8 79.8 304 178.3 304l91.4 0C368.2 304 448 383.8 448 482.3c0 16.4-13.3 29.7-29.7 29.7L29.7 512C13.3 512 0 498.7 0 482.3zM504 312l0-64-64 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l64 0 0-64c0-13.3 10.7-24 24-24s24 10.7 24 24l0 64 64 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-64 0 0 64c0 13.3-10.7 24-24 24s-24-10.7-24-24z", - ], - "iconName": "user-plus", - "prefix": "fas", - } - } - size={25} + + > + UA-1234...4567890 + - - - - } - scrollEventThrottle={100} - style={ - { - "flexGrow": 1, - "marginTop": 10, - "opacity": 0, - "width": "100%", + accessibilityValue={ + { + "max": undefined, + "min": undefined, + "now": undefined, + "text": undefined, + } } - } - > - - + accessible={true} + collapsable={false} + focusable={true} + onClick={[Function]} + onResponderGrant={[Function]} + onResponderMove={[Function]} + onResponderRelease={[Function]} + onResponderTerminate={[Function]} + onResponderTerminationRequest={[Function]} + onStartShouldSetResponder={[Function]} + style={ + { + "opacity": 1, + } + } + > - - text translated - + /> - + + + + + } + scrollEventThrottle={100} + style={ + { + "flexGrow": 1, + "marginTop": 10, + "opacity": 0, + "width": "100%", + } + } + > + + + + + > + text translated + - - + + + - + `; diff --git a/__tests__/__snapshots__/Pools.snapshot.tsx.snap b/__tests__/__snapshots__/Pools.snapshot.tsx.snap index 091a03cf1..3a1fda78e 100644 --- a/__tests__/__snapshots__/Pools.snapshot.tsx.snap +++ b/__tests__/__snapshots__/Pools.snapshot.tsx.snap @@ -1,23 +1,13 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Component Pools - test Pools - snapshot 1`] = ` - +[ < + color="#5a8c5a" icon={ { "icon": [ @@ -165,7 +156,7 @@ exports[`Component Pools - test Pools - snapshot 1`] = ` } /> - + , < - color="rgb(0, 122, 255)" + color="#18bd18" icon={ { "icon": [ @@ -242,7 +233,7 @@ exports[`Component Pools - test Pools - snapshot 1`] = ` - + , - - + , +] `; diff --git a/__tests__/__snapshots__/PriceFetcher.snapshot.tsx.snap b/__tests__/__snapshots__/PriceFetcher.snapshot.tsx.snap index 48106855c..b280b5f7e 100644 --- a/__tests__/__snapshots__/PriceFetcher.snapshot.tsx.snap +++ b/__tests__/__snapshots__/PriceFetcher.snapshot.tsx.snap @@ -39,7 +39,7 @@ exports[`Component PriceFetcher - test PriceFetcher - snapshot 1`] = ` style={ { "alignItems": "center", - "backgroundColor": "rgb(255, 255, 255)", + "backgroundColor": "#011401", "borderRadius": 10, "flexDirection": "row", "justifyContent": "center", @@ -53,7 +53,7 @@ exports[`Component PriceFetcher - test PriceFetcher - snapshot 1`] = ` < - color="rgb(0, 122, 255)" + color="#18bd18" icon={ { "icon": [ diff --git a/__tests__/__snapshots__/PrivKey.snapshot.tsx.snap b/__tests__/__snapshots__/PrivKey.snapshot.tsx.snap index a0c205d94..5ab6ec490 100644 --- a/__tests__/__snapshots__/PrivKey.snapshot.tsx.snap +++ b/__tests__/__snapshots__/PrivKey.snapshot.tsx.snap @@ -1,23 +1,13 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Component PrivKey - test PrivKey Private - snapshot 1`] = ` - +[ - + , < - color="rgb(0, 122, 255)" + color="#18bd18" icon={ { "icon": [ @@ -162,7 +152,7 @@ exports[`Component PrivKey - test PrivKey Private - snapshot 1`] = ` - + , - - + , +] `; exports[`Component PrivKey - test PrivKey View - snapshot 1`] = ` - +[ - + , < - color="rgb(0, 122, 255)" + color="#18bd18" icon={ { "icon": [ @@ -544,7 +524,7 @@ exports[`Component PrivKey - test PrivKey View - snapshot 1`] = ` - + , - - + , +] `; diff --git a/__tests__/__snapshots__/Rescan.snapshot.tsx.snap b/__tests__/__snapshots__/Rescan.snapshot.tsx.snap index fb0b8da29..d83525c9f 100644 --- a/__tests__/__snapshots__/Rescan.snapshot.tsx.snap +++ b/__tests__/__snapshots__/Rescan.snapshot.tsx.snap @@ -1,23 +1,13 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Component Rescan - test Rescan - snapshot 1`] = ` - +[ - + , < - color="rgb(0, 122, 255)" + color="#18bd18" icon={ { "icon": [ @@ -162,7 +152,7 @@ exports[`Component Rescan - test Rescan - snapshot 1`] = ` - + , - + , - - + , +] `; diff --git a/__tests__/__snapshots__/Scanner.snapshot.tsx.snap b/__tests__/__snapshots__/Scanner.snapshot.tsx.snap index fd5313a76..fd1d370b6 100644 --- a/__tests__/__snapshots__/Scanner.snapshot.tsx.snap +++ b/__tests__/__snapshots__/Scanner.snapshot.tsx.snap @@ -1,12 +1,15 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Component Scanner - test Scanner - snapshot 1`] = ` - `; diff --git a/__tests__/__snapshots__/Seed.snapshot.tsx.snap b/__tests__/__snapshots__/Seed.snapshot.tsx.snap index b5627e9b9..4e81be8fe 100644 --- a/__tests__/__snapshots__/Seed.snapshot.tsx.snap +++ b/__tests__/__snapshots__/Seed.snapshot.tsx.snap @@ -1,23 +1,13 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Component Seed - test Seed Backup - snapshot 1`] = ` - +[ < + color="#5a8c5a" icon={ { "icon": [ @@ -165,7 +156,7 @@ exports[`Component Seed - test Seed Backup - snapshot 1`] = ` } /> - + , < - color="rgb(0, 122, 255)" + color="#18bd18" icon={ { "icon": [ @@ -242,7 +233,7 @@ exports[`Component Seed - test Seed Backup - snapshot 1`] = ` - + , - + , - - + , +] `; exports[`Component Seed - test Seed Change - snapshot 1`] = ` - +[ < + color="#5a8c5a" icon={ { "icon": [ @@ -757,7 +739,7 @@ exports[`Component Seed - test Seed Change - snapshot 1`] = ` } /> - + , < - color="rgb(0, 122, 255)" + color="#18bd18" icon={ { "icon": [ @@ -834,7 +816,7 @@ exports[`Component Seed - test Seed Change - snapshot 1`] = ` - + , - + , - - + , +] `; exports[`Component Seed - test Seed New - snapshot 1`] = ` - +[ < + color="#5a8c5a" icon={ { "icon": [ @@ -1349,7 +1322,7 @@ exports[`Component Seed - test Seed New - snapshot 1`] = ` } /> - + , < - color="rgb(0, 122, 255)" + color="#18bd18" icon={ { "icon": [ @@ -1426,7 +1399,7 @@ exports[`Component Seed - test Seed New - snapshot 1`] = ` - + , - + , - - + , +] `; exports[`Component Seed - test Seed Server - snapshot 1`] = ` - +[ < + color="#5a8c5a" icon={ { "icon": [ @@ -1941,7 +1905,7 @@ exports[`Component Seed - test Seed Server - snapshot 1`] = ` } /> - + , < - color="rgb(0, 122, 255)" + color="#18bd18" icon={ { "icon": [ @@ -2018,7 +1982,7 @@ exports[`Component Seed - test Seed Server - snapshot 1`] = ` - + , - + , - - + , +] `; exports[`Component Seed - test Seed View - snapshot 1`] = ` - +[ < + color="#5a8c5a" icon={ { "icon": [ @@ -2533,7 +2488,7 @@ exports[`Component Seed - test Seed View - snapshot 1`] = ` } /> - + , < - color="rgb(0, 122, 255)" + color="#18bd18" icon={ { "icon": [ @@ -2610,7 +2565,7 @@ exports[`Component Seed - test Seed View - snapshot 1`] = ` - + , - + , - - + , +] `; diff --git a/__tests__/__snapshots__/Send.snapshot.tsx.snap b/__tests__/__snapshots__/Send.snapshot.tsx.snap index dfa229f4a..e6177493d 100644 --- a/__tests__/__snapshots__/Send.snapshot.tsx.snap +++ b/__tests__/__snapshots__/Send.snapshot.tsx.snap @@ -513,8 +513,8 @@ exports[`Component Send - test Send currency USD, privacy high & mode advanced - > - + - + testID="header" + > - - + /> + + - + + + - + } + style={ + { + "borderRadius": 10, + "height": 38, + "resizeMode": "contain", + "width": 38, + } + } + /> + + + + - + + text translated + + + + + - - < - color="rgb(0, 122, 255)" - icon={ - { - "icon": [ - 320, - 512, - [ - 9001, - ], - "f053", - "M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z", - ], - "iconName": "chevron-left", - "prefix": "fas", - } - } - size={30} - style={ - { - "marginHorizontal": 10, - } - } - /> - text translated - - - - - + - + + + + - text translated - - - - - - text translated - - - - - + - < - color="rgb(216, 216, 216)" - icon={ - { - "icon": [ - 512, - 512, - [ - 128308, - 128309, - 128992, - 128993, - 128994, - 128995, - 128996, - 9679, - 9898, - 9899, - 11044, - 61708, - 61915, - ], - "f111", - "M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z", - ], - "iconName": "circle", - "prefix": "far", - } - } - size={20} - /> - - text translated - - + text translated + - - text no currency - - - + text no currency + + + + + - + - < - color="rgb(216, 216, 216)" - icon={ - { - "icon": [ - 512, - 512, - [ - 128280, - "dot-circle", - ], - "f192", - "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-352a96 96 0 1 1 0 192 96 96 0 1 1 0-192z", - ], - "iconName": "circle-dot", - "prefix": "fas", - } - } - size={20} - /> - - text translated - - + text translated + - - text USD - - - - text translated + text USD - + + - - + + + + + - + - < - color="rgb(216, 216, 216)" - icon={ - { - "icon": [ - 512, - 512, - [ - 128280, - "dot-circle", - ], - "f192", - "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-352a96 96 0 1 1 0 192 96 96 0 1 1 0-192z", - ], - "iconName": "circle-dot", - "prefix": "fas", - } - } - size={20} - /> - - text translated - - + text translated + - - text en - - - + text en + + + + + - + - < - color="rgb(216, 216, 216)" - icon={ - { - "icon": [ - 512, - 512, - [ - 128308, - 128309, - 128992, - 128993, - 128994, - 128995, - 128996, - 9679, - 9898, - 9899, - 11044, - 61708, - 61915, - ], - "f111", - "M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z", - ], - "iconName": "circle", - "prefix": "far", - } - } - size={20} - /> - - text translated - - + text translated + - - text es - - - + text es + + + + + - + - < - color="rgb(216, 216, 216)" - icon={ - { - "icon": [ - 512, - 512, - [ - 128308, - 128309, - 128992, - 128993, - 128994, - 128995, - 128996, - 9679, - 9898, - 9899, - 11044, - 61708, - 61915, - ], - "f111", - "M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z", - ], - "iconName": "circle", - "prefix": "far", - } - } - size={20} - /> - - text translated - - + text translated + - - text pt - - - + text pt + + + + + - + - < - color="rgb(216, 216, 216)" - icon={ - { - "icon": [ - 512, - 512, - [ - 128308, - 128309, - 128992, - 128993, - 128994, - 128995, - 128996, - 9679, - 9898, - 9899, - 11044, - 61708, - 61915, - ], - "f111", - "M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z", - ], - "iconName": "circle", - "prefix": "far", - } - } - size={20} - /> - - text translated - - + text translated + - - text ru - - - - text translated + text ru - + + - - + + + + + - - < - color="rgb(216, 216, 216)" - icon={ - { - "icon": [ - 512, - 512, - [ - 128308, - 128309, - 128992, - 128993, - 128994, - 128995, - 128996, - 9679, - 9898, - 9899, - 11044, - 61708, - 61915, - ], - "f111", - "M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z", + "icon": [ + 512, + 512, + [ + 128308, + 128309, + 128992, + 128993, + 128994, + 128995, + 128996, + 9679, + 9898, + 9899, + 11044, + 61708, + 61915, ], - "iconName": "circle", - "prefix": "far", - } - } - size={20} - /> - - text translated - - - - - text true - - - - - + - < - color="rgb(216, 216, 216)" - icon={ - { - "icon": [ - 512, - 512, - [ - 128280, - "dot-circle", - ], - "f192", - "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-352a96 96 0 1 1 0 192 96 96 0 1 1 0-192z", - ], - "iconName": "circle-dot", - "prefix": "fas", - } - } - size={20} - /> - - text translated - - + text translated + - - text false - - - - text translated + text true - + - - - text translated - - - - - - < - color="rgb(216, 216, 216)" - icon={ - { - "icon": [ - 512, - 512, - [ - 128308, - 128309, - 128992, - 128993, - 128994, - 128995, - 128996, - 9679, - 9898, - 9899, - 11044, - 61708, - 61915, - ], - "f111", - "M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z", + "icon": [ + 512, + 512, + [ + 128280, + "dot-circle", ], - "iconName": "circle", - "prefix": "far", - } - } - size={20} - /> - - text translated - - - - - text true - - - - - + - < - color="rgb(216, 216, 216)" - icon={ - { - "icon": [ - 512, - 512, - [ - 128280, - "dot-circle", - ], - "f192", - "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-352a96 96 0 1 1 0 192 96 96 0 1 1 0-192z", - ], - "iconName": "circle-dot", - "prefix": "fas", - } - } - size={20} - /> - - text translated - - + text translated + - - text false - - - - text translated + text false - + + - - + + + + + text translated + + + + + + - + - < - color="rgb(216, 216, 216)" - icon={ - { - "icon": [ - 512, - 512, - [ - 128308, - 128309, - 128992, - 128993, - 128994, - 128995, - 128996, - 9679, - 9898, - 9899, - 11044, - 61708, - 61915, - ], - "f111", - "M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z", - ], - "iconName": "circle", - "prefix": "far", - } - } - size={20} - /> - - text translated - - + text translated + - - text true - - - + text true + + + + + - + - < - color="rgb(216, 216, 216)" - icon={ - { - "icon": [ - 512, - 512, - [ - 128280, - "dot-circle", - ], - "f192", - "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-352a96 96 0 1 1 0 192 96 96 0 1 1 0-192z", - ], - "iconName": "circle-dot", - "prefix": "fas", - } - } - size={20} - /> - - text translated - - + text translated + - - text false - - - - text translated + text false - + + - - + + + + + - + - < - color="rgb(216, 216, 216)" - icon={ - { - "icon": [ - 512, - 512, - [ - 128308, - 128309, - 128992, - 128993, - 128994, - 128995, - 128996, - 9679, - 9898, - 9899, - 11044, - 61708, - 61915, - ], - "f111", - "M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z", - ], - "iconName": "circle", - "prefix": "far", - } - } - size={20} - /> - - text translated - - + text translated + - - + + + - text translated - - - - - - < - color="rgb(216, 216, 216)" - icon={ - { - "icon": [ - 512, - 512, - [ - 128280, - "dot-circle", - ], - "f192", - "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-352a96 96 0 1 1 0 192 96 96 0 1 1 0-192z", - ], - "iconName": "circle-dot", - "prefix": "fas", - } - } - size={20} - /> - - text translated - - - https://zec.rocks:443 - - - - - - - text translated - - - - - + - < - color="rgb(216, 216, 216)" - icon={ - { - "icon": [ - 512, - 512, - [ - 128308, - 128309, - 128992, - 128993, - 128994, - 128995, - 128996, - 9679, - 9898, - 9899, - 11044, - 61708, - 61915, - ], - "f111", - "M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z", - ], - "iconName": "circle", - "prefix": "far", - } - } - size={20} - /> - - text translated - - - + text translated + + - - + + + + + text translated + + + + + - text translated - - - - + - - < - color="rgb(216, 216, 216)" - icon={ - { - "icon": [ - 512, - 512, - [ - 128308, - 128309, - 128992, - 128993, - 128994, - 128995, - 128996, - 9679, - 9898, - 9899, - 11044, - 61708, - 61915, - ], - "f111", - "M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z", + "icon": [ + 512, + 512, + [ + 128308, + 128309, + 128992, + 128993, + 128994, + 128995, + 128996, + 9679, + 9898, + 9899, + 11044, + 61708, + 61915, ], - "iconName": "circle", - "prefix": "far", - } - } - size={20} - /> - - text translated - - - - + size={20} + /> @@ -2188,1410 +1779,1808 @@ exports[`Component Settings - test Settings - snapshot 1`] = ` style={ { "display": "flex", - "margin": 10, } } > text translated - + - + > + < + color="#ffffff" + icon={ + { + "icon": [ + 512, + 512, + [ + 128280, + "dot-circle", + ], + "f192", + "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-352a96 96 0 1 1 0 192 96 96 0 1 1 0-192z", + ], + "iconName": "circle-dot", + "prefix": "fas", + } + } + size={20} + /> + + text translated + + + https://zec.rocks:443 + + + + text translated + + + + < + color="#ffffff" + icon={ + { + "icon": [ + 512, + 512, + [ + 128308, + 128309, + 128992, + 128993, + 128994, + 128995, + 128996, + 9679, + 9898, + 9899, + 11044, + 61708, + 61915, + ], + "f111", + "M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z", + ], + "iconName": "circle", + "prefix": "far", + } + } + size={20} + /> + + text translated + + + + + + text translated + + + - + > + < + color="#ffffff" + icon={ + { + "icon": [ + 512, + 512, + [ + 128308, + 128309, + 128992, + 128993, + 128994, + 128995, + 128996, + 9679, + 9898, + 9899, + 11044, + 61708, + 61915, + ], + "f111", + "M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z", + ], + "iconName": "circle", + "prefix": "far", + } + } + size={20} + /> + + text translated + + - - text translated - + + text translated + + - + + - + + + - - - + - text translated - + /> - - + + + + - + + + text translated + + + + + - - + + + text translated + + + + + - text translated - + /> - - + + + + + + + text translated + + + + + - + + + text translated + + + + + - - + + + text translated + + + + + - text translated - + /> + + text translated + + + + + text translated + + + - - - - - text translated - + value="500" + /> - + + + text translated + + + + - - - - text translated - - - - - + > + < + color="#ffffff" + icon={ + { + "icon": [ + 512, + 512, + [ + 128308, + 128309, + 128992, + 128993, + 128994, + 128995, + 128996, + 9679, + 9898, + 9899, + 11044, + 61708, + 61915, + ], + "f111", + "M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z", + ], + "iconName": "circle", + "prefix": "far", + } + } + size={20} + /> + + text translated + + - text translated - - - - - text translated + text none - + - - - - - - text translated - - - - - - < - color="rgb(216, 216, 216)" - icon={ - { - "icon": [ - 512, - 512, - [ - 128308, - 128309, - 128992, - 128993, - 128994, - 128995, - 128996, - 9679, - 9898, - 9899, - 11044, - 61708, - 61915, - ], - "f111", - "M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z", + "icon": [ + 512, + 512, + [ + 128280, + "dot-circle", ], - "iconName": "circle", - "prefix": "far", - } - } - size={20} - /> - - text translated - - - - - text none - - - - - + - < - color="rgb(216, 216, 216)" - icon={ - { - "icon": [ - 512, - 512, - [ - 128280, - "dot-circle", - ], - "f192", - "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-352a96 96 0 1 1 0 192 96 96 0 1 1 0-192z", - ], - "iconName": "circle-dot", - "prefix": "fas", - } - } - size={20} - /> - - text translated - - + text translated + - + + text wallet + + + + - text wallet - - - + } + testID="settings.memo-all" + > - + - < - color="rgb(216, 216, 216)" - icon={ - { - "icon": [ - 512, - 512, - [ - 128308, - 128309, - 128992, - 128993, - 128994, - 128995, - 128996, - 9679, - 9898, - 9899, - 11044, - 61708, - 61915, - ], - "f111", - "M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z", - ], - "iconName": "circle", - "prefix": "far", - } - } - size={20} - /> - - text translated - - + text translated + - - text all - - - - text translated + text all - + + - - + + + + + - + - < - color="rgb(216, 216, 216)" - icon={ - { - "icon": [ - 512, - 512, - [ - 128280, - "dot-circle", - ], - "f192", - "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-352a96 96 0 1 1 0 192 96 96 0 1 1 0-192z", - ], - "iconName": "circle-dot", - "prefix": "fas", - } - } - size={20} - /> - - text translated - - + text translated + - - text true - - - + text true + + + + + - + - < - color="rgb(216, 216, 216)" - icon={ - { - "icon": [ - 512, - 512, - [ - 128308, - 128309, - 128992, - 128993, - 128994, - 128995, - 128996, - 9679, - 9898, - 9899, - 11044, - 61708, - 61915, - ], - "f111", - "M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z", - ], - "iconName": "circle", - "prefix": "far", - } - } - size={20} - /> - - text translated - - + text translated + - - text false - - - - text translated + text false - + + + text translated + + + + + - - - text translated - - + text translated + - + `; diff --git a/__tests__/__snapshots__/ShowUfvk.snapshot.tsx.snap b/__tests__/__snapshots__/ShowUfvk.snapshot.tsx.snap index 563eb9a72..16bc1be8d 100644 --- a/__tests__/__snapshots__/ShowUfvk.snapshot.tsx.snap +++ b/__tests__/__snapshots__/ShowUfvk.snapshot.tsx.snap @@ -1,23 +1,13 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Component ShowUfvk - test ShowUfvk - snapshot 1`] = ` - +[ < + color="#5a8c5a" icon={ { "icon": [ @@ -165,7 +156,7 @@ exports[`Component ShowUfvk - test ShowUfvk - snapshot 1`] = ` } /> - + , < - color="rgb(0, 122, 255)" + color="#18bd18" icon={ { "icon": [ @@ -242,7 +233,7 @@ exports[`Component ShowUfvk - test ShowUfvk - snapshot 1`] = ` - + , - + , - - + , +] `; diff --git a/__tests__/__snapshots__/SingleAddress.snapshot.tsx.snap b/__tests__/__snapshots__/SingleAddress.snapshot.tsx.snap index 555ed4738..7486378b1 100644 --- a/__tests__/__snapshots__/SingleAddress.snapshot.tsx.snap +++ b/__tests__/__snapshots__/SingleAddress.snapshot.tsx.snap @@ -19,7 +19,7 @@ exports[`Component SingleAddress - test SingleAddress - snapshot 1`] = ` +[ - + , < - color="rgb(0, 122, 255)" + color="#18bd18" icon={ { "icon": [ @@ -162,7 +152,7 @@ exports[`Component SyncReport - test SyncReport - snapshot 1`] = ` - + , @@ -317,7 +307,7 @@ exports[`Component SyncReport - test SyncReport - snapshot 1`] = ` @@ -337,7 +327,7 @@ exports[`Component SyncReport - test SyncReport - snapshot 1`] = ` @@ -428,7 +418,7 @@ exports[`Component SyncReport - test SyncReport - snapshot 1`] = ` @@ -450,7 +440,7 @@ exports[`Component SyncReport - test SyncReport - snapshot 1`] = ` @@ -472,7 +462,7 @@ exports[`Component SyncReport - test SyncReport - snapshot 1`] = ` - - + , +] `; diff --git a/android/app/build.gradle b/android/app/build.gradle index 80e6ab06c..03277eb97 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -8,14 +8,14 @@ apply plugin: "org.jetbrains.kotlin.android" */ react { /* Folders */ - // The root of your project, i.e. where "package.json" lives. Default is '..' - // root = file("../") - // The folder where the react-native NPM package is. Default is ../node_modules/react-native - // reactNativeDir = file("../node_modules/react-native") - // The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen - // codegenDir = file("../node_modules/@react-native/codegen") - // The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js - // cliFile = file("../node_modules/react-native/cli.js") + // The root of your project, i.e. where "package.json" lives. Default is '../..' + // root = file("../../") + // The folder where the react-native NPM package is. Default is ../../node_modules/react-native + // reactNativeDir = file("../../node_modules/react-native") + // The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen + // codegenDir = file("../../node_modules/@react-native/codegen") + // The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js + // cliFile = file("../../node_modules/react-native/cli.js") /* Variants */ // The list of variants to that are debuggable. For those we're going to @@ -49,6 +49,9 @@ react { // // The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map" // hermesFlags = ["-O", "-output-source-map"] + + /* Autolinking */ + autolinkLibrariesWithApp() } /** @@ -131,12 +134,6 @@ android { } } - packagingOptions { - jniLibs { - pickFirsts += ['lib/armeabi-v7a/libc++_shared.so', 'lib/arm64-v8a/libc++_shared.so', 'lib/x86/libc++_shared.so', 'lib/x86_64/libc++_shared.so'] - } - } - buildTypes { debug { signingConfig signingConfigs.debug @@ -282,6 +279,4 @@ dependencies { // back navigation implementation implementation "androidx.activity:activity:1.6.0-alpha05" -} - -apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) +} \ No newline at end of file diff --git a/android/app/src/androidTest/java/org/ZingoLabs/Zingo/RustFFITest.kt b/android/app/src/androidTest/java/org/ZingoLabs/Zingo/RustFFITest.kt index e0d1c508a..bda79a560 100644 --- a/android/app/src/androidTest/java/org/ZingoLabs/Zingo/RustFFITest.kt +++ b/android/app/src/androidTest/java/org/ZingoLabs/Zingo/RustFFITest.kt @@ -113,7 +113,7 @@ data class ParseResult ( val address_kind: String? ) -val reactContext = ReactApplicationContext(MainApplication.getAppContext()) +val reactContext = MainApplication.getAppContext() as ReactApplicationContext val rpcModule = RPCModule(reactContext) @Category(OfflineTest::class) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index c0a162fed..8f5a43cbf 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -18,7 +18,8 @@ android:usesCleartextTraffic="false" android:enableOnBackInvokedCallback="false" android:hardwareAccelerated="true" - android:theme="@style/AppTheme"> + android:theme="@style/AppTheme" + android:supportsRtl="true"> /dev/null # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s' "$PWD" ) || exit cd "$SAVED" >/dev/null APP_NAME="Gradle" diff --git a/android/gradlew.bat b/android/gradlew.bat index 920486cf4..466141462 100644 --- a/android/gradlew.bat +++ b/android/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## diff --git a/android/settings.gradle b/android/settings.gradle index 6d834aa75..00223e3a8 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -1,4 +1,7 @@ +pluginManagement { includeBuild("../node_modules/@react-native/gradle-plugin") } +plugins { id("com.facebook.react.settings") } +extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() } + rootProject.name = 'Zingo' -apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) include ':app' includeBuild('../node_modules/@react-native/gradle-plugin') diff --git a/app/AppState/types/NetInfoType.ts b/app/AppState/types/NetInfoType.ts index db992bdd2..999b064ef 100644 --- a/app/AppState/types/NetInfoType.ts +++ b/app/AppState/types/NetInfoType.ts @@ -1,4 +1,4 @@ -import { NetInfoStateType } from '@react-native-community/netinfo'; +import { NetInfoStateType } from '@react-native-community/netinfo/src/index'; export default interface NetInfoType { isConnected: boolean | null; diff --git a/app/LoadedApp/LoadedApp.tsx b/app/LoadedApp/LoadedApp.tsx index 4f4ec937c..4c951d315 100644 --- a/app/LoadedApp/LoadedApp.tsx +++ b/app/LoadedApp/LoadedApp.tsx @@ -9,22 +9,21 @@ import { AppState, NativeEventSubscription, Linking, - SafeAreaView, Platform, ActivityIndicator, - TouchableOpacity, Dimensions, } from 'react-native'; -import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'; +import { SafeAreaProvider, SafeAreaView } from 'react-native-safe-area-context'; +import { BottomTabBarButtonProps, createBottomTabNavigator } from '@react-navigation/bottom-tabs'; import { FontAwesomeIcon } from '@fortawesome/react-native-fontawesome'; -import { faList, faUpload, faDownload, faCog, faRefresh } from '@fortawesome/free-solid-svg-icons'; +import { faDownload, faCog, faRefresh, faPaperPlane, faClockRotateLeft } from '@fortawesome/free-solid-svg-icons'; import { useTheme } from '@react-navigation/native'; -import { DrawerLayout } from 'react-native-gesture-handler'; +import ReanimatedDrawerLayout, { DrawerType } from 'react-native-gesture-handler/ReanimatedDrawerLayout'; import { I18n } from 'i18n-js'; import * as RNLocalize from 'react-native-localize'; import { cloneDeep, isEqual } from 'lodash'; import { StackScreenProps } from '@react-navigation/stack'; -import NetInfo, { NetInfoSubscription } from '@react-native-community/netinfo'; +import NetInfo, { NetInfoSubscription } from '@react-native-community/netinfo/src/index'; import { activateKeepAwake, deactivateKeepAwake } from '@sayem314/react-native-keep-awake'; import RPC from '../rpc'; @@ -91,8 +90,8 @@ import Send from '../../components/Send'; import Receive from '../../components/Receive'; import Settings from '../../components/Settings'; import Menu from './components/Menu'; -import RegText from '../../components/Components/RegText'; import { MessagesModal } from '../../components/Messages'; +import { PlatformPressable } from '@react-navigation/elements'; const About = React.lazy(() => import('../../components/About')); const Seed = React.lazy(() => import('../../components/Seed')); @@ -126,7 +125,7 @@ const SERVER_DEFAULT_0: ServerType = { } as ServerType; export default function LoadedApp(props: LoadedAppProps) { - const theme = useTheme() as unknown as ThemeType; + const theme = useTheme() as ThemeType; const [language, setLanguage] = useState(LanguageEnum.en); const [currency, setCurrency] = useState(CurrencyEnum.noCurrency); const [server, setServer] = useState(SERVER_DEFAULT_0); @@ -353,15 +352,17 @@ export default function LoadedApp(props: LoadedAppProps) { if (loading) { return ( - - - + + + + + ); } else { return ( @@ -434,6 +435,15 @@ type LoadedAppClassProps = { type LoadedAppClassState = AppStateLoaded & AppContextLoaded; +const TabPressable: React.FC = ({ colors, ...props }) => { + console.log('colors', colors); + + return ; +}; + +const renderTabPressable = (colors: ThemeType) => (props: BottomTabBarButtonProps) => + ; + export class LoadedAppClass extends Component { rpc: RPC; appstate: NativeEventSubscription; @@ -683,7 +693,7 @@ export class LoadedAppClass extends Component { + this.unsubscribeNetInfo = NetInfo.addEventListener(async (state: any) => { const { isConnected, type, isConnectionExpensive } = this.state.netInfo; if ( isConnected !== state.isConnected || @@ -1785,11 +1795,11 @@ export class LoadedAppClass extends Component; - const fnTabBarIcon = (route: StackScreenProps['route'], focused: boolean, navigation: any) => { + const fnTabBarIcon = (route: StackScreenProps['route'], focused: boolean) => { var iconName; if (route.name === translate('loadedapp.history-menu')) { - iconName = faList; + iconName = faClockRotateLeft; } else if (route.name === translate('loadedapp.send-menu')) { if ( mode === ModeEnum.basic && @@ -1800,7 +1810,7 @@ export class LoadedAppClass extends Component - { - navigation.navigate(route.name); - }}> - {focused ? ( - - ) : ( - - - - {route.name} - - - )} - - - ); + return ; }; //console.log('render LoadedAppClass - 3'); @@ -1837,10 +1828,10 @@ export class LoadedAppClass extends Component - (this.drawerRef = ref)} renderNavigationView={() => menu} - drawerType="slide" + drawerType={DrawerType.BACK} drawerWidth={Dimensions.get('window').width * 0.7}> 0) || (!readOnly && !!totalBalance && totalBalance.spendableOrchard + totalBalance.spendablePrivate > 0) ? ( ({ - tabBarIcon: ({ focused }) => fnTabBarIcon(route, focused, navigation), + screenOptions={({ route }) => ({ + tabBarIcon: ({ focused }) => fnTabBarIcon(route, focused), + tabBarIconStyle: { alignItems: 'center', justifyContent: 'center', alignSelf: 'center' }, + tabBarItemStyle: { + justifyContent: 'center', + alignSelf: 'center', + }, tabBarLabelPosition: 'below-icon', - tabBarActiveTintColor: 'transparent', + tabBarActiveTintColor: colors.background, tabBarActiveBackgroundColor: colors.primaryDisabled, tabBarInactiveTintColor: colors.money, - tabBarShowLabel: false, tabBarStyle: { borderRadius: 0, borderTopColor: colors.primaryDisabled, borderTopWidth: 1, }, headerShown: false, + tabBarButton: renderTabPressable(colors), })}> {() => ( @@ -2226,7 +2223,7 @@ export class LoadedAppClass extends Component )} - + ); } diff --git a/app/LoadedApp/components/ComputingTxContent.tsx b/app/LoadedApp/components/ComputingTxContent.tsx index 63fd00957..9cb8ecb53 100644 --- a/app/LoadedApp/components/ComputingTxContent.tsx +++ b/app/LoadedApp/components/ComputingTxContent.tsx @@ -1,6 +1,7 @@ /* eslint-disable react-native/no-inline-styles */ import React, { useContext } from 'react'; -import { ActivityIndicator, SafeAreaView, View } from 'react-native'; +import { ActivityIndicator, View } from 'react-native'; +import { SafeAreaProvider, SafeAreaView } from 'react-native-safe-area-context'; import { useTheme } from '@react-navigation/native'; import RegText from '../../../components/Components/RegText'; @@ -15,37 +16,39 @@ import 'moment/locale/ru'; const ComputingTxContent: React.FunctionComponent = () => { const context = useContext(ContextAppLoaded); const { translate, language } = context; - const { colors } = useTheme() as unknown as ThemeType; + const { colors } = useTheme() as ThemeType; moment.locale(language); return ( - -
- + - {translate('loadedapp.computingtx') as string} - - {translate('wait') as string} - - +
+ + {translate('loadedapp.computingtx') as string} + + {translate('wait') as string} + + + ); }; diff --git a/app/LoadedApp/components/Menu.tsx b/app/LoadedApp/components/Menu.tsx index 772f4cdc2..e68ca4a5b 100644 --- a/app/LoadedApp/components/Menu.tsx +++ b/app/LoadedApp/components/Menu.tsx @@ -1,6 +1,7 @@ /* eslint-disable react-native/no-inline-styles */ import React, { useContext } from 'react'; -import { ScrollView, View, Text, Dimensions, SafeAreaView } from 'react-native'; +import { ScrollView, View, Text, Dimensions } from 'react-native'; +import { SafeAreaProvider, SafeAreaView } from 'react-native-safe-area-context'; import RegText from '../../../components/Components/RegText'; @@ -33,7 +34,7 @@ const Menu: React.FunctionComponent = ({ onItemSelected, closeDrawer selectServer, netInfo, } = context; - const { colors } = useTheme() as unknown as ThemeType; + const { colors } = useTheme() as ThemeType; moment.locale(language); const dimensions = { @@ -74,160 +75,162 @@ const Menu: React.FunctionComponent = ({ onItemSelected, closeDrawer }; return ( - - + - - {translate('loadedapp.options') as string} - - - - - onItemSelectedWrapper(MenuItemEnum.About)} style={item}> - {translate('loadedapp.about') as string} + + + {translate('loadedapp.options') as string} + - {mode !== ModeEnum.basic && selectServer !== SelectServerEnum.offline && ( - onItemSelectedWrapper(MenuItemEnum.Info)} style={item}> - {translate('loadedapp.info') as string} + + onItemSelectedWrapper(MenuItemEnum.About)} style={item}> + {translate('loadedapp.about') as string} - )} - onItemSelectedWrapper(MenuItemEnum.Settings)} style={item}> - {translate('loadedapp.settings') as string} - - - onItemSelectedWrapper(MenuItemEnum.Chats)} - style={{ ...item, color: colors.primary }}> - {translate('messages.title-chats') as string} - - - onItemSelectedWrapper(MenuItemEnum.AddressBook)} - style={item}> - {translate('loadedapp.addressbook') as string} - + {mode !== ModeEnum.basic && selectServer !== SelectServerEnum.offline && ( + onItemSelectedWrapper(MenuItemEnum.Info)} style={item}> + {translate('loadedapp.info') as string} + + )} - {!(mode === ModeEnum.basic && valueTransfersTotal !== null && valueTransfersTotal === 0) && ( - onItemSelectedWrapper(MenuItemEnum.WalletSeedUfvk)} - style={item}> - {readOnly - ? mode === ModeEnum.basic - ? (translate('loadedapp.walletufvk-basic') as string) - : (translate('loadedapp.walletufvk') as string) - : mode === ModeEnum.basic - ? (translate('loadedapp.walletseed-basic') as string) - : (translate('loadedapp.walletseed') as string)} + onItemSelectedWrapper(MenuItemEnum.Settings)} style={item}> + {translate('loadedapp.settings') as string} - )} - {mode !== ModeEnum.basic && rescanMenu && selectServer !== SelectServerEnum.offline && ( - onItemSelectedWrapper(MenuItemEnum.Rescan)} style={item}> - {translate('loadedapp.rescanwallet') as string} + onItemSelectedWrapper(MenuItemEnum.Chats)} + style={{ ...item, color: colors.primary }}> + {translate('messages.title-chats') as string} - )} - {mode !== ModeEnum.basic && selectServer !== SelectServerEnum.offline && ( onItemSelectedWrapper(MenuItemEnum.SyncReport)} + testID="menu.addressbook" + onPress={() => onItemSelectedWrapper(MenuItemEnum.AddressBook)} style={item}> - {translate('loadedapp.report') as string} + {translate('loadedapp.addressbook') as string} - )} - {mode !== ModeEnum.basic && ( - onItemSelectedWrapper(MenuItemEnum.FundPools)} style={item}> - {translate('loadedapp.fundpools') as string} - - )} + {!(mode === ModeEnum.basic && valueTransfersTotal !== null && valueTransfersTotal === 0) && ( + onItemSelectedWrapper(MenuItemEnum.WalletSeedUfvk)} + style={item}> + {readOnly + ? mode === ModeEnum.basic + ? (translate('loadedapp.walletufvk-basic') as string) + : (translate('loadedapp.walletufvk') as string) + : mode === ModeEnum.basic + ? (translate('loadedapp.walletseed-basic') as string) + : (translate('loadedapp.walletseed') as string)} + + )} - {!(mode === ModeEnum.basic && valueTransfersTotal !== null && valueTransfersTotal === 0) && ( - onItemSelectedWrapper(MenuItemEnum.Insight)} style={item}> - {translate('loadedapp.insight') as string} - - )} + {mode !== ModeEnum.basic && rescanMenu && selectServer !== SelectServerEnum.offline && ( + onItemSelectedWrapper(MenuItemEnum.Rescan)} style={item}> + {translate('loadedapp.rescanwallet') as string} + + )} - {mode !== ModeEnum.basic && netInfo.isConnected && selectServer !== SelectServerEnum.offline && ( - onItemSelectedWrapper(MenuItemEnum.ChangeWallet)} - style={item}> - {translate('loadedapp.changewallet') as string} - - )} + {mode !== ModeEnum.basic && selectServer !== SelectServerEnum.offline && ( + onItemSelectedWrapper(MenuItemEnum.SyncReport)} + style={item}> + {translate('loadedapp.report') as string} + + )} - {mode !== ModeEnum.basic && ( - onItemSelectedWrapper(MenuItemEnum.RestoreWalletBackup)} - style={item}> - {translate('loadedapp.restorebackupwallet') as string} - - )} - {mode === ModeEnum.basic && - valueTransfersTotal !== null && - valueTransfersTotal === 0 && - netInfo.isConnected && - selectServer !== SelectServerEnum.offline && ( + {mode !== ModeEnum.basic && ( + onItemSelectedWrapper(MenuItemEnum.FundPools)} style={item}> + {translate('loadedapp.fundpools') as string} + + )} + + {!(mode === ModeEnum.basic && valueTransfersTotal !== null && valueTransfersTotal === 0) && ( + onItemSelectedWrapper(MenuItemEnum.Insight)} style={item}> + {translate('loadedapp.insight') as string} + + )} + + {mode !== ModeEnum.basic && netInfo.isConnected && selectServer !== SelectServerEnum.offline && ( onItemSelectedWrapper(MenuItemEnum.LoadWalletFromSeed)} + testID="menu.changewallet" + onPress={() => onItemSelectedWrapper(MenuItemEnum.ChangeWallet)} style={item}> - {translate('loadedapp.loadwalletfromseed-basic') as string} + {translate('loadedapp.changewallet') as string} )} - {mode === ModeEnum.basic && !readOnly && selectServer !== SelectServerEnum.offline && ( - onItemSelectedWrapper(MenuItemEnum.TipZingoLabs)} - style={item}> - {translate('loadedapp.tipzingolabs-basic') as string} - - )} - {mode !== ModeEnum.basic && !readOnly && selectServer !== SelectServerEnum.offline && ( - onItemSelectedWrapper(MenuItemEnum.VoteForNym)} - style={item}> - {translate('loadedapp.votefornym') as string} + + {mode !== ModeEnum.basic && ( + onItemSelectedWrapper(MenuItemEnum.RestoreWalletBackup)} + style={item}> + {translate('loadedapp.restorebackupwallet') as string} + + )} + {mode === ModeEnum.basic && + valueTransfersTotal !== null && + valueTransfersTotal === 0 && + netInfo.isConnected && + selectServer !== SelectServerEnum.offline && ( + onItemSelectedWrapper(MenuItemEnum.LoadWalletFromSeed)} + style={item}> + {translate('loadedapp.loadwalletfromseed-basic') as string} + + )} + {mode === ModeEnum.basic && !readOnly && selectServer !== SelectServerEnum.offline && ( + onItemSelectedWrapper(MenuItemEnum.TipZingoLabs)} + style={item}> + {translate('loadedapp.tipzingolabs-basic') as string} + + )} + {mode !== ModeEnum.basic && !readOnly && selectServer !== SelectServerEnum.offline && ( + onItemSelectedWrapper(MenuItemEnum.VoteForNym)} + style={item}> + {translate('loadedapp.votefornym') as string} + + )} + onItemSelectedWrapper(MenuItemEnum.Support)} style={item}> + {translate('loadedapp.support') as string} - )} - onItemSelectedWrapper(MenuItemEnum.Support)} style={item}> - {translate('loadedapp.support') as string} - + + + + Version : + {translate('version') as string} + {`${translate('settings.mode')}${translate( + `settings.value-mode-${mode}`, + )}`} - - - Version : - {translate('version') as string} - {`${translate('settings.mode')}${translate( - `settings.value-mode-${mode}`, - )}`} - - + + ); }; diff --git a/app/LoadingApp/LoadingApp.tsx b/app/LoadingApp/LoadingApp.tsx index b35017a23..cf5a6aee3 100644 --- a/app/LoadingApp/LoadingApp.tsx +++ b/app/LoadingApp/LoadingApp.tsx @@ -2,7 +2,6 @@ import React, { Component, useState, useMemo, useEffect } from 'react'; import { Alert, - SafeAreaView, Modal, I18nManager, EmitterSubscription, @@ -10,12 +9,14 @@ import { NativeEventSubscription, Platform, } from 'react-native'; +import { SafeAreaProvider, SafeAreaView } from 'react-native-safe-area-context'; + import Clipboard from '@react-native-clipboard/clipboard'; import { useTheme } from '@react-navigation/native'; import { I18n } from 'i18n-js'; import * as RNLocalize from 'react-native-localize'; import { StackScreenProps } from '@react-navigation/stack'; -import NetInfo, { NetInfoSubscription } from '@react-native-community/netinfo'; +import NetInfo, { NetInfoSubscription } from '@react-native-community/netinfo/src/index'; import RPCModule from '../RPCModule'; import { @@ -98,7 +99,7 @@ const SERVER_DEFAULT_0: ServerType = { } as ServerType; export default function LoadingApp(props: LoadingAppProps) { - const theme = useTheme() as unknown as ThemeType; + const theme = useTheme() as ThemeType; const [language, setLanguage] = useState(LanguageEnum.en); const [currency, setCurrency] = useState(CurrencyEnum.noCurrency); const [server, setServer] = useState(SERVER_DEFAULT_0); @@ -274,15 +275,17 @@ export default function LoadingApp(props: LoadingAppProps) { if (loading) { return ( - - - + + + + + ); } else { return ( @@ -646,7 +649,7 @@ export class LoadingAppClass extends Component { + this.unsubscribeNetInfo = NetInfo.addEventListener((state: any) => { const { screen } = this.state; const { isConnected, type, isConnectionExpensive } = this.state.netInfo; if ( @@ -1230,28 +1233,31 @@ export class LoadingAppClass extends Component { - Alert.alert( - this.props.translate('loadedapp.walletseed-basic') as string, - (security ? '' : ((this.props.translate('loadingapp.recoverkeysinstall') + '\n\n') as string)) + txt, - [ - { - text: this.props.translate('copy') as string, - onPress: () => { - Clipboard.setString(txt); - this.addLastSnackbar({ - message: this.props.translate('txtcopied') as string, - duration: SnackbarDurationEnum.short, - }); + setTimeout( + () => { + Alert.alert( + this.props.translate('loadedapp.walletseed-basic') as string, + (security ? '' : ((this.props.translate('loadingapp.recoverkeysinstall') + '\n\n') as string)) + txt, + [ + { + text: this.props.translate('copy') as string, + onPress: () => { + Clipboard.setString(txt); + this.addLastSnackbar({ + message: this.props.translate('txtcopied') as string, + duration: SnackbarDurationEnum.short, + }); + }, }, - }, - { text: this.props.translate('cancel') as string, style: 'cancel' }, - ], - { cancelable: false }, - ); - // IOS needs time to close the biometric screen. - // but Android I don't think so, a little bit Just in case. - }, Platform.OS === GlobalConst.platformOSios ? 2000 : 100); + { text: this.props.translate('cancel') as string, style: 'cancel' }, + ], + { cancelable: false }, + ); + // IOS needs time to close the biometric screen. + // but Android I don't think so, a little bit Just in case. + }, + Platform.OS === GlobalConst.platformOSios ? 2000 : 100, + ); } }; @@ -1314,75 +1320,77 @@ export class LoadingAppClass extends Component - - - - {screen === 0 && ( - { - this.setState({ biometricsFailed: false }, () => this.componentDidMount()); - }} - /> - )} - {screen === 1 && ( - - )} - {screen === 2 && wallet && ( - this.navigateToLoadedApp()}> - this.navigateToLoadedApp()} - onClickCancel={() => this.navigateToLoadedApp()} - action={SeedActionEnum.new} - setPrivacyOption={this.setPrivacyOption} + + + + + {screen === 0 && ( + { + this.setState({ biometricsFailed: false }, () => this.componentDidMount()); + }} /> - - )} - {screen === 3 && ( - this.setState({ screen: 1 })}> - this.doRestore(s, b)} - onClickCancel={() => this.setState({ screen: 1 })} + )} + {screen === 1 && ( + - - )} - + )} + {screen === 2 && wallet && ( + this.navigateToLoadedApp()}> + this.navigateToLoadedApp()} + onClickCancel={() => this.navigateToLoadedApp()} + action={SeedActionEnum.new} + setPrivacyOption={this.setPrivacyOption} + /> + + )} + {screen === 3 && ( + this.setState({ screen: 1 })}> + this.doRestore(s, b)} + onClickCancel={() => this.setState({ screen: 1 })} + /> + + )} + + ); } diff --git a/app/LoadingApp/components/Launching.tsx b/app/LoadingApp/components/Launching.tsx index b1e71f252..f11a15df7 100644 --- a/app/LoadingApp/components/Launching.tsx +++ b/app/LoadingApp/components/Launching.tsx @@ -1,6 +1,8 @@ /* eslint-disable react-native/no-inline-styles */ import React from 'react'; -import { SafeAreaView, Text, View, ActivityIndicator } from 'react-native'; +import { Text, View, ActivityIndicator } from 'react-native'; +import { SafeAreaProvider, SafeAreaView } from 'react-native-safe-area-context'; + import { useTheme } from '@react-navigation/native'; import { ThemeType } from '../../types'; @@ -16,145 +18,147 @@ type LaunchingProps = { }; const Launching: React.FunctionComponent = props => { - const { colors } = useTheme() as unknown as ThemeType; + const { colors } = useTheme() as ThemeType; return ( - - + - - {props.translate('zingo') as string} - - {props.translate('version') as string} - - - {!!props.message && ( - - {props.message} + + + {props.translate('zingo') as string} - )} - {props.biometricsFailed ? ( - <> - - {props.translate('biometricsfailed-title') as string} - - - {props.translate('biometricsfailed-body') as string} - - - {props.translate('biometricsfailed-footer') as string} - -