From a5c6bb7f5a6b8951be424677c6cfef6a86758e87 Mon Sep 17 00:00:00 2001 From: Philipp Walter Date: Mon, 4 Sep 2023 18:32:34 +0200 Subject: [PATCH] feat: update widgets --- .github/workflows/e2e-ios.yml | 10 +- .../async-storage.js | 1 + __tests__/backups.ts | 17 +- e2e/backup.e2e.js | 15 +- e2e/widgets.e2e.js | 70 +++ index.js | 9 + ios/Podfile.lock | 6 + ios/bitkit.xcodeproj/project.pbxproj | 160 +++---- jest.setup.js | 3 + package.json | 15 +- src/assets/icons/wallet.ts | 10 + src/components/AuthWidget.tsx | 181 +++++--- src/components/BaseFeedWidget.tsx | 181 ++++++++ src/components/BlocksWidget.tsx | 140 ++++-- src/components/ContactsList.tsx | 2 +- src/components/FactsWidget.tsx | 218 ++------- src/components/FeedWidget.tsx | 217 +++------ src/components/HeadlinesWidget.tsx | 286 +++++------- src/components/LoadingView.tsx | 82 ++++ src/components/PriceChart.tsx | 219 +++++++++ src/components/PriceWidget.tsx | 334 +++++++------- src/components/SlashtagURL.tsx | 28 +- src/components/SlashtagsProvider.tsx | 85 ++++ src/components/Spinner.tsx | 72 +-- src/components/SvgImage.tsx | 39 ++ src/components/Widgets.tsx | 270 ++++------- src/hooks/slashtags.ts | 66 ++- src/hooks/widgets.ts | 149 +++--- src/navigation/root/RootNavigator.tsx | 19 +- src/navigation/types/index.ts | 22 +- src/navigation/widgets/WidgetsNavigator.tsx | 53 --- src/screens/Wallets/index.tsx | 1 + src/screens/Widgets/SlashAuthModal.tsx | 6 +- src/screens/Widgets/Widget.tsx | 292 ++++++++++++ src/screens/Widgets/WidgetEdit.tsx | 296 ++++++++++++ src/screens/Widgets/WidgetFeedEdit.tsx | 415 ----------------- src/screens/Widgets/WidgetsOnboarding.tsx | 20 +- src/screens/Widgets/WidgetsSuggestions.tsx | 173 ++++--- src/store/actions/actions.ts | 8 +- src/store/actions/widgets.ts | 30 +- src/store/index.ts | 2 +- src/store/migrations/index.ts | 7 + src/store/reducers/backup.ts | 2 +- src/store/reducers/index.ts | 4 + src/store/reducers/widgets.ts | 20 +- src/store/reselect/widgets.ts | 5 + src/store/types/widgets.ts | 17 +- src/styles/icons.ts | 11 +- src/utils/i18n/locales/en/slashtags.json | 17 +- src/utils/i18n/locales/es_419/slashtags.json | 3 +- src/utils/i18n/locales/it/slashtags.json | 3 +- src/utils/i18n/locales/nl/slashtags.json | 3 +- src/utils/i18n/locales/pt_BR/slashtags.json | 3 +- src/utils/i18n/locales/ru/slashtags.json | 3 +- src/utils/slashtags/index.ts | 18 +- src/utils/widgets/index.ts | 87 ++-- yarn.lock | 426 ++++++++++++++++-- 57 files changed, 2956 insertions(+), 1895 deletions(-) create mode 100644 __mocks__/@react-native-async-storage/async-storage.js create mode 100644 e2e/widgets.e2e.js create mode 100644 src/components/BaseFeedWidget.tsx create mode 100644 src/components/LoadingView.tsx create mode 100644 src/components/PriceChart.tsx create mode 100644 src/components/SvgImage.tsx delete mode 100644 src/navigation/widgets/WidgetsNavigator.tsx create mode 100644 src/screens/Widgets/Widget.tsx create mode 100644 src/screens/Widgets/WidgetEdit.tsx delete mode 100644 src/screens/Widgets/WidgetFeedEdit.tsx diff --git a/.github/workflows/e2e-ios.yml b/.github/workflows/e2e-ios.yml index 02cf5bdf7..ebacc3b5c 100644 --- a/.github/workflows/e2e-ios.yml +++ b/.github/workflows/e2e-ios.yml @@ -21,13 +21,19 @@ jobs: uses: mikehardy/buildcache-action@v2 - name: Setup Docker Colima 1 - uses: douglascamata/setup-docker-macos-action@v1-alpha + # when https://github.com/douglascamata/setup-docker-macos-action/pull/19 is merged and tagged, move to new version: + uses: douglascamata/setup-docker-macos-action@ed0328701ed84842bf3a3941410e74f62392ab9c + env: + HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1 id: docker1 continue-on-error: true - name: Setup Docker Colima 2 if: steps.docker1.outcome != 'success' - uses: douglascamata/setup-docker-macos-action@v1-alpha + # when https://github.com/douglascamata/setup-docker-macos-action/pull/19 is merged and tagged, move to new version: + uses: douglascamata/setup-docker-macos-action@ed0328701ed84842bf3a3941410e74f62392ab9c + env: + HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1 id: docker2 continue-on-error: true diff --git a/__mocks__/@react-native-async-storage/async-storage.js b/__mocks__/@react-native-async-storage/async-storage.js new file mode 100644 index 000000000..69d0e5302 --- /dev/null +++ b/__mocks__/@react-native-async-storage/async-storage.js @@ -0,0 +1 @@ +export * from '@react-native-async-storage/async-storage/jest/async-storage-mock'; diff --git a/__tests__/backups.ts b/__tests__/backups.ts index 07cdb48eb..f1d142d6e 100644 --- a/__tests__/backups.ts +++ b/__tests__/backups.ts @@ -184,15 +184,16 @@ describe('Remote backups', () => { }); it('Backups and restores widgets', async () => { - setFeedWidget('url', { - name: 'name', + setFeedWidget({ + url: 'url', type: 'type', - icon: 'icon', - field: { - name: 'name', - main: 'main', - files: {}, - }, + fields: [ + { + name: 'name', + main: 'main', + files: {}, + }, + ], }); updateWidgets({ onboardedWidgets: true }); diff --git a/e2e/backup.e2e.js b/e2e/backup.e2e.js index 1aa13e0d7..b57760980 100644 --- a/e2e/backup.e2e.js +++ b/e2e/backup.e2e.js @@ -91,16 +91,16 @@ d('Backup', () => { // add price widget await element(by.id('WidgetsAdd')).tap(); - await element(by.id('ContinueWidgets')).tap(); - await element(by.id('ContinueWidgets')).tap(); + await element(by.id('ContinueWidgets-0')).tap(); + await element(by.id('ContinueWidgets-1')).tap(); await element(by.id('PriceWidget')).tap(); // for unknown reason await waitFor(element(by.id('HourglassSpinner'))).not.toBeVisible(); - // doesn't work here, so instead we just wait until we can tap SaveWidget + // doesn't work here, so instead we just wait until we can tap WidgetSave // 5 min timeout for (let i = 0; i < 300; i++) { await sleep(1000); try { - await element(by.id('SaveWidget')).tap(); + await element(by.id('WidgetSave')).tap(); break; } catch (e) {} } @@ -112,18 +112,17 @@ d('Backup', () => { await element(by.id('WidgetsAdd')).tap(); await element(by.id('HeadlinesWidget')).tap(); // for unknown reason await waitFor(element(by.id('HourglassSpinner'))).not.toBeVisible(); - // doesn't work here, so instead we just wait until we can tap SaveWidget + // doesn't work here, so instead we just wait until we can tap WidgetSave // 5 min timeout for (let i = 0; i < 300; i++) { await sleep(1000); try { - await element(by.id('SaveWidget')).tap(); + await element(by.id('WidgetSave')).tap(); break; } catch (e) {} } await sleep(1000); // animation - await element(by.id('WidgetsTitle')).swipe('down'); // get seed await element(by.id('Settings')).tap(); @@ -188,7 +187,7 @@ d('Backup', () => { await element(by.id('NavigationClose')).tap(); // check widgets - await element(by.id('WidgetsTitle')).swipe('up'); + await element(by.id('WalletsScrollView')).scroll(300, 'down', NaN, 0.85); await expect(element(by.id('PriceWidget'))).toBeVisible(); await expect(element(by.id('HeadlinesWidget'))).toBeVisible(); diff --git a/e2e/widgets.e2e.js b/e2e/widgets.e2e.js new file mode 100644 index 000000000..5fd64f324 --- /dev/null +++ b/e2e/widgets.e2e.js @@ -0,0 +1,70 @@ +import { + checkComplete, + markComplete, + completeOnboarding, + launchAndWait, +} from './helpers'; + +d = checkComplete('widgets-1') ? describe.skip : describe; + +d('Widgets', () => { + beforeAll(async () => { + await completeOnboarding(); + }); + + beforeEach(async () => { + await launchAndWait(); + }); + + // General + // - can add a widget + // - can edit a widget + // - can delete a widget + + it('Can add/edit/remove a widget', async () => { + if (checkComplete('widgets-1')) { + return; + } + + // add price widget + await element(by.id('WidgetsAdd')).tap(); + await element(by.id('ContinueWidgets-0')).tap(); + await element(by.id('ContinueWidgets-1')).tap(); + await element(by.id('PriceWidget')).tap(); + await waitFor(element(by.id('WidgetEdit'))) + .toBeVisible() + .withTimeout(20000); + await expect(element(by.text('Default'))).toBeVisible(); + await element(by.id('WidgetEdit')).tap(); + await element(by.id('WidgetEditField-BTC/EUR')).tap(); + await element(by.id('WidgetEditScrollView')).scrollTo('bottom'); + await element(by.id('PriceWidgetSetting-1W')).tap(); + await element(by.id('WidgetEditSource')).tap(); + await element(by.id('WidgetEditPreview')).tap(); + await element(by.id('WidgetSave')).tap(); + await element(by.id('WalletsScrollView')).scroll(200, 'down', NaN, 0.85); + await expect(element(by.id('PriceWidget'))).toBeVisible(); + await expect(element(by.id('PriceWidgetRow-BTC/EUR'))).toBeVisible(); + await expect(element(by.id('PriceWidgetSource'))).toBeVisible(); + + // edit price widget + await element(by.id('WidgetsEdit')).tap(); + await element(by.id('WidgetActionEdit')).tap(); + await expect(element(by.text('Custom'))).toBeVisible(); + await element(by.id('WidgetEdit')).tap(); + await element(by.id('WidgetEditReset')).tap(); + await element(by.id('WidgetEditPreview')).tap(); + await element(by.id('WidgetSave')).tap(); + await expect(element(by.id('PriceWidget'))).toBeVisible(); + await expect(element(by.id('PriceWidgetRow-BTC/EUR'))).not.toBeVisible(); + await expect(element(by.id('PriceWidgetSource'))).not.toBeVisible(); + + // delete price widget + await element(by.id('WidgetsEdit')).tap(); + await element(by.id('WidgetActionDelete')).tap(); + await element(by.text('Yes, Delete')).tap(); + await expect(element(by.id('PriceWidget'))).not.toBeVisible(); + + markComplete('widgets-1'); + }); +}); diff --git a/index.js b/index.js index 2385e7b44..cc9e62c75 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,7 @@ import './shim'; +import { polyfill as polyfillFetch } from 'react-native-polyfill-globals/src/fetch'; +import { polyfill as polyfillEncoding } from 'react-native-polyfill-globals/src/encoding'; +import { polyfill as polyfillReadableStream } from 'react-native-polyfill-globals/src/readable-stream'; import './src/utils/ignoreLogs'; import { AppRegistry, Text, TextInput } from 'react-native'; import { gestureHandlerRootHOC } from 'react-native-gesture-handler'; @@ -6,6 +9,12 @@ import { gestureHandlerRootHOC } from 'react-native-gesture-handler'; import Root from './src/Root'; import { name as appName } from './app.json'; +// Polyfill fetch streaming on iOS (Android is not supported yet) +// https://github.com/react-native-community/fetch/issues/13 +polyfillEncoding(); +polyfillReadableStream(); +polyfillFetch(); + // TEMP: disable font scaling globally Text.defaultProps = Text.defaultProps || {}; Text.defaultProps.allowFontScaling = false; diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 2495c6f66..4ea14e404 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -462,6 +462,8 @@ PODS: - React-perflogger (= 0.71.7) - ReactNativeCameraKit (14.0.0-beta2): - React-Core + - RNCAsyncStorage (1.19.3): + - React-Core - RNCClipboard (1.11.2): - React-Core - RNDeviceInfo (10.6.0): @@ -616,6 +618,7 @@ DEPENDENCIES: - React-runtimeexecutor (from `../node_modules/react-native/ReactCommon/runtimeexecutor`) - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`) - ReactNativeCameraKit (from `../node_modules/react-native-camera-kit`) + - "RNCAsyncStorage (from `../node_modules/@react-native-async-storage/async-storage`)" - "RNCClipboard (from `../node_modules/@react-native-clipboard/clipboard`)" - RNDeviceInfo (from `../node_modules/react-native-device-info`) - RNExitApp (from `../node_modules/react-native-exit-app`) @@ -762,6 +765,8 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/ReactCommon" ReactNativeCameraKit: :path: "../node_modules/react-native-camera-kit" + RNCAsyncStorage: + :path: "../node_modules/@react-native-async-storage/async-storage" RNCClipboard: :path: "../node_modules/@react-native-clipboard/clipboard" RNDeviceInfo: @@ -869,6 +874,7 @@ SPEC CHECKSUMS: React-runtimeexecutor: c5c89f8f543842dd864b63ded1b0bbb9c9445328 ReactCommon: dbfbe2f7f3c5ce4ce44f43f2fd0d5950d1eb67c5 ReactNativeCameraKit: 32e04877e57e0eeab26e45817e3fd532e7d302fb + RNCAsyncStorage: c913ede1fa163a71cea118ed4670bbaaa4b511bb RNCClipboard: 3f0451a8100393908bea5c5c5b16f96d45f30bfc RNDeviceInfo: 475a4c447168d0ad4c807e48ef5e0963a0f4eb1b RNExitApp: c4e052df2568b43bec8a37c7cd61194d4cfee2c3 diff --git a/ios/bitkit.xcodeproj/project.pbxproj b/ios/bitkit.xcodeproj/project.pbxproj index 639925398..e6f17db75 100644 --- a/ios/bitkit.xcodeproj/project.pbxproj +++ b/ios/bitkit.xcodeproj/project.pbxproj @@ -11,13 +11,13 @@ 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; - 5F503AADACF24608F5918DBC /* libPods-bitkit-bitkitTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B53683A434E450032E4871B1 /* libPods-bitkit-bitkitTests.a */; }; + 678D72082584145BD030686A /* libPods-bitkit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3FC278701FE55E5BD7E945AC /* libPods-bitkit.a */; }; 777F5BE129EDEB75005E0E4B /* InterTight-Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 777F5BDD29EDEB75005E0E4B /* InterTight-Bold.ttf */; }; 777F5BE229EDEB75005E0E4B /* InterTight-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 777F5BDE29EDEB75005E0E4B /* InterTight-Regular.ttf */; }; 777F5BE329EDEB75005E0E4B /* InterTight-SemiBold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 777F5BDF29EDEB75005E0E4B /* InterTight-SemiBold.ttf */; }; 777F5BE429EDEB75005E0E4B /* InterTight-Medium.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 777F5BE029EDEB75005E0E4B /* InterTight-Medium.ttf */; }; 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; - A6A7D18CCA855DF8DCFDCD5E /* libPods-bitkit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 18C32352660895B32F76F551 /* libPods-bitkit.a */; }; + AF4DD8FE685FE2416CDFDFA3 /* libPods-bitkit-bitkitTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F6B04593BB39054E42600211 /* libPods-bitkit-bitkitTests.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -40,18 +40,18 @@ 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = bitkit/Images.xcassets; sourceTree = ""; }; 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = bitkit/Info.plist; sourceTree = ""; }; 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = bitkit/main.m; sourceTree = ""; }; - 18C32352660895B32F76F551 /* libPods-bitkit.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-bitkit.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 3A2A790D063C00580DACF5E0 /* Pods-bitkit-bitkitTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-bitkit-bitkitTests.release.xcconfig"; path = "Target Support Files/Pods-bitkit-bitkitTests/Pods-bitkit-bitkitTests.release.xcconfig"; sourceTree = ""; }; - 444EAABECD73CC86C582C108 /* Pods-bitkit-bitkitTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-bitkit-bitkitTests.debug.xcconfig"; path = "Target Support Files/Pods-bitkit-bitkitTests/Pods-bitkit-bitkitTests.debug.xcconfig"; sourceTree = ""; }; + 2B529F73F1F983B697655CEB /* Pods-bitkit.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-bitkit.debug.xcconfig"; path = "Target Support Files/Pods-bitkit/Pods-bitkit.debug.xcconfig"; sourceTree = ""; }; + 3F5C045E4A0F1BDCDF1C54C5 /* Pods-bitkit-bitkitTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-bitkit-bitkitTests.release.xcconfig"; path = "Target Support Files/Pods-bitkit-bitkitTests/Pods-bitkit-bitkitTests.release.xcconfig"; sourceTree = ""; }; + 3FC278701FE55E5BD7E945AC /* libPods-bitkit.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-bitkit.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 777F5BDD29EDEB75005E0E4B /* InterTight-Bold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "InterTight-Bold.ttf"; sourceTree = ""; }; 777F5BDE29EDEB75005E0E4B /* InterTight-Regular.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "InterTight-Regular.ttf"; sourceTree = ""; }; 777F5BDF29EDEB75005E0E4B /* InterTight-SemiBold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "InterTight-SemiBold.ttf"; sourceTree = ""; }; 777F5BE029EDEB75005E0E4B /* InterTight-Medium.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "InterTight-Medium.ttf"; sourceTree = ""; }; 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = bitkit/LaunchScreen.storyboard; sourceTree = ""; }; - B53683A434E450032E4871B1 /* libPods-bitkit-bitkitTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-bitkit-bitkitTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - D13A1262BE3ECB2581FC2EDC /* Pods-bitkit.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-bitkit.debug.xcconfig"; path = "Target Support Files/Pods-bitkit/Pods-bitkit.debug.xcconfig"; sourceTree = ""; }; + B53DDB4220237AC35791CDA9 /* Pods-bitkit-bitkitTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-bitkit-bitkitTests.debug.xcconfig"; path = "Target Support Files/Pods-bitkit-bitkitTests/Pods-bitkit-bitkitTests.debug.xcconfig"; sourceTree = ""; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; - F615571D2777FBACDAED24E2 /* Pods-bitkit.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-bitkit.release.xcconfig"; path = "Target Support Files/Pods-bitkit/Pods-bitkit.release.xcconfig"; sourceTree = ""; }; + EF9395BA4FAB3F1CC5D2E2EE /* Pods-bitkit.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-bitkit.release.xcconfig"; path = "Target Support Files/Pods-bitkit/Pods-bitkit.release.xcconfig"; sourceTree = ""; }; + F6B04593BB39054E42600211 /* libPods-bitkit-bitkitTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-bitkit-bitkitTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -59,7 +59,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 5F503AADACF24608F5918DBC /* libPods-bitkit-bitkitTests.a in Frameworks */, + AF4DD8FE685FE2416CDFDFA3 /* libPods-bitkit-bitkitTests.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -67,7 +67,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - A6A7D18CCA855DF8DCFDCD5E /* libPods-bitkit.a in Frameworks */, + 678D72082584145BD030686A /* libPods-bitkit.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -108,8 +108,8 @@ isa = PBXGroup; children = ( ED297162215061F000B7C4FE /* JavaScriptCore.framework */, - 18C32352660895B32F76F551 /* libPods-bitkit.a */, - B53683A434E450032E4871B1 /* libPods-bitkit-bitkitTests.a */, + 3FC278701FE55E5BD7E945AC /* libPods-bitkit.a */, + F6B04593BB39054E42600211 /* libPods-bitkit-bitkitTests.a */, ); name = Frameworks; sourceTree = ""; @@ -161,10 +161,10 @@ BBD78D7AC51CEA395F1C20DB /* Pods */ = { isa = PBXGroup; children = ( - D13A1262BE3ECB2581FC2EDC /* Pods-bitkit.debug.xcconfig */, - F615571D2777FBACDAED24E2 /* Pods-bitkit.release.xcconfig */, - 444EAABECD73CC86C582C108 /* Pods-bitkit-bitkitTests.debug.xcconfig */, - 3A2A790D063C00580DACF5E0 /* Pods-bitkit-bitkitTests.release.xcconfig */, + 2B529F73F1F983B697655CEB /* Pods-bitkit.debug.xcconfig */, + EF9395BA4FAB3F1CC5D2E2EE /* Pods-bitkit.release.xcconfig */, + B53DDB4220237AC35791CDA9 /* Pods-bitkit-bitkitTests.debug.xcconfig */, + 3F5C045E4A0F1BDCDF1C54C5 /* Pods-bitkit-bitkitTests.release.xcconfig */, ); path = Pods; sourceTree = ""; @@ -176,12 +176,12 @@ isa = PBXNativeTarget; buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "bitkitTests" */; buildPhases = ( - 4F668DDA4EDFD6DF63FA3B0A /* [CP] Check Pods Manifest.lock */, + E4F036D93B1793CFD93D89B0 /* [CP] Check Pods Manifest.lock */, 00E356EA1AD99517003FC87E /* Sources */, 00E356EB1AD99517003FC87E /* Frameworks */, 00E356EC1AD99517003FC87E /* Resources */, - 64383155207573885C83E29B /* [CP] Embed Pods Frameworks */, - 0F88CC10F942A17639D1DE30 /* [CP] Copy Pods Resources */, + F88A761665BCB701C05C9145 /* [CP] Embed Pods Frameworks */, + F7C7425D117B8310B4890EC2 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -197,18 +197,18 @@ isa = PBXNativeTarget; buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "bitkit" */; buildPhases = ( - 7423DCEEFDC3099766E2D590 /* [CP] Check Pods Manifest.lock */, + 0E6ABE98A4CC0A1190F9896B /* [CP] Check Pods Manifest.lock */, FD10A7F022414F080027D42C /* Start Packager */, 13B07F871A680F5B00A75B9A /* Sources */, 13B07F8C1A680F5B00A75B9A /* Frameworks */, 13B07F8E1A680F5B00A75B9A /* Resources */, 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, - 858A1B0A99257412E7E49F95 /* [CP] Embed Pods Frameworks */, - B1532D37C5F5312586AA8B59 /* [CP] Copy Pods Resources */, - D53FEE3A6B78AC158AEEDE16 /* [CP-User] [NODEJS MOBILE] Copy Node.js Project files */, - E62D6EB5874E6BC8745C22E1 /* [CP-User] [NODEJS MOBILE] Build Native Modules */, - 0ED46121177E47B0E2C921D5 /* [CP-User] [NODEJS MOBILE] Sign Native Modules */, - 32DD0831F26A205A155B06CA /* [CP-User] [NODEJS MOBILE] Remove Simulator Strip */, + 5F9B105CF6395412B4F6CF28 /* [CP] Embed Pods Frameworks */, + 93B93A21A9CBF290A3216709 /* [CP] Copy Pods Resources */, + 6FFF4B34C85EA52D3BCB18E2 /* [CP-User] [NODEJS MOBILE] Copy Node.js Project files */, + FA66F65AB74D6662EF8E0D6A /* [CP-User] [NODEJS MOBILE] Build Native Modules */, + 3BBC4CFADEFD8479F15FCFA1 /* [CP-User] [NODEJS MOBILE] Sign Native Modules */, + 6BBCBEB38529A1A459BC3698 /* [CP-User] [NODEJS MOBILE] Remove Simulator Strip */, ); buildRules = ( ); @@ -295,7 +295,29 @@ shellPath = /bin/sh; shellScript = "set -e\n\nWITH_ENVIRONMENT=\"../node_modules/react-native/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"../node_modules/react-native/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n"; }; - 0ED46121177E47B0E2C921D5 /* [CP-User] [NODEJS MOBILE] Sign Native Modules */ = { + 0E6ABE98A4CC0A1190F9896B /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-bitkit-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + 3BBC4CFADEFD8479F15FCFA1 /* [CP-User] [NODEJS MOBILE] Sign Native Modules */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -305,24 +327,24 @@ shellPath = /bin/sh; shellScript = "#!/bin/sh\nset -e\nif [ -z \"$NODEJS_MOBILE_BUILD_NATIVE_MODULES\" ]; then\n# If build native modules preference is not set, look for it in the project's\n#nodejs-assets/BUILD_NATIVE_MODULES.txt file.\nNODEJS_ASSETS_DIR=\"$( cd \"$PROJECT_DIR\" && cd ../nodejs-assets/ && pwd )\"\nPREFERENCE_FILE_PATH=\"$NODEJS_ASSETS_DIR/BUILD_NATIVE_MODULES.txt\"\n if [ -f \"$PREFERENCE_FILE_PATH\" ]; then\n NODEJS_MOBILE_BUILD_NATIVE_MODULES=\"$(cat $PREFERENCE_FILE_PATH | xargs)\"\n fi\nfi\nif [ -z \"$NODEJS_MOBILE_BUILD_NATIVE_MODULES\" ]; then\n# If build native modules preference is not set, try to find .gyp files\n#to turn it on.\n gypfiles=($(find \"$CODESIGNING_FOLDER_PATH/nodejs-project/\" -type f -name \"*.gyp\"))\n if [ ${#gypfiles[@]} -gt 0 ]; then\n NODEJS_MOBILE_BUILD_NATIVE_MODULES=1\n else\n NODEJS_MOBILE_BUILD_NATIVE_MODULES=0\n fi\nfi\nif [ \"1\" != \"$NODEJS_MOBILE_BUILD_NATIVE_MODULES\" ]; then exit 0; fi\n# Delete object files\nfind \"$CODESIGNING_FOLDER_PATH/nodejs-project/\" -name \"*.o\" -type f -delete\nfind \"$CODESIGNING_FOLDER_PATH/nodejs-project/\" -name \"*.a\" -type f -delete\n# Create Info.plist for each framework built and loader override.\nPATCH_SCRIPT_DIR=\"$( cd \"$PROJECT_DIR\" && cd ../node_modules/nodejs-mobile-react-native/scripts/ && pwd )\"\nNODEJS_PROJECT_DIR=\"$( cd \"$CODESIGNING_FOLDER_PATH\" && cd nodejs-project/ && pwd )\"\nnode \"$PATCH_SCRIPT_DIR\"/ios-create-plists-and-dlopen-override.js $NODEJS_PROJECT_DIR\n# Embed every resulting .framework in the application and delete them afterwards.\nembed_framework()\n{\n FRAMEWORK_NAME=\"$(basename \"$1\")\"\n cp -r \"$1\" \"$TARGET_BUILD_DIR/$FRAMEWORKS_FOLDER_PATH/\"\n /usr/bin/codesign --force --sign $EXPANDED_CODE_SIGN_IDENTITY --preserve-metadata=identifier,entitlements,flags --timestamp=none \"$TARGET_BUILD_DIR/$FRAMEWORKS_FOLDER_PATH/$FRAMEWORK_NAME\"\n}\nfind \"$CODESIGNING_FOLDER_PATH/nodejs-project/\" -name \"*.framework\" -type d | while read frmwrk_path; do embed_framework \"$frmwrk_path\"; done\n\n#Delete gyp temporary .deps dependency folders from the project structure.\nfind \"$CODESIGNING_FOLDER_PATH/nodejs-project/\" -path \"*/.deps/*\" -delete\nfind \"$CODESIGNING_FOLDER_PATH/nodejs-project/\" -name \".deps\" -type d -delete\n\n#Delete frameworks from their build paths\nfind \"$CODESIGNING_FOLDER_PATH/nodejs-project/\" -path \"*/*.framework/*\" -delete\nfind \"$CODESIGNING_FOLDER_PATH/nodejs-project/\" -name \"*.framework\" -type d -delete\n"; }; - 0F88CC10F942A17639D1DE30 /* [CP] Copy Pods Resources */ = { + 5F9B105CF6395412B4F6CF28 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-bitkit-bitkitTests/Pods-bitkit-bitkitTests-resources-${CONFIGURATION}-input-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-bitkit/Pods-bitkit-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - name = "[CP] Copy Pods Resources"; + name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-bitkit-bitkitTests/Pods-bitkit-bitkitTests-resources-${CONFIGURATION}-output-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-bitkit/Pods-bitkit-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-bitkit-bitkitTests/Pods-bitkit-bitkitTests-resources.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-bitkit/Pods-bitkit-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - 32DD0831F26A205A155B06CA /* [CP-User] [NODEJS MOBILE] Remove Simulator Strip */ = { + 6BBCBEB38529A1A459BC3698 /* [CP-User] [NODEJS MOBILE] Remove Simulator Strip */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -332,46 +354,34 @@ shellPath = /bin/sh; shellScript = "#!/bin/sh\nset -e\nFRAMEWORK_BINARY_PATH=\"$TARGET_BUILD_DIR/$FRAMEWORKS_FOLDER_PATH/NodeMobile.framework/NodeMobile\"\nFRAMEWORK_STRIPPED_PATH=\"$FRAMEWORK_BINARY_PATH-strip\"\nif [ \"$PLATFORM_NAME\" != \"iphonesimulator\" ]; then\n if $(lipo \"$FRAMEWORK_BINARY_PATH\" -verify_arch \"x86_64\") ; then\n lipo -output \"$FRAMEWORK_STRIPPED_PATH\" -remove \"x86_64\" \"$FRAMEWORK_BINARY_PATH\"\n rm \"$FRAMEWORK_BINARY_PATH\"\n mv \"$FRAMEWORK_STRIPPED_PATH\" \"$FRAMEWORK_BINARY_PATH\"\n echo \"Removed simulator strip from NodeMobile.framework\"\n fi\nfi\n"; }; - 4F668DDA4EDFD6DF63FA3B0A /* [CP] Check Pods Manifest.lock */ = { + 6FFF4B34C85EA52D3BCB18E2 /* [CP-User] [NODEJS MOBILE] Copy Node.js Project files */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-bitkit-bitkitTests-checkManifestLockResult.txt", - ); + name = "[CP-User] [NODEJS MOBILE] Copy Node.js Project files"; runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; + shellScript = "#!/bin/sh\nset -e\nNODEJS_ASSETS_DIR=\"$( cd \"$PROJECT_DIR\" && cd ../nodejs-assets/ && pwd )\"\nNODEJS_BUILT_IN_MODULES_DIR=\"$( cd \"$PROJECT_DIR\" && cd ../node_modules/nodejs-mobile-react-native/install/resources/nodejs-modules/ && pwd )\"\nif [ -d \"$CODESIGNING_FOLDER_PATH/nodejs-project/\" ]\nthen\nrm -rf \"$CODESIGNING_FOLDER_PATH/nodejs-project/\"\nfi\nif [ -d \"$CODESIGNING_FOLDER_PATH/builtin_modules/\" ]\nthen\nrm -rf \"$CODESIGNING_FOLDER_PATH/builtin_modules/\"\nfi\nrsync -av --delete \"$NODEJS_ASSETS_DIR/nodejs-project\" \"$CODESIGNING_FOLDER_PATH\"\nrsync -av --delete \"$NODEJS_BUILT_IN_MODULES_DIR/builtin_modules\" \"$CODESIGNING_FOLDER_PATH\"\n"; }; - 64383155207573885C83E29B /* [CP] Embed Pods Frameworks */ = { + 93B93A21A9CBF290A3216709 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-bitkit-bitkitTests/Pods-bitkit-bitkitTests-frameworks-${CONFIGURATION}-input-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-bitkit/Pods-bitkit-resources-${CONFIGURATION}-input-files.xcfilelist", ); - name = "[CP] Embed Pods Frameworks"; + name = "[CP] Copy Pods Resources"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-bitkit-bitkitTests/Pods-bitkit-bitkitTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-bitkit/Pods-bitkit-resources-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-bitkit-bitkitTests/Pods-bitkit-bitkitTests-frameworks.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-bitkit/Pods-bitkit-resources.sh\"\n"; showEnvVarsInLog = 0; }; - 7423DCEEFDC3099766E2D590 /* [CP] Check Pods Manifest.lock */ = { + E4F036D93B1793CFD93D89B0 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -386,58 +396,48 @@ outputFileListPaths = ( ); outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-bitkit-checkManifestLockResult.txt", + "$(DERIVED_FILE_DIR)/Pods-bitkit-bitkitTests-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - 858A1B0A99257412E7E49F95 /* [CP] Embed Pods Frameworks */ = { + F7C7425D117B8310B4890EC2 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-bitkit/Pods-bitkit-frameworks-${CONFIGURATION}-input-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-bitkit-bitkitTests/Pods-bitkit-bitkitTests-resources-${CONFIGURATION}-input-files.xcfilelist", ); - name = "[CP] Embed Pods Frameworks"; + name = "[CP] Copy Pods Resources"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-bitkit/Pods-bitkit-frameworks-${CONFIGURATION}-output-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-bitkit-bitkitTests/Pods-bitkit-bitkitTests-resources-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-bitkit/Pods-bitkit-frameworks.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-bitkit-bitkitTests/Pods-bitkit-bitkitTests-resources.sh\"\n"; showEnvVarsInLog = 0; }; - B1532D37C5F5312586AA8B59 /* [CP] Copy Pods Resources */ = { + F88A761665BCB701C05C9145 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-bitkit/Pods-bitkit-resources-${CONFIGURATION}-input-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-bitkit-bitkitTests/Pods-bitkit-bitkitTests-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - name = "[CP] Copy Pods Resources"; + name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-bitkit/Pods-bitkit-resources-${CONFIGURATION}-output-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-bitkit-bitkitTests/Pods-bitkit-bitkitTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-bitkit/Pods-bitkit-resources.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-bitkit-bitkitTests/Pods-bitkit-bitkitTests-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - D53FEE3A6B78AC158AEEDE16 /* [CP-User] [NODEJS MOBILE] Copy Node.js Project files */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - name = "[CP-User] [NODEJS MOBILE] Copy Node.js Project files"; - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "#!/bin/sh\nset -e\nNODEJS_ASSETS_DIR=\"$( cd \"$PROJECT_DIR\" && cd ../nodejs-assets/ && pwd )\"\nNODEJS_BUILT_IN_MODULES_DIR=\"$( cd \"$PROJECT_DIR\" && cd ../node_modules/nodejs-mobile-react-native/install/resources/nodejs-modules/ && pwd )\"\nif [ -d \"$CODESIGNING_FOLDER_PATH/nodejs-project/\" ]\nthen\nrm -rf \"$CODESIGNING_FOLDER_PATH/nodejs-project/\"\nfi\nif [ -d \"$CODESIGNING_FOLDER_PATH/builtin_modules/\" ]\nthen\nrm -rf \"$CODESIGNING_FOLDER_PATH/builtin_modules/\"\nfi\nrsync -av --delete \"$NODEJS_ASSETS_DIR/nodejs-project\" \"$CODESIGNING_FOLDER_PATH\"\nrsync -av --delete \"$NODEJS_BUILT_IN_MODULES_DIR/builtin_modules\" \"$CODESIGNING_FOLDER_PATH\"\n"; - }; - E62D6EB5874E6BC8745C22E1 /* [CP-User] [NODEJS MOBILE] Build Native Modules */ = { + FA66F65AB74D6662EF8E0D6A /* [CP-User] [NODEJS MOBILE] Build Native Modules */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -499,7 +499,7 @@ /* Begin XCBuildConfiguration section */ 00E356F61AD99517003FC87E /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 444EAABECD73CC86C582C108 /* Pods-bitkit-bitkitTests.debug.xcconfig */; + baseConfigurationReference = B53DDB4220237AC35791CDA9 /* Pods-bitkit-bitkitTests.debug.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; BUNDLE_LOADER = "$(TEST_HOST)"; @@ -527,7 +527,7 @@ }; 00E356F71AD99517003FC87E /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 3A2A790D063C00580DACF5E0 /* Pods-bitkit-bitkitTests.release.xcconfig */; + baseConfigurationReference = 3F5C045E4A0F1BDCDF1C54C5 /* Pods-bitkit-bitkitTests.release.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; BUNDLE_LOADER = "$(TEST_HOST)"; @@ -552,7 +552,7 @@ }; 13B07F941A680F5B00A75B9A /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = D13A1262BE3ECB2581FC2EDC /* Pods-bitkit.debug.xcconfig */; + baseConfigurationReference = 2B529F73F1F983B697655CEB /* Pods-bitkit.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; @@ -583,7 +583,7 @@ }; 13B07F951A680F5B00A75B9A /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = F615571D2777FBACDAED24E2 /* Pods-bitkit.release.xcconfig */; + baseConfigurationReference = EF9395BA4FAB3F1CC5D2E2EE /* Pods-bitkit.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; diff --git a/jest.setup.js b/jest.setup.js index 8558c3ef0..4b98e94e0 100644 --- a/jest.setup.js +++ b/jest.setup.js @@ -14,6 +14,9 @@ jest.mock('react-native-permissions', () => jest.mock('@react-native-community/netinfo', () => mockRNCNetInfo); jest.mock('react-native-localize', () => mockRNLocalize); jest.mock('@synonymdev/react-native-ldk', () => mockLDK); +jest.mock('@react-native-async-storage/async-storage', () => + require('@react-native-async-storage/async-storage/jest/async-storage-mock'), +); global.net = require('net'); // needed by Electrum client. For RN it is proviced in shim.js global.tls = require('tls'); // needed by Electrum client. For RN it is proviced in shim.js diff --git a/package.json b/package.json index b87d616aa..867e3889e 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ "@formatjs/intl-pluralrules": "^5.1.10", "@formatjs/intl-relativetimeformat": "^11.1.10", "@gorhom/bottom-sheet": "^4.4.7", + "@react-native-async-storage/async-storage": "^1.19.3", "@react-native-clipboard/clipboard": "^1.11.2", "@react-native-community/blur": "^4.3.0", "@react-native-community/netinfo": "^9.3.7", @@ -52,11 +53,18 @@ "@sayem314/react-native-keep-awake": "^1.2.0", "@shopify/react-native-skia": "0.1.182", "@synonymdev/blocktank-lsp-http-client": "^0.2.4", + "@synonymdev/bitcoin-feed": "github:synonymdev/slashtags-widget-bitcoin-feed", + "@synonymdev/facts-feed": "github:synonymdev/slashtags-widget-facts-feed", + "@synonymdev/news-feed": "github:synonymdev/slashtags-widget-news-feed", + "@synonymdev/price-feed": "github:synonymdev/slashtags-widget-price-feed", "@synonymdev/react-native-ldk": "0.0.105", "@synonymdev/react-native-lnurl": "0.0.5", "@synonymdev/result": "0.0.2", "@synonymdev/slashtags-auth": "^1.0.0-alpha.5", + "@synonymdev/slashtags-feeds": "github:synonymdev/slashtags-feeds", "@synonymdev/slashtags-sdk": "1.0.0-alpha.38", + "@synonymdev/slashtags-url": "^1.0.0-alpha.4", + "@synonymdev/web-relay": "https://github.com/slashtags/web-relay.git", "assert": "^2.0.0", "backpack-client": "github:synonymdev/bitkit-backup-client#f08fdb28529d8a3f8bfecc789443c43b966a7581", "bech32": "^2.0.0", @@ -100,6 +108,7 @@ "react-native-dotenv": "^3.4.8", "react-native-draggable-flatlist": "^4.0.1", "react-native-exit-app": "^1.1.0", + "react-native-fetch-api": "^3.0.0", "react-native-fs": "^2.20.0", "react-native-gesture-handler": "2.9.0", "react-native-haptic-feedback": "^1.14.0", @@ -111,6 +120,7 @@ "react-native-mmkv": "^2.8.0", "react-native-modal": "^13.0.1", "react-native-permissions": "^3.7.3", + "react-native-polyfill-globals": "^3.1.0", "react-native-qrcode-svg": "^6.2.0", "react-native-quick-actions": "^0.3.13", "react-native-randombytes": "^3.6.1", @@ -121,15 +131,14 @@ "react-native-safe-area-context": "^4.5.0", "react-native-screens": "^3.20.0", "react-native-share": "^8.2.1", - "react-native-skia-stub": "github:limpbrains/react-native-skia-stub", + "react-native-skia-stub": "github:limpbrains/react-native-skia-stub#main", "react-native-svg": "^12.3.0", "react-native-tcp-socket": "5.6.2", "react-native-toast-message": "^2.1.6", "react-native-touch-id": "^4.4.1", - "react-native-url-polyfill": "^1.3.0", "react-native-zip-archive": "^6.0.9", "react-redux": "^8.0.5", - "readable-stream": "^4.2.0", + "readable-stream": "^4.4.2", "redux": "^4.2.1", "redux-logger": "^3.0.6", "redux-persist": "^6.0.0", diff --git a/src/assets/icons/wallet.ts b/src/assets/icons/wallet.ts index e0e84029a..a1abf9ea1 100644 --- a/src/assets/icons/wallet.ts +++ b/src/assets/icons/wallet.ts @@ -345,6 +345,16 @@ export const plusCircledIcon = ( `; +export const questionMarkIcon = + (): string => ` + + + + + + +`; + export const keyIcon = (color = 'white'): string => ``; diff --git a/src/components/AuthWidget.tsx b/src/components/AuthWidget.tsx index eb3ee39e5..db727f24b 100644 --- a/src/components/AuthWidget.tsx +++ b/src/components/AuthWidget.tsx @@ -5,52 +5,47 @@ import React, { useMemo, useState, } from 'react'; -import { Linking, StyleSheet } from 'react-native'; +import { View, Linking, StyleSheet, StyleProp, ViewStyle } from 'react-native'; import { Client } from '@synonymdev/slashtags-auth'; import { useTranslation } from 'react-i18next'; -import { useProfile, useSelectedSlashtag } from '../hooks/slashtags'; -import { TouchableOpacity, View } from '../styles/components'; import { Text01M } from '../styles/text'; -import { KeyIcon, ListIcon, TrashIcon } from '../styles/icons'; +import { TouchableOpacity } from '../styles/components'; +import { KeyIcon, ListIcon, SettingsIcon, TrashIcon } from '../styles/icons'; +import { useProfile, useSelectedSlashtag } from '../hooks/slashtags'; import { showToast } from '../utils/notifications'; -import Button from './Button'; -import ProfileImage from './ProfileImage'; import { IWidget } from '../store/types/widgets'; import { deleteWidget } from '../store/actions/widgets'; +import Button from './Button'; import Dialog from './Dialog'; +import ProfileImage from './ProfileImage'; +import { rootNavigation } from '../navigation/root/RootNavigator'; const AuthWidget = ({ url, widget, isEditing = false, + style, + testID, onLongPress, onPressIn, - testID, }: { url: string; widget: IWidget; isEditing?: boolean; + style?: StyleProp; + testID?: string; onLongPress?: () => void; onPressIn?: () => void; - testID?: string; }): ReactElement => { const { t } = useTranslation('slashtags'); - const [showButtons, setShowButtons] = useState(false); - const [showDialog, setShowDialog] = useState(false); - - const { profile } = useProfile(url, { resolve: true }); const { slashtag } = useSelectedSlashtag(); + const { profile } = useProfile(url, { resolve: true }); + const [showDialog, setShowDialog] = useState(false); - const switchShowButtons = (): void => { - setShowButtons((b) => !b); - }; - - const client = useMemo(() => { - return new Client(slashtag); - }, [slashtag]); + const client = useMemo(() => new Client(slashtag), [slashtag]); - const openMagicLink = useCallback(async () => { + const onSignIn = useCallback(async () => { const magiclink = await client.magiclink(url).catch((e: Error) => { showToast({ type: 'error', @@ -71,52 +66,77 @@ const AuthWidget = ({ } }, [client, url, t]); + const onEdit = (): void => { + rootNavigation.navigate('Widget', { url }); + }; + const onDelete = (): void => { setShowDialog(true); }; return ( - - - - {profile?.name || ' '} - - - {showButtons && widget.magiclink && !isEditing && ( - -