diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index e364074a3..f73d5072f 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -9,7 +9,7 @@ "features": { "ghcr.io/devcontainers/features/java:1": { "installGradle": true, - "version": "17", + "version": "18", "jdkDistro": "open", "gradleVersion": "latest", "mavenVersion": "latest", diff --git a/.github/workflows/android-build.yaml b/.github/workflows/android-build.yaml index 8acfb5698..3b1e29fa0 100644 --- a/.github/workflows/android-build.yaml +++ b/.github/workflows/android-build.yaml @@ -62,7 +62,7 @@ jobs: if: ${{ needs.android-check-build-cache.outputs.native-cache-found != 'true' || needs.android-check-build-cache.outputs.kotlin-cache-found != 'true' }} runs-on: ubuntu-22.04 container: - image: zingodevops/android_builder:010 + image: zingodevops/android_builder:011 env: RUSTUP_HOME: /root/.rustup steps: diff --git a/.github/workflows/android-macos-integration-test.yaml b/.github/workflows/android-macos-integration-test.yaml index c7567e267..ec4a8702e 100644 --- a/.github/workflows/android-macos-integration-test.yaml +++ b/.github/workflows/android-macos-integration-test.yaml @@ -143,7 +143,7 @@ jobs: uses: actions/setup-java@v4 with: distribution: 'temurin' - java-version: '17' + java-version: '18' - name: Setup Android SDK uses: android-actions/setup-android@v3 diff --git a/.github/workflows/android-ubuntu-e2e-test-ci.yaml b/.github/workflows/android-ubuntu-e2e-test-ci.yaml index a78ea8dd4..69831c52a 100644 --- a/.github/workflows/android-ubuntu-e2e-test-ci.yaml +++ b/.github/workflows/android-ubuntu-e2e-test-ci.yaml @@ -220,7 +220,7 @@ jobs: uses: actions/setup-java@v4 with: distribution: 'temurin' - java-version: '17' + java-version: '18' - name: Gradle cache uses: gradle/actions/setup-gradle@v4 diff --git a/.github/workflows/android-ubuntu-integration-test-ci.yaml b/.github/workflows/android-ubuntu-integration-test-ci.yaml index 110d7d893..ac6b77661 100644 --- a/.github/workflows/android-ubuntu-integration-test-ci.yaml +++ b/.github/workflows/android-ubuntu-integration-test-ci.yaml @@ -201,7 +201,7 @@ jobs: uses: actions/setup-java@v4 with: distribution: 'temurin' - java-version: '17' + java-version: '18' - name: Gradle cache uses: gradle/actions/setup-gradle@v4 diff --git a/.github/workflows/old/android-e2e-test-actions.yaml b/.github/workflows/old/android-e2e-test-actions.yaml index e2c926927..3fccba572 100644 --- a/.github/workflows/old/android-e2e-test-actions.yaml +++ b/.github/workflows/old/android-e2e-test-actions.yaml @@ -48,7 +48,7 @@ jobs: uses: actions/setup-java@v4 with: distribution: 'temurin' - java-version: '17' + java-version: '18' - name: Gradle cache uses: gradle/actions/setup-gradle@v4 diff --git a/.github/workflows/old/android-e2e-test-script.yaml b/.github/workflows/old/android-e2e-test-script.yaml index eb502c00b..ca48f6621 100644 --- a/.github/workflows/old/android-e2e-test-script.yaml +++ b/.github/workflows/old/android-e2e-test-script.yaml @@ -194,7 +194,7 @@ jobs: uses: actions/setup-java@v4 with: distribution: 'temurin' - java-version: '17' + java-version: '18' - name: Setup Android SDK uses: android-actions/setup-android@v3 diff --git a/.github/workflows/old/android-ubuntu-integration-test.yaml b/.github/workflows/old/android-ubuntu-integration-test.yaml index 0fda44a13..ea7a149fd 100644 --- a/.github/workflows/old/android-ubuntu-integration-test.yaml +++ b/.github/workflows/old/android-ubuntu-integration-test.yaml @@ -170,7 +170,7 @@ jobs: uses: actions/setup-java@v4 with: distribution: 'temurin' - java-version: '17' + java-version: '18' - name: Setup Android SDK uses: android-actions/setup-android@v3 diff --git a/Gemfile b/Gemfile index 40733d160..f2b7ed68e 100644 --- a/Gemfile +++ b/Gemfile @@ -6,4 +6,5 @@ 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.3', '< 7.1.0' \ No newline at end of file +gem 'activesupport', '>= 6.1.7.5', '< 7.1.0' +gem 'xcodeproj', '< 1.26.0' \ No newline at end of file diff --git a/__mocks__/dataMocks/mockAddresses.ts b/__mocks__/dataMocks/mockAddresses.ts index edabd33a4..feee6c484 100644 --- a/__mocks__/dataMocks/mockAddresses.ts +++ b/__mocks__/dataMocks/mockAddresses.ts @@ -2,19 +2,19 @@ import { AddressClass, AddressKindEnum, ReceiverEnum } from '../../app/AppState' export const mockAddresses: AddressClass[] = [ { - uaAddress: 'UA-12345678901234567890', + uOrchardAddress: 'UA-12345678901234567890', address: 'UA-12345678901234567890', addressKind: AddressKindEnum.u, receivers: ReceiverEnum.o + ReceiverEnum.z + ReceiverEnum.t, }, { - uaAddress: 'UA-12345678901234567890', + uOrchardAddress: 'UA-12345678901234567890', address: 'sapling-12345678901234567890', addressKind: AddressKindEnum.z, receivers: ReceiverEnum.z, }, { - uaAddress: 'UA-12345678901234567890', + uOrchardAddress: 'UA-12345678901234567890', address: 'transparent-12345678901234567890', addressKind: AddressKindEnum.t, receivers: ReceiverEnum.t, diff --git a/__tests__/About.snapshot.tsx b/__tests__/About.snapshot.tsx index 892cd746b..6f60b4656 100644 --- a/__tests__/About.snapshot.tsx +++ b/__tests__/About.snapshot.tsx @@ -43,6 +43,10 @@ jest.mock('react-native', () => { return RN; }); +jest.mock('@react-native-clipboard/clipboard', () => ({ + getString: jest.fn(() => Promise.resolve('mocked clipboard content')), + setString: jest.fn(), +})); // test suite describe('Component About - test', () => { diff --git a/__tests__/App.snapshot.tsx b/__tests__/App.snapshot.tsx index 84d59bfff..00c2f0c1b 100644 --- a/__tests__/App.snapshot.tsx +++ b/__tests__/App.snapshot.tsx @@ -40,7 +40,7 @@ jest.mock('react-native', () => { RN.NativeModules.RPCModule = { execute: jest.fn(() => '{}'), - getValueTransfersList: jest.fn(() => '{ "value_transfers": [] }'), + getValueTransfersList: jest.fn(() => '{ "value_transfers": [], "total": 0 }'), }; return RN; @@ -93,6 +93,10 @@ jest.mock('react-native-keychain', () => ({ getGenericPassword: jest.fn(), resetGenericPassword: jest.fn(), })); +jest.mock('@react-native-clipboard/clipboard', () => ({ + getString: jest.fn(() => Promise.resolve('mocked clipboard content')), + setString: jest.fn(), +})); // test suite describe('Component App - test', () => { diff --git a/__tests__/Components.unit.tsx b/__tests__/Components.unit.tsx index aa1210f00..6b019d252 100644 --- a/__tests__/Components.unit.tsx +++ b/__tests__/Components.unit.tsx @@ -32,14 +32,12 @@ describe('Component Components - test', () => { , ).toJSON(); expect(text.type).toBe('View'); - expect(text.children[0].children[0].children[0].children[0]).toBe('$'); - expect(text.children[0].children[0].children[1].children[0]).toBe(' -.--'); + expect(text.children[0].children[0].children[0].children[0]).toBe('$ -.--'); }); test('CurrencyAmount - price undefined result $ -- USD', () => { const text: any = render().toJSON(); expect(text.type).toBe('View'); - expect(text.children[0].children[0].children[0].children[0]).toBe('$'); - expect(text.children[0].children[0].children[1].children[0]).toBe(' -.--'); + expect(text.children[0].children[0].children[0].children[0]).toBe('$ -.--'); }); test('CurrencyAmount - price 0 result $ -- USD', () => { @@ -47,15 +45,13 @@ describe('Component Components - test', () => { , ).toJSON(); expect(text.type).toBe('View'); - expect(text.children[0].children[0].children[0].children[0]).toBe('$'); - expect(text.children[0].children[0].children[1].children[0]).toBe(' -.--'); + expect(text.children[0].children[0].children[0].children[0]).toBe('$ -.--'); }); test('CurrencyAmount - amtZec undefined result $ -- USD', () => { const text: any = render().toJSON(); expect(text.type).toBe('View'); - expect(text.children[0].children[0].children[0].children[0]).toBe('$'); - expect(text.children[0].children[0].children[1].children[0]).toBe(' -.--'); + expect(text.children[0].children[0].children[0].children[0]).toBe('$ -.--'); }); test('CurrencyAmount - price * amtZec really tiny result $ < 0.01 USD', () => { @@ -63,8 +59,7 @@ describe('Component Components - test', () => { , ).toJSON(); expect(text.type).toBe('View'); - expect(text.children[0].children[0].children[0].children[0]).toBe('$'); - expect(text.children[0].children[0].children[1].children[0]).toBe(' < 0.01'); + expect(text.children[0].children[0].children[0].children[0]).toBe('$ < 0.01'); }); test('CurrencyAmount - price=2.9826 and amtZec=1.00098 result $ 2.99 USD', () => { @@ -72,8 +67,7 @@ describe('Component Components - test', () => { , ).toJSON(); expect(text.type).toBe('View'); - expect(text.children[0].children[0].children[0].children[0]).toBe('$'); - expect(text.children[0].children[0].children[1].children[0]).toBe(' 2.99'); + expect(text.children[0].children[0].children[0].children[0]).toBe('$ 2.99'); }); test("CurrencyAmount - style={backgroundColor: 'red'} result same", () => { @@ -87,7 +81,6 @@ describe('Component Components - test', () => { ).toJSON(); expect(text.type).toBe('View'); expect(text.children[0].children[0].children[0].props.style.backgroundColor).toBe('red'); - expect(text.children[0].children[0].children[1].props.style.backgroundColor).toBe('red'); }); test('ZecAmount - High Privacy - amtZec -1.123456789 rounded up result -.---- ZEC', () => { diff --git a/__tests__/DetailLine.snapshot.tsx b/__tests__/DetailLine.snapshot.tsx index 200a1610c..1aa1e8934 100644 --- a/__tests__/DetailLine.snapshot.tsx +++ b/__tests__/DetailLine.snapshot.tsx @@ -9,6 +9,11 @@ import { render } from '@testing-library/react-native'; import DetailLine from '../components/Components/DetailLine'; import { View } from 'react-native'; +jest.mock('@react-native-clipboard/clipboard', () => ({ + getString: jest.fn(() => Promise.resolve('mocked clipboard content')), + setString: jest.fn(), +})); + // test suite describe('Component DetailLine - test', () => { //snapshot test diff --git a/__tests__/History.ValueTransferDetail.unit.tsx b/__tests__/History.ValueTransferDetail.unit.tsx index b558728b5..3b60d014d 100644 --- a/__tests__/History.ValueTransferDetail.unit.tsx +++ b/__tests__/History.ValueTransferDetail.unit.tsx @@ -82,6 +82,10 @@ jest.mock('react-native', () => { return RN; }); +jest.mock('@react-native-clipboard/clipboard', () => ({ + getString: jest.fn(() => Promise.resolve('mocked clipboard content')), + setString: jest.fn(), +})); // test suite describe('Component History ValueTransferDetail - test', () => { diff --git a/__tests__/History.snapshot.tsx b/__tests__/History.snapshot.tsx index 9e14821a7..a6b5a5592 100644 --- a/__tests__/History.snapshot.tsx +++ b/__tests__/History.snapshot.tsx @@ -110,13 +110,17 @@ jest.mock('@react-navigation/native', () => ({ useScrollToTop: jest.fn(), useTheme: () => mockTheme, })); +jest.mock('@react-native-clipboard/clipboard', () => ({ + getString: jest.fn(() => Promise.resolve('mocked clipboard content')), + setString: jest.fn(), +})); // test suite describe('Component History - test', () => { //snapshot test const state = defaultAppContextLoaded; state.valueTransfers = mockValueTransfers; - state.uaAddress = mockAddresses[0].uaAddress; + state.uOrchardAddress = mockAddresses[0].uOrchardAddress; state.addresses = mockAddresses; state.translate = mockTranslate; state.info = mockInfo; @@ -146,6 +150,9 @@ describe('Component History - test', () => { scrollToTop={false} setScrollToBottom={onFunction} scrollToBottom={false} + sendTransaction={onFunction} + clearToAddr={onFunction} + setServerOption={onFunction} /> , ); @@ -175,6 +182,9 @@ describe('Component History - test', () => { scrollToTop={false} setScrollToBottom={onFunction} scrollToBottom={false} + sendTransaction={onFunction} + clearToAddr={onFunction} + setServerOption={onFunction} /> , ); diff --git a/__tests__/ImportUfvk.snapshot.tsx b/__tests__/ImportUfvk.snapshot.tsx index 4f3a7ce23..b96cb45e7 100644 --- a/__tests__/ImportUfvk.snapshot.tsx +++ b/__tests__/ImportUfvk.snapshot.tsx @@ -44,6 +44,10 @@ jest.mock('react-native', () => { return RN; }); +jest.mock('@react-native-clipboard/clipboard', () => ({ + getString: jest.fn(() => Promise.resolve('mocked clipboard content')), + setString: jest.fn(), +})); // test suite describe('Component ImportUfvk - test', () => { diff --git a/__tests__/Info.es.unit.tsx b/__tests__/Info.es.unit.tsx index ee09a6868..2d18018c5 100644 --- a/__tests__/Info.es.unit.tsx +++ b/__tests__/Info.es.unit.tsx @@ -43,6 +43,10 @@ jest.mock('react-native', () => { return RN; }); +jest.mock('@react-native-clipboard/clipboard', () => ({ + getString: jest.fn(() => Promise.resolve('mocked clipboard content')), + setString: jest.fn(), +})); // test suite describe('Component Info - test', () => { @@ -59,6 +63,6 @@ describe('Component Info - test', () => { , ); - screen.getByText('33,33'); + screen.getByText('$ 33,33'); }); }); diff --git a/__tests__/Info.snapshot.tsx b/__tests__/Info.snapshot.tsx index cc2945322..839230a49 100644 --- a/__tests__/Info.snapshot.tsx +++ b/__tests__/Info.snapshot.tsx @@ -44,6 +44,10 @@ jest.mock('react-native', () => { return RN; }); +jest.mock('@react-native-clipboard/clipboard', () => ({ + getString: jest.fn(() => Promise.resolve('mocked clipboard content')), + setString: jest.fn(), +})); // test suite describe('Component Info - test', () => { diff --git a/__tests__/Info.us.unit.tsx b/__tests__/Info.us.unit.tsx index e55c3dd5a..27db349f3 100644 --- a/__tests__/Info.us.unit.tsx +++ b/__tests__/Info.us.unit.tsx @@ -43,6 +43,10 @@ jest.mock('react-native', () => { return RN; }); +jest.mock('@react-native-clipboard/clipboard', () => ({ + getString: jest.fn(() => Promise.resolve('mocked clipboard content')), + setString: jest.fn(), +})); // test suite describe('Component Info - test', () => { @@ -59,6 +63,6 @@ describe('Component Info - test', () => { , ); - screen.getByText('33.33'); + screen.getByText('$ 33.33'); }); }); diff --git a/__tests__/Insight.snapshot.tsx b/__tests__/Insight.snapshot.tsx index f29fd55a0..2b6e3243f 100644 --- a/__tests__/Insight.snapshot.tsx +++ b/__tests__/Insight.snapshot.tsx @@ -36,6 +36,10 @@ jest.mock('react-native', () => { return RN; }); +jest.mock('@react-native-clipboard/clipboard', () => ({ + getString: jest.fn(() => Promise.resolve('mocked clipboard content')), + setString: jest.fn(), +})); // test suite describe('Component Insight - test', () => { diff --git a/__tests__/LoadedApp.snapshot.tsx b/__tests__/LoadedApp.snapshot.tsx index 92d2db5d5..fa48ca95b 100644 --- a/__tests__/LoadedApp.snapshot.tsx +++ b/__tests__/LoadedApp.snapshot.tsx @@ -64,7 +64,7 @@ jest.mock('react-native', () => { RN.NativeModules.RPCModule = { execute: jest.fn(() => '[]'), - getValueTransfersList: jest.fn(() => '{ "value_transfers": [] }'), + getValueTransfersList: jest.fn(() => '{ "value_transfers": [], "total": 0 }'), }; return RN; @@ -122,6 +122,10 @@ jest.mock('react-native-keychain', () => ({ getGenericPassword: jest.fn(), resetGenericPassword: jest.fn(), })); +jest.mock('@react-native-clipboard/clipboard', () => ({ + getString: jest.fn(() => Promise.resolve('mocked clipboard content')), + setString: jest.fn(), +})); // test suite describe('Component LoadedApp - test', () => { diff --git a/__tests__/LoadingApp.snapshot.tsx b/__tests__/LoadingApp.snapshot.tsx index 938b7a751..e14d51a1a 100644 --- a/__tests__/LoadingApp.snapshot.tsx +++ b/__tests__/LoadingApp.snapshot.tsx @@ -65,7 +65,7 @@ jest.mock('react-native', () => { execute: jest.fn(() => '{}'), getLatestBlock: jest.fn(() => '{}'), walletExists: jest.fn(() => 'false'), - getValueTransfersList: jest.fn(() => '{ "value_transfers": [] }'), + getValueTransfersList: jest.fn(() => '{ "value_transfers": [], "total": 0 }'), setCryptoDefaultProvider: jest.fn(() => 'true'), }; @@ -110,6 +110,10 @@ jest.mock('react-native-keychain', () => ({ hasGenericPassword: jest.fn(), getSupportedBiometryType: jest.fn(), })); +jest.mock('@react-native-clipboard/clipboard', () => ({ + getString: jest.fn(() => Promise.resolve('mocked clipboard content')), + setString: jest.fn(), +})); // test suite describe('Component LoadingApp - test', () => { diff --git a/__tests__/Memo.snapshot.tsx b/__tests__/Memo.snapshot.tsx index c0ea65890..8f1eb5c44 100644 --- a/__tests__/Memo.snapshot.tsx +++ b/__tests__/Memo.snapshot.tsx @@ -53,7 +53,7 @@ describe('Component Memo - test', () => { const onClose = jest.fn(); const memo = render( - + , ); expect(memo.toJSON()).toMatchSnapshot(); diff --git a/__tests__/Messages.snapshot.tsx b/__tests__/Messages.snapshot.tsx index 00c5d918e..27c0bf807 100644 --- a/__tests__/Messages.snapshot.tsx +++ b/__tests__/Messages.snapshot.tsx @@ -89,13 +89,17 @@ jest.mock('@react-navigation/native', () => ({ useScrollToTop: jest.fn(), useTheme: () => mockTheme, })); +jest.mock('@react-native-clipboard/clipboard', () => ({ + getString: jest.fn(() => Promise.resolve('mocked clipboard content')), + setString: jest.fn(), +})); // test suite describe('Component Messages - test', () => { //snapshot test const state = defaultAppContextLoaded; state.valueTransfers = mockValueTransfers; - state.uaAddress = mockAddresses[0].uaAddress; + state.uOrchardAddress = mockAddresses[0].uOrchardAddress; state.addresses = mockAddresses; state.translate = mockTranslate; state.info = mockInfo; @@ -119,6 +123,11 @@ describe('Component Messages - test', () => { setSendPageState={onFunction} setScrollToBottom={onFunction} scrollToBottom={false} + setScrollToTop={onFunction} + scrollToTop={false} + sendTransaction={onFunction} + clearToAddr={onFunction} + setServerOption={onFunction} /> , ); @@ -142,6 +151,11 @@ describe('Component Messages - test', () => { setSendPageState={onFunction} setScrollToBottom={onFunction} scrollToBottom={false} + setScrollToTop={onFunction} + scrollToTop={false} + sendTransaction={onFunction} + clearToAddr={onFunction} + setServerOption={onFunction} /> , ); diff --git a/__tests__/MessagesAddress.snapshot.tsx b/__tests__/MessagesAddress.snapshot.tsx index 77be1987a..b87750262 100644 --- a/__tests__/MessagesAddress.snapshot.tsx +++ b/__tests__/MessagesAddress.snapshot.tsx @@ -89,13 +89,17 @@ jest.mock('@react-navigation/native', () => ({ useScrollToTop: jest.fn(), useTheme: () => mockTheme, })); +jest.mock('@react-native-clipboard/clipboard', () => ({ + getString: jest.fn(() => Promise.resolve('mocked clipboard content')), + setString: jest.fn(), +})); // test suite describe('Component Messages Address - test', () => { //snapshot test const state = defaultAppContextLoaded; state.valueTransfers = mockValueTransfers; - state.uaAddress = mockAddresses[0].uaAddress; + state.uOrchardAddress = mockAddresses[0].uOrchardAddress; state.addresses = mockAddresses; state.translate = mockTranslate; state.info = mockInfo; @@ -113,15 +117,16 @@ describe('Component Messages Address - test', () => { , ); diff --git a/__tests__/Pools.snapshot.tsx b/__tests__/Pools.snapshot.tsx index 5a1427e46..56604de92 100644 --- a/__tests__/Pools.snapshot.tsx +++ b/__tests__/Pools.snapshot.tsx @@ -43,6 +43,10 @@ jest.mock('react-native', () => { return RN; }); +jest.mock('@react-native-clipboard/clipboard', () => ({ + getString: jest.fn(() => Promise.resolve('mocked clipboard content')), + setString: jest.fn(), +})); // test suite describe('Component Pools - test', () => { diff --git a/__tests__/PrivKey.snapshot.tsx b/__tests__/PrivKey.snapshot.tsx index e52b663fc..3a922094d 100644 --- a/__tests__/PrivKey.snapshot.tsx +++ b/__tests__/PrivKey.snapshot.tsx @@ -43,6 +43,10 @@ jest.mock('react-native', () => { return RN; }); +jest.mock('@react-native-clipboard/clipboard', () => ({ + getString: jest.fn(() => Promise.resolve('mocked clipboard content')), + setString: jest.fn(), +})); // test suite describe('Component PrivKey - test', () => { diff --git a/__tests__/Receive.snapshot.tsx b/__tests__/Receive.snapshot.tsx index 3e69d89ae..8fc5e7e2d 100644 --- a/__tests__/Receive.snapshot.tsx +++ b/__tests__/Receive.snapshot.tsx @@ -49,13 +49,17 @@ jest.mock('react-native', () => { return RN; }); +jest.mock('@react-native-clipboard/clipboard', () => ({ + getString: jest.fn(() => Promise.resolve('mocked clipboard content')), + setString: jest.fn(), +})); // test suite describe('Component Receive - test', () => { //snapshot test test('Receive - snapshot', () => { const state = defaultAppContextLoaded; - state.uaAddress = mockAddresses[0].uaAddress; + state.uOrchardAddress = mockAddresses[0].uOrchardAddress; state.addresses = mockAddresses; state.translate = mockTranslate; state.info = mockInfo; @@ -63,7 +67,7 @@ describe('Component Receive - test', () => { const onFunction = jest.fn(); const receive = render( - + , ); expect(receive.toJSON()).toMatchSnapshot(); diff --git a/__tests__/Scanner.snapshot.tsx b/__tests__/Scanner.snapshot.tsx index 987337d4d..2d9c7b748 100644 --- a/__tests__/Scanner.snapshot.tsx +++ b/__tests__/Scanner.snapshot.tsx @@ -13,8 +13,7 @@ describe('Component Scanner - test', () => { //snapshot test test('Scanner - snapshot', () => { const onRead = jest.fn(); - const doCancel = jest.fn(); - const scanner = render(); + const scanner = render(); expect(scanner.toJSON()).toMatchSnapshot(); }); }); diff --git a/__tests__/Seed.snapshot.tsx b/__tests__/Seed.snapshot.tsx index 7a41296f5..78bec5b34 100644 --- a/__tests__/Seed.snapshot.tsx +++ b/__tests__/Seed.snapshot.tsx @@ -50,6 +50,10 @@ jest.mock('react-native', () => { return RN; }); +jest.mock('@react-native-clipboard/clipboard', () => ({ + getString: jest.fn(() => Promise.resolve('mocked clipboard content')), + setString: jest.fn(), +})); // test suite describe('Component Seed - test', () => { diff --git a/__tests__/Send.snapshot.tsx b/__tests__/Send.snapshot.tsx index 9b4c31408..2de470a26 100644 --- a/__tests__/Send.snapshot.tsx +++ b/__tests__/Send.snapshot.tsx @@ -61,13 +61,17 @@ jest.mock('react-native-device-info', () => ({ getManufacturer: jest.fn(() => 'Mocked Manufacturer'), getModel: jest.fn(() => 'Mocked Model'), })); +jest.mock('@react-native-clipboard/clipboard', () => ({ + getString: jest.fn(() => Promise.resolve('mocked clipboard content')), + setString: jest.fn(), +})); // test suite describe('Component Send - test', () => { //snapshot test const state = defaultAppContextLoaded; state.valueTransfers = mockValueTransfers; - state.uaAddress = mockAddresses[0].uaAddress; + state.uOrchardAddress = mockAddresses[0].uOrchardAddress; state.addresses = mockAddresses; state.translate = mockTranslate; state.info = mockInfo; @@ -89,7 +93,6 @@ describe('Component Send - test', () => { setSendPageState={onFunction} sendTransaction={onFunction} clearToAddr={onFunction} - setSendProgress={onFunction} toggleMenuDrawer={onFunction} setComputingModalVisible={onFunction} poolsMoreInfoOnClick={onFunction} @@ -100,8 +103,6 @@ describe('Component Send - test', () => { setScrollToTop={onFunction} setScrollToBottom={onFunction} setServerOption={onFunction} - clearTimers={onFunction} - configure={onFunction} /> , ); @@ -121,7 +122,6 @@ describe('Component Send - test', () => { setSendPageState={onFunction} sendTransaction={onFunction} clearToAddr={onFunction} - setSendProgress={onFunction} toggleMenuDrawer={onFunction} setComputingModalVisible={onFunction} poolsMoreInfoOnClick={onFunction} @@ -132,8 +132,6 @@ describe('Component Send - test', () => { setScrollToTop={onFunction} setScrollToBottom={onFunction} setServerOption={onFunction} - clearTimers={onFunction} - configure={onFunction} /> , ); diff --git a/__tests__/ShowUfvk.snapshot.tsx b/__tests__/ShowUfvk.snapshot.tsx index ccf030110..59ca9448e 100644 --- a/__tests__/ShowUfvk.snapshot.tsx +++ b/__tests__/ShowUfvk.snapshot.tsx @@ -45,6 +45,10 @@ jest.mock('react-native', () => { return RN; }); +jest.mock('@react-native-clipboard/clipboard', () => ({ + getString: jest.fn(() => Promise.resolve('mocked clipboard content')), + setString: jest.fn(), +})); // test suite describe('Component ShowUfvk - test', () => { diff --git a/__tests__/SingleAddress.snapshot.tsx b/__tests__/SingleAddress.snapshot.tsx index 32bee124c..4901e651e 100644 --- a/__tests__/SingleAddress.snapshot.tsx +++ b/__tests__/SingleAddress.snapshot.tsx @@ -14,6 +14,10 @@ jest.mock('@fortawesome/react-native-fontawesome', () => ({ FontAwesomeIcon: '', })); jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper'); +jest.mock('@react-native-clipboard/clipboard', () => ({ + getString: jest.fn(() => Promise.resolve('mocked clipboard content')), + setString: jest.fn(), +})); // test suite describe('Component SingleAddress - test', () => { @@ -22,7 +26,7 @@ describe('Component SingleAddress - test', () => { const onPrev = jest.fn(); const onNext = jest.fn(); const single = render( - , + , ); expect(single.toJSON()).toMatchSnapshot(); }); diff --git a/__tests__/SyncReport.snapshot.tsx b/__tests__/SyncReport.snapshot.tsx index 0ee972555..de0ceb431 100644 --- a/__tests__/SyncReport.snapshot.tsx +++ b/__tests__/SyncReport.snapshot.tsx @@ -61,6 +61,10 @@ jest.mock('react-native', () => { return RN; }); +jest.mock('@react-native-clipboard/clipboard', () => ({ + getString: jest.fn(() => Promise.resolve('mocked clipboard content')), + setString: jest.fn(), +})); // test suite describe('Component SyncReport - test', () => { diff --git a/__tests__/__snapshots__/About.snapshot.tsx.snap b/__tests__/__snapshots__/About.snapshot.tsx.snap index e9b42d53e..6363eef06 100644 --- a/__tests__/__snapshots__/About.snapshot.tsx.snap +++ b/__tests__/__snapshots__/About.snapshot.tsx.snap @@ -12,70 +12,38 @@ exports[`Component About - test About - snapshot 1`] = ` } } > - + - - - - text translated text translated - + /> @@ -94,7 +63,6 @@ exports[`Component About - test About - snapshot 1`] = ` + + + + + < + 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 + + + @@ -226,92 +291,5 @@ exports[`Component About - test About - snapshot 1`] = ` /> - - - - - text translated - - - - `; diff --git a/__tests__/__snapshots__/AddressBook.AbDetail.snapshot.tsx.snap b/__tests__/__snapshots__/AddressBook.AbDetail.snapshot.tsx.snap index 2c7d76a0b..6c5938400 100644 --- a/__tests__/__snapshots__/AddressBook.AbDetail.snapshot.tsx.snap +++ b/__tests__/__snapshots__/AddressBook.AbDetail.snapshot.tsx.snap @@ -80,13 +80,6 @@ exports[`Component Address Book Details - test Address Book Datails - Add - snap } } > - @@ -485,13 +480,6 @@ exports[`Component Address Book Details - test Address Book Datails - Delete - s } } > - @@ -958,13 +948,6 @@ exports[`Component Address Book Details - test Address Book Datails - Modify - s } } > - - - - text translated - - diff --git a/__tests__/__snapshots__/AddressBook.snapshot.tsx.snap b/__tests__/__snapshots__/AddressBook.snapshot.tsx.snap index a47f3d592..3760de803 100644 --- a/__tests__/__snapshots__/AddressBook.snapshot.tsx.snap +++ b/__tests__/__snapshots__/AddressBook.snapshot.tsx.snap @@ -12,6 +12,186 @@ exports[`Component Address Book - test Address Book - snapshot 1`] = ` } } > + + + + + + + + + + + + + + + < + 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 + + + + + - - - text translated - - + /> - - - - text translated - - - `; diff --git a/__tests__/__snapshots__/Button.snapshot.tsx.snap b/__tests__/__snapshots__/Button.snapshot.tsx.snap index eb07626e2..72c24e332 100644 --- a/__tests__/__snapshots__/Button.snapshot.tsx.snap +++ b/__tests__/__snapshots__/Button.snapshot.tsx.snap @@ -33,7 +33,7 @@ exports[`Component Button - test Button Primary - snapshot 1`] = ` { "alignItems": "center", "backgroundColor": "rgb(0, 122, 255)", - "borderColor": "rgb(28, 28, 30)", + "borderColor": "rgb(0, 122, 255)", "borderRadius": 10, "borderWidth": 2, "justifyContent": "center", @@ -44,6 +44,7 @@ exports[`Component Button - test Button Primary - snapshot 1`] = ` "padding": 0, "paddingLeft": 20, "paddingRight": 20, + "width": "80%", } } > @@ -122,6 +123,7 @@ exports[`Component Button - test Button Secondary - snapshot 1`] = ` "padding": 0, "paddingLeft": 20, "paddingRight": 20, + "width": "80%", } } > diff --git a/__tests__/__snapshots__/Components.snapshot.tsx.snap b/__tests__/__snapshots__/Components.snapshot.tsx.snap index d6fcc3ffa..63a3c1977 100644 --- a/__tests__/__snapshots__/Components.snapshot.tsx.snap +++ b/__tests__/__snapshots__/Components.snapshot.tsx.snap @@ -67,17 +67,6 @@ exports[`Component Components - test CurrencyAmount High Privacy - snapshot 1`] } } > - - $ - - -.-- + $ -.-- @@ -146,17 +135,6 @@ exports[`Component Components - test CurrencyAmount Normal Privacy - snapshot 1` } } > - - $ - - 44.93 + $ 44.93 @@ -224,7 +202,7 @@ exports[`Component Components - test ZecAmount High Privacy - snapshot 1`] = ` { "backgroundColor": "red", "flexDirection": "row", - "margin": 5, + "marginHorizontal": 5, } } > @@ -374,7 +352,7 @@ exports[`Component Components - test ZecAmount Normal Privacy - snapshot 1`] = ` { "backgroundColor": "red", "flexDirection": "row", - "margin": 5, + "marginHorizontal": 5, } } > diff --git a/__tests__/__snapshots__/Header.snapshot.tsx.snap b/__tests__/__snapshots__/Header.snapshot.tsx.snap index feaa36073..5628e1b74 100644 --- a/__tests__/__snapshots__/Header.snapshot.tsx.snap +++ b/__tests__/__snapshots__/Header.snapshot.tsx.snap @@ -1,386 +1,444 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Component Header - test Header Complex - snapshot 1`] = ` - - +[ + - - < - color="red" - icon={ - { - "icon": [ - 640, - 512, - [ - 62337, - "cloud-download", - "cloud-download-alt", - ], - "f0ed", - "M144 480C64.5 480 0 415.5 0 336c0-62.8 40.2-116.2 96.2-135.9c-.1-2.7-.2-5.4-.2-8.1c0-88.4 71.6-160 160-160c59.3 0 111 32.2 138.7 80.2C409.9 102 428.3 96 448 96c53 0 96 43 96 96c0 12.2-2.3 23.8-6.4 34.6C596 238.4 640 290.1 640 352c0 70.7-57.3 128-128 128l-368 0zm79-167l80 80c9.4 9.4 24.6 9.4 33.9 0l80-80c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-39 39L344 184c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 134.1-39-39c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9z", - ], - "iconName": "cloud-arrow-down", - "prefix": "fas", - } - } - size={20} - /> - - - - - - < - icon={ + + > + + < + color="red" + icon={ + { + "icon": [ + 640, + 512, + [ + 62337, + "cloud-download", + "cloud-download-alt", + ], + "f0ed", + "M144 480C64.5 480 0 415.5 0 336c0-62.8 40.2-116.2 96.2-135.9c-.1-2.7-.2-5.4-.2-8.1c0-88.4 71.6-160 160-160c59.3 0 111 32.2 138.7 80.2C409.9 102 428.3 96 448 96c53 0 96 43 96 96c0 12.2-2.3 23.8-6.4 34.6C596 238.4 640 290.1 640 352c0 70.7-57.3 128-128 128l-368 0zm79-167l80 80c9.4 9.4 24.6 9.4 33.9 0l80-80c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-39 39L344 184c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 134.1-39-39c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9z", + ], + "iconName": "cloud-arrow-down", + "prefix": "fas", + } + } + size={20} + /> + + - - - - - - - - " > - - - + + + + + + + + + + + " + > + + + + + + + - + 1.1234 + + - - - + 5678 + + + + + - 1.1234 - - + - 5678 - + < + color="rgb(0, 122, 255)" + icon={ + { + "icon": [ + 512, + 512, + [ + "info-circle", + ], + "f05a", + "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336l24 0 0-64-24 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l48 0c13.3 0 24 10.7 24 24l0 88 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zm40-208a32 32 0 1 1 0 64 32 32 0 1 1 0-64z", + ], + "iconName": "circle-info", + "prefix": "fas", + } + } + size={25} + /> + @@ -388,297 +446,289 @@ exports[`Component Header - test Header Complex - snapshot 1`] = ` style={ { "alignItems": "center", - "backgroundColor": "rgb(255, 255, 255)", - "borderRadius": 10, - "display": "flex", "flexDirection": "row", - "justifyContent": "center", - "margin": 0, - "marginLeft": 5, - "minHeight": 25, - "minWidth": 25, - "padding": 0, + "height": 45, } } > - < - color="rgb(0, 122, 255)" - icon={ + + 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={ + { + "marginRight": 5, + "opacity": 1, + } + } + testID="header.drawmenu" + > + < + color="rgb(216, 216, 216)" + icon={ + { + "icon": [ + 448, + 512, + [ + "navicon", + ], + "f0c9", + "M0 96C0 78.3 14.3 64 32 64l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 128C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 288c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32L32 448c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z", + ], + "iconName": "bars", + "prefix": "fas", + } + } + size={45} + /> + - - - - title - - - + + + , + + - < - color="rgb(216, 216, 216)" - icon={ - { - "icon": [ - 448, - 512, - [ - "navicon", - ], - "f0c9", - "M0 96C0 78.3 14.3 64 32 64l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 128C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 288c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32L32 448c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z", - ], - "iconName": "bars", - "prefix": "fas", - } + title + + - - - - - + + - - - + , +] `; exports[`Component Header - test Header Simple - snapshot 1`] = ` - - - - + - + + + - title - - - + + + > + + + , + - - - + + + title + + + + - - - + , +] `; diff --git a/__tests__/__snapshots__/History.snapshot.tsx.snap b/__tests__/__snapshots__/History.snapshot.tsx.snap index 62676eca5..ea960b4b8 100644 --- a/__tests__/__snapshots__/History.snapshot.tsx.snap +++ b/__tests__/__snapshots__/History.snapshot.tsx.snap @@ -13,163 +13,38 @@ exports[`Component History - test History currency USD, privacy high & mode adva } } > - - + - - < - color="red" - icon={ - { - "icon": [ - 640, - 512, - [ - 62337, - "cloud-download", - "cloud-download-alt", - ], - "f0ed", - "M144 480C64.5 480 0 415.5 0 336c0-62.8 40.2-116.2 96.2-135.9c-.1-2.7-.2-5.4-.2-8.1c0-88.4 71.6-160 160-160c59.3 0 111 32.2 138.7 80.2C409.9 102 428.3 96 448 96c53 0 96 43 96 96c0 12.2-2.3 23.8-6.4 34.6C596 238.4 640 290.1 640 352c0 70.7-57.3 128-128 128l-368 0zm79-167l80 80c9.4 9.4 24.6 9.4 33.9 0l80-80c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-39 39L344 184c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 134.1-39-39c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9z", - ], - "iconName": "cloud-arrow-down", - "prefix": "fas", - } - } - size={20} - /> - - - - - @@ -177,9 +52,6 @@ exports[`Component History - test History currency USD, privacy high & mode adva style={ { "alignItems": "center", - "backgroundColor": "#011401", - "display": "flex", - "flexDirection": "row", "justifyContent": "center", "margin": 0, "marginRight": 5, @@ -189,33 +61,72 @@ exports[`Component History - test History currency USD, privacy high & mode adva } } > - < - color="#18bd18" - icon={ + + 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, + } + } + > + < + color="red" + icon={ + { + "icon": [ + 640, + 512, + [ + 62337, + "cloud-download", + "cloud-download-alt", + ], + "f0ed", + "M144 480C64.5 480 0 415.5 0 336c0-62.8 40.2-116.2 96.2-135.9c-.1-2.7-.2-5.4-.2-8.1c0-88.4 71.6-160 160-160c59.3 0 111 32.2 138.7 80.2C409.9 102 428.3 96 448 96c53 0 96 43 96 96c0 12.2-2.3 23.8-6.4 34.6C596 238.4 640 290.1 640 352c0 70.7-57.3 128-128 128l-368 0zm79-167l80 80c9.4 9.4 24.6 9.4 33.9 0l80-80c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-39 39L344 184c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 134.1-39-39c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9z", + ], + "iconName": "cloud-arrow-down", + "prefix": "fas", + } + } + size={20} + /> + @@ -224,7 +135,7 @@ exports[`Component History - test History currency USD, privacy high & mode adva { "busy": undefined, "checked": undefined, - "disabled": false, + "disabled": undefined, "expanded": undefined, "selected": undefined, } @@ -249,6 +160,7 @@ exports[`Component History - test History currency USD, privacy high & mode adva onStartShouldSetResponder={[Function]} style={ { + "marginHorizontal": 5, "opacity": 1, } } @@ -256,279 +168,202 @@ exports[`Component History - test History currency USD, privacy high & mode adva - - - - - - " - > - - - - - - - - -.---- - + < + color="#18bd18" + icon={ + { + "icon": [ + 448, + 512, + [ + 128274, + ], + "f023", + "M144 144l0 48 160 0 0-48c0-44.2-35.8-80-80-80s-80 35.8-80 80zM80 192l0-48C80 64.5 144.5 0 224 0s144 64.5 144 144l0 48 16 0c35.3 0 64 28.7 64 64l0 192c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 256c0-35.3 28.7-64 64-64l16 0z", + ], + "iconName": "lock", + "prefix": "fas", + } + } + size={25} + /> + - - - < - color="#18bd18" - icon={ + - - - - - - - - - $ - - - -.-- - + vbHeight={147.85} + vbWidth={282.84} + width={50.4} + xml=" + + + + + " + > + + + + + + + + -.---- + + - - @@ -580,54 +417,179 @@ exports[`Component History - test History currency USD, privacy high & mode adva 512, 512, [ - 128472, - "refresh", - "sync", + "info-circle", ], - "f021", - "M105.1 202.6c7.7-21.8 20.2-42.3 37.8-59.8c62.5-62.5 163.8-62.5 226.3 0L386.3 160 352 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l111.5 0c0 0 0 0 0 0l.4 0c17.7 0 32-14.3 32-32l0-112c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 35.2L414.4 97.6c-87.5-87.5-229.3-87.5-316.8 0C73.2 122 55.6 150.7 44.8 181.4c-5.9 16.7 2.9 34.9 19.5 40.8s34.9-2.9 40.8-19.5zM39 289.3c-5 1.5-9.8 4.2-13.7 8.2c-4 4-6.7 8.8-8.1 14c-.3 1.2-.6 2.5-.8 3.8c-.3 1.7-.4 3.4-.4 5.1L16 432c0 17.7 14.3 32 32 32s32-14.3 32-32l0-35.1 17.6 17.5c0 0 0 0 0 0c87.5 87.4 229.3 87.4 316.7 0c24.4-24.4 42.1-53.1 52.9-83.8c5.9-16.7-2.9-34.9-19.5-40.8s-34.9 2.9-40.8 19.5c-7.7 21.8-20.2 42.3-37.8 59.8c-62.5 62.5-163.8 62.5-226.3 0l-.1-.1L125.6 352l34.4 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L48.4 288c-1.6 0-3.2 .1-4.8 .3s-3.1 .5-4.6 1z", + "f05a", + "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336l24 0 0-64-24 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l48 0c13.3 0 24 10.7 24 24l0 88 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zm40-208a32 32 0 1 1 0 64 32 32 0 1 1 0-64z", ], - "iconName": "arrows-rotate", + "iconName": "circle-info", "prefix": "fas", } } - size={20} + size={25} /> - - - - text translated - + + + + + $ -.-- + + + + + + + + < + color="#18bd18" + icon={ + { + "icon": [ + 512, + 512, + [ + 128472, + "refresh", + "sync", + ], + "f021", + "M105.1 202.6c7.7-21.8 20.2-42.3 37.8-59.8c62.5-62.5 163.8-62.5 226.3 0L386.3 160 352 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l111.5 0c0 0 0 0 0 0l.4 0c17.7 0 32-14.3 32-32l0-112c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 35.2L414.4 97.6c-87.5-87.5-229.3-87.5-316.8 0C73.2 122 55.6 150.7 44.8 181.4c-5.9 16.7 2.9 34.9 19.5 40.8s34.9-2.9 40.8-19.5zM39 289.3c-5 1.5-9.8 4.2-13.7 8.2c-4 4-6.7 8.8-8.1 14c-.3 1.2-.6 2.5-.8 3.8c-.3 1.7-.4 3.4-.4 5.1L16 432c0 17.7 14.3 32 32 32s32-14.3 32-32l0-35.1 17.6 17.5c0 0 0 0 0 0c87.5 87.4 229.3 87.4 316.7 0c24.4-24.4 42.1-53.1 52.9-83.8c5.9-16.7-2.9-34.9-19.5-40.8s-34.9 2.9-40.8 19.5c-7.7 21.8-20.2 42.3-37.8 59.8c-62.5 62.5-163.8 62.5-226.3 0l-.1-.1L125.6 352l34.4 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L48.4 288c-1.6 0-3.2 .1-4.8 .3s-3.1 .5-4.6 1z", + ], + "iconName": "arrows-rotate", + "prefix": "fas", + } + } + size={20} + /> + + + + @@ -704,7 +667,6 @@ exports[`Component History - test History currency USD, privacy high & mode adva + + + + + + text translated + + + - - + - < - color="red" - icon={ + + > + + < + color="red" + icon={ + { + "icon": [ + 640, + 512, + [ + 62337, + "cloud-download", + "cloud-download-alt", + ], + "f0ed", + "M144 480C64.5 480 0 415.5 0 336c0-62.8 40.2-116.2 96.2-135.9c-.1-2.7-.2-5.4-.2-8.1c0-88.4 71.6-160 160-160c59.3 0 111 32.2 138.7 80.2C409.9 102 428.3 96 448 96c53 0 96 43 96 96c0 12.2-2.3 23.8-6.4 34.6C596 238.4 640 290.1 640 352c0 70.7-57.3 128-128 128l-368 0zm79-167l80 80c9.4 9.4 24.6 9.4 33.9 0l80-80c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-39 39L344 184c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 134.1-39-39c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9z", + ], + "iconName": "cloud-arrow-down", + "prefix": "fas", + } + } + size={20} + /> + + - - - + > + " - > - - - - + + + + + + - - - - 1.1234 - - + 1.1234 + + - 5678 - + testID="undefined.small-part" + > + 5678 + + @@ -1008,34 +1021,6 @@ exports[`Component History - test History no currency, privacy normal & mode bas - - text translated - - - @@ -1112,7 +1098,6 @@ exports[`Component History - test History no currency, privacy normal & mode bas + + + + + + 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, + } + } + /> + + + + + + @@ -76,7 +248,6 @@ exports[`Component ImportUfvk - test ImportUfvk - snapshot 1`] = ` } > - - - - - `; diff --git a/__tests__/__snapshots__/Info.snapshot.tsx.snap b/__tests__/__snapshots__/Info.snapshot.tsx.snap index bebe52f07..fa2556876 100644 --- a/__tests__/__snapshots__/Info.snapshot.tsx.snap +++ b/__tests__/__snapshots__/Info.snapshot.tsx.snap @@ -12,70 +12,38 @@ exports[`Component Info - test Info - snapshot 1`] = ` } } > - - - + - - text translated - + /> @@ -94,7 +63,6 @@ exports[`Component Info - test Info - snapshot 1`] = ` + + + + + < + 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 + + + @@ -484,92 +549,5 @@ exports[`Component Info - test Info - snapshot 1`] = ` - - - - - text translated - - - - `; diff --git a/__tests__/__snapshots__/Insight.snapshot.tsx.snap b/__tests__/__snapshots__/Insight.snapshot.tsx.snap index 0d484e25c..85c828411 100644 --- a/__tests__/__snapshots__/Insight.snapshot.tsx.snap +++ b/__tests__/__snapshots__/Insight.snapshot.tsx.snap @@ -12,74 +12,66 @@ exports[`Component Insight - test Insight - snapshot 1`] = ` } } > - + @@ -87,34 +79,44 @@ exports[`Component Insight - test Insight - snapshot 1`] = ` style={ { "alignItems": "center", - "backgroundColor": "rgb(255, 255, 255)", - "display": "flex", "flexDirection": "row", "justifyContent": "center", - "margin": 0, - "marginRight": 5, - "minHeight": 25, - "minWidth": 25, - "padding": 0, } } > - < - icon={ + + > + < + icon={ + { + "icon": [ + 576, + 512, + [], + "f3c1", + "M352 144c0-44.2 35.8-80 80-80s80 35.8 80 80l0 48c0 17.7 14.3 32 32 32s32-14.3 32-32l0-48C576 64.5 511.5 0 432 0S288 64.5 288 144l0 48L64 192c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-192c0-35.3-28.7-64-64-64l-32 0 0-48z", + ], + "iconName": "lock-open", + "prefix": "fas", + } + } + size={25} + /> + @@ -122,40 +124,6 @@ exports[`Component Insight - test Insight - snapshot 1`] = ` - - - text translated - - - @@ -174,7 +143,6 @@ exports[`Component Insight - test Insight - snapshot 1`] = ` + + + + + < + 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 + + + @@ -486,92 +551,5 @@ exports[`Component Insight - test Insight - snapshot 1`] = ` - - - - - text translated - - - - `; diff --git a/__tests__/__snapshots__/LoadedApp.snapshot.tsx.snap b/__tests__/__snapshots__/LoadedApp.snapshot.tsx.snap index 7850af93a..93a93ad08 100644 --- a/__tests__/__snapshots__/LoadedApp.snapshot.tsx.snap +++ b/__tests__/__snapshots__/LoadedApp.snapshot.tsx.snap @@ -26,26 +26,22 @@ exports[`Component LoadedApp - test LoadedApp - snapshot 1`] = ` ] } > - @@ -230,7 +226,7 @@ exports[`Component LoadedApp - test LoadedApp - snapshot 1`] = ` text translatedtext translated - + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + < + color="rgb(0, 122, 255)" icon={ { "icon": [ - 384, + 320, 512, [ - 128473, - 10005, - 10006, - 10060, - 215, - "close", - "multiply", - "remove", - "times", + 9001, ], - "f00d", - "M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z", + "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": "xmark", + "iconName": "chevron-left", "prefix": "fas", } } - size={25} + size={30} style={ { - "margin": 10, + "marginHorizontal": 10, } } /> - - - 60 - - text translated - - 511 - + /> - - - - + + - + - + + + < + icon={ + { + "icon": [ + 384, + 512, + [ + 128473, + 10005, + 10006, + 10060, + 215, + "close", + "multiply", + "remove", + "times", + ], + "f00d", + "M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z", + ], + "iconName": "xmark", + "prefix": "fas", + } + } + size={25} + style={ + { + "margin": 10, + } + } + /> + + + - text translated - + + 60 + + + text translated + + + 511 + + - + - - text translated - + + text translated + + - - + + `; diff --git a/__tests__/__snapshots__/Messages.snapshot.tsx.snap b/__tests__/__snapshots__/Messages.snapshot.tsx.snap index cae80aff2..aa810ed85 100644 --- a/__tests__/__snapshots__/Messages.snapshot.tsx.snap +++ b/__tests__/__snapshots__/Messages.snapshot.tsx.snap @@ -13,53 +13,112 @@ exports[`Component Messages - test Messages currency USD, privacy high & mode ad } } > - - + + + + + < + color="red" + icon={ + { + "icon": [ + 640, + 512, + [ + 62337, + "cloud-download", + "cloud-download-alt", + ], + "f0ed", + "M144 480C64.5 480 0 415.5 0 336c0-62.8 40.2-116.2 96.2-135.9c-.1-2.7-.2-5.4-.2-8.1c0-88.4 71.6-160 160-160c59.3 0 111 32.2 138.7 80.2C409.9 102 428.3 96 448 96c53 0 96 43 96 96c0 12.2-2.3 23.8-6.4 34.6C596 238.4 640 290.1 640 352c0 70.7-57.3 128-128 128l-368 0zm79-167l80 80c9.4 9.4 24.6 9.4 33.9 0l80-80c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-39 39L344 184c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 134.1-39-39c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9z", + ], + "iconName": "cloud-arrow-down", + "prefix": "fas", + } + } + size={20} + /> + + + - < - color="red" - icon={ - { - "icon": [ - 640, - 512, - [ - 62337, - "cloud-download", - "cloud-download-alt", - ], - "f0ed", - "M144 480C64.5 480 0 415.5 0 336c0-62.8 40.2-116.2 96.2-135.9c-.1-2.7-.2-5.4-.2-8.1c0-88.4 71.6-160 160-160c59.3 0 111 32.2 138.7 80.2C409.9 102 428.3 96 448 96c53 0 96 43 96 96c0 12.2-2.3 23.8-6.4 34.6C596 238.4 640 290.1 640 352c0 70.7-57.3 128-128 128l-368 0zm79-167l80 80c9.4 9.4 24.6 9.4 33.9 0l80-80c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-39 39L344 184c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 134.1-39-39c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9z", - ], - "iconName": "cloud-arrow-down", - "prefix": "fas", - } - } - size={20} - /> - - - - - < - color="#18bd18" - icon={ + + > + < + color="#18bd18" + icon={ + { + "icon": [ + 448, + 512, + [ + 128274, + ], + "f023", + "M144 144l0 48 160 0 0-48c0-44.2-35.8-80-80-80s-80 35.8-80 80zM80 192l0-48C80 64.5 144.5 0 224 0s144 64.5 144 144l0 48 16 0c35.3 0 64 28.7 64 64l0 192c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 256c0-35.3 28.7-64 64-64l16 0z", + ], + "iconName": "lock", + "prefix": "fas", + } + } + size={25} + /> + @@ -203,40 +206,6 @@ exports[`Component Messages - test Messages currency USD, privacy high & mode ad - - - text translated - - - @@ -313,7 +283,6 @@ exports[`Component Messages - test Messages currency USD, privacy high & mode ad + + - - - - } - scrollEventThrottle={100} - style={ - { - "flexGrow": 1, - "marginTop": 10, - "opacity": 0, - "width": "100%", - } - } - > - - + > - + - text translated - - + } + > + text translated + - + + + `; @@ -428,113 +388,82 @@ exports[`Component Messages - test Messages no currency, privacy normal & mode b } } > - - + - < - color="red" - icon={ + + > + + < + color="red" + icon={ + { + "icon": [ + 640, + 512, + [ + 62337, + "cloud-download", + "cloud-download-alt", + ], + "f0ed", + "M144 480C64.5 480 0 415.5 0 336c0-62.8 40.2-116.2 96.2-135.9c-.1-2.7-.2-5.4-.2-8.1c0-88.4 71.6-160 160-160c59.3 0 111 32.2 138.7 80.2C409.9 102 428.3 96 448 96c53 0 96 43 96 96c0 12.2-2.3 23.8-6.4 34.6C596 238.4 640 290.1 640 352c0 70.7-57.3 128-128 128l-368 0zm79-167l80 80c9.4 9.4 24.6 9.4 33.9 0l80-80c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-39 39L344 184c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 134.1-39-39c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9z", + ], + "iconName": "cloud-arrow-down", + "prefix": "fas", + } + } + size={20} + /> + + - - - text translated - - - @@ -611,7 +541,6 @@ exports[`Component Messages - test Messages no currency, privacy normal & mode b + + - - - - } - scrollEventThrottle={100} - style={ - { - "flexGrow": 1, - "marginTop": 10, - "opacity": 0, - "width": "100%", - } - } - > - - + > - + - text translated - - + } + > + text translated + - + + + `; diff --git a/__tests__/__snapshots__/MessagesAddress.snapshot.tsx.snap b/__tests__/__snapshots__/MessagesAddress.snapshot.tsx.snap index 391b4d645..2e8587462 100644 --- a/__tests__/__snapshots__/MessagesAddress.snapshot.tsx.snap +++ b/__tests__/__snapshots__/MessagesAddress.snapshot.tsx.snap @@ -13,166 +13,110 @@ exports[`Component Messages Address - test Messages Address - snapshot 1`] = ` } > - - - - - + - text translated - - - + + - - - + + + + > + + - - - - + @@ -209,226 +153,65 @@ exports[`Component Messages Address - test Messages Address - snapshot 1`] = ` "opacity": 1, } } - > - - - UA-1234...4567890 - - - - - - < color="#18bd18" icon={ { "icon": [ - 640, + 320, 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", + [ + 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": "user-plus", + "iconName": "chevron-left", "prefix": "fas", } } - size={25} + size={30} style={ { - "marginTop": 3, + "marginHorizontal": 10, } } /> - - - - - - } - scrollEventThrottle={100} - style={ - { - "flexGrow": 1, - "marginTop": 10, - "opacity": 0, - "width": "100%", - } - } - > - - - text translated + - - - - - - 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} + style={ + { + "marginTop": 3, + } + } + /> + + + + + + } + 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 a2f3bdcd8..091a03cf1 100644 --- a/__tests__/__snapshots__/Pools.snapshot.tsx.snap +++ b/__tests__/__snapshots__/Pools.snapshot.tsx.snap @@ -12,74 +12,66 @@ exports[`Component Pools - test Pools - snapshot 1`] = ` } } > - + @@ -87,34 +79,44 @@ exports[`Component Pools - test Pools - snapshot 1`] = ` style={ { "alignItems": "center", - "backgroundColor": "rgb(255, 255, 255)", - "display": "flex", "flexDirection": "row", "justifyContent": "center", - "margin": 0, - "marginRight": 5, - "minHeight": 25, - "minWidth": 25, - "padding": 0, } } > - < - icon={ + + > + < + icon={ + { + "icon": [ + 576, + 512, + [], + "f3c1", + "M352 144c0-44.2 35.8-80 80-80s80 35.8 80 80l0 48c0 17.7 14.3 32 32 32s32-14.3 32-32l0-48C576 64.5 511.5 0 432 0S288 64.5 288 144l0 48L64 192c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-192c0-35.3-28.7-64-64-64l-32 0 0-48z", + ], + "iconName": "lock-open", + "prefix": "fas", + } + } + size={25} + /> + @@ -122,40 +124,6 @@ exports[`Component Pools - test Pools - snapshot 1`] = ` - - - text translated - - - @@ -174,7 +143,6 @@ exports[`Component Pools - test Pools - snapshot 1`] = ` + + + + + < + 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 + + + @@ -243,93 +308,5 @@ exports[`Component Pools - test Pools - snapshot 1`] = ` - - - - - text translated - - - - `; diff --git a/__tests__/__snapshots__/PrivKey.snapshot.tsx.snap b/__tests__/__snapshots__/PrivKey.snapshot.tsx.snap index 763b90825..a0c205d94 100644 --- a/__tests__/__snapshots__/PrivKey.snapshot.tsx.snap +++ b/__tests__/__snapshots__/PrivKey.snapshot.tsx.snap @@ -12,70 +12,38 @@ exports[`Component PrivKey - test PrivKey Private - snapshot 1`] = ` } } > - + - - - - text translated text translated - + /> @@ -94,7 +63,6 @@ exports[`Component PrivKey - test PrivKey Private - snapshot 1`] = ` + + + + + < + 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 + + + @@ -314,93 +379,6 @@ exports[`Component PrivKey - test PrivKey Private - snapshot 1`] = ` - - - - - text translated - - - - `; @@ -416,70 +394,38 @@ exports[`Component PrivKey - test PrivKey View - snapshot 1`] = ` } } > - + - - - - text translated text translated - + /> @@ -498,7 +445,6 @@ exports[`Component PrivKey - test PrivKey View - snapshot 1`] = ` + + + + + < + 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 + + + @@ -718,92 +761,5 @@ exports[`Component PrivKey - test PrivKey View - snapshot 1`] = ` - - - - - text translated - - - - `; diff --git a/__tests__/__snapshots__/Receive.snapshot.tsx.snap b/__tests__/__snapshots__/Receive.snapshot.tsx.snap index 9685d81c0..09fd80c1a 100644 --- a/__tests__/__snapshots__/Receive.snapshot.tsx.snap +++ b/__tests__/__snapshots__/Receive.snapshot.tsx.snap @@ -7,11 +7,7 @@ exports[`Component Receive - test Receive - snapshot 1`] = ` "index": 0, "routes": [ { - "key": "uaddr", - "title": "text translated", - }, - { - "key": "zaddr", + "key": "uorchardaddr", "title": "text translated", }, { diff --git a/__tests__/__snapshots__/Rescan.snapshot.tsx.snap b/__tests__/__snapshots__/Rescan.snapshot.tsx.snap index 3b15b5deb..fb0b8da29 100644 --- a/__tests__/__snapshots__/Rescan.snapshot.tsx.snap +++ b/__tests__/__snapshots__/Rescan.snapshot.tsx.snap @@ -12,70 +12,38 @@ exports[`Component Rescan - test Rescan - snapshot 1`] = ` } } > - - - + - - text translated - + /> @@ -94,7 +63,6 @@ exports[`Component Rescan - test Rescan - snapshot 1`] = ` + + + + + < + 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 + + + @@ -209,86 +275,10 @@ exports[`Component Rescan - test Rescan - snapshot 1`] = ` { "alignItems": "center", "backgroundColor": "rgb(0, 122, 255)", - "borderColor": "rgb(28, 28, 30)", - "borderRadius": 10, - "borderWidth": 2, - "justifyContent": "center", - "maxWidth": "90%", - "minHeight": 48, - "minWidth": "30%", - "opacity": 1, - "padding": 0, - "paddingLeft": 20, - "paddingRight": 20, - } - } - > - - - text translated - - - - @@ -316,7 +307,7 @@ exports[`Component Rescan - test Rescan - snapshot 1`] = ` - + @@ -87,34 +79,44 @@ exports[`Component Seed - test Seed Backup - snapshot 1`] = ` style={ { "alignItems": "center", - "backgroundColor": "rgb(255, 255, 255)", - "display": "flex", "flexDirection": "row", "justifyContent": "center", - "margin": 0, - "marginRight": 5, - "minHeight": 25, - "minWidth": 25, - "padding": 0, } } > - < - icon={ + + > + < + icon={ + { + "icon": [ + 576, + 512, + [], + "f3c1", + "M352 144c0-44.2 35.8-80 80-80s80 35.8 80 80l0 48c0 17.7 14.3 32 32 32s32-14.3 32-32l0-48C576 64.5 511.5 0 432 0S288 64.5 288 144l0 48L64 192c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-192c0-35.3-28.7-64-64-64l-32 0 0-48z", + ], + "iconName": "lock-open", + "prefix": "fas", + } + } + size={25} + /> + @@ -122,40 +124,6 @@ exports[`Component Seed - test Seed Backup - snapshot 1`] = ` - - - text translated (text translated) - - - @@ -174,7 +143,6 @@ exports[`Component Seed - test Seed Backup - snapshot 1`] = ` + + + + + < + 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) + + + - @@ -488,7 +545,7 @@ exports[`Component Seed - test Seed Backup - snapshot 1`] = ` { "alignItems": "center", "backgroundColor": "rgb(0, 122, 255)", - "borderColor": "rgb(28, 28, 30)", + "borderColor": "rgb(0, 122, 255)", "borderRadius": 10, "borderWidth": 2, "justifyContent": "center", @@ -499,6 +556,7 @@ exports[`Component Seed - test Seed Backup - snapshot 1`] = ` "padding": 0, "paddingLeft": 20, "paddingRight": 20, + "width": "80%", } } testID="seed.button.ok" @@ -530,53 +588,36 @@ exports[`Component Seed - test Seed Backup - snapshot 1`] = ` /> + + +`; + +exports[`Component Seed - test Seed Change - snapshot 1`] = ` + + - - text translated - + + + < + icon={ + { + "icon": [ + 576, + 512, + [], + "f3c1", + "M352 144c0-44.2 35.8-80 80-80s80 35.8 80 80l0 48c0 17.7 14.3 32 32 32s32-14.3 32-32l0-48C576 64.5 511.5 0 432 0S288 64.5 288 144l0 48L64 192c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-192c0-35.3-28.7-64-64-64l-32 0 0-48z", + ], + "iconName": "lock-open", + "prefix": "fas", + } + } + size={25} + /> + + + - - -`; - -exports[`Component Seed - test Seed Change - snapshot 1`] = ` - - + > + + + + + + + @@ -680,81 +802,41 @@ exports[`Component Seed - test Seed Change - snapshot 1`] = ` onStartShouldSetResponder={[Function]} style={ { - "marginHorizontal": 5, "opacity": 1, } } > - - - < - icon={ - { - "icon": [ - 576, - 512, - [], - "f3c1", - "M352 144c0-44.2 35.8-80 80-80s80 35.8 80 80l0 48c0 17.7 14.3 32 32 32s32-14.3 32-32l0-48C576 64.5 511.5 0 432 0S288 64.5 288 144l0 48L64 192c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-192c0-35.3-28.7-64-64-64l-32 0 0-48z", - ], - "iconName": "lock-open", - "prefix": "fas", - } - } - size={25} - /> - - + /> - - - text translated (text translated) - - - - - @@ -818,15 +864,6 @@ exports[`Component Seed - test Seed Change - snapshot 1`] = ` } /> - @@ -1099,7 +1137,7 @@ exports[`Component Seed - test Seed Change - snapshot 1`] = ` { "alignItems": "center", "backgroundColor": "rgb(0, 122, 255)", - "borderColor": "rgb(28, 28, 30)", + "borderColor": "rgb(0, 122, 255)", "borderRadius": 10, "borderWidth": 2, "justifyContent": "center", @@ -1110,6 +1148,7 @@ exports[`Component Seed - test Seed Change - snapshot 1`] = ` "padding": 0, "paddingLeft": 20, "paddingRight": 20, + "width": "80%", } } testID="seed.button.ok" @@ -1141,53 +1180,36 @@ exports[`Component Seed - test Seed Change - snapshot 1`] = ` /> + + +`; + +exports[`Component Seed - test Seed New - snapshot 1`] = ` + + - - text translated - + + + < + icon={ + { + "icon": [ + 576, + 512, + [], + "f3c1", + "M352 144c0-44.2 35.8-80 80-80s80 35.8 80 80l0 48c0 17.7 14.3 32 32 32s32-14.3 32-32l0-48C576 64.5 511.5 0 432 0S288 64.5 288 144l0 48L64 192c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-192c0-35.3-28.7-64-64-64l-32 0 0-48z", + ], + "iconName": "lock-open", + "prefix": "fas", + } + } + size={25} + /> + + + - - -`; - -exports[`Component Seed - test Seed New - snapshot 1`] = ` - - + > + + + + + + + @@ -1291,81 +1394,41 @@ exports[`Component Seed - test Seed New - snapshot 1`] = ` onStartShouldSetResponder={[Function]} style={ { - "marginHorizontal": 5, "opacity": 1, } } > - - - < - icon={ - { - "icon": [ - 576, - 512, - [], - "f3c1", - "M352 144c0-44.2 35.8-80 80-80s80 35.8 80 80l0 48c0 17.7 14.3 32 32 32s32-14.3 32-32l0-48C576 64.5 511.5 0 432 0S288 64.5 288 144l0 48L64 192c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-192c0-35.3-28.7-64-64-64l-32 0 0-48z", - ], - "iconName": "lock-open", - "prefix": "fas", - } - } - size={25} - /> - - + /> - - - text translated (text translated) - - - - - @@ -1429,15 +1456,6 @@ exports[`Component Seed - test Seed New - snapshot 1`] = ` } /> - @@ -1710,7 +1729,7 @@ exports[`Component Seed - test Seed New - snapshot 1`] = ` { "alignItems": "center", "backgroundColor": "rgb(0, 122, 255)", - "borderColor": "rgb(28, 28, 30)", + "borderColor": "rgb(0, 122, 255)", "borderRadius": 10, "borderWidth": 2, "justifyContent": "center", @@ -1721,6 +1740,7 @@ exports[`Component Seed - test Seed New - snapshot 1`] = ` "padding": 0, "paddingLeft": 20, "paddingRight": 20, + "width": "80%", } } testID="seed.button.ok" @@ -1768,74 +1788,66 @@ exports[`Component Seed - test Seed Server - snapshot 1`] = ` } } > - + @@ -1843,34 +1855,44 @@ exports[`Component Seed - test Seed Server - snapshot 1`] = ` style={ { "alignItems": "center", - "backgroundColor": "rgb(255, 255, 255)", - "display": "flex", "flexDirection": "row", "justifyContent": "center", - "margin": 0, - "marginRight": 5, - "minHeight": 25, - "minWidth": 25, - "padding": 0, } } > - < - icon={ + + > + < + icon={ + { + "icon": [ + 576, + 512, + [], + "f3c1", + "M352 144c0-44.2 35.8-80 80-80s80 35.8 80 80l0 48c0 17.7 14.3 32 32 32s32-14.3 32-32l0-48C576 64.5 511.5 0 432 0S288 64.5 288 144l0 48L64 192c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-192c0-35.3-28.7-64-64-64l-32 0 0-48z", + ], + "iconName": "lock-open", + "prefix": "fas", + } + } + size={25} + /> + @@ -1878,40 +1900,6 @@ exports[`Component Seed - test Seed Server - snapshot 1`] = ` - - - text translated (text translated) - - - @@ -1930,7 +1919,6 @@ exports[`Component Seed - test Seed Server - snapshot 1`] = ` + + + + + < + 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) + + + - @@ -2148,144 +2225,70 @@ exports[`Component Seed - test Seed Server - snapshot 1`] = ` { "busy": undefined, "checked": undefined, - "disabled": undefined, - "expanded": undefined, - "selected": undefined, - } - } - 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, - } - } - > - - 1900100 - - - - - - - - - - + > + + 1900100 + + + + + - text translated - + /> @@ -2379,74 +2380,66 @@ exports[`Component Seed - test Seed View - snapshot 1`] = ` } } > - + @@ -2454,34 +2447,44 @@ exports[`Component Seed - test Seed View - snapshot 1`] = ` style={ { "alignItems": "center", - "backgroundColor": "rgb(255, 255, 255)", - "display": "flex", "flexDirection": "row", "justifyContent": "center", - "margin": 0, - "marginRight": 5, - "minHeight": 25, - "minWidth": 25, - "padding": 0, } } > - < - icon={ + + > + < + icon={ + { + "icon": [ + 576, + 512, + [], + "f3c1", + "M352 144c0-44.2 35.8-80 80-80s80 35.8 80 80l0 48c0 17.7 14.3 32 32 32s32-14.3 32-32l0-48C576 64.5 511.5 0 432 0S288 64.5 288 144l0 48L64 192c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-192c0-35.3-28.7-64-64-64l-32 0 0-48z", + ], + "iconName": "lock-open", + "prefix": "fas", + } + } + size={25} + /> + @@ -2489,40 +2492,6 @@ exports[`Component Seed - test Seed View - snapshot 1`] = ` - - - text translated (text translated) - - - @@ -2541,7 +2511,6 @@ exports[`Component Seed - test Seed View - snapshot 1`] = ` + + + + + < + 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) + + + - @@ -2855,7 +2913,7 @@ exports[`Component Seed - test Seed View - snapshot 1`] = ` { "alignItems": "center", "backgroundColor": "rgb(0, 122, 255)", - "borderColor": "rgb(28, 28, 30)", + "borderColor": "rgb(0, 122, 255)", "borderRadius": 10, "borderWidth": 2, "justifyContent": "center", @@ -2866,6 +2924,7 @@ exports[`Component Seed - test Seed View - snapshot 1`] = ` "padding": 0, "paddingLeft": 20, "paddingRight": 20, + "width": "80%", } } testID="seed.button.ok" diff --git a/__tests__/__snapshots__/Send.snapshot.tsx.snap b/__tests__/__snapshots__/Send.snapshot.tsx.snap index 65cccc1af..dfa229f4a 100644 --- a/__tests__/__snapshots__/Send.snapshot.tsx.snap +++ b/__tests__/__snapshots__/Send.snapshot.tsx.snap @@ -14,27 +14,6 @@ exports[`Component Send - test Send currency USD, privacy high & mode advanced - } } > - - - @@ -864,17 +843,6 @@ exports[`Component Send - test Send currency USD, privacy high & mode advanced - } } > - - $ - - -.-- + $ -.-- @@ -1050,6 +1018,7 @@ exports[`Component Send - test Send currency USD, privacy high & mode advanced - "padding": 0, "paddingLeft": 20, "paddingRight": 20, + "width": "40%", } } testID="send.button-disabled" @@ -1127,6 +1096,7 @@ exports[`Component Send - test Send currency USD, privacy high & mode advanced - "padding": 0, "paddingLeft": 20, "paddingRight": 20, + "width": "40%", } } > @@ -1181,27 +1151,6 @@ exports[`Component Send - test Send no currency, privacy normal & mode basic - s } } > - - - @@ -2032,17 +1981,6 @@ exports[`Component Send - test Send no currency, privacy normal & mode basic - s } } > - - $ - - 16.66 + $ 16.66 @@ -2218,6 +2156,7 @@ exports[`Component Send - test Send no currency, privacy normal & mode basic - s "padding": 0, "paddingLeft": 20, "paddingRight": 20, + "width": "40%", } } testID="send.button-disabled" @@ -2295,6 +2234,7 @@ exports[`Component Send - test Send no currency, privacy normal & mode basic - s "padding": 0, "paddingLeft": 20, "paddingRight": 20, + "width": "40%", } } > diff --git a/__tests__/__snapshots__/Settings.snapshot.tsx.snap b/__tests__/__snapshots__/Settings.snapshot.tsx.snap index c92dc964a..88576d7cb 100644 --- a/__tests__/__snapshots__/Settings.snapshot.tsx.snap +++ b/__tests__/__snapshots__/Settings.snapshot.tsx.snap @@ -12,6 +12,186 @@ exports[`Component Settings - test Settings - snapshot 1`] = ` } } > + + + + + + + + + + + + + + + < + 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 - - - `; diff --git a/__tests__/__snapshots__/ShowUfvk.snapshot.tsx.snap b/__tests__/__snapshots__/ShowUfvk.snapshot.tsx.snap index 4498b61e1..563eb9a72 100644 --- a/__tests__/__snapshots__/ShowUfvk.snapshot.tsx.snap +++ b/__tests__/__snapshots__/ShowUfvk.snapshot.tsx.snap @@ -12,74 +12,66 @@ exports[`Component ShowUfvk - test ShowUfvk - snapshot 1`] = ` } } > - + @@ -87,34 +79,44 @@ exports[`Component ShowUfvk - test ShowUfvk - snapshot 1`] = ` style={ { "alignItems": "center", - "backgroundColor": "rgb(255, 255, 255)", - "display": "flex", "flexDirection": "row", "justifyContent": "center", - "margin": 0, - "marginRight": 5, - "minHeight": 25, - "minWidth": 25, - "padding": 0, } } > - < - icon={ + + > + < + icon={ + { + "icon": [ + 576, + 512, + [], + "f3c1", + "M352 144c0-44.2 35.8-80 80-80s80 35.8 80 80l0 48c0 17.7 14.3 32 32 32s32-14.3 32-32l0-48C576 64.5 511.5 0 432 0S288 64.5 288 144l0 48L64 192c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-192c0-35.3-28.7-64-64-64l-32 0 0-48z", + ], + "iconName": "lock-open", + "prefix": "fas", + } + } + size={25} + /> + @@ -122,40 +124,6 @@ exports[`Component ShowUfvk - test ShowUfvk - snapshot 1`] = ` - - - text translated (text translated) - - - @@ -174,7 +143,6 @@ exports[`Component ShowUfvk - test ShowUfvk - snapshot 1`] = ` + + + + + < + 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) + + + - @@ -265,11 +322,9 @@ exports[`Component ShowUfvk - test ShowUfvk - snapshot 1`] = ` > @@ -569,7 +624,7 @@ exports[`Component ShowUfvk - test ShowUfvk - snapshot 1`] = ` { "alignItems": "center", "backgroundColor": "rgb(0, 122, 255)", - "borderColor": "rgb(28, 28, 30)", + "borderColor": "rgb(0, 122, 255)", "borderRadius": 10, "borderWidth": 2, "justifyContent": "center", @@ -580,6 +635,7 @@ exports[`Component ShowUfvk - test ShowUfvk - snapshot 1`] = ` "padding": 0, "paddingLeft": 20, "paddingRight": 20, + "width": "80%", } } > diff --git a/__tests__/__snapshots__/SingleAddress.snapshot.tsx.snap b/__tests__/__snapshots__/SingleAddress.snapshot.tsx.snap index fb47d1351..555ed4738 100644 --- a/__tests__/__snapshots__/SingleAddress.snapshot.tsx.snap +++ b/__tests__/__snapshots__/SingleAddress.snapshot.tsx.snap @@ -10,11 +10,9 @@ exports[`Component SingleAddress - test SingleAddress - snapshot 1`] = ` > diff --git a/__tests__/__snapshots__/SyncReport.snapshot.tsx.snap b/__tests__/__snapshots__/SyncReport.snapshot.tsx.snap index a4192c634..2ee4f85ef 100644 --- a/__tests__/__snapshots__/SyncReport.snapshot.tsx.snap +++ b/__tests__/__snapshots__/SyncReport.snapshot.tsx.snap @@ -12,70 +12,38 @@ exports[`Component SyncReport - test SyncReport - snapshot 1`] = ` } } > - - - + - - text translated - + /> @@ -94,7 +63,6 @@ exports[`Component SyncReport - test SyncReport - snapshot 1`] = ` + + + + + < + 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 + + + - 1600099text translated100% + 1600099text translated100.00% - 200001text translated100% + 200001text translated100.00% - - - - - text translated - - - - `; diff --git a/android/app/build.gradle b/android/app/build.gradle index 0eb417a96..c2ac57b62 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -1,7 +1,6 @@ apply plugin: 'com.android.application' apply plugin: 'com.facebook.react' -apply plugin: 'kotlin-android' - +apply plugin: "org.jetbrains.kotlin.android" /** * This is the configuration block to customize your React Native Android app. @@ -85,7 +84,8 @@ ext.includeUniversalApk = project.properties['includeUniversalApk'] ?: false android { ndkVersion rootProject.ext.ndkVersion - compileSdkVersion rootProject.ext.compileSdkVersion + buildToolsVersion rootProject.ext.buildToolsVersion + compileSdk rootProject.ext.compileSdkVersion namespace 'org.ZingoLabs.Zingo' compileOptions { @@ -97,12 +97,18 @@ android { jvmTarget = '17' } + java { + toolchain { + languageVersion = JavaLanguageVersion.of(17) + } + } + defaultConfig { applicationId 'org.ZingoLabs.Zingo' // Real minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 205 // Real - versionName "zingo-1.10.3" // Real + versionCode 209 // Real + versionName "zingo-1.11.0" // Real missingDimensionStrategy 'react-native-camera', 'general' testBuildType System.getProperty('testBuildType', 'debug') testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' @@ -219,6 +225,7 @@ android.applicationVariants.configureEach { variant -> dependencies { // The version of react-native is set by the React Native Gradle Plugin implementation("com.facebook.react:react-android") + implementation("com.facebook.react:flipper-integration") androidTestImplementation('com.wix:detox:20.27.2') implementation 'androidx.appcompat:appcompat:1.7.0' @@ -230,13 +237,6 @@ dependencies { // Detox tests getAttributes() needs this debugImplementation('com.google.android.material:material:1.12.0') - debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") - debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") { - exclude group:'com.squareup.okhttp3', module:'okhttp' - } - - debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") - if (hermesEnabled.toBoolean()) { implementation("com.facebook.react:hermes-android") } else { 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 be13dc1f3..e0d1c508a 100644 --- a/android/app/src/androidTest/java/org/ZingoLabs/Zingo/RustFFITest.kt +++ b/android/app/src/androidTest/java/org/ZingoLabs/Zingo/RustFFITest.kt @@ -104,6 +104,7 @@ data class ValueTransfer ( data class ValueTransfers ( val value_transfers : List, + val total : Long, ) data class ParseResult ( @@ -321,10 +322,6 @@ class ExecuteSendFromOrchard { println("\nPropose:") println(proposeJson) - val sendProgressJson: String = uniffi.zingo.executeCommand("sendprogress", "") - println("\nSend progress:") - println(sendProgressJson) - val confirmJson: String = uniffi.zingo.executeCommand("confirm", "") println("\nConfirm Txid:") println(confirmJson) @@ -371,7 +368,7 @@ class UpdateCurrentPriceAndValueTransfersFromSeed { println("\nSync:") println(syncJson) - val valueTranfersJson: String = uniffi.zingo.getValueTransfers() + val valueTranfersJson: String = uniffi.zingo.getValueTransfers("50") println("\nValue Transfers:") println(valueTranfersJson) val valueTranfers: ValueTransfers = mapper.readValue(valueTranfersJson) @@ -425,7 +422,7 @@ class ExecuteSaplingBalanceFromSeed { println("\nSync:") println(syncJson) - val valueTranfersJson: String = uniffi.zingo.getValueTransfers() + val valueTranfersJson: String = uniffi.zingo.getValueTransfers("50") println("\nValue Transfers:") println(valueTranfersJson) diff --git a/android/app/src/debug/java/org/ZingoLabs/Zingo/ReactNativeFlipper.java b/android/app/src/debug/java/org/ZingoLabs/Zingo/ReactNativeFlipper.java deleted file mode 100644 index b5d6d12a0..000000000 --- a/android/app/src/debug/java/org/ZingoLabs/Zingo/ReactNativeFlipper.java +++ /dev/null @@ -1,72 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - *

This source code is licensed under the MIT license found in the LICENSE file in the root - * directory of this source tree. - */ -package org.ZingoLabs.Zingo; - -import android.content.Context; -import com.facebook.flipper.android.AndroidFlipperClient; -import com.facebook.flipper.android.utils.FlipperUtils; -import com.facebook.flipper.core.FlipperClient; -import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin; -import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin; -import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin; -import com.facebook.flipper.plugins.inspector.DescriptorMapping; -import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin; -import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor; -import com.facebook.flipper.plugins.network.NetworkFlipperPlugin; -import com.facebook.flipper.plugins.react.ReactFlipperPlugin; -import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin; -import com.facebook.react.ReactInstanceManager; -import com.facebook.react.bridge.ReactContext; -import com.facebook.react.modules.network.NetworkingModule; -import okhttp3.OkHttpClient; - -public class ReactNativeFlipper { - public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) { - if (FlipperUtils.shouldEnableFlipper(context)) { - final FlipperClient client = AndroidFlipperClient.getInstance(context); - - client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults())); - client.addPlugin(new ReactFlipperPlugin()); - client.addPlugin(new DatabasesFlipperPlugin(context)); - client.addPlugin(new SharedPreferencesFlipperPlugin(context)); - client.addPlugin(CrashReporterPlugin.getInstance()); - - NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin(); - NetworkingModule.setCustomClientBuilder( - new NetworkingModule.CustomClientBuilder() { - @Override - public void apply(OkHttpClient.Builder builder) { - builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin)); - } - }); - client.addPlugin(networkFlipperPlugin); - client.start(); - - // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized - // Hence we run if after all native modules have been initialized - ReactContext reactContext = reactInstanceManager.getCurrentReactContext(); - if (reactContext == null) { - reactInstanceManager.addReactInstanceEventListener( - new ReactInstanceManager.ReactInstanceEventListener() { - @Override - public void onReactContextInitialized(ReactContext reactContext) { - reactInstanceManager.removeReactInstanceEventListener(this); - reactContext.runOnNativeModulesQueueThread( - new Runnable() { - @Override - public void run() { - client.addPlugin(new FrescoFlipperPlugin()); - } - }); - } - }); - } else { - client.addPlugin(new FrescoFlipperPlugin()); - } - } - } -} diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index fc523b090..36a877314 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -5,7 +5,6 @@ - @@ -25,7 +24,7 @@ android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" android:launchMode="singleTask" android:screenOrientation="portrait" - android:windowSoftInputMode="adjustResize" + android:windowSoftInputMode="adjustPan" android:exported="true" tools:ignore="LockedOrientationActivity"> @@ -37,8 +36,8 @@ - - + + diff --git a/android/app/src/main/java/org/ZingoLabs/Zingo/BackgroundSyncWorker.kt b/android/app/src/main/java/org/ZingoLabs/Zingo/BackgroundSyncWorker.kt index efe8a3579..c52dc3e34 100644 --- a/android/app/src/main/java/org/ZingoLabs/Zingo/BackgroundSyncWorker.kt +++ b/android/app/src/main/java/org/ZingoLabs/Zingo/BackgroundSyncWorker.kt @@ -32,6 +32,7 @@ import kotlin.time.DurationUnit import kotlin.time.toDuration import kotlin.time.toJavaDuration import org.ZingoLabs.Zingo.Constants.* +import java.io.FileInputStream class BackgroundSyncWorker(context: Context, workerParams: WorkerParameters) : Worker(context, workerParams) { @@ -107,7 +108,7 @@ class BackgroundSyncWorker(context: Context, workerParams: WorkerParameters) : W private fun loadWalletFile(rpcModule: RPCModule) { // I have to init from wallet file in order to do the sync // and I need to read the settings.json to find the server & chain type - MainApplication.getAppContext()?.openFileInput("settings.json")?.use { file -> + MainApplication.getAppContext()?.openFileInput("settings.json")?.use { file: FileInputStream -> val settingsBytes = file.readBytes() file.close() val settingsString = settingsBytes.toString(Charsets.UTF_8) @@ -160,7 +161,7 @@ class BackgroundSyncWorker(context: Context, workerParams: WorkerParameters) : W class BSCompanion { companion object { - private const val taskID = "Zingo_Processing_Task_ID" + private const val TASKID = "Zingo_Processing_Task_ID" private val SYNC_PERIOD = 24.hours private val SYNC_DAY_SHIFT = 1.days // Move to tomorrow private val SYNC_START_TIME_HOURS = 3.hours // Start around 3 a.m. at night @@ -189,13 +190,13 @@ class BSCompanion { Log.i("SCHEDULING_TASK", "Enqueuing the background task - Background") WorkManager.getInstance(reactContext) .enqueueUniquePeriodicWork( - taskID, - ExistingPeriodicWorkPolicy.REPLACE, + TASKID, + ExistingPeriodicWorkPolicy.UPDATE, workRequest ) Log.i("SCHEDULING_TASK", "Task info ${WorkManager.getInstance(reactContext).getWorkInfosForUniqueWork( - taskID).get()}") + TASKID).get()}") } private fun calculateTargetTimeDifference(): Duration { @@ -236,7 +237,7 @@ class BSCompanion { Log.i("SCHEDULING_TASK", "Cancel background Task") WorkManager.getInstance(reactContext) - .cancelUniqueWork(taskID) + .cancelUniqueWork(TASKID) } } diff --git a/android/app/src/main/java/org/ZingoLabs/Zingo/MainActivity.kt b/android/app/src/main/java/org/ZingoLabs/Zingo/MainActivity.kt index 8851807c0..4900d77a5 100644 --- a/android/app/src/main/java/org/ZingoLabs/Zingo/MainActivity.kt +++ b/android/app/src/main/java/org/ZingoLabs/Zingo/MainActivity.kt @@ -4,7 +4,7 @@ import android.os.Bundle import android.util.Log import com.facebook.react.ReactActivity import com.facebook.react.ReactActivityDelegate -import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint +import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled import com.facebook.react.defaults.DefaultReactActivityDelegate class MainActivity : ReactActivity() { @@ -14,19 +14,19 @@ class MainActivity : ReactActivity() { */ private var isStarting = true - override fun getMainComponentName(): String { - return "Zingo" - } + + override fun getMainComponentName(): String = "Zingo" + override fun onCreate(savedInstanceState: Bundle?) { Log.i("ON_CREATE", "Starting main activity") super.onCreate(null) } - override fun createReactActivityDelegate(): ReactActivityDelegate? { + override fun createReactActivityDelegate(): ReactActivityDelegate { return DefaultReactActivityDelegate( this, mainComponentName, // If you opted-in for the New Architecture, we enable the Fabric Renderer. - DefaultNewArchitectureEntryPoint.fabricEnabled + fabricEnabled ) } override fun onPause() { diff --git a/android/app/src/main/java/org/ZingoLabs/Zingo/MainApplication.kt b/android/app/src/main/java/org/ZingoLabs/Zingo/MainApplication.kt index 543f51b85..ce15bf6db 100644 --- a/android/app/src/main/java/org/ZingoLabs/Zingo/MainApplication.kt +++ b/android/app/src/main/java/org/ZingoLabs/Zingo/MainApplication.kt @@ -1,43 +1,40 @@ package org.ZingoLabs.Zingo import android.app.Application -import android.content.Context -import com.facebook.react.* -import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint +import com.facebook.react.PackageList +import com.facebook.react.ReactApplication +import com.facebook.react.ReactHost +import com.facebook.react.ReactNativeHost +import com.facebook.react.ReactPackage +import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load +import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost import com.facebook.react.defaults.DefaultReactNativeHost import com.facebook.soloader.SoLoader +import android.content.Context import java.lang.ref.WeakReference - class MainApplication : Application(), ReactApplication { - private val mReactNativeHost: ReactNativeHost = object : DefaultReactNativeHost(this) { - override fun getUseDeveloperSupport(): Boolean { - return BuildConfig.DEBUG - } - - override fun getPackages(): List { - // Packages that cannot be autolinked yet can be added manually here, for example: - // packages.add(new MyReactNativePackage()); - val packages: MutableList = PackageList(this).packages - - packages.add(RPCPackage()) - return packages - } - - override fun getJSMainModuleName(): String { - return "index" - } - - override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED + override val reactNativeHost: ReactNativeHost = + object : DefaultReactNativeHost(this) { + override fun getPackages(): List = + PackageList(this).packages.apply { + // Packages that cannot be autolinked yet can be added manually here, for example: + // add(MyReactNativePackage()) + add(RPCPackage()) + } + + override fun getJSMainModuleName(): String = "index" + + override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG + override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED } - - override fun getReactNativeHost(): ReactNativeHost { - return mReactNativeHost - } - + + override val reactHost: ReactHost + get() = getDefaultReactHost(this.applicationContext, reactNativeHost) + override fun onCreate() { super.onCreate() context = WeakReference(applicationContext) @@ -46,7 +43,7 @@ class MainApplication : Application(), ReactApplication { SoLoader.init(this, false) if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { // If you opted-in for the New Architecture, we load the native entry point for this app. - DefaultNewArchitectureEntryPoint.load() + load() } } diff --git a/android/app/src/main/java/org/ZingoLabs/Zingo/RPCModule.kt b/android/app/src/main/java/org/ZingoLabs/Zingo/RPCModule.kt index 7518c4049..733cec0ee 100644 --- a/android/app/src/main/java/org/ZingoLabs/Zingo/RPCModule.kt +++ b/android/app/src/main/java/org/ZingoLabs/Zingo/RPCModule.kt @@ -7,11 +7,9 @@ import com.facebook.react.bridge.ReactApplicationContext import com.facebook.react.bridge.ReactContextBaseJavaModule import com.facebook.react.bridge.ReactMethod import com.facebook.react.bridge.Promise - import java.io.File import java.io.FileNotFoundException import java.io.IOException -import kotlin.concurrent.thread import org.ZingoLabs.Zingo.Constants.* import kotlinx.coroutines.* @@ -434,16 +432,12 @@ class RPCModule internal constructor(private val reactContext: ReactApplicationC saveWalletFile() } - withContext(Dispatchers.Main) { - promise.resolve(resp) - } + promise.resolve(resp) } catch (e: Exception) { val errorMessage = "Error: executing command '$cmd': ${e.localizedMessage}" Log.e("MAIN", errorMessage, e) - withContext(Dispatchers.Main) { - promise.resolve(errorMessage) - } + promise.resolve(errorMessage) } } } @@ -454,16 +448,12 @@ class RPCModule internal constructor(private val reactContext: ReactApplicationC try { val result = saveWalletFile() - withContext(Dispatchers.Main) { - promise.resolve(result) - } + promise.resolve(result) } catch (e: Exception) { val errorMessage = "Error: saving wallet: ${e.localizedMessage}" Log.e("MAIN", errorMessage, e) - withContext(Dispatchers.Main) { - promise.resolve(errorMessage) - } + promise.resolve(errorMessage) } } } @@ -474,16 +464,12 @@ class RPCModule internal constructor(private val reactContext: ReactApplicationC try { val result = saveWalletBackupFile() - withContext(Dispatchers.Main) { - promise.resolve(result) - } + promise.resolve(result) } catch (e: Exception) { val errorMessage = "Error: saving wallet backup: ${e.localizedMessage}" Log.e("MAIN", errorMessage, e) - withContext(Dispatchers.Main) { - promise.resolve(errorMessage) - } + promise.resolve(errorMessage) } } } @@ -495,15 +481,12 @@ class RPCModule internal constructor(private val reactContext: ReactApplicationC uniffi.zingo.initLogging() val resp = uniffi.zingo.getLatestBlockServer(server) - withContext(Dispatchers.Main) { - promise.resolve(resp) - } + promise.resolve(resp) } catch (e: Exception) { val errorMessage = "Error: getting latest block: ${e.localizedMessage}" Log.e("MAIN", errorMessage, e) - withContext(Dispatchers.Main) { - promise.resolve(errorMessage) - } + + promise.resolve(errorMessage) } } } @@ -515,15 +498,12 @@ class RPCModule internal constructor(private val reactContext: ReactApplicationC uniffi.zingo.initLogging() val resp = uniffi.zingo.getDeveloperDonationAddress() - withContext(Dispatchers.Main) { - promise.resolve(resp) - } + promise.resolve(resp) } catch (e: Exception) { val errorMessage = "Error: getting donation address: ${e.localizedMessage}" Log.e("MAIN", errorMessage, e) - withContext(Dispatchers.Main) { - promise.resolve(errorMessage) - } + + promise.resolve(errorMessage) } } } @@ -535,35 +515,29 @@ class RPCModule internal constructor(private val reactContext: ReactApplicationC uniffi.zingo.initLogging() val resp = uniffi.zingo.getZenniesForZingoDonationAddress() - withContext(Dispatchers.Main) { - promise.resolve(resp) - } + promise.resolve(resp) } catch (e: Exception) { val errorMessage = "Error: getting Zennies donation address: ${e.localizedMessage}" Log.e("MAIN", errorMessage, e) - withContext(Dispatchers.Main) { - promise.resolve(errorMessage) - } + + promise.resolve(errorMessage) } } } @ReactMethod - fun getValueTransfersList(promise: Promise) { + fun getValueTransfersList(items: String, promise: Promise) { CoroutineScope(Dispatchers.IO).launch { try { uniffi.zingo.initLogging() - val resp = uniffi.zingo.getValueTransfers() + val resp = uniffi.zingo.getValueTransfers(items) - withContext(Dispatchers.Main) { - promise.resolve(resp) - } + promise.resolve(resp) } catch (e: Exception) { val errorMessage = "Error: getting value transfers list: ${e.localizedMessage}" Log.e("MAIN", errorMessage, e) - withContext(Dispatchers.Main) { - promise.resolve(errorMessage) - } + + promise.resolve(errorMessage) } } } @@ -575,15 +549,12 @@ class RPCModule internal constructor(private val reactContext: ReactApplicationC uniffi.zingo.initLogging() val resp = uniffi.zingo.getTransactionSummaries() - withContext(Dispatchers.Main) { - promise.resolve(resp) - } + promise.resolve(resp) } catch (e: Exception) { val errorMessage = "Error: getting transaction summaries list: ${e.localizedMessage}" Log.e("MAIN", errorMessage, e) - withContext(Dispatchers.Main) { - promise.resolve(errorMessage) - } + + promise.resolve(errorMessage) } } } @@ -595,15 +566,11 @@ class RPCModule internal constructor(private val reactContext: ReactApplicationC uniffi.zingo.initLogging() val resp = uniffi.zingo.setCryptoDefaultProviderToRing() - withContext(Dispatchers.Main) { - promise.resolve(resp) - } + promise.resolve(resp) } catch (e: Exception) { val errorMessage = "Error: setting crypto default provider: ${e.localizedMessage}" Log.e("MAIN", errorMessage, e) - withContext(Dispatchers.Main) { - promise.resolve(errorMessage) - } + promise.resolve(errorMessage) } } } diff --git a/android/build.gradle b/android/build.gradle index 7cfaa3e4a..04ce3f5e0 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -6,20 +6,22 @@ buildscript { minSdkVersion = 24 compileSdkVersion = 34 targetSdkVersion = 34 - ndkVersion = "24.0.8215888" - kotlinVersion = '1.8.20' + ndkVersion = "25.2.9519653" + kotlinVersion = '1.8.22' } repositories { google() mavenCentral() } dependencies { - classpath('com.android.tools.build:gradle:8.2.1') - classpath("com.facebook.react:react-native-gradle-plugin") - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" + classpath('com.android.tools.build:gradle:8.3.2') + classpath("com.facebook.react:react-native-gradle-plugin") + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin" } } +apply plugin: "com.facebook.react.rootproject" + allprojects { repositories { google() diff --git a/android/gradle.properties b/android/gradle.properties index 63747fd0e..d4c32ecae 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -26,9 +26,6 @@ android.useAndroidX=true # Automatically convert third-party libraries to use AndroidX android.enableJetifier=true -# Version of flipper SDK to use with React Native -FLIPPER_VERSION=0.182.0 - # Use this property to specify which architecture you want to build. # You can also override it from the CLI using # ./gradlew -PreactNativeArchitectures=x86_64 diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 8612e3f67..9cbf3239c 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ +#Fri Jan 24 19:05:10 MST 2025 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/android/gradlew b/android/gradlew index 2fe81a7d9..43304d37e 100755 --- a/android/gradlew +++ b/android/gradlew @@ -37,15 +37,13 @@ while [ -h "$PRG" ] ; do done SAVED="`pwd`" cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" +# 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 cd "$SAVED" >/dev/null APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" @@ -98,10 +96,13 @@ location of your Java installation." fi else JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. @@ -177,6 +178,9 @@ save () { } APP_ARGS=`save "$@"` +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + # Collect all arguments for the java command, following the shell quoting and substitution rules eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" diff --git a/app/AppState/AppContextLoaded.ts b/app/AppState/AppContextLoaded.ts index f897078ca..af2074287 100644 --- a/app/AppState/AppContextLoaded.ts +++ b/app/AppState/AppContextLoaded.ts @@ -3,7 +3,6 @@ import { StackScreenProps } from '@react-navigation/stack'; import TotalBalanceClass from './classes/TotalBalanceClass'; import AddressClass from './classes/AddressClass'; import SendPageStateClass from './classes/SendPageStateClass'; -import SendProgressClass from './classes/SendProgressClass'; import ReceivePageStateClass from './classes/ReceivePageStateClass'; import WalletSettingsClass from './classes/WalletSettingsClass'; import AddressBookFileClass from './classes/AddressBookFileClass'; @@ -39,9 +38,13 @@ export default interface AppContextLoaded { // List of all T and Z and O value transfers valueTransfers: ValueTransferType[] | null; + valueTransfersFetchItems: number; + valueTransfersTotal: number | null; // List of messages messages: ValueTransferType[] | null; + messagesFetchItems: number; + messagesTotal: number | null; // The state of the send page sendPageState: SendPageStateClass; @@ -58,14 +61,11 @@ export default interface AppContextLoaded { // syncing Info about the status of the process syncingStatus: SyncingStatusClass; - // Build progress from Tx - sendProgress: SendProgressClass; - // wallet recovery info wallet: WalletType; // active UA in the wallet - uaAddress: string; + uOrchardAddress: string; // zec price in USD from internet zecPrice: ZecPriceType; diff --git a/app/AppState/classes/AddressBookFileClass.ts b/app/AppState/classes/AddressBookFileClass.ts index 20f2c8287..98907b4d9 100644 --- a/app/AppState/classes/AddressBookFileClass.ts +++ b/app/AppState/classes/AddressBookFileClass.ts @@ -1,9 +1,11 @@ export default class AddressBookFileClass { label: string; address: string; + uOrchardAddress?: string; - constructor(label: string, address: string) { + constructor(label: string, address: string, uOrchardAddress?: string) { this.label = label; this.address = address; + this.uOrchardAddress = uOrchardAddress; } } diff --git a/app/AppState/classes/AddressClass.ts b/app/AppState/classes/AddressClass.ts index b6183b731..0e096d747 100644 --- a/app/AppState/classes/AddressClass.ts +++ b/app/AppState/classes/AddressClass.ts @@ -1,13 +1,13 @@ import { AddressKindEnum } from '../enums/AddressKindEnum'; export default class AddressClass { - uaAddress: string; + uOrchardAddress: string; address: string; addressKind: AddressKindEnum; receivers: string; - constructor(uaAddress: string, address: string, addressKind: AddressKindEnum, receivers: string) { - this.uaAddress = uaAddress; + constructor(uOrchardAddress: string, address: string, addressKind: AddressKindEnum, receivers: string) { + this.uOrchardAddress = uOrchardAddress; this.address = address; this.addressKind = addressKind; this.receivers = receivers; diff --git a/app/AppState/classes/SendProgressClass.ts b/app/AppState/classes/SendProgressClass.ts deleted file mode 100644 index e3b7e71e7..000000000 --- a/app/AppState/classes/SendProgressClass.ts +++ /dev/null @@ -1,13 +0,0 @@ -export default class SendProgressClass { - sendInProgress: boolean; - progress: number; - total: number; - etaSeconds: number | string; - - constructor(progress: number, total: number, etaSeconds: number | string) { - this.sendInProgress = false; - this.progress = progress; - this.total = total; - this.etaSeconds = etaSeconds; - } -} diff --git a/app/AppState/const/GlobalConst.ts b/app/AppState/const/GlobalConst.ts index 347e22be9..81e34dff7 100644 --- a/app/AppState/const/GlobalConst.ts +++ b/app/AppState/const/GlobalConst.ts @@ -21,4 +21,5 @@ export const GlobalConst = { background: '@background', keyKeyChain: 'ZINGO_SEED_BIRTHDAY', serviceKeyChain: 'ZINGO', + replyTo: '\nReply to: \n', }; diff --git a/app/AppState/enums/CommandAddressesEnum.ts b/app/AppState/enums/CommandAddressesEnum.ts new file mode 100644 index 000000000..af25d21bd --- /dev/null +++ b/app/AppState/enums/CommandAddressesEnum.ts @@ -0,0 +1,5 @@ +export enum CommandAddressesEnum { + full = '', + shielded = 'shielded', + orchard = 'orchard', +} diff --git a/app/AppState/enums/CommandEnum.ts b/app/AppState/enums/CommandEnum.ts index a28df940d..53139feb8 100644 --- a/app/AppState/enums/CommandEnum.ts +++ b/app/AppState/enums/CommandEnum.ts @@ -1,5 +1,4 @@ export enum CommandEnum { - sendprogress = 'sendprogress', changeserver = 'changeserver', walletKind = 'wallet_kind', interruptSyncAfterBatch = 'interrupt_sync_after_batch', diff --git a/app/AppState/enums/FilterEnum.ts b/app/AppState/enums/FilterEnum.ts new file mode 100644 index 000000000..9b614ea59 --- /dev/null +++ b/app/AppState/enums/FilterEnum.ts @@ -0,0 +1,5 @@ +export enum FilterEnum { + all = 'all', + contacts = 'contacts', + noContacts = 'no contacts', +} diff --git a/app/AppState/enums/ShieldedEnum.ts b/app/AppState/enums/ShieldedEnum.ts new file mode 100644 index 000000000..71b15499f --- /dev/null +++ b/app/AppState/enums/ShieldedEnum.ts @@ -0,0 +1,6 @@ +export enum ShieldedEnum { + uFull = 'uFull', + uOrchardSapling = 'uOrchardSapling', + uOrchard = 'uOrchard', + sapling = 'sapling', +} diff --git a/app/AppState/index.js b/app/AppState/index.js index 9974673bf..0572c9079 100644 --- a/app/AppState/index.js +++ b/app/AppState/index.js @@ -2,7 +2,6 @@ import AddressClass from './classes/AddressClass'; import AddressBookFileClass from './classes/AddressBookFileClass'; import ReceivePageStateClass from './classes/ReceivePageStateClass'; import SendPageStateClass from './classes/SendPageStateClass'; -import SendProgressClass from './classes/SendProgressClass'; import SettingsFileClass from './classes/SettingsFileClass'; import SyncingStatusClass from './classes/SyncingStatusClass'; import ToAddrClass from './classes/ToAddrClass'; @@ -22,6 +21,7 @@ import ZecPriceType from './types/ZecPriceType'; import SecurityType from './types/SecurityType'; import ServerUrisType from './types/ServerUrisType'; import ValueTransferType from './types/ValueTransferType'; +import ContactType from './types/ContactType'; import { CommandEnum } from './enums/CommandEnum'; import { AddressBookActionEnum } from './enums/AddressBookActionEnum'; @@ -51,6 +51,7 @@ import { PrivacyLevelFromEnum } from './enums/PrivacyLevelFromEnum'; import { SecurityTypeEnum } from './enums/SecurityTypeEnum'; import { EventListenerEnum } from './enums/EventListenerEnum'; import { ValueTransferKindEnum } from './enums/ValueTransferKindEnum'; +import { FilterEnum } from './enums/FilterEnum'; import { GlobalConst } from './const/GlobalConst'; @@ -68,7 +69,6 @@ export { AddressBookFileClass, ReceivePageStateClass, SendPageStateClass, - SendProgressClass, SettingsFileClass, SyncingStatusClass, ToAddrClass, @@ -87,6 +87,7 @@ export { SecurityType, ServerUrisType, ValueTransferType, + ContactType, CommandEnum, AddressBookActionEnum, MenuItemEnum, @@ -115,5 +116,6 @@ export { SecurityTypeEnum, EventListenerEnum, ValueTransferKindEnum, + FilterEnum, GlobalConst, }; diff --git a/app/AppState/types/ContactType.ts b/app/AppState/types/ContactType.ts new file mode 100644 index 000000000..2fcc990bd --- /dev/null +++ b/app/AppState/types/ContactType.ts @@ -0,0 +1,15 @@ +import { RPCValueTransfersStatusEnum } from '../../rpc/enums/RPCValueTransfersStatusEnum'; +import { ValueTransferKindEnum } from '../enums/ValueTransferKindEnum'; + +export default interface ContactType { + address: string; + + // last message + time: number; + memos: string[]; + confirmations: number; + status?: RPCValueTransfersStatusEnum; + kind?: ValueTransferKindEnum; + + // eslint-disable-next-line semi +} diff --git a/app/AppState/types/ValueTransferType.ts b/app/AppState/types/ValueTransferType.ts index aa7c785d4..638c5b1c3 100644 --- a/app/AppState/types/ValueTransferType.ts +++ b/app/AppState/types/ValueTransferType.ts @@ -4,7 +4,7 @@ import { RPCValueTransfersStatusEnum } from '../../rpc/enums/RPCValueTransfersSt export default interface ValueTransferType { txid: string; - kind?: ValueTransferKindEnum; // like kind + kind: ValueTransferKindEnum; fee?: number; confirmations: number; time: number; diff --git a/app/LoadedApp/LoadedApp.tsx b/app/LoadedApp/LoadedApp.tsx index 0dbade6e0..90e7c9adf 100644 --- a/app/LoadedApp/LoadedApp.tsx +++ b/app/LoadedApp/LoadedApp.tsx @@ -34,7 +34,6 @@ import { InfoType, ToAddrClass, SyncingStatusClass, - SendProgressClass, WalletSettingsClass, AddressClass, ZecPriceType, @@ -273,10 +272,35 @@ export default function LoadedApp(props: LoadedAppProps) { } // adding `Zenny Tips` address always. - const ab = await AddressBookFileImpl.writeAddressBookItem( + let ab = await AddressBookFileImpl.writeAddressBookItem( translate('zenny-tips-ab') as string, await Utils.getZenniesDonationAddress(server.chainName), + '', ); + + // reply-to change, from full UA to only orchard UA. + // we need to calculate the only orchard UA for all the + // contacts with a full UA stored in the Address Book. + // We need to identify the old transaction memos (with full UA) + // and we need to idenfify the new transaction memos (with only orchard UA) + + // if some contact don't have the new field: `uOrchardAddress` then + // the App have to create and calculate it if needed. + const toUpdate = ab.filter((a: AddressBookFileClass) => !a.hasOwnProperty('uOrchardAddress')); + console.log('Address Book -> TO UPDATE', toUpdate); + if (toUpdate.length > 0) { + for (let i = 0; i < toUpdate.length; i++) { + const a = toUpdate[i]; + const validAddress: { isValid: boolean; onlyOrchardUA: string } = await Utils.isValidAddress( + a.address, + server.chainName, + ); + if (validAddress.isValid) { + //ab = await AddressBookFileImpl.removeAddressBookItem(a.label, a.address); + ab = await AddressBookFileImpl.writeAddressBookItem(a.label, a.address, validAddress.onlyOrchardUA); + } + } + } setAddressBook(ab); setLoading(false); @@ -384,16 +408,19 @@ export class LoadedAppClass extends Component { + setValueTransfersList = async (valueTransfers: ValueTransferType[], valueTransfersTotal: number) => { const basicFirstViewSeed = (await SettingsFileImpl.readSettings()).basicFirstViewSeed; // only for basic mode if (this.state.mode === ModeEnum.basic) { @@ -793,7 +818,7 @@ export class LoadedAppClass extends Component 0 && vtNew[0].confirmations > 0) { let message: string = ''; let title: string = ''; - if (vtNew[0].kind === ValueTransferKindEnum.Received) { + if (vtNew[0].kind === ValueTransferKindEnum.Received && vtNew[0].amount > 0) { message = (this.state.translate('loadedapp.incoming-funds') as string) + (this.state.translate('history.received') as string) + @@ -823,7 +848,7 @@ export class LoadedAppClass extends Component 0) { message = (this.state.translate('loadedapp.valuetransfer-confirmed') as string) + (this.state.translate('history.memotoself') as string) + @@ -835,7 +860,7 @@ export class LoadedAppClass extends Component 0) { message = (this.state.translate('loadedapp.valuetransfer-confirmed') as string) + (this.state.translate('history.sendtoself') as string) + @@ -847,20 +872,18 @@ export class LoadedAppClass extends Component 0) { + // not so sure about this `kind`... + // I guess the wallet is receiving some refund from a TEX sent. message = - (this.state.translate('loadedapp.valuetransfer-confirmed') as string) + - (this.state.translate('history.rejection') as string) + - (vtNew[0].fee - ? ((' ' + this.state.translate('send.fee')) as string) + - ' ' + - Utils.parseNumberFloatToStringLocale(vtNew[0].fee, 8) + - ' ' + - this.state.info.currencyName - : ''); - title = this.state.translate('loadedapp.send-menu') as string; - } else if (vtNew[0].kind === ValueTransferKindEnum.Shield) { + (this.state.translate('loadedapp.incoming-funds') as string) + + (this.state.translate('history.received') as string) + + ' ' + + Utils.parseNumberFloatToStringLocale(vtNew[0].amount, 8) + + ' ' + + this.state.info.currencyName; + title = this.state.translate('loadedapp.receive-menu') as string; + } else if (vtNew[0].kind === ValueTransferKindEnum.Shield && vtNew[0].amount > 0) { message = (this.state.translate('loadedapp.incoming-funds') as string) + (this.state.translate('history.shield') as string) + @@ -869,7 +892,7 @@ export class LoadedAppClass extends Component 0) { message = (this.state.translate('loadedapp.payment-made') as string) + (this.state.translate('history.sent') as string) + @@ -879,7 +902,9 @@ export class LoadedAppClass extends Component Likely Reverted by the server if (vtNew.length === 0) { @@ -897,31 +922,47 @@ export class LoadedAppClass extends Component { - this.setState({ valueTransfers, somePending: pending > 0 }); + this.setState({ + valueTransfers, + somePending: pending > 0, + valueTransfersTotal, + }); }, pending === 0 ? 250 : 0, ); } }; - setMessagesList = (messages: ValueTransferType[]) => { - if (!isEqual(this.state.messages, messages)) { + setValueTransfersFetchItems = (items: number) => { + this.setState({ + valueTransfersFetchItems: items, + }); + }; + + setMessagesList = (messages: ValueTransferType[], messagesTotal: number) => { + if (!isEqual(this.state.messages, messages) || this.state.messagesTotal !== messagesTotal) { //console.log('fetch messages'); - this.setState({ messages }); + this.setState({ messages, messagesTotal }); } }; + setMessagesFetchItems = (items: number) => { + this.setState({ + messagesFetchItems: items, + }); + }; + setAllAddresses = (addresses: AddressClass[]) => { if (!isEqual(this.state.addresses, addresses)) { //console.log('fetch addresses'); this.setState({ addresses }); } if (addresses.length > 0) { - if (this.state.uaAddress !== addresses[0].uaAddress) { - this.setState({ uaAddress: addresses[0].uaAddress }); + if (this.state.uOrchardAddress !== addresses[0].uOrchardAddress) { + this.setState({ uOrchardAddress: addresses[0].uOrchardAddress }); } } else { - this.setState({ uaAddress: '' }); + this.setState({ uOrchardAddress: '' }); } }; @@ -963,13 +1004,6 @@ export class LoadedAppClass extends Component { - if (!isEqual(this.state.sendProgress, sendProgress)) { - //console.log('fetch send progress'); - this.setState({ sendProgress }); - } - }; - setInfo = (info: InfoType) => { if (!isEqual(this.state.info, info)) { //console.log('fetch info'); @@ -995,18 +1029,20 @@ export class LoadedAppClass extends Component void): Promise => { + sendTransaction = async (): Promise => { try { // Construct a sendJson from the sendPage state - const { sendPageState, uaAddress, addresses, server, donation } = this.state; + const { sendPageState, uOrchardAddress, addresses, server, donation } = this.state; const sendJson = await Utils.getSendManyJSON( sendPageState, - uaAddress, + uOrchardAddress, addresses ? addresses : ([] as AddressClass[]), server, donation, ); - const txid = await this.rpc.sendTransaction(sendJson, setSendProgress); + //const start = Date.now(); + const txid = await this.rpc.sendTransaction(sendJson); + //console.log('&&&&&&&&&&&&&& send tx', Date.now() - start); return txid; } catch (err) { @@ -1015,13 +1051,13 @@ export class LoadedAppClass extends Component { - await this.rpc.refresh(false); + doRefresh = () => { + this.rpc.refreshSync(false); }; doRescan = async () => { await this.rpc.stopSyncProcess(); - this.rpc.refresh(false, true); + this.rpc.refreshSync(false, true); }; toggleMenuDrawer = () => { @@ -1198,7 +1234,7 @@ export class LoadedAppClass extends Component { - await this.rpc.clearTimers(); - }; - - configure = async () => { - await this.rpc.configure(); - }; - onClickOKChangeWallet = async (state: any) => { const { server } = this.state; @@ -1540,10 +1568,6 @@ export class LoadedAppClass extends Component { - this.setState({ uaAddress }); - }; - syncingStatusMoreInfoOnClick = async () => { await this.fetchWallet(); this.setState({ syncReportModalVisible: true }); @@ -1625,7 +1649,7 @@ export class LoadedAppClass extends Component {mode === ModeEnum.advanced || - (!!valueTransfers && valueTransfers.length > 0) || + (!!valueTransfersTotal && valueTransfersTotal > 0) || (!readOnly && !!totalBalance && totalBalance.spendableOrchard + totalBalance.spendablePrivate > 0) ? ( )} @@ -2046,7 +2076,6 @@ export class LoadedAppClass extends Component )} @@ -2066,10 +2093,10 @@ export class LoadedAppClass extends Component {() => ( )} @@ -2082,15 +2109,20 @@ export class LoadedAppClass extends Component )} ) : ( <> - {valueTransfers === null || addresses === null || totalBalance === null ? ( + {valueTransfersTotal === null || addresses === null || totalBalance === null ? ( ) : ( {() => ( )} diff --git a/app/LoadedApp/components/ComputingTxContent.tsx b/app/LoadedApp/components/ComputingTxContent.tsx index 036c56da9..63fd00957 100644 --- a/app/LoadedApp/components/ComputingTxContent.tsx +++ b/app/LoadedApp/components/ComputingTxContent.tsx @@ -5,7 +5,6 @@ import { useTheme } from '@react-navigation/native'; import RegText from '../../../components/Components/RegText'; import { ThemeType } from '../../types'; -import CircularProgress from '../../../components/Components/CircularProgress'; import { ContextAppLoaded } from '../../context'; import Header from '../../../components/Header'; import moment from 'moment'; @@ -15,7 +14,7 @@ import 'moment/locale/ru'; const ComputingTxContent: React.FunctionComponent = () => { const context = useContext(ContextAppLoaded); - const { sendProgress: progress, translate, language } = context; + const { translate, language } = context; const { colors } = useTheme() as unknown as ThemeType; moment.locale(language); @@ -43,27 +42,7 @@ const ComputingTxContent: React.FunctionComponent = () => { height: '70%', }}> {translate('loadedapp.computingtx') as string} - {progress && progress.sendInProgress ? ( - <> - {`${translate('loadedapp.step')} ${progress.progress} ${translate( - 'loadedapp.of', - )} ${progress.total}`} - {`${translate('loadedapp.eta')} ${progress.etaSeconds} ${translate( - 'loadedapp.sec', - )}`} - - - ) : ( - <> - - - )} + {translate('wait') as string} diff --git a/app/LoadedApp/components/Menu.tsx b/app/LoadedApp/components/Menu.tsx index d3089c00d..6afd41f39 100644 --- a/app/LoadedApp/components/Menu.tsx +++ b/app/LoadedApp/components/Menu.tsx @@ -1,6 +1,6 @@ /* eslint-disable react-native/no-inline-styles */ import React, { useContext } from 'react'; -import { ScrollView, View, Text, Dimensions } from 'react-native'; +import { ScrollView, View, Text, Dimensions, SafeAreaView } from 'react-native'; import RegText from '../../../components/Components/RegText'; @@ -26,7 +26,7 @@ const Menu: React.FunctionComponent = ({ onItemSelected, updateMenuSt translate, readOnly, mode, - valueTransfers, + valueTransfersTotal, addLastSnackbar, security, language, @@ -38,8 +38,8 @@ const Menu: React.FunctionComponent = ({ onItemSelected, updateMenuSt moment.locale(language); const dimensions = { - width: Dimensions.get('screen').width, - height: Dimensions.get('screen').height, + width: Dimensions.get('window').width, + height: Dimensions.get('window').height, }; const item = { @@ -80,16 +80,19 @@ const Menu: React.FunctionComponent = ({ onItemSelected, updateMenuSt }; return ( - + + }}> {translate('loadedapp.options') as string} @@ -117,7 +120,7 @@ const Menu: React.FunctionComponent = ({ onItemSelected, updateMenuSt {translate('loadedapp.addressbook') as string} - {!(mode === ModeEnum.basic && valueTransfers && valueTransfers.length <= 0) && ( + {!(mode === ModeEnum.basic && valueTransfersTotal && valueTransfersTotal <= 0) && ( onItemSelectedWrapper(MenuItemEnum.WalletSeedUfvk)} @@ -153,7 +156,7 @@ const Menu: React.FunctionComponent = ({ onItemSelected, updateMenuSt )} - {!(mode === ModeEnum.basic && valueTransfers && valueTransfers.length <= 0) && ( + {!(mode === ModeEnum.basic && valueTransfersTotal && valueTransfersTotal <= 0) && ( onItemSelectedWrapper(MenuItemEnum.Insight)} style={item}> {translate('loadedapp.insight') as string} @@ -177,8 +180,8 @@ const Menu: React.FunctionComponent = ({ onItemSelected, updateMenuSt )} {mode === ModeEnum.basic && - valueTransfers && - valueTransfers.length === 0 && + valueTransfersTotal && + valueTransfersTotal === 0 && netInfo.isConnected && selectServer !== SelectServerEnum.offline && ( = ({ onItemSelected, updateMenuSt `settings.value-mode-${mode}`, )}`} - + ); }; diff --git a/app/LoadingApp/Launching.tsx b/app/LoadingApp/Launching.tsx index f7dc1e852..f04960720 100644 --- a/app/LoadingApp/Launching.tsx +++ b/app/LoadingApp/Launching.tsx @@ -66,7 +66,8 @@ const Launching: React.FunctionComponent = props => { color: colors.primaryDisabled, fontSize: 15, marginTop: 10, - }}> + }} + selectable> {props.message} )} @@ -79,7 +80,8 @@ const Launching: React.FunctionComponent = props => { fontWeight: 'bold', marginTop: 10, textAlign: 'center', - }}> + }} + selectable> {props.translate('biometricsfailed-title') as string} = props => { fontSize: 15, marginTop: 10, textAlign: 'center', - }}> + }} + selectable> {props.translate('biometricsfailed-body') as string} = props => { marginTop: 10, marginBottom: 10, textAlign: 'center', - }}> + }} + selectable> {props.translate('biometricsfailed-footer') as string}