Compare commits

..
3 Commits
227 changed files with 1636 additions and 3445 deletions
+4
View File
@@ -196,6 +196,10 @@ status-im.desktop.core/init
status-im.chat.models-test/test-db
quo.design-system.spacing/padding-vertical
status-im.utils.money/percent-change
status-im.utils.platform/isMacOs?
status-im.utils.platform/isNix?
status-im.utils.platform/isWin?
status-im.utils.platform/android-version>=
utils.debounce/clear-all
status-im.transport.db/create-chat
status-im.utils.priority-map/priority-map
+16 -43
View File
@@ -9,49 +9,22 @@
status-im.utils.styles/defn clojure.core/defn
test-helpers.unit/deftest-sub clojure.core/defn
taoensso.tufte/defnp clojure.core/defn}
:linters {:clj-kondo-config {:level :error}
:cond-else {:level :error}
:consistent-alias {:level :error
:aliases {clojure.string string
clojure.set set
clojure.walk walk
taoensso.timbre log}}
:docstring-blank {:level :error}
:inline-def {:level :error}
:invalid-arity {:skip-args [status-im.utils.fx/defn utils.re-frame/defn]}
:loop-without-recur {:level :error}
:misplaced-docstring {:level :error}
:missing-body-in-when {:level :error}
:missing-clause-in-try {:level :error}
:missing-else-branch {:level :error}
:not-empty? {:level :error}
:quoted-case-test-constant {:level :error}
:redundant-do {:level :error}
:redundant-let {:level :error}
:refer-all {:level :error}
:shadowed-var {:level :error
;; We temporarily use :include to define an
;; allowlist of core Clojure vars. In the
;; future, as we progressively fix shadowed
;; vars, we should be able to delete this
;; option and lint all vars.
:exclude [type name]}
:single-operand-comparison {:level :error}
:syntax {:level :error}
:unbound-destructuring-default {:level :error}
:unknown-require-option {:level :error}
:unreachable-code {:level :error}
:unresolved-namespace {:level :error}
:linters {:consistent-alias {:level :error
:aliases {clojure.string string
clojure.set set
clojure.walk walk
taoensso.timbre log}}
:shadowed-var {:level :error
;; We temporarily use :include to define an
;; allowlist of core Clojure vars. In the
;; future, as we progressively fix shadowed
;; vars, we should be able to delete this
;; option and lint all vars.
:exclude [type name]}
:invalid-arity {:skip-args [status-im.utils.fx/defn utils.re-frame/defn]}
;; TODO remove number when this is fixed
;; https://github.com/borkdude/clj-kondo/issues/867
:unresolved-symbol {:exclude [PersistentPriorityMap.EMPTY
number
status-im.test-helpers/restore-app-db]}
:unresolved-var {:level :error}
:unused-binding {:level :error}
:unused-import {:level :error}
:unused-namespace {:level :error}
:unused-private-var {:level :error}
:unused-referred-var {:level :error}
:use {:level :error}}
:unresolved-symbol {:exclude [PersistentPriorityMap.EMPTY
number
status-im.test-helpers/restore-app-db]}}
:config-in-ns {mocks.js-dependencies {:linters {:clojure-lsp/unused-public-var {:level :off}}}}}
-1
View File
@@ -32,4 +32,3 @@ TWO_MINUTES_SYNCING=1
SWAP_ENABLED=1
STICKERS_TEST_ENABLED=1
LOCAL_PAIRING_ENABLED=1
TEST_STATEOFUS=1
-40
View File
@@ -1,40 +0,0 @@
# How to catch crash on ios use xcode
## Overview
Sometimes, we can't reproduce crash with local dev build, probably because your built version differs from the one QA team used.
The QA team mostly used the PR build version. In this guide we will try to make a build as close as possible to the PR build for iOS.
You may notice various configuration files starting with .env (such as .env, .env.e2e, .env.jenkins) in the project.
The usage of these files and environment variables injected at build time on CI will not be covered in this guide.
This guide covers how to configure Xcode to capture a crash stack trace with a physical iOS device. This allows debugging crashes by inspecting the stack trace.
I will use [issue #17255](https://github.com/status-im/status-mobile/issues/17255) as an example to reproduce and analyze a crash.
## Prerequisites
- A physical ios device (simulator is not considered in this doc)
- Xcode installed
## Steps
1. Prepare Status Mobile
1. Open Terminal, cd to project root
2. Run `make run-clojure` in one tab
3. Run `make run-metro` in a second tab
4. Run `make pod-install` in a third tab
2. Configure Xcode Project
1. Open Xcode
2. Open a project or file, navigate to folder `path_to_root_directory_of_status_mobile/ios`
3. Set Scheme `StatusImPR` as current scheme ![](images/how-to-catch-crash-on-ios/choose-scheme-StatusImPR.png)
4. Edit scheme ![](images/how-to-catch-crash-on-ios/edit-scheme.png)
5. Change `Info` ![](images/how-to-catch-crash-on-ios/config-release.png)
6. Change `Diagnostics` ![](images/how-to-catch-crash-on-ios/change-diagnostics.png)
7. Set automatically manage signing ![](images/how-to-catch-crash-on-ios/automatically-manage-signing.png)
3. Update Code
1. Edit `src/status_im2/setup/dev.cljs`, comment out lines 47-52 ![](images/how-to-catch-crash-on-ios/edit-dev.png)
2. Edit `shadow-cljs.edn`, comment out `re-frisk-remote.preload`, otherwise it will try to connect `localhost:4567` on physical device which could slow down performance ![](images/how-to-catch-crash-on-ios/edit-shadow-cljs.png)
4. Reproduce Crash And Analyze
1. Choose your physical ios device as target device and Run
2. Follow reproduce steps from [issue #17255](https://github.com/status-im/status-mobile/issues/17255) mentioned and xcode will halt at crash point ![](images/how-to-catch-crash-on-ios/located-stack-trace.png)
3. Inspect stack trace to identify root cause. From the stack trace, we can locate the crash happened in `api/geth_backend.go:1048`(createTempDBFile) clearly! ![](images/how-to-catch-crash-on-ios/located-go-code.png)
## Links
- [changes](https://github.com/status-im/status-mobile/commit/4306d419de15e737e8ded3a749cc5e8d6a06e627) to source code
Binary file not shown.

Before

Width:  |  Height:  |  Size: 176 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 169 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 228 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 344 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 161 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 205 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

-4
View File
@@ -62,10 +62,6 @@ abstract_target 'Status' do
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'
# fix for no template named 'unary_function' in namespace 'std'; did you mean '__unary_function'?
# ref : https://github.com/facebook/react-native/issues/37748
# TODO : remove after upgrading to react-native 0.72.x
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)', '_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION']
end
end
end
+2 -2
View File
@@ -772,7 +772,7 @@ SPEC CHECKSUMS:
RNLanguages: 962e562af0d34ab1958d89bcfdb64fafc37c513e
RNPermissions: ad71dd4f767ec254f2cd57592fbee02afee75467
RNReactNativeHapticFeedback: 2566b468cc8d0e7bb2f84b23adc0f4614594d071
RNReanimated: 43adb0307a62c1ce9694f36f124ca3b51a15272a
RNReanimated: d0db0ee059c33381bca787a2193c27e52750ccaf
RNShare: d82e10f6b7677f4b0048c23709bd04098d5aee6c
RNStaticSafeAreaInsets: 055ddbf5e476321720457cdaeec0ff2ba40ec1b8
RNSVG: 80584470ff1ffc7994923ea135a3e5ad825546b9
@@ -785,6 +785,6 @@ SPEC CHECKSUMS:
TouchID: ba4c656d849cceabc2e4eef722dea5e55959ecf4
Yoga: d24d6184b6b85f742536bd93bd07d69d7b9bb4c1
PODFILE CHECKSUM: ac30a0172ff0126b6f307c20f34c47ce0ebf278f
PODFILE CHECKSUM: 1b60eee24bff3a6287f8b33e57657289b2966342
COCOAPODS: 1.12.0
+120 -120
View File
@@ -8,7 +8,6 @@
/* Begin PBXBuildFile section */
00E356F31AD99517003FC87E /* StatusImTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* StatusImTests.m */; };
04515E9DF839CBF55C690E79 /* libPods-Status-StatusImPR.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5006FF03675A7E50320B4002 /* libPods-Status-StatusImPR.a */; };
13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; };
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
25DC9C9DC25846BD8D084888 /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B9A886A2CB448B1ABA0EB62 /* libc++.tbd */; };
@@ -44,11 +43,12 @@
715D8132290BE850006F5C88 /* UbuntuMono-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 715D8131290BE850006F5C88 /* UbuntuMono-Regular.ttf */; };
715D8133290BE850006F5C88 /* UbuntuMono-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 715D8131290BE850006F5C88 /* UbuntuMono-Regular.ttf */; };
74B758FC20D7C00B003343C3 /* launch-image-universal.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 74B758FB20D7C00B003343C3 /* launch-image-universal.storyboard */; };
81F3191BB1D4BDF3442402BD /* libPods-Status-StatusIm.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0F8E9088BDE117AB71366407 /* libPods-Status-StatusIm.a */; };
8391E8E0E93C41A98AAA6631 /* Inter-SemiBoldItalic.otf in Resources */ = {isa = PBXBuildFile; fileRef = A4F2BBE8D4DD4140A6CCAC39 /* Inter-SemiBoldItalic.otf */; };
B0E570AEBE2BEB426BF60259 /* libPods-Status-StatusImPR.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D059F2E62D7CD9FB1896703 /* libPods-Status-StatusImPR.a */; };
B24FC7FD1DE7195700D694FF /* Social.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B24FC7FC1DE7195700D694FF /* Social.framework */; };
B24FC7FF1DE7195F00D694FF /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B24FC7FE1DE7195F00D694FF /* MessageUI.framework */; };
B2F2D1BC1D9D531B00B7B453 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B2F2D1BB1D9D531B00B7B453 /* Images.xcassets */; };
B73930D752A70EAB45001773 /* libPods-Status-StatusIm.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FBEDE2F94002488EF6B277DA /* libPods-Status-StatusIm.a */; };
BA68A2377A20496EA737000D /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 4E586E1B0E544F64AA9F5BD1 /* libz.tbd */; };
C14C5F8D29C0A149005C58A7 /* launch-icon@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = C14C5F8C29C0A149005C58A7 /* launch-icon@3x.png */; };
C14C5F9129C0AD9C005C58A7 /* launch-icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = C14C5F9029C0AD9C005C58A7 /* launch-icon@2x.png */; };
@@ -57,10 +57,10 @@
C1715FFB29C0BCE50088FA8B /* launch-icon@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = C14C5F8C29C0A149005C58A7 /* launch-icon@3x.png */; };
C1715FFC29C0BCE80088FA8B /* launch-icon.png in Resources */ = {isa = PBXBuildFile; fileRef = C14C5F9229C0ADB5005C58A7 /* launch-icon.png */; };
CE4E31B31D8695250033ED64 /* Statusgo.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE4E31B21D8695250033ED64 /* Statusgo.xcframework */; };
D156FF2CCF43C136F7BF8AE5 /* libPods-Status-StatusIm-StatusImTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D3EFEEB5FC1235562D5D3BF1 /* libPods-Status-StatusIm-StatusImTests.a */; };
D1786306E0184916B11F4C37 /* Inter-Medium.otf in Resources */ = {isa = PBXBuildFile; fileRef = B2A38FC3D3954DE7B2B171F8 /* Inter-Medium.otf */; };
D84616FB563A48EBB1678699 /* Inter-Bold.otf in Resources */ = {isa = PBXBuildFile; fileRef = CD4A2C27D6D5473184DC1F7E /* Inter-Bold.otf */; };
D99C50E5E18942A39C8DDF61 /* Inter-BoldItalic.otf in Resources */ = {isa = PBXBuildFile; fileRef = B321D25F4493470980039457 /* Inter-BoldItalic.otf */; };
F5EC958C8908294B8536B835 /* libPods-Status-StatusIm-StatusImTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 06FA6B17CC0A7FAFA9DA5364 /* libPods-Status-StatusIm-StatusImTests.a */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -108,23 +108,24 @@
00E356EE1AD99517003FC87E /* StatusImTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = StatusImTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
00E356F21AD99517003FC87E /* StatusImTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = StatusImTests.m; sourceTree = "<group>"; };
06AF19FA626AFFC91E66916B /* Pods-Status-StatusImPR.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Status-StatusImPR.release.xcconfig"; path = "Target Support Files/Pods-Status-StatusImPR/Pods-Status-StatusImPR.release.xcconfig"; sourceTree = "<group>"; };
0F8E9088BDE117AB71366407 /* libPods-Status-StatusIm.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Status-StatusIm.a"; sourceTree = BUILT_PRODUCTS_DIR; };
06FA6B17CC0A7FAFA9DA5364 /* libPods-Status-StatusIm-StatusImTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Status-StatusIm-StatusImTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
08A713A336BFEE0924821EC9 /* Pods-Status-StatusIm.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Status-StatusIm.release.xcconfig"; path = "Target Support Files/Pods-Status-StatusIm/Pods-Status-StatusIm.release.xcconfig"; sourceTree = "<group>"; };
103861DFF36B6063BED2602B /* Pods-Status-StatusImPR.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Status-StatusImPR.release.xcconfig"; path = "Target Support Files/Pods-Status-StatusImPR/Pods-Status-StatusImPR.release.xcconfig"; sourceTree = "<group>"; };
13B07F961A680F5B00A75B9A /* StatusIm.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = StatusIm.app; sourceTree = BUILT_PRODUCTS_DIR; };
13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = StatusIm/AppDelegate.h; sourceTree = "<group>"; };
13B07FB01A68108700A75B9A /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = StatusIm/AppDelegate.mm; sourceTree = "<group>"; };
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = StatusIm/Info.plist; sourceTree = "<group>"; };
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = StatusIm/main.m; sourceTree = "<group>"; };
1426DF592BA248FC81D955CB /* Inter-Regular.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "Inter-Regular.otf"; path = "../resources/fonts/Inter-Regular.otf"; sourceTree = "<group>"; };
1CDF317A2E103217DF386083 /* Pods-Status-StatusIm.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Status-StatusIm.release.xcconfig"; path = "Target Support Files/Pods-Status-StatusIm/Pods-Status-StatusIm.release.xcconfig"; sourceTree = "<group>"; };
3A2626CE245C3F2200D5F94B /* Dummy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Dummy.swift; sourceTree = "<group>"; };
3A6406FB24A3ADF90046ED37 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
3A8F8EA924A4D31600BF206D /* GameKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameKit.framework; path = System/Library/Frameworks/GameKit.framework; sourceTree = SDKROOT; };
3AAD2ADC24A3A60E0075D594 /* Status PR.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Status PR.app"; sourceTree = BUILT_PRODUCTS_DIR; };
3AB1C3AD245C043900098F67 /* StatusIm-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "StatusIm-Bridging-Header.h"; sourceTree = "<group>"; };
4C16DE0B1F89508700AA10DB /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
4D059F2E62D7CD9FB1896703 /* libPods-Status-StatusImPR.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Status-StatusImPR.a"; sourceTree = BUILT_PRODUCTS_DIR; };
4D7FC122A838AC3BFC46D82B /* Pods-Status-StatusImPR.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Status-StatusImPR.debug.xcconfig"; path = "Target Support Files/Pods-Status-StatusImPR/Pods-Status-StatusImPR.debug.xcconfig"; sourceTree = "<group>"; };
4E586E1B0E544F64AA9F5BD1 /* libz.tbd */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; };
5006FF03675A7E50320B4002 /* libPods-Status-StatusImPR.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Status-StatusImPR.a"; sourceTree = BUILT_PRODUCTS_DIR; };
65F693BD2578002500A45E76 /* CoreNFC.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreNFC.framework; path = System/Library/Frameworks/CoreNFC.framework; sourceTree = SDKROOT; };
65F693BF2578003600A45E76 /* CoreNFC.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreNFC.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/System/iOSSupport/System/Library/Frameworks/CoreNFC.framework; sourceTree = DEVELOPER_DIR; };
65F6941725780A4E00A45E76 /* StatusImTests-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "StatusImTests-Bridging-Header.h"; sourceTree = "<group>"; };
@@ -132,13 +133,13 @@
693A62DB37BC4CD5A30E5C96 /* Inter-SemiBold.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "Inter-SemiBold.otf"; path = "../resources/fonts/Inter-SemiBold.otf"; sourceTree = "<group>"; };
715D8131290BE850006F5C88 /* UbuntuMono-Regular.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "UbuntuMono-Regular.ttf"; path = "../resources/fonts/UbuntuMono-Regular.ttf"; sourceTree = "<group>"; };
74B758FB20D7C00B003343C3 /* launch-image-universal.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = "launch-image-universal.storyboard"; sourceTree = "<group>"; };
84C3C20891247EC6BFF93B51 /* Pods-Status-StatusIm-StatusImTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Status-StatusIm-StatusImTests.release.xcconfig"; path = "Target Support Files/Pods-Status-StatusIm-StatusImTests/Pods-Status-StatusIm-StatusImTests.release.xcconfig"; sourceTree = "<group>"; };
886398AFEF2B823AC8A4912C /* Pods-Status-StatusIm.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Status-StatusIm.debug.xcconfig"; path = "Target Support Files/Pods-Status-StatusIm/Pods-Status-StatusIm.debug.xcconfig"; sourceTree = "<group>"; };
8B9A886A2CB448B1ABA0EB62 /* libc++.tbd */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "usr/lib/libc++.tbd"; sourceTree = SDKROOT; };
922C4CA61F4D5F8B0033C753 /* StatusIm.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = StatusIm.entitlements; path = StatusIm/StatusIm.entitlements; sourceTree = "<group>"; };
93347A9564A62A24509EFA9C /* Pods-Status-StatusIm-StatusImTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Status-StatusIm-StatusImTests.release.xcconfig"; path = "Target Support Files/Pods-Status-StatusIm-StatusImTests/Pods-Status-StatusIm-StatusImTests.release.xcconfig"; sourceTree = "<group>"; };
9C76AF5A418D4D65A4CAD1D9 /* InterStatus-Regular.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "InterStatus-Regular.otf"; path = "../resources/fonts/InterStatus-Regular.otf"; sourceTree = "<group>"; };
9EC0135C1E06FB1900155B5C /* RCTWKWebView.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWKWebView.xcodeproj; path = "../node_modules/react-native-wkwebview-reborn/ios/RCTWKWebView.xcodeproj"; sourceTree = "<group>"; };
A4F2BBE8D4DD4140A6CCAC39 /* Inter-SemiBoldItalic.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "Inter-SemiBoldItalic.otf"; path = "../resources/fonts/Inter-SemiBoldItalic.otf"; sourceTree = "<group>"; };
AA6DC18226EB1EFB2A8FE64D /* Pods-Status-StatusIm.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Status-StatusIm.debug.xcconfig"; path = "Target Support Files/Pods-Status-StatusIm/Pods-Status-StatusIm.debug.xcconfig"; sourceTree = "<group>"; };
B07176ACDAA1422E8F0A3D6B /* Inter-Italic.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "Inter-Italic.otf"; path = "../resources/fonts/Inter-Italic.otf"; sourceTree = "<group>"; };
B24FC7FC1DE7195700D694FF /* Social.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Social.framework; path = System/Library/Frameworks/Social.framework; sourceTree = SDKROOT; };
B24FC7FE1DE7195F00D694FF /* MessageUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MessageUI.framework; path = System/Library/Frameworks/MessageUI.framework; sourceTree = SDKROOT; };
@@ -148,12 +149,11 @@
C14C5F8C29C0A149005C58A7 /* launch-icon@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "launch-icon@3x.png"; path = "StatusIm/launch-icon@3x.png"; sourceTree = "<group>"; };
C14C5F9029C0AD9C005C58A7 /* launch-icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "launch-icon@2x.png"; path = "StatusIm/launch-icon@2x.png"; sourceTree = "<group>"; };
C14C5F9229C0ADB5005C58A7 /* launch-icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "launch-icon.png"; path = "StatusIm/launch-icon.png"; sourceTree = "<group>"; };
C618F2C2EF820C722B1E7624 /* Pods-Status-StatusImPR.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Status-StatusImPR.debug.xcconfig"; path = "Target Support Files/Pods-Status-StatusImPR/Pods-Status-StatusImPR.debug.xcconfig"; sourceTree = "<group>"; };
C6B1215047604CD59A4C74D6 /* Inter-MediumItalic.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "Inter-MediumItalic.otf"; path = "../resources/fonts/Inter-MediumItalic.otf"; sourceTree = "<group>"; };
CD4A2C27D6D5473184DC1F7E /* Inter-Bold.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "Inter-Bold.otf"; path = "../resources/fonts/Inter-Bold.otf"; sourceTree = "<group>"; };
CE4E31B21D8695250033ED64 /* Statusgo.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = Statusgo.xcframework; path = "../modules/react-native-status/ios/RCTStatus/Statusgo.xcframework"; sourceTree = "<group>"; };
D3EFEEB5FC1235562D5D3BF1 /* libPods-Status-StatusIm-StatusImTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Status-StatusIm-StatusImTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
DAE7378308FEB005CE0A6E42 /* Pods-Status-StatusIm-StatusImTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Status-StatusIm-StatusImTests.debug.xcconfig"; path = "Target Support Files/Pods-Status-StatusIm-StatusImTests/Pods-Status-StatusIm-StatusImTests.debug.xcconfig"; sourceTree = "<group>"; };
EBFEABB7D6CC1144D83FBA82 /* Pods-Status-StatusIm-StatusImTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Status-StatusIm-StatusImTests.debug.xcconfig"; path = "Target Support Files/Pods-Status-StatusIm-StatusImTests/Pods-Status-StatusIm-StatusImTests.debug.xcconfig"; sourceTree = "<group>"; };
FBEDE2F94002488EF6B277DA /* libPods-Status-StatusIm.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Status-StatusIm.a"; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -161,7 +161,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
D156FF2CCF43C136F7BF8AE5 /* libPods-Status-StatusIm-StatusImTests.a in Frameworks */,
F5EC958C8908294B8536B835 /* libPods-Status-StatusIm-StatusImTests.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -174,7 +174,7 @@
CE4E31B31D8695250033ED64 /* Statusgo.xcframework in Frameworks */,
25DC9C9DC25846BD8D084888 /* libc++.tbd in Frameworks */,
BA68A2377A20496EA737000D /* libz.tbd in Frameworks */,
81F3191BB1D4BDF3442402BD /* libPods-Status-StatusIm.a in Frameworks */,
B73930D752A70EAB45001773 /* libPods-Status-StatusIm.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -188,7 +188,7 @@
3AAD2AC224A3A60E0075D594 /* Statusgo.xcframework in Frameworks */,
3AAD2AC524A3A60E0075D594 /* libc++.tbd in Frameworks */,
3AAD2AC624A3A60E0075D594 /* libz.tbd in Frameworks */,
04515E9DF839CBF55C690E79 /* libPods-Status-StatusImPR.a in Frameworks */,
B0E570AEBE2BEB426BF60259 /* libPods-Status-StatusImPR.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -314,9 +314,9 @@
CE4E31B21D8695250033ED64 /* Statusgo.xcframework */,
8B9A886A2CB448B1ABA0EB62 /* libc++.tbd */,
4E586E1B0E544F64AA9F5BD1 /* libz.tbd */,
0F8E9088BDE117AB71366407 /* libPods-Status-StatusIm.a */,
D3EFEEB5FC1235562D5D3BF1 /* libPods-Status-StatusIm-StatusImTests.a */,
5006FF03675A7E50320B4002 /* libPods-Status-StatusImPR.a */,
FBEDE2F94002488EF6B277DA /* libPods-Status-StatusIm.a */,
06FA6B17CC0A7FAFA9DA5364 /* libPods-Status-StatusIm-StatusImTests.a */,
4D059F2E62D7CD9FB1896703 /* libPods-Status-StatusImPR.a */,
);
name = Frameworks;
sourceTree = "<group>";
@@ -324,12 +324,12 @@
D0D5C8D06825D33BA2D2121E /* Pods */ = {
isa = PBXGroup;
children = (
AA6DC18226EB1EFB2A8FE64D /* Pods-Status-StatusIm.debug.xcconfig */,
1CDF317A2E103217DF386083 /* Pods-Status-StatusIm.release.xcconfig */,
DAE7378308FEB005CE0A6E42 /* Pods-Status-StatusIm-StatusImTests.debug.xcconfig */,
93347A9564A62A24509EFA9C /* Pods-Status-StatusIm-StatusImTests.release.xcconfig */,
C618F2C2EF820C722B1E7624 /* Pods-Status-StatusImPR.debug.xcconfig */,
06AF19FA626AFFC91E66916B /* Pods-Status-StatusImPR.release.xcconfig */,
886398AFEF2B823AC8A4912C /* Pods-Status-StatusIm.debug.xcconfig */,
08A713A336BFEE0924821EC9 /* Pods-Status-StatusIm.release.xcconfig */,
EBFEABB7D6CC1144D83FBA82 /* Pods-Status-StatusIm-StatusImTests.debug.xcconfig */,
84C3C20891247EC6BFF93B51 /* Pods-Status-StatusIm-StatusImTests.release.xcconfig */,
4D7FC122A838AC3BFC46D82B /* Pods-Status-StatusImPR.debug.xcconfig */,
103861DFF36B6063BED2602B /* Pods-Status-StatusImPR.release.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
@@ -341,11 +341,11 @@
isa = PBXNativeTarget;
buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "StatusImTests" */;
buildPhases = (
A461E3110C485D2A21EB942C /* [CP] Check Pods Manifest.lock */,
F083BDB009D93F14ABE9577A /* [CP] Check Pods Manifest.lock */,
00E356EA1AD99517003FC87E /* Sources */,
00E356EB1AD99517003FC87E /* Frameworks */,
00E356EC1AD99517003FC87E /* Resources */,
2B2389E62F0A9702C522FD40 /* [CP] Copy Pods Resources */,
D2C750D3F094DB4514432955 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
@@ -361,14 +361,14 @@
isa = PBXNativeTarget;
buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "StatusIm" */;
buildPhases = (
C5DA0344FCE555AD1908FBCD /* [CP] Check Pods Manifest.lock */,
29DFA8D4A1684BDC5257F30D /* [CP] Check Pods Manifest.lock */,
13B07F871A680F5B00A75B9A /* Sources */,
13B07F8C1A680F5B00A75B9A /* Frameworks */,
13B07F8E1A680F5B00A75B9A /* Resources */,
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
20B6B6891D92C42700CC5C6A /* Embed Frameworks */,
E3914A731DF919ED00EBB515 /* Run Script */,
EC618D80223E4CE064CFF898 /* [CP] Copy Pods Resources */,
81ABD64BC3E76C9EEE7A6C62 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
@@ -383,14 +383,14 @@
isa = PBXNativeTarget;
buildConfigurationList = 3AAD2AD924A3A60E0075D594 /* Build configuration list for PBXNativeTarget "StatusImPR" */;
buildPhases = (
0196982A5A6EB89DC2106F9B /* [CP] Check Pods Manifest.lock */,
B75C010670287761677282A4 /* [CP] Check Pods Manifest.lock */,
3AAD2ABB24A3A60E0075D594 /* Sources */,
3AAD2ABF24A3A60E0075D594 /* Frameworks */,
3AAD2AC924A3A60E0075D594 /* Resources */,
3AAD2AD524A3A60E0075D594 /* Bundle React Native code and images */,
3AAD2AD624A3A60E0075D594 /* Embed Frameworks */,
3AAD2AD724A3A60E0075D594 /* Run Script */,
4DBAAF9A3117797361E216BA /* [CP] Copy Pods Resources */,
C7E5420D406F9FB4ACC8ECE8 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
@@ -544,7 +544,7 @@
shellPath = "/usr/bin/env sh";
shellScript = "set -o errexit\nexport NODE_BINARY=\"${NODE_BINARY:-node}\"\nexport NODE_ARGS=\"${NODE_ARGS:- --max-old-space-size=16384 }\"\n\nbash -x ../node_modules/react-native/scripts/react-native-xcode.sh > ./logs/react-native-xcode.log 2>&1";
};
0196982A5A6EB89DC2106F9B /* [CP] Check Pods Manifest.lock */ = {
29DFA8D4A1684BDC5257F30D /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
@@ -559,35 +559,13 @@
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Status-StatusImPR-checkManifestLockResult.txt",
"$(DERIVED_FILE_DIR)/Pods-Status-StatusIm-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;
};
2B2389E62F0A9702C522FD40 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Status-StatusIm-StatusImTests/Pods-Status-StatusIm-StatusImTests-resources.sh",
"${PODS_CONFIGURATION_BUILD_DIR}/RNImageCropPicker/QBImagePicker.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/AccessibilityResources.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/TOCropViewController/TOCropViewControllerBundle.bundle",
);
name = "[CP] Copy Pods Resources";
outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/QBImagePicker.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AccessibilityResources.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/TOCropViewControllerBundle.bundle",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Status-StatusIm-StatusImTests/Pods-Status-StatusIm-StatusImTests-resources.sh\"\n";
showEnvVarsInLog = 0;
};
3AAD2AD524A3A60E0075D594 /* Bundle React Native code and images */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
@@ -616,7 +594,51 @@
shellPath = "/usr/bin/env sh";
shellScript = "\"${PROJECT_DIR}/scripts/set_xcode_version.sh\" > ./logs/set_xcode_version.log 2>&1";
};
4DBAAF9A3117797361E216BA /* [CP] Copy Pods Resources */ = {
81ABD64BC3E76C9EEE7A6C62 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Status-StatusIm/Pods-Status-StatusIm-resources.sh",
"${PODS_CONFIGURATION_BUILD_DIR}/RNImageCropPicker/QBImagePicker.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/AccessibilityResources.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/TOCropViewController/TOCropViewControllerBundle.bundle",
);
name = "[CP] Copy Pods Resources";
outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/QBImagePicker.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AccessibilityResources.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/TOCropViewControllerBundle.bundle",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Status-StatusIm/Pods-Status-StatusIm-resources.sh\"\n";
showEnvVarsInLog = 0;
};
B75C010670287761677282A4 /* [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-Status-StatusImPR-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;
};
C7E5420D406F9FB4ACC8ECE8 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
@@ -638,7 +660,43 @@
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Status-StatusImPR/Pods-Status-StatusImPR-resources.sh\"\n";
showEnvVarsInLog = 0;
};
A461E3110C485D2A21EB942C /* [CP] Check Pods Manifest.lock */ = {
D2C750D3F094DB4514432955 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Status-StatusIm-StatusImTests/Pods-Status-StatusIm-StatusImTests-resources.sh",
"${PODS_CONFIGURATION_BUILD_DIR}/RNImageCropPicker/QBImagePicker.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/AccessibilityResources.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/TOCropViewController/TOCropViewControllerBundle.bundle",
);
name = "[CP] Copy Pods Resources";
outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/QBImagePicker.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AccessibilityResources.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/TOCropViewControllerBundle.bundle",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Status-StatusIm-StatusImTests/Pods-Status-StatusIm-StatusImTests-resources.sh\"\n";
showEnvVarsInLog = 0;
};
E3914A731DF919ED00EBB515 /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 8;
files = (
);
inputPaths = (
);
name = "Run Script";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 1;
shellPath = "/usr/bin/env sh";
shellScript = "\"${PROJECT_DIR}/scripts/set_xcode_version.sh\" > ./logs/set_xcode_version.log 2>&1";
};
F083BDB009D93F14ABE9577A /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
@@ -660,64 +718,6 @@
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;
};
C5DA0344FCE555AD1908FBCD /* [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-Status-StatusIm-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;
};
E3914A731DF919ED00EBB515 /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 8;
files = (
);
inputPaths = (
);
name = "Run Script";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 1;
shellPath = "/usr/bin/env sh";
shellScript = "\"${PROJECT_DIR}/scripts/set_xcode_version.sh\" > ./logs/set_xcode_version.log 2>&1";
};
EC618D80223E4CE064CFF898 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Status-StatusIm/Pods-Status-StatusIm-resources.sh",
"${PODS_CONFIGURATION_BUILD_DIR}/RNImageCropPicker/QBImagePicker.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/AccessibilityResources.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/TOCropViewController/TOCropViewControllerBundle.bundle",
);
name = "[CP] Copy Pods Resources";
outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/QBImagePicker.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AccessibilityResources.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/TOCropViewControllerBundle.bundle",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Status-StatusIm/Pods-Status-StatusIm-resources.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
@@ -765,7 +765,7 @@
/* Begin XCBuildConfiguration section */
00E356F61AD99517003FC87E /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = DAE7378308FEB005CE0A6E42 /* Pods-Status-StatusIm-StatusImTests.debug.xcconfig */;
baseConfigurationReference = EBFEABB7D6CC1144D83FBA82 /* Pods-Status-StatusIm-StatusImTests.debug.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_ID_SUFFIX = .debug;
@@ -802,7 +802,7 @@
};
00E356F71AD99517003FC87E /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 93347A9564A62A24509EFA9C /* Pods-Status-StatusIm-StatusImTests.release.xcconfig */;
baseConfigurationReference = 84C3C20891247EC6BFF93B51 /* Pods-Status-StatusIm-StatusImTests.release.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_ID_SUFFIX = "";
@@ -835,7 +835,7 @@
};
13B07F941A680F5B00A75B9A /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = AA6DC18226EB1EFB2A8FE64D /* Pods-Status-StatusIm.debug.xcconfig */;
baseConfigurationReference = 886398AFEF2B823AC8A4912C /* Pods-Status-StatusIm.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon$(BUNDLE_ID_SUFFIX)";
BUNDLE_ID_SUFFIX = .debug;
@@ -915,7 +915,7 @@
};
13B07F951A680F5B00A75B9A /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 1CDF317A2E103217DF386083 /* Pods-Status-StatusIm.release.xcconfig */;
baseConfigurationReference = 08A713A336BFEE0924821EC9 /* Pods-Status-StatusIm.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon$(BUNDLE_ID_SUFFIX)";
BUNDLE_ID_SUFFIX = "";
@@ -988,7 +988,7 @@
};
3AAD2ADA24A3A60E0075D594 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = C618F2C2EF820C722B1E7624 /* Pods-Status-StatusImPR.debug.xcconfig */;
baseConfigurationReference = 4D7FC122A838AC3BFC46D82B /* Pods-Status-StatusImPR.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon$(BUNDLE_ID_SUFFIX)";
BUNDLE_ID_SUFFIX = .debug;
@@ -1065,7 +1065,7 @@
};
3AAD2ADB24A3A60E0075D594 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 06AF19FA626AFFC91E66916B /* Pods-Status-StatusImPR.release.xcconfig */;
baseConfigurationReference = 103861DFF36B6063BED2602B /* Pods-Status-StatusImPR.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = "AppIconPR$(BUNDLE_ID_SUFFIX)";
BUNDLE_ID_SUFFIX = "";
+1
View File
@@ -46,6 +46,7 @@
"react-native-dialogs": "^1.0.4",
"react-native-draggable-flatlist": "^4.0.1",
"react-native-fast-image": "^8.5.11",
"react-native-fetch-polyfill": "^1.1.2",
"react-native-fs": "^2.14.1",
"react-native-gesture-handler": "2.6.1",
"react-native-gifted-charts": "git+https://github.com/status-im/react-native-gifted-charts.git#refs/tags/1.3.2-status.1",
File diff suppressed because one or more lines are too long
Binary file not shown.

Before

Width:  |  Height:  |  Size: 984 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 939 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 350 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 467 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 819 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 622 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 745 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 848 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

+1 -8
View File
@@ -121,14 +121,7 @@ export function screenGestureOnEnd(data) {
return function (event) {
'worklet';
const {
'screen-left': screenLeft,
'screen-state': screenState,
'screen-width': screenWidth,
'left-velocity': leftVelocity,
'right-velocity': rightVelocity,
'screen-closed-callback': screenClosedCallback,
} = data;
const { screenLeft, screenState, screenWidth, leftVelocity, rightVelocity, screenClosedCallback } = data;
const absoluteX = event.absoluteX ?? 0;
const velocityX = event.velocityX ?? 0;
const closeScreen = velocityX > rightVelocity || (velocityX > leftVelocity && absoluteX >= screenWidth / 2);
-2
View File
@@ -420,8 +420,6 @@
"react-native-transparent-video" react-native-transparent-video
"react-native-orientation-locker" react-native-orientation-locker
"react-native-gifted-charts" react-native-gifted-charts
"../resources/data/emojis/en.json" (js/JSON.parse (slurp
"./resources/data/emojis/en.json"))
"../src/js/worklets/core.js" worklet-factory
"../src/js/worklets/shell/bottom_tabs.js" #js {}
"../src/js/worklets/shell/home_stack.js" #js {}
@@ -12,19 +12,18 @@
:height view-height})
(defn button-container
[{:keys [left right theme]}]
[position]
(merge
{:width 32
:height 32
:border-radius 10
:justify-content :center
:align-items :center
:background-color (colors/theme-colors colors/white-opa-40 colors/neutral-80-opa-40 theme)
:background-color (colors/theme-colors colors/white-opa-40 colors/neutral-80-opa-40)
:position :absolute
:top 56
:z-index 3
:left left
:right right}))
:z-index 3}
position))
(defn blur-view
[animation]
@@ -39,7 +38,7 @@
:overflow :hidden}))
(defn entity-picture
[animation theme]
[animation]
(reanimated/apply-animations-to-style
{:width animation
:height animation}
@@ -50,11 +49,11 @@
:left 20
:justify-content :center
:align-items :center
:background-color (colors/theme-colors colors/white colors/neutral-100 theme)
:background-color (colors/theme-colors colors/white colors/neutral-100)
:overflow :hidden}))
(defn header-bottom-part
[animation theme]
[animation]
(reanimated/apply-animations-to-style
{:border-top-right-radius animation
:border-top-left-radius animation}
@@ -63,7 +62,7 @@
:height 86
:left 0
:right 0
:background-color (colors/theme-colors colors/white colors/neutral-100 theme)}))
:background-color (colors/theme-colors colors/white colors/neutral-100)}))
(defn header-comp
[y-animation opacity-animation]
@@ -9,8 +9,7 @@
[reagent.core :as reagent]
[quo2.foundations.colors :as colors]
[quo2.components.animated-header-flatlist.style :as style]
[oops.core :as oops]
[quo2.theme :as quo.theme]))
[oops.core :as oops]))
(def header-height 234)
(def cover-height 192)
@@ -31,7 +30,7 @@
(reanimated/set-shared-value scroll-y current-y)))
(defn header
[{:keys [theme-color f-display-picture-comp cover-uri title-comp theme]} top-inset scroll-y]
[{:keys [theme-color f-display-picture-comp cover-uri title-comp]} top-inset scroll-y]
(let [input-range [0 (* threshold 0.33)]
picture-scale-down 0.4
size-animation (interpolate scroll-y input-range [80 (* 80 picture-scale-down)])
@@ -39,23 +38,21 @@
border-animation (interpolate scroll-y input-range [12 0])]
[rn/view
{:style {:height header-height
:background-color (or theme-color
(colors/theme-colors colors/white colors/neutral-95 theme))
:background-color (or theme-color (colors/theme-colors colors/white colors/neutral-95))
:margin-top (when platform/ios? (- top-inset))}}
(when cover-uri
[fast-image/fast-image
{:style {:width "100%"
:height cover-height}
:source {:uri cover-uri}}])
[reanimated/view {:style (style/header-bottom-part border-animation theme)}
[reanimated/view {:style (style/header-bottom-part border-animation)}
[title-comp]]
[reanimated/view {:style (style/entity-picture size-animation theme)}
[reanimated/view {:style (style/entity-picture size-animation)}
[:f> f-display-picture-comp image-animation]]]))
(defn- f-animated-header-list
[{:keys [header-comp main-comp back-button-on-press] :as params}]
(let [theme (quo.theme/use-theme-value)
window-height (:height (rn/get-window))
(let [window-height (:height (rn/get-window))
{:keys [top bottom]} (safe-area/get-insets)
;; view height calculation is different because window height is different on iOS and Android:
view-height (if platform/ios?
@@ -72,12 +69,12 @@
[rn/touchable-opacity
{:active-opacity 1
:on-press back-button-on-press
:style (style/button-container {:left 20 :theme theme})}
[quo/icon :i/arrow-left {:size 20 :color (colors/theme-colors colors/black colors/white theme)}]]
:style (style/button-container {:left 20})}
[quo/icon :i/arrow-left {:size 20 :color (colors/theme-colors colors/black colors/white)}]]
[rn/touchable-opacity
{:active-opacity 1
:style (style/button-container {:right 20 :theme theme})}
[quo/icon :i/options {:size 20 :color (colors/theme-colors colors/black colors/white theme)}]]
:style (style/button-container {:right 20})}
[quo/icon :i/options {:size 20 :color (colors/theme-colors colors/black colors/white)}]]
[reanimated/blur-view
{:blurAmount 32
:blurType :light
@@ -89,7 +86,7 @@
{:data [nil]
:render-fn main-comp
:key-fn str
:header (reagent/as-element (header (assoc params :theme theme) top scroll-y))
:header (reagent/as-element (header params top scroll-y))
;; TODO: https://github.com/status-im/status-mobile/issues/14924
:scroll-event-throttle 8
:on-scroll (fn [event] (scroll-handler event initial-y scroll-y))}]]))
@@ -3,15 +3,12 @@
(defn container
[{:keys [container-size customization-color theme]}]
(let [color (if (keyword? customization-color)
customization-color
:blue)]
{:width container-size
:height container-size
:align-items :center
:justify-content :center
:border-radius (/ container-size 2)
:overflow :hidden
:background-color (colors/theme-colors (colors/custom-color color 50)
(colors/custom-color color 60)
theme)}))
{:width container-size
:height container-size
:align-items :center
:justify-content :center
:border-radius (/ container-size 2)
:overflow :hidden
:background-color (colors/theme-colors (colors/custom-color customization-color 50)
(colors/custom-color customization-color 60)
theme)})
@@ -1,10 +1,6 @@
(ns quo2.components.dividers.divider-label.style
(:require [quo2.foundations.colors :as colors]))
(defn get-height
[tight?]
(if tight? 34 42))
(defn- get-border-color
[blur? theme]
(colors/theme-colors (if blur? colors/neutral-80-opa-5 colors/neutral-10)
@@ -21,7 +17,6 @@
[blur? tight? chevron theme]
{:border-top-width 1
:border-top-color (get-border-color blur? theme)
:height (get-height tight?)
:padding-top (if tight? 6 14)
:padding-bottom 7
:padding-left (if (= :left chevron) 16 20)
@@ -2,10 +2,10 @@
(:require [quo2.foundations.colors :as colors]))
(defn divider-line
[{:keys [blur? container-style theme]}]
(merge
{:border-color (if blur?
(colors/theme-colors colors/neutral-80-opa-5 colors/white-opa-5 theme)
(colors/theme-colors colors/neutral-10 colors/neutral-90 theme))
:border-bottom-width 1}
container-style))
[blur? theme]
{:border-color (if blur?
(colors/theme-colors colors/neutral-80-opa-5 colors/white-opa-5 theme)
(colors/theme-colors colors/neutral-10 colors/neutral-90 theme))
:padding-top 12
:padding-bottom 8
:border-bottom-width 1})
@@ -5,7 +5,7 @@
[quo2.components.dividers.divider-line.style :as style]))
(defn- view-internal
[props]
[rn/view {:style (style/divider-line props)}])
[{:keys [blur? theme]}]
[rn/view {:style (style/divider-line blur? theme)}])
(def view (quo.theme/with-theme view-internal))
@@ -1,98 +0,0 @@
(ns quo2.components.drawers.drawer-top.component-spec
(:require [test-helpers.component :as h]
[quo2.core :as quo]))
(h/describe "drawer top tests"
(h/test "component renders in default type"
(h/render [quo/drawer-top
{:title "Title"
:type :default}])
(h/is-truthy (h/get-by-text "Title")))
(h/test "component renders in default + description type"
(h/render [quo/drawer-top
{:title "Title"
:type :default
:description "Description"}])
(h/is-truthy (h/get-by-text "Title"))
(h/is-truthy (h/get-by-text "Description")))
(h/test "component renders in info type"
(h/render [quo/drawer-top
{:title "Title"
:type :info}])
(h/is-truthy (h/get-by-text "Title"))
(h/is-truthy (h/get-by-label-text :info-icon)))
(h/test "component renders in info + description type"
(h/render [quo/drawer-top
{:title "Title"
:description "Description"
:type :info}])
(h/is-truthy (h/get-by-text "Title"))
(h/is-truthy (h/get-by-text "Description"))
(h/is-truthy (h/get-by-label-text :info-icon)))
(h/test "component renders in context-tag type"
(h/render [quo/drawer-top
{:title "Title"
:type :context-tag
:community-name "Coinbase"}])
(h/is-truthy (h/get-by-text "Title"))
(h/is-truthy (h/get-by-label-text :context-tag-wrapper)))
(h/test "component renders in context-tag + button type"
(h/render [quo/drawer-top
{:title "Title"
:type :context-tag
:button-icon :i/placeholder
:community-name "Coinbase"}])
(h/is-truthy (h/get-by-text "Title"))
(h/is-truthy (h/get-by-label-text :button-icon))
(h/is-truthy (h/get-by-label-text :context-tag-wrapper)))
(h/test "component renders in account type"
(h/render [quo/drawer-top
{:title "Title"
:type :account
:account-avatar-emoji "🍿"
:networks [:ethereum]
:description "0x62b...0a5"
:customization-color :purple}])
(h/is-truthy (h/get-by-text "Title"))
(h/is-truthy (h/get-by-text "0x62b...0a5"))
(h/is-truthy (h/get-by-label-text :account-avatar)))
(h/test "component renders in keypair type when keycard? is false"
(h/render [quo/drawer-top
{:title "Title"
:keycard? false
:icon-avatar :i/placeholder
:type :keypair}])
(h/is-truthy (h/get-by-text "Title"))
(-> (h/expect (h/get-by-translation-text :on-device))
(.toBeTruthy)))
(h/test "component renders in keypair type when keycard? is true"
(h/render [quo/drawer-top
{:title "Title"
:keycard? true
:icon-avatar :i/placeholder
:type :keypair}])
(h/is-truthy (h/get-by-text "Title"))
(-> (h/expect (h/get-by-translation-text :on-keycard))
(.toBeTruthy)))
(h/test "component renders in default-keypair type"
(h/render [quo/drawer-top
{:title "Title"
:description "0x62b...0a5"
:type :default-keypair}])
(h/is-truthy (h/get-by-text "Title"))
(h/is-truthy (h/get-by-label-text :default-keypair-text)))
(h/test "component renders in label type"
(h/render [quo/drawer-top
{:label "label"
:type :label}])
(h/is-truthy (h/get-by-text "label"))))
@@ -1,31 +0,0 @@
(ns quo2.components.drawers.drawer-top.style
(:require [quo2.foundations.colors :as colors]))
(def container
{:padding-horizontal 20
:padding-bottom 12
:flex-direction :row})
(def body-container
{:flex 1})
(defn description
[theme blur?]
{:color (if blur?
colors/white-opa-40
(colors/theme-colors colors/neutral-50 colors/neutral-40 theme))})
(def left-container
{:margin-right 8
:justify-content :center})
(defn network-text-color
[network]
{:color (colors/custom-color network)})
(def row
{:flex-direction :row
:align-items :center})
(def keycard-icon
{:margin-left 4})
@@ -1,204 +0,0 @@
(ns quo2.components.drawers.drawer-top.view
(:require [quo2.theme :as quo.theme]
[quo2.components.markdown.text :as text]
[quo2.components.drawers.drawer-top.style :as style]
[quo2.components.buttons.button.view :as button]
[quo2.components.tags.context-tag.view :as context-tag]
[react-native.core :as rn]
[quo2.components.icon :as icons]
[quo2.components.avatars.account-avatar.view :as account-avatar]
[quo2.components.avatars.icon-avatar :as icon-avatar]
[quo2.components.avatars.user-avatar.view :as user-avatar]
[quo2.foundations.colors :as colors]
[utils.i18n :as i18n]))
(defn- left-image
[{:keys [type customization-color account-avatar-emoji icon-avatar profile-picture]}]
(case type
:account [account-avatar/view
{:customization-color customization-color
:size 32
:emoji account-avatar-emoji
:type :default}]
:keypair [icon-avatar/icon-avatar
{:icon icon-avatar
:border? true
:color :neutral}]
:default-keypair [user-avatar/user-avatar
{:size :small
:status-indicator? false
:profile-picture profile-picture}]
nil))
(defn- network-view
[network]
[text/text
{:size :paragraph-2
:weight :regular
:style (style/network-text-color network)}
(str (subs (name network) 0 3) ":")])
(defn- keypair-subtitle
[{:keys [theme blur? keycard?]}]
[rn/view {:style style/row}
[text/text
{:size :paragraph-2
:weight :regular
:style (style/description theme blur?)}
(if keycard?
(i18n/label :t/on-keycard)
(i18n/label :t/on-device))]
(when keycard?
[icons/icon
:i/keycard-card
{:color (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)
:size 16
:container-style style/keycard-icon}])])
(defn- acocunt-subtitle
[{:keys [networks theme blur? description]}]
[rn/view {:style style/row}
(for [network networks]
^{:key (str network)}
[network-view network])
[text/text
{:size :paragraph-2
:weight :regular
:style (style/description theme blur?)}
description]])
(defn- default-keypair-subtitle
[{:keys [description theme blur?]}]
[text/text
{:accessibility-label :default-keypair-text
:size :paragraph-2
:weight :regular
:style (style/description theme blur?)}
(str description " · " (i18n/label :t/on-device))])
(defn- context-tag-subtitle
[{:keys [community-logo community-name]}]
[rn/view
{:accessibility-label :context-tag-wrapper
:style {:flex-wrap :wrap}}
[context-tag/view
{:type :community
:community-name community-name
:community-logo community-logo
:size 24}]])
(defn- description-subtitle
[{:keys [theme blur? description]}]
[text/text
{:size :paragraph-1
:weight :regular
:style (style/description theme blur?)}
description])
(defn- subtitle
[{:keys [type theme blur? keycard? networks description community-name community-logo]}]
(cond
(= :keypair type)
[keypair-subtitle
{:theme theme
:blur? blur?
:keycard? keycard?}]
(= :account type)
[acocunt-subtitle
{:networks networks
:theme theme
:blur? blur?
:description description}]
(= :default-keypair type)
[default-keypair-subtitle
{:description description
:theme theme
:blur? blur?}]
(= :context-tag type)
[context-tag-subtitle
{:community-logo community-logo
:community-name community-name}]
(and (not= :label type) description)
[description-subtitle
{:theme theme
:blur? blur?
:description description}]))
(defn- right-icon
[{:keys [theme type on-button-press on-button-long-press button-disabled? button-icon]}]
(cond
(= :info type)
[icons/icon
:i/info
{:accessibility-label :info-icon
:size 20
:color (colors/theme-colors colors/neutral-50
colors/neutral-40
theme)}]
(and (= :context-tag type) button-icon)
[button/button
{:accessibility-label :button-icon
:on-press on-button-press
:on-long-press on-button-long-press
:disabled? button-disabled?
:type :primary
:size 24
:icon-only? true}
button-icon]))
(defn- left-title
[{:keys [type label title theme blur?]}]
(case type
:label [text/text
{:weight :medium
:size :paragraph-2
:style (style/description theme blur?)}
label]
[text/text
{:size :heading-2
:weight :semi-bold}
title]))
(defn- view-internal
[{:keys [title type theme description blur? community-name community-logo button-icon on-button-press
on-button-long-press
button-disabled? account-avatar-emoji customization-color icon-avatar
profile-picture keycard? networks label]}]
[rn/view {:style style/container}
[rn/view {:style style/left-container}
[left-image
{:type type
:customization-color customization-color
:account-avatar-emoji account-avatar-emoji
:icon-avatar icon-avatar
:profile-picture profile-picture}]]
[rn/view {:style style/body-container}
[left-title
{:type type
:label label
:title title
:theme theme
:blur? blur?}]
[subtitle
{:type type
:theme theme
:blur? blur?
:keycard? keycard?
:networks networks
:description description
:community-name community-name
:community-logo community-logo}]]
[right-icon
{:theme theme
:type type
:on-button-press on-button-press
:on-button-long-press on-button-long-press
:button-disabled? button-disabled?
:button-icon button-icon}]])
(def view (quo.theme/with-theme view-internal))
+7 -12
View File
@@ -3,7 +3,6 @@
[quo2.components.buttons.button.view :as button]
[quo2.components.markdown.text :as text]
[quo2.foundations.colors :as colors]
[quo2.theme :as quo.theme]
[react-native.core :as rn]
[react-native.reanimated :as reanimated]
[reagent.core :as reagent]))
@@ -11,12 +10,11 @@
(def header-height 56)
(defn header-wrapper-style
[{:keys [height border-bottom background theme]}]
[{:keys [height border-bottom background]}]
(merge
{:background-color (colors/theme-colors
colors/neutral-5
colors/neutral-95
theme)
colors/neutral-95)
:height height}
(when background
{:background-color background})
@@ -24,8 +22,7 @@
{:border-bottom-width 1
:border-bottom-color (colors/theme-colors
colors/neutral-5
colors/neutral-95
theme)})))
colors/neutral-95)})))
(def absolute-fill
{:position :absolute
@@ -132,7 +129,7 @@
:size :large}
title])])
(defn- header-internal
(defn header
[{:keys [left-width right-width]}]
(let [layout (reagent/atom {:left {:width (or left-width 8)
:height header-height}
@@ -156,7 +153,7 @@
[{:keys [left-accessories left-component border-bottom
right-accessories right-component insets get-layout
title subtitle title-component style title-align
background theme]
background]
:or {title-align :center
border-bottom false}}]
(let [status-bar-height (get insets :top 0)
@@ -164,8 +161,7 @@
[reanimated/view
{:style (header-wrapper-style {:height height
:background background
:border-bottom border-bottom
:theme theme})}
:border-bottom border-bottom})}
[rn/view
{:pointer-events :box-none
:height status-bar-height}]
@@ -196,6 +192,7 @@
:subtitle subtitle
:title-align title-align
:component title-component}]]
[rn/view
{:style right-style
:on-layout (handle-layout :right get-layout)
@@ -203,5 +200,3 @@
[header-actions
{:accessories right-accessories
:component right-component}]]]]]]))))
(def header (quo.theme/with-theme header-internal))
@@ -1,161 +0,0 @@
(ns quo2.components.inputs.address-input.component-spec
(:require [quo2.components.inputs.address-input.view :as address-input]
[test-helpers.component :as h]
[react-native.clipboard :as clipboard]
[quo2.foundations.colors :as colors]))
(def ens-regex #"^(?=.{5,255}$)([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.[a-zA-Z]{2,}$")
(h/describe "Address input"
(h/test "default render"
(with-redefs [clipboard/get-string #(% "")]
(h/render [address-input/address-input {:ens-regex ens-regex}])
(h/is-truthy (h/get-by-label-text :address-text-input))))
(h/test "on focus with blur? false"
(with-redefs [clipboard/get-string #(% "")]
(h/render [address-input/address-input {:ens-regex ens-regex}])
(h/fire-event :on-focus (h/get-by-label-text :address-text-input))
(h/has-prop (h/get-by-label-text :address-text-input) :placeholder-text-color colors/neutral-40)))
(h/test "on focus with blur? true"
(with-redefs [clipboard/get-string #(% "")]
(h/render [address-input/address-input
{:blur? true
:ens-regex ens-regex}])
(h/fire-event :on-focus (h/get-by-label-text :address-text-input))
(h/has-prop (h/get-by-label-text :address-text-input)
:placeholder-text-color
colors/neutral-80-opa-40)))
(h/test "scanned value is properly set"
(let [on-change-text (h/mock-fn)
scanned-value "scanned-value"]
(with-redefs [clipboard/get-string #(% "")]
(h/render [address-input/address-input
{:scanned-value scanned-value
:on-change-text on-change-text
:ens-regex ens-regex}])
(h/wait-for #(h/is-truthy (h/get-by-label-text :clear-button)))
(h/was-called-with on-change-text scanned-value)
(h/has-prop (h/get-by-label-text :address-text-input) :default-value scanned-value))))
(h/test "clear icon is shown when input has text"
(with-redefs [clipboard/get-string #(% "")]
(h/render [address-input/address-input
{:scanned-value "scanned value"
:ens-regex ens-regex}])
(h/wait-for #(h/is-truthy (h/get-by-label-text :clear-button-container)))
(h/wait-for #(h/is-truthy (h/get-by-label-text :clear-button)))))
(h/test "on blur with text and blur? false"
(with-redefs [clipboard/get-string #(% "")]
(h/render [address-input/address-input
{:scanned-value "scanned value"
:ens-regex ens-regex}])
(h/wait-for #(h/is-truthy (h/get-by-label-text :clear-button)))
(h/fire-event :on-focus (h/get-by-label-text :address-text-input))
(h/fire-event :on-blur (h/get-by-label-text :address-text-input))
(h/has-prop (h/get-by-label-text :address-text-input) :placeholder-text-color colors/neutral-30)))
(h/test "on blur with text blur? true"
(with-redefs [clipboard/get-string #(% "")]
(h/render [address-input/address-input
{:scanned-value "scanned value"
:blur? true
:ens-regex ens-regex}])
(h/wait-for #(h/is-truthy (h/get-by-label-text :clear-button)))
(h/fire-event :on-focus (h/get-by-label-text :address-text-input))
(h/fire-event :on-blur (h/get-by-label-text :address-text-input))
(h/has-prop (h/get-by-label-text :address-text-input)
:placeholder-text-color
colors/neutral-80-opa-20)))
(h/test "on blur with no text and blur? false"
(with-redefs [clipboard/get-string #(% "")]
(h/render [address-input/address-input {:ens-regex ens-regex}])
(h/fire-event :on-focus (h/get-by-label-text :address-text-input))
(h/fire-event :on-blur (h/get-by-label-text :address-text-input))
(h/has-prop (h/get-by-label-text :address-text-input) :placeholder-text-color colors/neutral-40)))
(h/test "on blur with no text blur? true"
(with-redefs [clipboard/get-string #(% "")]
(h/render [address-input/address-input
{:blur? true
:ens-regex ens-regex}])
(h/fire-event :on-focus (h/get-by-label-text :address-text-input))
(h/fire-event :on-blur (h/get-by-label-text :address-text-input))
(h/has-prop (h/get-by-label-text :address-text-input)
:placeholder-text-color
colors/neutral-80-opa-40)))
(h/test "on-clear is called"
(let [on-clear (h/mock-fn)]
(with-redefs [clipboard/get-string #(% "")]
(h/render [address-input/address-input
{:scanned-value "scanned value"
:on-clear on-clear
:ens-regex ens-regex}])
(h/wait-for #(h/is-truthy (h/get-by-label-text :clear-button)))
(h/fire-event :press (h/get-by-label-text :clear-button))
(h/was-called on-clear))))
(h/test "on-focus is called"
(let [on-focus (h/mock-fn)]
(with-redefs [clipboard/get-string #(% "")]
(h/render [address-input/address-input {:on-focus on-focus}])
(h/fire-event :on-focus (h/get-by-label-text :address-text-input))
(h/was-called on-focus))))
(h/test "on-blur is called"
(let [on-blur (h/mock-fn)]
(with-redefs [clipboard/get-string #(% "")]
(h/render [address-input/address-input
{:on-blur on-blur
:ens-regex ens-regex}])
(h/fire-event :on-blur (h/get-by-label-text :address-text-input))
(h/was-called on-blur))))
(h/test "on-scan is called"
(let [on-scan (h/mock-fn)]
(with-redefs [clipboard/get-string #(% "")]
(h/render [address-input/address-input {:on-scan on-scan}])
(h/wait-for #(h/is-truthy (h/get-by-label-text :scan-button)))
(h/fire-event :press (h/get-by-label-text :scan-button))
(h/was-called on-scan))))
(h/test "paste from clipboard"
(let [clipboard "clipboard"]
(with-redefs [clipboard/get-string #(% clipboard)]
(h/render [address-input/address-input {:ens-regex ens-regex}])
(h/wait-for #(h/is-truthy (h/get-by-label-text :paste-button)))
(h/fire-event :press (h/get-by-label-text :paste-button))
(h/wait-for #(h/is-truthy (h/get-by-label-text :clear-button)))
(h/has-prop (h/get-by-label-text :address-text-input) :default-value clipboard))))
(h/test "ENS loading state and call on-detect-ens"
(let [clipboard "test.eth"
on-detect-ens (h/mock-fn)]
(with-redefs [clipboard/get-string #(% clipboard)]
(h/render [address-input/address-input
{:on-detect-ens on-detect-ens
:ens-regex ens-regex}])
(h/wait-for #(h/is-truthy (h/get-by-label-text :paste-button)))
(h/fire-event :press (h/get-by-label-text :paste-button))
(h/wait-for #(h/is-falsy (h/get-by-label-text :clear-button)))
(h/wait-for #(h/is-truthy (h/get-by-label-text :loading-button-container)))
(h/was-called on-detect-ens))))
(h/test "ENS valid state and call on-detect-ens"
(let [clipboard "test.eth"
on-detect-ens (h/mock-fn)]
(with-redefs [clipboard/get-string #(% clipboard)]
(h/render [address-input/address-input
{:on-detect-ens on-detect-ens
:valid-ens? true
:ens-regex ens-regex}])
(h/wait-for #(h/is-truthy (h/get-by-label-text :paste-button)))
(h/fire-event :press (h/get-by-label-text :paste-button))
(h/wait-for #(h/is-falsy (h/get-by-label-text :clear-button)))
(h/wait-for #(h/is-truthy (h/get-by-label-text :positive-button-container)))
(h/was-called on-detect-ens)))))
@@ -1,40 +0,0 @@
(ns quo2.components.inputs.address-input.style
(:require [quo2.foundations.colors :as colors]
[quo2.components.markdown.text :as text]
[react-native.platform :as platform]))
(def container
{:padding-horizontal 20
:padding-top 8
:padding-bottom 16
:height 48
:flex-direction :row
:align-items :flex-start})
(def buttons-container
{:flex-direction :row
:align-items :center
:padding-top (when platform/android? 2)})
(def clear-icon-container
{:justify-content :center
:align-items :center
:padding-top (if platform/ios? 6 2)
:height 24
:width 20})
(defn input-text
[theme]
(assoc (text/text-style {:size :paragraph-1
:weight :monospace})
:flex 1
:color (colors/theme-colors colors/neutral-100 colors/white theme)
:margin-top (if platform/ios? 0 -4)
:margin-right 8
:height (if platform/ios? 24 40)))
(defn accessory-button
[blur? theme]
{:border-color (if blur?
(colors/theme-colors colors/neutral-80-opa-10 colors/white-opa-10 theme)
(colors/theme-colors colors/neutral-30 colors/neutral-70 theme))})
@@ -1,163 +0,0 @@
(ns quo2.components.inputs.address-input.view
(:require [react-native.core :as rn]
[react-native.clipboard :as clipboard]
[quo2.theme :as quo.theme]
[quo2.foundations.colors :as colors]
[quo2.components.icon :as icon]
[quo2.components.buttons.button.view :as button]
[quo2.components.inputs.address-input.style :as style]
[utils.i18n :as i18n]
[reagent.core :as reagent]
[react-native.platform :as platform]))
(defn- icon-color
[blur? theme]
(if blur?
(colors/theme-colors colors/neutral-80-opa-30 colors/white-opa-10 theme)
(colors/theme-colors colors/neutral-40 colors/neutral-60 theme)))
(defn- clear-button
[{:keys [on-press blur? theme]}]
[rn/touchable-opacity
{:accessibility-label :clear-button
:style style/clear-icon-container
:on-press on-press}
[icon/icon :i/clear
{:color (icon-color blur? theme)
:size 20}]])
(defn- loading-icon
[blur? theme]
[rn/view {:style style/clear-icon-container}
[icon/icon :i/loading
{:color (icon-color blur? theme)
:size 20}]])
(defn- positive-state-icon
[theme]
[rn/view {:style style/clear-icon-container}
[icon/icon :i/positive-state
{:color (colors/theme-colors (colors/custom-color :success 50)
(colors/custom-color :success 60)
theme)
:size 20}]])
(defn- get-placeholder-text-color
[status theme blur?]
(cond
(and (= status :default) blur?)
(colors/theme-colors colors/neutral-80-opa-40 colors/white-opa-30 theme)
(and (= status :default) (not blur?))
(colors/theme-colors colors/neutral-40 colors/neutral-50 theme)
(and (not= status :default) blur?)
(colors/theme-colors colors/neutral-80-opa-20 colors/white-opa-20 theme)
(and (not= status :default) (not blur?))
(colors/theme-colors colors/neutral-30 colors/neutral-60 theme)))
(defn- f-address-input-internal
[]
(let [status (reagent/atom :default)
value (reagent/atom "")
focused? (atom false)]
(fn [{:keys [scanned-value theme blur? on-change-text on-blur on-focus on-clear on-scan on-detect-ens
ens-regex
valid-ens?]}]
(let [on-change (fn [text]
(let [ens? (boolean (re-matches ens-regex text))]
(if (> (count text) 0)
(reset! status :typing)
(reset! status :active))
(reset! value text)
(when on-change-text
(on-change-text text))
(when (and ens? on-detect-ens)
(reset! status :loading)
(on-detect-ens text))))
on-paste (fn []
(clipboard/get-string
(fn [clipboard]
(when-not (empty? clipboard)
(on-change clipboard)
(reset! value clipboard)))))
on-clear (fn []
(reset! value "")
(reset! status (if @focused? :active :default))
(when on-clear
(on-clear)))
on-scan #(when on-scan
(on-scan))
on-focus (fn []
(when (= (count @value) 0)
(reset! status :active))
(reset! focused? true)
(when on-focus (on-focus)))
on-blur (fn []
(when (= @status :active)
(reset! status :default))
(reset! focused? false)
(when on-blur (on-blur)))
placeholder-text-color (get-placeholder-text-color @status theme blur?)]
(rn/use-effect (fn []
(when-not (empty? scanned-value)
(on-change scanned-value)))
[scanned-value])
[rn/view {:style style/container}
[rn/text-input
{:accessibility-label :address-text-input
:style (style/input-text theme)
:placeholder (i18n/label :t/name-ens-or-address)
:placeholder-text-color placeholder-text-color
:default-value @value
:auto-complete (when platform/ios? :none)
:auto-capitalize :none
:auto-correct false
:keyboard-appearance (quo.theme/theme-value :light :dark theme)
:on-focus on-focus
:on-blur on-blur
:on-change-text on-change}]
(when (or (= @status :default)
(= @status :active))
[rn/view
{:style style/buttons-container
:accessibility-label :paste-scan-buttons-container}
[button/button
{:accessibility-label :paste-button
:type :outline
:size 24
:container-style {:margin-right 8}
:inner-style (style/accessory-button blur? theme)
:on-press on-paste}
(i18n/label :t/paste)]
[button/button
{:accessibility-label :scan-button
:icon-only? true
:type :outline
:size 24
:inner-style (style/accessory-button blur? theme)
:on-press on-scan}
:main-icons/scan]])
(when (= @status :typing)
[rn/view
{:style style/buttons-container
:accessibility-label :clear-button-container}
[clear-button
{:on-press on-clear
:blur? blur?
:theme theme}]])
(when (and (= @status :loading) (not valid-ens?))
[rn/view
{:style style/buttons-container
:accessibility-label :loading-button-container}
[loading-icon blur? theme]])
(when (and (= @status :loading) valid-ens?)
[rn/view
{:style style/buttons-container
:accessibility-label :positive-button-container}
[positive-state-icon theme]])]))))
(defn address-input-internal
[props]
[:f> f-address-input-internal props])
(def address-input
(quo.theme/with-theme address-input-internal))
@@ -25,7 +25,7 @@
(colors/alpha (if blur?
(colors/theme-colors colors/neutral-100 colors/white theme)
(colors/custom-color customization-color
(if (= :dark theme) 60 50)))
(if (or (= :dark theme) colors/dark?) 60 50)))
(if platform/ios? 1 0.2)))
(def text-input-container {:flex 1})
+8 -12
View File
@@ -5,7 +5,7 @@
(def keycard-chip-height 28)
(defn card-container
[locked? theme]
[locked?]
{:overflow :hidden
:height keycard-height
:align-items :flex-start
@@ -13,26 +13,22 @@
:border-width 1
:border-color (if locked?
colors/white-opa-5
(colors/theme-colors colors/neutral-20 colors/neutral-80 theme))
(colors/theme-colors colors/neutral-20 colors/neutral-80))
:border-style :solid
:border-radius 16
:padding 16
:background-color (if locked?
(colors/theme-colors colors/danger colors/danger-opa-40 theme)
(colors/theme-colors colors/neutral-5 colors/neutral-90 theme))})
(colors/theme-colors colors/danger colors/danger-opa-40)
(colors/theme-colors colors/neutral-5 colors/neutral-90))})
(defn keycard-logo
[locked? theme]
{:tint-color (if locked?
colors/white
(colors/theme-colors colors/neutral-100 colors/white theme))})
[locked?]
{:tint-color (if locked? colors/white (colors/theme-colors colors/neutral-100 colors/white))})
(defn keycard-watermark
[locked? theme]
[locked?]
{:position :absolute
:tint-color (if locked?
colors/white-opa-5
(colors/theme-colors colors/neutral-100 colors/white theme))
:tint-color (if locked? colors/white-opa-5 (colors/theme-colors colors/neutral-100 colors/white))
:align-self :center
:height 280.48
:transform [{:rotate "-30deg"} {:translateY -30}]
+7 -11
View File
@@ -4,30 +4,28 @@
[quo2.components.tags.tag :as tag]
[quo2.foundations.colors :as colors]
[quo2.foundations.resources :as resources]
[utils.i18n :as i18n]
[quo2.theme :as quo.theme]))
[utils.i18n :as i18n]))
(defn- view-internal
(defn keycard
"This component based on the following properties:
- :holder-name - Can be owner's name. Default is Empty
- :locked? - Boolean to specify whether the keycard is locked or not
- :theme :light/:dark
"
[{:keys [holder-name locked? theme]}]
[{:keys [holder-name locked?]}]
(let [label (if (boolean holder-name)
(i18n/label :t/user-keycard {:name holder-name})
(i18n/label :t/empty-keycard))]
[rn/view {:style (style/card-container locked? theme)}
[rn/view {:style (style/card-container locked?)}
[rn/image
{:source (resources/get-image :keycard-logo)
:style (style/keycard-logo locked? theme)}]
:style (style/keycard-logo locked?)}]
[rn/image
{:source (resources/get-image
(if (or locked? (= :dark theme)) :keycard-chip-dark :keycard-chip-light))
(if (or locked? (colors/dark?)) :keycard-chip-dark :keycard-chip-light))
:style style/keycard-chip}]
[rn/image
{:source (resources/get-image :keycard-watermark)
:style (style/keycard-watermark locked? theme)}]
:style (style/keycard-watermark locked?)}]
[tag/tag
{:size 32
:type (when locked? :icon)
@@ -38,5 +36,3 @@
:accessibility-label :holder-name
:icon-color colors/white-70-blur
:override-theme (when locked? :dark)}]]))
(def keycard (quo.theme/with-theme view-internal))
@@ -2,23 +2,19 @@
(:require [quo2.foundations.colors :as colors]))
(defn container
[{:keys [state blur? theme]}]
[state theme]
(let [light-bg (if (= state :default) colors/neutral-2_5 colors/neutral-5)
dark-bg (if (= state :default) colors/neutral-80-opa-40 colors/neutral-80-opa-60)
blur-bg (if (= state :default) colors/white-opa-5 colors/white-opa-10)
light-border (if (= state :default) colors/neutral-10 colors/neutral-20)
dark-border (if (= state :default) colors/neutral-80 colors/neutral-70)]
{:height 48
{:width 319
:height 48
:border-radius 12
:background-color (if blur? blur-bg (colors/theme-colors light-bg dark-bg theme))
:border-width (if blur? 0 1)
:background-color (colors/theme-colors light-bg dark-bg theme)
:border-width 1
:border-color (colors/theme-colors light-border dark-border theme)
:flex-direction :row
:align-items :center
:padding-horizontal 8
:padding-vertical 6
:justify-content :space-between}))
(def left-container
{:flex-direction :row
:align-items :center})
@@ -6,45 +6,37 @@
[quo2.foundations.colors :as colors]
[quo2.theme :as quo.theme]
[react-native.core :as rn]
[quo2.components.list-items.account-list-card.style :as style]
[reagent.core :as reagent]))
[quo2.components.list-items.account-list-card.style :as style]))
(defn- internal-view
[]
(let [state (reagent/atom :default)]
(fn [{:keys [action blur? account-props networks on-press on-options-press theme]}]
[rn/pressable
{:style (style/container {:state @state :blur? blur? :theme theme})
:on-press-in #(reset! state :pressed)
:on-press-out #(reset! state :default)
:on-press on-press
:accessibility-label :container}
[rn/view {:style style/left-container}
[account-avatar/view account-props]
[rn/view {:style {:margin-left 8}}
[text/text
{:weight :semi-bold
:size :paragraph-2}
(:name account-props)]
[text/text {:size :paragraph-2}
(map (fn [network]
^{:key (str network)}
[text/text
{:size :paragraph-2
:style {:color (get colors/networks network)}} (str (subs (name network) 0 3) ":")])
networks)
[text/text
{:size :paragraph-2
:style {:color (if blur?
colors/white-opa-40
(colors/theme-colors colors/neutral-50 colors/neutral-40 theme))}}
(:address account-props)]]]]
(when (= action :icon)
[rn/pressable {:on-press on-options-press}
[icon/icon :i/options
{:color (if blur?
colors/white-opa-70
(colors/theme-colors colors/neutral-50 colors/neutral-40 theme))
:accessibility-label :icon}]])])))
[{:keys [theme account-props networks state action on-press]}]
[rn/view
{:style (style/container state theme)
:accessibility-label :container}
[rn/view
{:style {:flex-direction :row
:align-items :center}}
[account-avatar/view account-props]
[rn/view {:style {:margin-left 8}}
[text/text
{:weight :semi-bold
:size :paragraph-2}
(:name account-props)]
[text/text {:size :paragraph-2}
(map (fn [network]
^{:key (str network)}
[text/text
{:size :paragraph-2
:style {:color (get colors/networks network)}} (str (subs (name network) 0 3) ":")])
networks)
[text/text
{:size :paragraph-2
:style {:color (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)}}
(:address account-props)]]]]
(when (= action :icon)
[rn/pressable {:on-press on-press}
[icon/icon :i/options
{:color (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)
:accessibility-label :icon}]])])
(def view (quo.theme/with-theme internal-view))
+8 -12
View File
@@ -3,8 +3,7 @@
[react-native.core :as rn]
[react-native.masked-view :as masked-view]
[react-native.reanimated :as reanimated]
[reagent.core :as reagent]
[quo2.theme :as quo.theme]))
[reagent.core :as reagent]))
(def message-skeleton-height 54)
@@ -23,10 +22,10 @@
;; Standlone message skeleton
(defn- f-message-skeleton
{:deprecated "quo2.components.loaders.skeleton-list.view should be used instead"}
[{:keys [theme]}]
[]
(let [color (colors/theme-colors colors/neutral-5 colors/neutral-70 theme)
loading-color (colors/theme-colors colors/neutral-10 colors/neutral-60 theme)
(let [color (colors/theme-colors colors/neutral-5 colors/neutral-70)
loading-color (colors/theme-colors colors/neutral-10 colors/neutral-60)
content-width (rand-nth message-content-width)
author-width (content-width :author)
message-width (content-width :message)
@@ -77,17 +76,14 @@
:end {:x 1 :y 0}
:style animated-gradient-style}]]]))
(defn- view-internal
[{:keys [parent-height theme]}]
(defn skeleton
[parent-height]
(let [number-of-skeletons (int (Math/floor (/ parent-height message-skeleton-height)))]
[rn/view
{:style {:background-color (colors/theme-colors
colors/white
colors/neutral-90
theme)
colors/neutral-90)
:flex 1}}
(doall
(for [n (range number-of-skeletons)]
[:f> f-message-skeleton {:key n :theme theme}]))]))
(def view (quo.theme/with-theme view-internal))
[:f> f-message-skeleton {:key n}]))]))
@@ -34,8 +34,8 @@
:color color})}])]])
(defn- f-animated-skeleton-view
[{:keys [style color skeleton-height animated? translate-x window-width theme] :as data}]
(let [loading-color (colors/theme-colors colors/neutral-10 colors/neutral-60 theme)]
[{:keys [style color skeleton-height animated? translate-x window-width] :as data}]
(let [loading-color (colors/theme-colors colors/neutral-10 colors/neutral-60)]
(rn/use-effect
(fn []
@@ -73,9 +73,10 @@
:height "100%"})
skeleton-height (get-in constants/layout-dimensions [content :height])
number-of-skeletons (int (Math/ceil (/ parent-height skeleton-height)))
color (if (and blur? (= theme :dark))
colors/white-opa-5
(colors/theme-colors colors/neutral-5 colors/neutral-90 theme))
color (cond
(and blur? (= theme :dark)) colors/white-opa-5
(= theme :dark) colors/neutral-90
:else colors/neutral-5)
component (if animated? animated-skeleton-view static-skeleton-view)]
[rn/view
{:style {:padding 8}
@@ -56,9 +56,7 @@
(cond
;; TODO: use account-switcher when available (issue #16456)
(and support-account-switcher? (= content :account-switcher))
[rn/pressable
{:style style/account-switcher-placeholder
:on-press #(js/alert "Not implemented yet")}]
[rn/view {:style style/account-switcher-placeholder}]
(coll? content)
(into [rn/view {:style style/right-actions-container}]
@@ -1,10 +1,8 @@
(ns quo2.components.profile.showcase-nav.style
(:require [quo2.foundations.colors :as colors]))
(def height 56)
(def root-container
{:height height})
{:height 56})
(defn container
[state theme]
@@ -5,7 +5,7 @@
[react-native.core :as rn]))
(defn- render-button
[{:keys [icon id]} index _ {:keys [state on-press active-id]}]
[{:keys [icon id]} _ _ {:keys [state on-press active-id]}]
(let [active? (= id active-id)
button-type (if active? :grey :ghost)
scroll-state? (= state :scroll)]
@@ -17,21 +17,21 @@
:icon-only? true
:on-press (fn []
(when on-press
(on-press id index)))
(on-press id)))
:container-style style/button-container}
icon]))
(defn- view-internal
[{:keys [theme container-style default-active state data on-press active-id]}]
[rn/view
{:style (merge style/root-container container-style)
{:style style/root-container
:accessibility-label :showcase-nav}
[rn/flat-list
{:data data
:key-fn :id
:key-fn str
:horizontal true
:shows-horizontal-scroll-indicator false
:content-container-style (style/container state theme)
:content-container-style (merge (style/container state theme) container-style)
:render-fn render-button
:render-data {:state state
:on-press on-press
+13 -14
View File
@@ -12,32 +12,31 @@
[rn/touchable-opacity
{:on-press on-press
:accessibility-label :emoji-reaction-add
:style (style/add-reaction theme)}
:style (style/add-reaction)}
[icons/icon :i/add-reaction
{:size 20
:color (colors/theme-colors colors/neutral-50
colors/neutral-40
theme)}]])
:color (colors/theme-colors colors/neutral-50 colors/white theme)}]])
(def add-reaction (theme/with-theme add-reaction-internal))
(defn reaction-internal
(defn reaction
"Add your emoji as a param here"
[{:keys [emoji clicks neutral? on-press accessibility-label on-long-press theme]}]
[{:keys [emoji clicks neutral? on-press accessibility-label on-long-press]}]
(let [numeric-value (int clicks)]
[rn/touchable-opacity
{:on-press on-press
:on-long-press on-long-press
:accessibility-label accessibility-label
:style (style/reaction neutral? theme)}
:style (style/reaction neutral?)}
[rn/image
{:style {:width 16 :height 16}
:accessibility-label :emoji
:source (resource/get-reaction emoji)}]
[text/text
{:size :paragraph-2
:weight :semi-bold
:style style/reaction-count}
(str (if (pos? numeric-value) numeric-value 1))]]))
{:size :paragraph-2
:weight :semi-bold
:flex-direction :row
:align-items :center
:justify-content :center}
(when (pos? numeric-value)
(str " " numeric-value))]]))
(def reaction (theme/with-theme reaction-internal))
(def add-reaction (theme/with-theme add-reaction-internal))
+17 -16
View File
@@ -10,24 +10,25 @@
:height 24})
(defn add-reaction
[theme]
[]
(merge reaction-styling
{:padding-horizontal 8
{:padding-horizontal 9
:border-width 1
:border-color (colors/theme-colors colors/neutral-20
colors/neutral-70
theme)}))
:border-color (colors/theme-colors colors/neutral-30 colors/neutral-70)}))
(defn reaction
[neutral? theme]
[neutral?]
(merge reaction-styling
{:border-color (colors/theme-colors colors/neutral-20
colors/neutral-80
theme)
:border-width 1
:background-color (if neutral?
(colors/theme-colors colors/neutral-10
colors/neutral-80-opa-40)
:transparent)}))
(def reaction-count {:margin-left 4})
(cond->
{:background-color (colors/theme-colors (if neutral?
colors/neutral-30
:transparent)
(if neutral?
colors/neutral-70
:transparent))}
(and (colors/dark?) (not neutral?))
(assoc :border-color colors/neutral-70
:border-width 1)
(and (not (colors/dark?)) (not neutral?))
(assoc :border-color colors/neutral-30
:border-width 1))))
@@ -28,9 +28,9 @@
[reanimated/view {:style (style/animated-circle scale opacity color)}]))))))
(defn f-record-button-big
[{:keys [recording? ready-to-send? ready-to-lock? ready-to-delete? record-button-is-animating?
record-button-at-initial-position? locked? reviewing-audio? recording-length-ms
clear-timeout touch-active? recorder-ref reload-recorder-fn idle? on-send on-cancel theme]}]
[recording? ready-to-send? ready-to-lock? ready-to-delete? record-button-is-animating?
record-button-at-initial-position? locked? reviewing-audio? recording-length-ms
clear-timeout touch-active? recorder-ref reload-recorder-fn idle? on-send on-cancel]
(let [scale (reanimated/use-shared-value 1)
opacity (reanimated/use-shared-value 0)
opacity-from (if @ready-to-lock? opacity-from-lock opacity-from-default)
@@ -46,14 +46,13 @@
(range 0 5))
rings-color (cond
@ready-to-lock? (colors/theme-colors colors/neutral-80-opa-5-opaque
colors/neutral-80
theme)
colors/neutral-80)
@ready-to-delete? colors/danger-50
:else colors/primary-50)
translate-y (reanimated/use-shared-value 0)
translate-x (reanimated/use-shared-value 0)
button-color colors/primary-50
icon-color (if (and (not (= :dark theme)) @ready-to-lock?) colors/black colors/white)
icon-color (if (and (not (colors/dark?)) @ready-to-lock?) colors/black colors/white)
icon-opacity (reanimated/use-shared-value 1)
red-overlay-opacity (reanimated/use-shared-value 0)
gray-overlay-opacity (reanimated/use-shared-value 0)
@@ -17,8 +17,7 @@
[quo2.components.record-audio.record-audio.buttons.record-button :as record-button]
[clojure.string :as string]
[utils.datetime :as datetime]
[react-native.platform :as platform]
[quo2.theme :as quo.theme]))
[react-native.platform :as platform]))
(def ^:private min-audio-duration-ms 1000)
(def ^:private max-audio-duration-ms (if platform/ios? 120800 120500))
@@ -156,11 +155,11 @@
(if @playing-audio? :i/pause :i/play)
{:color (colors/theme-colors colors/neutral-100 colors/white)}]]))
(defn- record-audio-internal
(defn record-audio
[{:keys [on-init on-start-recording on-send on-cancel on-reviewing-audio
record-audio-permission-granted
on-request-record-audio-permission on-check-audio-permissions
audio-file on-lock max-duration-ms theme]}]
audio-file on-lock max-duration-ms]}]
[:f>
;; TODO we need to refactor this, and use :f> with defined function, currenly state is reseted each
;; time parent component
@@ -575,23 +574,20 @@
[:f> send-button/f-send-button recording? ready-to-send? reviewing-audio?
@force-show-controls?]
[:f> record-button-big/f-record-button-big
{:recording? recording?
:ready-to-send? ready-to-send?
:ready-to-lock? ready-to-lock?
:ready-to-delete? ready-to-delete?
:record-button-is-animating? record-button-is-animating?
:record-button-at-initial-position? record-button-at-initial-position?
:locked? locked?
:reviewing-audio? reviewing-audio?
:recording-length-ms recording-length-ms
:clear-timeout clear-timeout
:touch-active? touch-active?
:recorder-ref recorder-ref
:reload-recorder-fn reload-recorder
:idle? idle?
:on-send on-send
:on-cancel on-cancel
:theme theme}]
recording?
ready-to-send?
ready-to-lock?
ready-to-delete?
record-button-is-animating?
record-button-at-initial-position?
locked?
reviewing-audio?
recording-length-ms
clear-timeout
touch-active?
recorder-ref
reload-recorder
idle?
on-send
on-cancel]
[:f> record-button/f-record-button recording? reviewing-audio?]]])))])
(def record-audio (quo.theme/with-theme record-audio-internal))
@@ -4,16 +4,14 @@
[react-native.audio-toolkit :as audio]
[taoensso.timbre :as log]
[react-native.platform :as platform]
[react-native.slider :as slider]
[quo2.theme :as quo.theme]))
[react-native.slider :as slider]))
(def ^:private thumb-light (js/require "../resources/images/icons2/12x12/thumb-light.png"))
(def ^:private thumb-dark (js/require "../resources/images/icons2/12x12/thumb-dark.png"))
(defn f-soundtrack
[{:keys [audio-current-time-ms player-ref style seeking-audio? max-audio-duration-ms]}]
(let [audio-duration-ms (min max-audio-duration-ms (audio/get-player-duration player-ref))
theme (quo.theme/use-theme-value)]
(let [audio-duration-ms (min max-audio-duration-ms (audio/get-player-duration player-ref))]
[:<>
[slider/slider
{:test-ID "soundtrack"
@@ -33,9 +31,8 @@
#(log/error "[record-audio] on seek - error: " %)))
:on-value-change #(when @seeking-audio?
(reset! audio-current-time-ms %))
:thumb-image (quo.theme/theme-value thumb-light thumb-dark theme)
:minimum-track-tint-color (colors/theme-colors colors/primary-50 colors/primary-60 theme)
:thumb-image (if (colors/dark?) thumb-dark thumb-light)
:minimum-track-tint-color (colors/theme-colors colors/primary-50 colors/primary-60)
:maximum-track-tint-color (colors/theme-colors
(if platform/ios? colors/neutral-20 colors/neutral-40)
(if platform/ios? colors/neutral-80 colors/neutral-60)
theme)}]]))
(if platform/ios? colors/neutral-80 colors/neutral-60))}]]))
@@ -1,30 +1,29 @@
(ns quo2.components.settings.privacy-option.view
(ns quo2.components.settings.privacy-option
(:require [quo2.components.icon :as icons]
[quo2.components.markdown.text :as text]
[quo2.components.selectors.selectors.view :as selectors]
[quo2.components.settings.privacy-option.style :as style]
[quo2.components.settings.style :as style]
[quo2.foundations.colors :as colors]
[react-native.core :as rn]
[quo2.theme :as quo.theme]))
[react-native.core :as rn]))
(defn- bullet
[theme]
[]
[rn/view {:style style/bullet-container}
[rn/view {:style (style/bullet theme)}]])
[rn/view {:style (style/bullet)}]])
(defn- unordered-list
[{:keys [container-style theme]} list-items]
[container-style list-items]
[rn/view {:style (merge style/list-container container-style)}
(for [item list-items]
^{:key (hash item)}
[rn/view {:style style/list-item}
[bullet theme]
[bullet]
[text/text {:size :paragraph-2} item]])])
(defn- card-footer
[{:keys [active? label on-toggle theme]}]
[{:keys [active? label on-toggle]}]
[rn/touchable-without-feedback
[rn/view {:style (style/card-footer theme)}
[rn/view {:style (style/card-footer)}
[rn/view {:style style/card-footer-label-container}
[text/text {:size :paragraph-2} label]]
[rn/view {:style style/card-footer-toggle-container}
@@ -33,42 +32,36 @@
:on-change on-toggle}]]]])
(defn- selection-indicator
[active? theme]
[rn/view {:style (style/selection-indicator-container active? theme)}
[rn/view {:style (style/selection-indicator active? theme)}]])
[active?]
[rn/view {:style (style/selection-indicator-container active?)}
[rn/view {:style (style/selection-indicator active?)}]])
(defn- card-header
[{:keys [icon label active? theme]}]
[{:keys [icon label active?]}]
[rn/view {:style style/card-header-container}
[icons/icon icon
{:size 20
:color (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)}]
:color (colors/theme-colors colors/neutral-50 colors/neutral-40)}]
[rn/view {:style style/card-header-label-container}
[text/text {:weight :semi-bold} label]]
[selection-indicator active?]])
(defn- view-internal
[{:keys [active? header footer list-items icon on-select on-toggle theme]
(defn card
[{:keys [active? header footer list-items icon on-select on-toggle]
:or {icon :i/world
active? false}}]
[rn/touchable-without-feedback
{:on-press on-select
:accessibility-label :privacy-option-card
:testID :privacy-option-card}
[rn/view (style/privacy-option-card active? theme)
[rn/view (style/privacy-option-card active?)
[card-header
{:theme theme
:active? active?
{:active? active?
:icon icon
:label header}]
[unordered-list
{:theme theme
:container-style (when-not footer {:margin-bottom 8})} list-items]
[unordered-list (when-not footer {:margin-bottom 8}) list-items]
(when footer
[card-footer
{:theme theme
:active? active?
{:active? active?
:label footer
:on-toggle on-toggle}])]])
(def view (quo.theme/with-theme view-internal))
@@ -8,14 +8,12 @@
(if tag 72 icon-height)))
(defn container
[{:keys [in-card? tag container-style]}]
(merge {:padding-horizontal 12
:padding-top (if in-card? 12 13)
:padding-bottom (if in-card? 12 13)
:flex-direction :row
:justify-content :space-between
:height (if tag 96 48)}
container-style))
[{:keys [in-card? tag]}]
{:padding-horizontal 12
:padding-vertical (if in-card? 12 13)
:flex-direction :row
:justify-content :space-between
:height (if tag 96 48)})
(def sub-container
{:flex-direction :row
@@ -62,8 +62,7 @@
(case tag
:positive [status-tags/status-tag
{:status {:type :positive}
:label (:label tag-props)
:no-icon? true
:label (i18n/label :t/positive)
:size :small
:container-style {:margin-top 8}}]
:context [context-tag/view
@@ -1,4 +1,4 @@
(ns quo2.components.settings.privacy-option.style
(ns quo2.components.settings.style
(:require [quo2.foundations.colors :as colors]))
(def bullet-container
@@ -8,8 +8,8 @@
:align-self :flex-start})
(defn bullet
[theme]
{:background-color (colors/theme-colors colors/neutral-40 colors/neutral-50 theme)
[]
{:background-color (colors/theme-colors colors/neutral-40 colors/neutral-50)
:border-radius 100
:width 8
:height 8
@@ -28,23 +28,23 @@
:padding-horizontal 12})
(defn selection-indicator-container
[active? theme]
[active?]
{:height 20
:width 20
:border-radius 20
:border-width 1
:border-color (if active?
(colors/theme-colors colors/primary-50 colors/primary-60 theme)
(colors/theme-colors colors/neutral-20 colors/neutral-80 theme))})
(colors/theme-colors colors/primary-50 colors/primary-60)
(colors/theme-colors colors/neutral-20 colors/neutral-80))})
(defn selection-indicator
[active? theme]
[active?]
{:margin-left :auto
:height 14
:width 14
:background-color (if active?
(colors/theme-colors colors/primary-50 colors/primary-60 theme)
(colors/theme-colors colors/white-opa-40 colors/neutral-80-opa-40 theme))
(colors/theme-colors colors/primary-50 colors/primary-60)
(colors/theme-colors colors/white-opa-40 colors/neutral-80-opa-40))
:border-radius 20
:margin-right :auto
:margin-top :auto
@@ -60,7 +60,7 @@
:align-self :center})
(defn card-footer
[theme]
[]
{:flex 1
:flex-direction :row
:justify-content :space-between
@@ -70,8 +70,8 @@
:padding-vertical 12
:border-radius 12
:border-width 1
:background-color (colors/theme-colors colors/neutral-5 colors/neutral-90 theme)
:border-color (colors/theme-colors colors/neutral-10 colors/neutral-80 theme)})
:background-color (colors/theme-colors colors/neutral-5 colors/neutral-90)
:border-color (colors/theme-colors colors/neutral-10 colors/neutral-80)})
(def card-header-container
{:flex-direction :row
@@ -85,9 +85,9 @@
:margin-left 4})
(defn privacy-option-card
[active? theme]
[active?]
{:border-radius 16
:border-width 1
:border-color (if active?
(colors/theme-colors colors/primary-50 colors/primary-60 theme)
(colors/theme-colors colors/neutral-10 colors/neutral-80 theme))})
(colors/theme-colors colors/primary-50 colors/primary-60)
(colors/theme-colors colors/neutral-10 colors/neutral-80))})
+1 -1
View File
@@ -26,7 +26,7 @@
[theme :background-color])
:border-radius (case size
32 10
28 10
28 8
24 8
20 6)
:padding 2}
+27 -27
View File
@@ -70,7 +70,8 @@
on-change
scroll-on-press?
size
style]}]
style
]}]
[rn/view
{:style (style/tab {:size size
:default-tab-size default-tab-size
@@ -131,7 +132,6 @@
scroll-on-press?
scrollable?
style
container-style
size
blur?
in-scroll-view?
@@ -159,36 +159,35 @@
:size)
(when scroll-on-press?
{:initial-scroll-index (utils.collection/first-index #(= @active-tab-id (:id %)) data)})
{:ref #(reset! flat-list-ref %)
:style style
{:ref #(reset! flat-list-ref %)
:style style
;; The padding-top workaround is needed because on Android
;; {:overflow :visible} doesn't work on components inheriting
;; from ScrollView (e.g. FlatList). There are open issues, here's
;; just one about this topic:
;; https://github.com/facebook/react-native/issues/31218
:content-container-style
(assoc container-style :padding-top (dec unread-count-offset))
:horizontal true
:scroll-event-throttle 64
:content-container-style {:padding-top (dec unread-count-offset)}
:horizontal true
:scroll-event-throttle 64
:shows-horizontal-scroll-indicator false
:data data
:key-fn (comp str :id)
:on-scroll-to-index-failed identity
:on-scroll (partial on-scroll-handler
{:fade-end-percentage fade-end-percentage
:fade-end? fade-end?
:fading fading
:on-scroll on-scroll})
:render-fn tab-view
:render-data {:active-tab-id active-tab-id
:blur? blur?
:customization-color customization-color
:flat-list-ref flat-list-ref
:number-of-items (count data)
:on-change on-change
:scroll-on-press? scroll-on-press?
:size size
:style style}})]]]
:data data
:key-fn (comp str :id)
:on-scroll-to-index-failed identity
:on-scroll (partial on-scroll-handler
{:fade-end-percentage fade-end-percentage
:fade-end? fade-end?
:fading fading
:on-scroll on-scroll})
:render-fn tab-view
:render-data {:active-tab-id active-tab-id
:blur? blur?
:customization-color customization-color
:flat-list-ref flat-list-ref
:number-of-items (count data)
:on-change on-change
:scroll-on-press? scroll-on-press?
:size size
:style style}})]]]
[rn/view (merge style {:flex-direction :row})
(map-indexed (fn [index item]
^{:key (:id item)}
@@ -199,5 +198,6 @@
:number-of-items (count data)
:on-change on-change
:size size
:style style}])
:style style}
])
data)]))))
@@ -79,14 +79,13 @@
state :default}
:as props}]
[rn/view
{:style (merge (style/container {:theme theme
:type type
:size size
:state state
:blur? blur?
:customization-color customization-color})
container-style)
:accessibility-label :context-tag}
{:style (merge (style/container {:theme theme
:type type
:size size
:state state
:blur? blur?
:customization-color customization-color})
container-style)}
(case type
:default
[tag-skeleton {:theme theme :size size :text full-name}
+1 -1
View File
@@ -67,7 +67,7 @@
[rn/view {:style {:margin-left 4}}
[icon/icon :i/keycard-card
{:size 16
:color (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)}]])])
:color (colors/theme-colors colors/neutral-50 colors/neutral-40)}]])])
(defn- view-internal
[]
@@ -13,9 +13,9 @@
:opacity (when (= state :disabled) 0.3)})
(defn add-container
[theme]
[]
{:border-style :dashed
:border-color (colors/theme-colors colors/neutral-30 colors/neutral-70 theme)
:border-color (colors/theme-colors colors/neutral-30 colors/neutral-70)
:justify-content :center
:align-items :center
:padding-vertical 0
@@ -11,8 +11,8 @@
(defn network-bridge-add
[{:keys [network state theme]}]
[rn/view {:style (merge (style/container network state) (style/add-container theme))}
[{:keys [network state]}]
[rn/view {:style (merge (style/container network state) (style/add-container))}
[icon/icon :i/add-circle {:size 12 :no-color true}]])
(defn view-internal
@@ -1,32 +0,0 @@
(ns quo2.components.wallet.transaction-summary.component-spec
(:require [quo2.components.wallet.transaction-summary.view :as transaction-summary]
[test-helpers.component :as h]))
(h/describe "Transaction summary"
(h/test "default render"
(h/render [transaction-summary/view {}])
(h/is-truthy (h/query-by-label-text :transaction-summary)))
(h/test "incorrect setting doesn't crash render"
(h/render [transaction-summary/view {:transaction :unknown}])
(h/is-truthy (h/query-by-label-text :transaction-summary)))
(h/test "icon displayed"
(h/render [transaction-summary/view {:transaction :send}])
(h/is-truthy (h/query-by-label-text :header-icon)))
(h/test "Context tag rendered"
(h/render [transaction-summary/view
{:transaction :send
:first-tag {:size 24
:type :token
:token-name "SNT"
:amount 1500}}])
(h/is-truthy (h/query-by-label-text :context-tag))))
@@ -1,70 +0,0 @@
(ns quo2.components.wallet.transaction-summary.style
(:require [quo2.foundations.colors :as colors]))
(defn container
[theme]
{:border-radius 16
:padding-top 9
:padding-bottom 8
:border-color (colors/theme-colors colors/neutral-10 colors/neutral-80 theme)
:border-width 1})
(def transaction-header-container
{:flex-direction :row
:align-items :center
:margin-bottom 9
:padding-horizontal 12})
(defn transaction-header
[theme]
{:color (colors/theme-colors colors/neutral-100 colors/white theme)
:margin-left 4})
(defn prop-text
[theme]
{:margin-right 4
:color (colors/theme-colors colors/neutral-100 colors/white theme)})
(def prop-tag
{:margin-right 4})
(def icon-container
{:width 20
:height 20
:align-items :center
:justify-content :center})
(def content
{:margin-bottom 8
:padding-horizontal 12})
(def content-line
{:flex-direction :row
:margin-top 4
:align-items :center})
(defn icon-color
[theme]
(colors/theme-colors colors/neutral-50 colors/neutral-40 theme))
(defn divider
[theme]
{:height 1
:margin-vertical 4
:background-color (colors/theme-colors colors/neutral-10 colors/neutral-80 theme)})
(defn extra-info-header
[theme]
{:color (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)})
(defn extra-info-content
[theme]
{:color (colors/theme-colors colors/neutral-100 colors/white theme)})
(def extra-info-container
{:margin-horizontal 12})
(def extras-container
{:flex-direction :row
:justify-content :space-between
:margin-top 4})
@@ -1,123 +0,0 @@
(ns quo2.components.wallet.transaction-summary.view
(:require [quo2.theme :as quo.theme]
[quo2.components.wallet.transaction-summary.style :as style]
[react-native.core :as rn]
[quo2.components.markdown.text :as text]
[quo2.components.icon :as icon]
[quo2.components.tags.context-tag.view :as context-tag]
[utils.i18n :as i18n]))
(def transaction-translation
{:send (i18n/label :t/send)
:swap (i18n/label :t/swap)
:bridge (i18n/label :t/bridge)})
(def transaction-icon
{:send :i/send
:swap :i/swap
:bridge :i/bridge})
(defn transaction-header
[{:keys [transaction
theme]
:or {transaction :send}}]
(let [icon (transaction-icon transaction)
translation (transaction transaction-translation)]
[rn/view
{:style style/transaction-header-container}
[rn/view {:style style/icon-container}
(when icon
[icon/icon icon
{:color (style/icon-color theme)
:accessibility-label :header-icon}])]
(when translation
[text/text
{:weight :semi-bold
:size :paragraph-1
:style (style/transaction-header theme)}
translation])]))
(defn prop-text
[label theme]
[text/text
{:weight :regular
:size :paragraph-2
:style (style/prop-text theme)}
(i18n/label label)])
(defn prop-tag
[props]
[rn/view {:style style/prop-tag}
[context-tag/view (assoc props :size 24)]])
(defn extra-info
[{:keys [header content theme]}]
[rn/view {:style style/extra-info-container}
[text/text
{:weight :regular
:size :paragraph-2
:style (style/extra-info-header theme)}
header]
[text/text
{:weight :medium
:size :paragraph-2
:style (style/extra-info-content theme)}
content]])
(defn- view-internal
[{:keys [theme first-tag second-tag third-tag fourth-tag second-tag-prefix
third-tag-prefix fourth-tag-prefix fifth-tag max-fees
nonce input-data]
:as props}]
[rn/view
{:style (style/container theme)
:accessibility-label :transaction-summary}
[transaction-header props]
[rn/view {:style style/content}
[rn/view {:style style/content-line}
(when first-tag [prop-tag first-tag])
(when second-tag-prefix [prop-text second-tag-prefix theme])
(when second-tag [prop-tag second-tag])]
[rn/view {:style style/content-line}
(when third-tag-prefix [prop-text third-tag-prefix theme])
(when third-tag [prop-tag third-tag])
(when fourth-tag-prefix [prop-text fourth-tag-prefix theme])
(when fourth-tag [prop-tag fourth-tag])
(when fifth-tag [prop-tag fifth-tag])]]
[rn/view {:style (style/divider theme)}]
[rn/view {:style style/extras-container}
[extra-info
{:header (i18n/label :t/max-fees)
:content max-fees
:theme theme}]
[extra-info
{:header (i18n/label :t/nonce)
:content nonce
:theme theme}]
[extra-info
{:header (i18n/label :t/input-data)
:content input-data
:theme theme}]]])
(def view
"Properties:
- :transaction - type of transaction`. Possible values:
- :send
- :swap
- :bridge
- :first-tag - props for context tag component that will be first on the first line
- :second-tag - props for context tag component that will be second on the first line
- :third-tag - props for context tag component that will be first on the second line
- :fourth-tag - props for context tag component that will be second on the second line
- :fifth-tag - props for context tag component that will be second on the second line
- :second-tag-prefix - translation keyword to be used with label before second context tag
- :third-tag-prefix - translation keyword to be used with label before third context tag
- :fourth-tag-prefix - translation keyword to be used with label before fourth context tag
- :max-fees - string
- :nonce - digit
- :input data - string
"
(quo.theme/with-theme view-internal))
+2 -8
View File
@@ -40,7 +40,6 @@
quo2.components.drawers.action-drawers.view
quo2.components.drawers.documentation-drawers.view
quo2.components.drawers.drawer-buttons.view
quo2.components.drawers.drawer-top.view
quo2.components.drawers.permission-context.view
quo2.components.dropdowns.dropdown
quo2.components.dropdowns.network-dropdown.view
@@ -52,7 +51,6 @@
quo2.components.info.info-message
quo2.components.info.information-box.view
quo2.components.inputs.input.view
quo2.components.inputs.address-input.view
quo2.components.inputs.locked-input.view
quo2.components.inputs.profile-input.view
quo2.components.inputs.recovery-phrase.view
@@ -100,7 +98,7 @@
quo2.components.selectors.selectors.view
quo2.components.settings.accounts.view
quo2.components.settings.data-item.view
quo2.components.settings.privacy-option.view
quo2.components.settings.privacy-option
quo2.components.settings.reorder-item.view
quo2.components.settings.settings-item.view
quo2.components.settings.category.view
@@ -128,7 +126,6 @@
quo2.components.wallet.progress-bar.view
quo2.components.wallet.summary-info.view
quo2.components.wallet.token-input.view
quo2.components.wallet.transaction-summary.view
quo2.components.wallet.wallet-activity.view
quo2.components.wallet.wallet-overview.view
[quo2.components.graph.interactive-graph.view :as interactive-graph]))
@@ -203,7 +200,6 @@
(def action-drawer quo2.components.drawers.action-drawers.view/action-drawer)
(def documentation-drawers quo2.components.drawers.documentation-drawers.view/view)
(def drawer-buttons quo2.components.drawers.drawer-buttons.view/view)
(def drawer-top quo2.components.drawers.drawer-top.view/view)
(def permission-context quo2.components.drawers.permission-context.view/view)
;;;; Dropdowns
@@ -232,7 +228,6 @@
;;;; Inputs
(def input quo2.components.inputs.input.view/input)
(def address-input quo2.components.inputs.address-input.view/address-input)
(def locked-input quo2.components.inputs.locked-input.view/locked-input)
(def profile-input quo2.components.inputs.profile-input.view/profile-input)
(def recovery-phrase-input quo2.components.inputs.recovery-phrase.view/recovery-phrase-input)
@@ -306,7 +301,7 @@
(def checkbox quo2.components.selectors.selectors.view/checkbox)
;;;; Settings
(def privacy-option quo2.components.settings.privacy-option.view/view)
(def privacy-option quo2.components.settings.privacy-option/card)
(def account quo2.components.settings.accounts.view/account)
(def settings-item quo2.components.settings.settings-item.view/view)
(def reorder-item quo2.components.settings.reorder-item.view/reorder-item)
@@ -348,4 +343,3 @@
(def token-input quo2.components.wallet.token-input.view/view)
(def wallet-overview quo2.components.wallet.wallet-overview.view/view)
(def wallet-activity quo2.components.wallet.wallet-activity.view/view)
(def transaction-summary quo2.components.wallet.transaction-summary.view/view)
+1 -4
View File
@@ -22,15 +22,13 @@
[quo2.components.drawers.action-drawers.component-spec]
[quo2.components.drawers.documentation-drawers.component-spec]
[quo2.components.drawers.drawer-buttons.component-spec]
[quo2.components.drawers.drawer-top.component-spec]
[quo2.components.drawers.permission-context.component-spec]
[quo2.components.dropdowns.network-dropdown.component-spec]
[quo2.components.gradient.gradient-cover.component-spec]
[quo2.components.graph.wallet-graph.component-spec]
[quo2.components.inputs.address-input.component-spec]
[quo2.components.inputs.locked-input.component-spec]
[quo2.components.inputs.input.component-spec]
[quo2.components.inputs.profile-input.component-spec]
[quo2.components.inputs.locked-input.component-spec]
[quo2.components.inputs.recovery-phrase.component-spec]
[quo2.components.inputs.title-input.component-spec]
[quo2.components.keycard.component-spec]
@@ -73,6 +71,5 @@
[quo2.components.wallet.progress-bar.component-spec]
[quo2.components.wallet.summary-info.component-spec]
[quo2.components.wallet.token-input.component-spec]
[quo2.components.wallet.transaction-summary.component-spec]
[quo2.components.wallet.wallet-overview.component-spec]
[quo2.components.wallet.wallet-activity.component-spec]))
+26 -30
View File
@@ -222,18 +222,6 @@
:magenta {50 "#EC266C"
60 "#BD1E56"}})
;;;; Networks
(def networks
{:ethereum "#758EEB"
:optimism "#E76E6E"
:arbitrum "#6BD5F0"
:zkSync "#9FA0FE"
:hermez "#EB8462"
:xDai "#3FC0BD"
:polygon "#AD71F3"
:unknown "#EEF2F5"})
(def colors-map
(merge {:primary {50 primary-50 ;; User can also use primary color as customisation color
60 primary-60}
@@ -253,12 +241,7 @@
60 danger-60}
:success {50 success-50
60 success-60}}
customization
networks))
(defn hex-string?
[s]
(and (string? s) (string/starts-with? s "#")))
customization))
(def custom-color
"(custom-color color suffix opacity)
@@ -267,22 +250,20 @@
opacity 0-100 (optional)"
(memoize
(fn
([color]
(custom-color color nil nil))
([color suffix]
(custom-color color suffix nil))
([color suffix opacity]
(let [hex? (not (keyword? color))
resolved-color (cond hex? color
(hex-string? (get colors-map color)) (get colors-map color)
:else (get-in colors-map
[color suffix]))]
(if opacity
(alpha resolved-color (/ opacity 100))
resolved-color))))))
(let [hex? (not (keyword? color))
color-keyword (keyword color)
base-color (get-in colors-map
[color-keyword suffix])]
(cond
(and opacity hex?) (alpha color (/ opacity 100))
opacity (alpha base-color (/ opacity 100))
hex? color
:else base-color))))))
(defn custom-color-by-theme
"(custom-color-by-theme color suffix-light suffix-dark opacity-light opacity-dark)
color :primary/:purple/...
suffix-light 50/60
@@ -290,7 +271,6 @@
opacity-light 0-100 (optional)
opacity-dark 0-100 (optional)
theme :light/:dark (optional)"
{:deprecated true :superseded-by "theme/colors"}
([color suffix-light suffix-dark]
(custom-color-by-theme color suffix-light suffix-dark nil nil (theme/get-theme)))
([color suffix-light suffix-dark opacity-light opacity-dark]
@@ -315,3 +295,19 @@
([light dark override-theme]
(let [theme (or override-theme (theme/get-theme))]
(if (= theme :light) light dark))))
(defn dark?
[]
(theme/dark?))
;;;; Networks
(def networks
{:ethereum "#758EEB"
:optimism "#E76E6E"
:arbitrum "#6BD5F0"
:zkSync "#9FA0FE"
:hermez "#EB8462"
:xDai "#3FC0BD"
:polygon "#AD71F3"
:unknown "#EEF2F5"})
-27
View File
@@ -1,27 +0,0 @@
(ns quo2.foundations.colors-test
(:require [cljs.test :refer-macros [deftest testing is]]
[quo2.foundations.colors :as colors]))
(deftest custom-color-resolver-test
(testing "community color - resolves a hex string and ignores suffix of 50"
(is (= "#fff" (colors/custom-color "#fff" 50))))
(testing "community color - resolves a hex string and ignores suffix of 60"
(is (= "#fff" (colors/custom-color "#fff" 60))))
(testing "user/wallet/chat colors - resolves a keyword from the customization map with suffix 50"
(is (= (get-in colors/customization [:blue 50]) (colors/custom-color :blue 50))))
(testing "user/wallet/chat colors - resolves a keyword from the colors map with suffix 60"
(is (= (get-in colors/customization [:blue 60]) (colors/custom-color :blue 60))))
(testing "network colors - resolves a keyword with from the networks map which has no suffix"
(is (= (:ethereum colors/networks) (colors/custom-color :ethereum nil)))))
(deftest custom-color-resolver-with-opacity-test
(testing "community color with 10% opacity- resolves a hex string and ignores suffix of 50"
(is (= "rgba(255,15,NaN,0.1)" (colors/custom-color "#fff" 50 10))))
(testing "community color with 10% opacity- resolves a hex string and ignores suffix of 50"
(is (= "rgba(255,15,NaN,0.9)" (colors/custom-color "#fff" 50 90))))
(testing
"user/wallet/chat colors with 10% opacity - resolves a keyword from the colors map with suffix 50"
(is (= "rgba(42,74,245,0.1)" (colors/custom-color :blue 50 10))))
(testing
"network colors with 10% opacity - resolves a keyword with from the networks map which has no suffix"
(is (= "rgba(117,142,235,0.1)" (colors/custom-color :ethereum nil 10)))))
-4
View File
@@ -43,10 +43,6 @@
[]
(utils.transforms/js->clj (rn/use-context theme-context)))
(defn use-theme-value
[]
(keyword (:theme (use-theme))))
(defn ^:private f-with-theme
[component props & args]
(let [theme (-> (use-theme) :theme keyword)]
+6 -6
View File
@@ -6,15 +6,15 @@
(defn- wrap-render-fn
[f render-data]
(fn [^js data]
(reagent/as-element [f (.-item data) (.-index data)
(.-separators data) render-data
(.-isActive data) (.-drag data)])))
(fn [data]
(reagent/as-element [f (.-item ^js data) (.-index ^js data)
(.-separators ^js data) render-data
(.-isActive ^js data) (.-drag ^js data)])))
(defn- wrap-on-drag-end-fn
[f]
(fn [^js data]
(f (.-from data) (.-to data) (.-data data))))
(fn [data]
(f (.-from ^js data) (.-to ^js data) (.-data ^js data))))
(defn- wrap-key-fn
[f]
+12 -12
View File
@@ -17,8 +17,8 @@
[status-im.signing.core :as signing]
[status-im.ui.components.list-selection :as list-selection]
[utils.re-frame :as rf]
[utils.url :as url]
[react-native.platform :as platform]
[status-im.utils.http :as http]
[status-im.utils.platform :as platform]
[status-im.utils.random :as random]
[status-im.utils.types :as types]
[status-im.utils.universal-links.utils :as links]
@@ -75,7 +75,7 @@
(defn check-if-phishing-url
[{:keys [history history-index] :as browser}]
(let [history-host (url/url-host (try (nth history history-index) (catch js/Error _)))]
(let [history-host (http/url-host (try (nth history history-index) (catch js/Error _)))]
(cond-> browser history-host (assoc :unsafe? (eth-phishing-detect history-host)))))
(defn resolve-ens-contenthash-callback
@@ -88,7 +88,7 @@
[{:keys [db]} {:keys [error? resolved-url]}]
(when (not error?)
(let [current-url (get-current-url (get-current-browser db))
host (url/url-host current-url)]
host (http/url-host current-url)]
(if (and (not resolved-url) (ens/is-valid-eth-name? host))
{:db (update db :browser/options assoc :resolving? true)
:browser/resolve-ens-contenthash {:chain-id (ethereum/chain-id db)
@@ -162,7 +162,7 @@
{:events [:browser/ignore-unsafe]}
[cofx]
(let [browser (get-current-browser (:db cofx))
host (url/url-host (get-current-url browser))]
host (http/url-host (get-current-url browser))]
(update-browser cofx (assoc browser :ignore-unsafe host))))
(defn can-go-forward?
@@ -194,7 +194,7 @@
{:events [:browser.callback/resolve-ens-multihash-success]}
[{:keys [db] :as cofx} url]
(let [current-url (get-current-url (get-current-browser db))
host (url/url-host current-url)
host (http/url-host current-url)
path (subs current-url (+ (.indexOf ^js current-url host) (count host)))
gateway url]
(rf/merge cofx
@@ -247,9 +247,9 @@
(not= (.indexOf ^js url (second v)) -1))
(:resolved-ens options)))
resolved-url (if resolved-ens
(url/normalize-url (string/replace url
(second resolved-ens)
(first resolved-ens)))
(http/normalize-url (string/replace url
(second resolved-ens)
(first resolved-ens)))
url)]
(rf/merge cofx
(update-browser-history browser resolved-url)
@@ -282,7 +282,7 @@
{:events [:browser.ui/url-submitted]}
[cofx url]
(let [browser (get-current-browser (:db cofx))
normalized-url (url/normalize-and-decode-url url)]
normalized-url (http/normalize-and-decode-url url)]
(if (links/universal-link? normalized-url)
{:dispatch [:universal-links/handle-url normalized-url]}
(rf/merge cofx
@@ -296,7 +296,7 @@
If the browser is reused, the history is flushed"
{:events [:browser.ui/open-url]}
[{:keys [db] :as cofx} url]
(let [normalized-url (url/normalize-and-decode-url url)
(let [normalized-url (http/normalize-and-decode-url url)
browser {:browser-id (random/id)
:history-index 0
:history [normalized-url]}]
@@ -503,7 +503,7 @@
{:keys [dapp? name]} browser
dapp-name (if dapp?
name
(url/url-host
(http/url-host
url-original))]
(cond
(and (= type constants/history-state-changed)
+2 -2
View File
@@ -1,7 +1,7 @@
(ns status-im.browser.core-test
(:require [cljs.test :refer-macros [deftest is testing]]
[status-im.browser.core :as browser]
[utils.url :as url]))
[status-im.utils.http :as http]))
(defn has-wrong-properties?
[result dapp-url expected-browser]
@@ -16,7 +16,7 @@
(defn get-dapp-id
[result dapp-url]
(some #(when (= (url/normalize-and-decode-url dapp-url) (first (:history %))) (:browser-id %))
(some #(when (= (http/normalize-and-decode-url dapp-url) (first (:history %))) (:browser-id %))
(vals (get-in result [:db :browser/browsers]))))
(deftest browser-test
+1 -1
View File
@@ -7,7 +7,7 @@
[react-native.fs :as fs]
[status-im2.constants :as constants]
[utils.re-frame :as rf]
[react-native.platform :as platform]
[status-im.utils.platform :as platform]
[taoensso.timbre :as log]))
(def temp-image-url (str (fs/cache-dir) "/StatusIm_Image.jpeg"))
+1 -1
View File
@@ -4,7 +4,7 @@
[status-im.chat.models.loading :as chat.loading]
[status-im.data-store.messages :as data-store.messages]
[status-im.transport.message.protocol :as protocol]
[react-native.platform :as platform]
[status-im.utils.platform :as platform]
[status-im.utils.types :as types]
[status-im2.contexts.chat.messages.delete-message.events :as delete-message]
[status-im2.contexts.chat.messages.list.events :as message-list]
+64 -89
View File
@@ -1,21 +1,17 @@
(ns status-im.ens.core
(:refer-clojure :exclude [name])
(:require
[clojure.set :as set]
[clojure.string :as string]
[re-frame.core :as re-frame]
[status-im.bottom-sheet.events :as bottom-sheet]
[status-im.ethereum.core :as ethereum]
[status-im.ethereum.eip55 :as eip55]
[status-im.ethereum.ens :as ens]
[status-im.ethereum.stateofus :as stateofus]
[status-im.multiaccounts.update.core :as multiaccounts.update]
[utils.re-frame :as rf]
[utils.datetime :as datetime]
[status-im.utils.random :as random]
[status-im2.navigation.events :as navigation]
[status-im2.constants :as constants]
[taoensso.timbre :as log]))
(:require [clojure.string :as string]
[re-frame.core :as re-frame]
[status-im.bottom-sheet.events :as bottom-sheet]
[status-im.ethereum.core :as ethereum]
[status-im.ethereum.eip55 :as eip55]
[status-im.ethereum.ens :as ens]
[status-im.ethereum.stateofus :as stateofus]
[status-im.multiaccounts.update.core :as multiaccounts.update]
[utils.re-frame :as rf]
[utils.datetime :as datetime]
[status-im.utils.random :as random]
[status-im2.navigation.events :as navigation]))
(defn fullname
[custom-domain? username]
@@ -44,7 +40,7 @@
(ens/expire-at chain-id name cb)))
(rf/defn update-ens-tx-state
{:events [:ens/update-ens-tx-state]}
{:events [:update-ens-tx-state]}
[{:keys [db]} new-state username custom-domain? tx-hash]
{:db (assoc-in db
[:ens/registrations tx-hash]
@@ -57,19 +53,20 @@
[cofx]
;; we reset navigation so that navigate back doesn't return
;; into the registration flow
(rf/merge cofx
(navigation/navigate-back-to :my-profile)
(navigation/navigate-to :ens-confirmation {})))
(navigation/set-stack-root cofx
:profile-stack
[:my-profile
:ens-confirmation]))
(rf/defn update-ens-tx-state-and-redirect
{:events [:update-ens-tx-state-and-redirect]}
[{:keys [db] :as cofx} new-state username custom-domain? tx-hash]
[cofx new-state username custom-domain? tx-hash]
(rf/merge cofx
(update-ens-tx-state new-state username custom-domain? tx-hash)
(redirect-to-ens-summary)))
(rf/defn clear-ens-registration
{:events [:ens/clear-registration]}
{:events [:clear-ens-registration]}
[{:keys [db]} tx-hash]
{:db (update db :ens/registrations dissoc tx-hash)})
@@ -82,43 +79,23 @@
(assoc-in [:ens/registration :state] state)
(assoc-in [:ens/registration :address] address))}))
(rf/defn update-usernames
{:events [:ens/update-usernames]}
[{:keys [db]} name-details]
(let [name-details (map #(set/rename-keys %
{:chainId :chain-id
:removed :removed?})
name-details)]
{:db (reduce (fn [db {:keys [username removed?] :as name-detail}]
(if removed?
(update-in db [:ens/names] dissoc username)
(let [old (get-in db [:ens/names username])]
(assoc-in db [:ens/names username] (merge old name-detail)))))
db
name-details)}))
(rf/defn save-username
{:events [:ens/save-username]}
[{:keys [db] :as cofx} custom-domain? username redirect-to-summary? connected?]
(let [name (fullname custom-domain? username)
names (get-in db [:ens/names] [])
chain-id (ethereum/chain-id db)]
{:events [::save-username]}
[{:keys [db] :as cofx} custom-domain? username redirectToSummary]
(let [name (fullname custom-domain? username)
names (get-in db [:profile/profile :usernames] [])
new-names (conj names name)]
(rf/merge cofx
(cond-> {:dispatch-n [[:ens/update-usernames [{:username name :chain-id chain-id}]]]}
connected? (assoc :json-rpc/call
[{:method "ens_add"
:params [chain-id name]
:on-success #()
:on-error #(log/error
"Failed to add ens name"
{:chain-id chain-id :name name :error %})}])
redirect-to-summary? (update-in [:dispatch-n] #(conj % [::redirect-to-ens-summary])))
#(when (empty? names)
(multiaccounts.update/multiaccount-update
cofx
:preferred-name
name
{})))))
(multiaccounts.update/multiaccount-update
:usernames
new-names
(when redirectToSummary
{:on-success #(re-frame/dispatch [::redirect-to-ens-summary])}))
(when (empty? names)
(multiaccounts.update/multiaccount-update
:preferred-name
name
{})))))
(rf/defn set-pub-key
{:events [::set-pub-key]}
@@ -128,14 +105,15 @@
{:keys [public-key]} (:profile/profile db)
chain-id (ethereum/chain-id db)
username (fullname custom-domain? username)]
{:db (assoc-in db [:ens/registration :action] constants/ens-action-type-set-pub-key)
:json-rpc/call [{:method "ens_setPubKeyPrepareTx"
:params [chain-id {:from address} username public-key]
:on-success #(re-frame/dispatch [:signing.ui/sign
{:tx-obj %
:on-result [:ens/save-username custom-domain?
username true]
:on-error [::on-registration-failure]}])}]}))
(ens/set-pub-key-prepare-tx
chain-id
address
username
public-key
#(re-frame/dispatch [:signing.ui/sign
{:tx-obj %
:on-result [::save-username custom-domain? username true]
:on-error [::on-registration-failure]}]))))
(rf/defn on-input-submitted
{:events [::input-submitted]}
@@ -147,7 +125,7 @@
:connected-with-different-key
(re-frame/dispatch [::set-pub-key])
:connected
(save-username cofx custom-domain? username true true)
(save-username cofx custom-domain? username true)
;; for other states, we do nothing
nil)))
@@ -193,14 +171,15 @@
(:ens/registration db)
{:keys [public-key]} (:profile/profile db)
chain-id (ethereum/chain-id db)]
{:db (assoc-in db [:ens/registration :action] constants/ens-action-type-register)
:json-rpc/call [{:method "ens_registerPrepareTx"
:params [chain-id {:from address} username public-key]
:on-success #(re-frame/dispatch [:signing.ui/sign
{:tx-obj %
:on-result [:update-ens-tx-state-and-redirect
:submitted username false]
:on-error [::on-registration-failure]}])}]}))
(ens/register-prepare-tx
chain-id
address
username
public-key
#(re-frame/dispatch [:signing.ui/sign
{:tx-obj %
:on-result [:update-ens-tx-state-and-redirect :submitted username false]
:on-error [::on-registration-failure]}]))))
(defn- valid-custom-domain?
[username]
@@ -232,7 +211,7 @@
{:events [::set-username-candidate]}
[{:keys [db]} username]
(let [{:keys [custom-domain?]} (:ens/registration db)
usernames (into #{} (keys (get-in db [:ens/names])))
usernames (into #{} (get-in db [:profile/profile :usernames]))
state (state custom-domain? username usernames)]
(reset! resolve-last-id (random/id))
(merge
@@ -265,9 +244,9 @@
{:db (dissoc db :ens/registration)}
;; we reset navigation so that navigate back doesn't return
;; into the registration flow
(navigation/navigate-back-to :my-profile)
(navigation/navigate-to :ens-main {})
))
(navigation/set-stack-root :profile-stack
[:my-profile
:ens-main])))
(rf/defn switch-domain-type
{:events [::switch-domain-type]}
@@ -344,18 +323,14 @@
(rf/defn remove-username
{:events [::remove-username]}
[{:keys [db] :as cofx} name]
(let [names (get-in db [:ens/names] [])
preferred-name (get-in db [:profile/profile :preferred-name])
new-names (remove #(= name %) (keys names))
{:keys [chain-id username]} (get-in names [name])]
(let [names (get-in db [:profile/profile :usernames] [])
preferred-name (get-in db [:profile/profile :preferred-name])
new-names (remove #(= name %) names)]
(rf/merge cofx
{:json-rpc/call [{:method "ens_remove"
:params [chain-id username]
:on-success #()
:on-error #(log/error "Failed to remove ENS name"
{:name name :error %})}]
:dispatch [:ens/update-usernames
[{:username username :chain-id chain-id :removed? true}]]}
(multiaccounts.update/multiaccount-update
:usernames
new-names
{})
(when (= name preferred-name)
(multiaccounts.update/multiaccount-update
:preferred-name
+12
View File
@@ -67,3 +67,15 @@
:on-success
;;NOTE: returns a timestamp in s and we want ms
#(cb (* (js/Number (native-module/hex-to-number %)) 1000))}))
(defn register-prepare-tx
[chain-id from ens-name public-key cb]
(json-rpc/call {:method "ens_registerPrepareTx"
:params [chain-id {:from from} ens-name public-key]
:on-success cb}))
(defn set-pub-key-prepare-tx
[chain-id from ens-name public-key cb]
(json-rpc/call {:method "ens_setPubKeyPrepareTx"
:params [chain-id {:from from} ens-name public-key]
:on-success cb}))
+48 -3
View File
@@ -1,6 +1,7 @@
(ns status-im.ethereum.transactions.core
(:require [cljs.spec.alpha :as spec]
[re-frame.core :as re-frame]
[status-im.ens.core :as ens]
[status-im.ethereum.core :as ethereum]
[status-im.ethereum.decode :as decode]
[status-im.ethereum.eip55 :as eip55]
@@ -110,7 +111,6 @@
`trigger-fn` is a function that returns true if the watch has been triggered
`on-trigger` is a function that returns the effects to apply when the
transaction has been triggered"
{:events [:transactions/watch-transaction]}
[{:keys [db]} transaction-id {:keys [trigger-fn on-trigger] :as watch-params}]
(when (and (fn? trigger-fn)
(fn? on-trigger))
@@ -246,6 +246,19 @@
:all
:all-preloaded))}))
(rf/defn delete-pending-transactions
[{:keys [db]} address transactions]
(let [all-transactions
(get-in db [:wallet :accounts (eip55/address->checksum address) :transactions])
pending-tx-hashes (keep (fn [{:keys [hash]}]
(let [{:keys [type] :as old-tx}
(get all-transactions hash)]
(when (and (get all-transactions hash)
(= type :pending))
hash)))
transactions)]
{:wallet/delete-pending-transactions pending-tx-hashes}))
(rf/defn handle-new-transfer
[{:keys [db] :as cofx} transfers {:keys [address limit]}]
(log/debug "[transfers] new-transfers"
@@ -260,7 +273,7 @@
(seq transfers)
(concat
[]
[(delete-pending-transactions address transfers)]
(mapv add-transfer transfers))
(and max-known-block
@@ -277,12 +290,44 @@
(conj (tx-history-end-reached checksum)))]
(apply rf/merge cofx (tx-fetching-ended [checksum]) effects)))
(rf/defn check-ens-transactions
[{:keys [db] :as cofx} transfers]
(let [set-of-transactions-hash (reduce (fn [acc {:keys [hash]}] (conj acc hash)) #{} transfers)
registrations (filter
(fn [[hash {:keys [state]}]]
(and
(or (= state :dismissed) (= state :submitted))
(contains? set-of-transactions-hash hash)))
(get db :ens/registrations))
fxs (map
(fn [[hash {:keys [username custom-domain?]}]]
(let [transfer (first (filter (fn [transfer]
(let [transfer-hash
(get transfer
:hash)]
(= transfer-hash hash)))
transfers))
type (get transfer :type)
transaction-success (get transfer :transfer)]
(cond
(= transaction-success true)
(rf/merge cofx
(ens/clear-ens-registration hash)
(ens/save-username custom-domain? username false))
(= type :failed)
(ens/update-ens-tx-state :failure username custom-domain? hash)
:else
nil)))
registrations)]
(apply rf/merge cofx fxs)))
(rf/defn new-transfers
{:events [::new-transfers]}
[cofx transfers params]
(rf/merge cofx
(handle-new-transfer transfers params)
(wallet/stop-fetching-on-empty-tx-history transfers)))
(wallet/stop-fetching-on-empty-tx-history transfers)
(check-ens-transactions transfers)))
(rf/defn tx-fetching-failed
{:events [::tx-fetching-failed]}
+1
View File
@@ -17,6 +17,7 @@
status-im.currency.core
status-im.ethereum.subscriptions
status-im.fleet.core
status-im.http.core
[utils.i18n :as i18n]
[status-im.keycard.core :as keycard]
status-im.log-level.core
+11
View File
@@ -0,0 +1,11 @@
(ns status-im.http.core
(:require [re-frame.core :as re-frame]
[status-im.utils.http :as http]))
(re-frame/reg-fx
:http-post
(fn [{:keys [url data response-validator on-success on-error timeout-ms opts]}]
(let [all-opts (assoc opts
:valid-response? response-validator
:timeout-ms timeout-ms)]
(http/post url data on-success on-error all-opts))))
+1 -1
View File
@@ -10,7 +10,7 @@
[utils.re-frame :as rf]
[utils.datetime :as datetime]
[status-im.utils.keychain.core :as keychain]
[react-native.platform :as platform]
[status-im.utils.platform :as platform]
[status-im.utils.types :as types]
[status-im2.navigation.events :as navigation]
[taoensso.timbre :as log]))
+1 -1
View File
@@ -5,7 +5,7 @@
[status-im.ethereum.core :as ethereum]
[status-im.keycard.keycard :as keycard]
[native-module.core :as native-module]
[react-native.platform :as platform]
[status-im.utils.platform :as platform]
[status-im.utils.types :as types]
[taoensso.timbre :as log]))
+1 -1
View File
@@ -15,7 +15,7 @@
[utils.re-frame :as rf]
[utils.datetime :as datetime]
[status-im.utils.keychain.core :as keychain]
[react-native.platform :as platform]
[status-im.utils.platform :as platform]
[status-im.utils.types :as types]
[status-im2.navigation.events :as navigation]
[taoensso.timbre :as log]
+4 -5
View File
@@ -24,11 +24,10 @@
(defn displayed-name
"Use preferred name, display-name, name or alias in that order"
[{:keys [name display-name preferred-name alias public-key ens-verified primary-name]}]
(let [display-name (if (string/blank? display-name) nil display-name)
preferred-name (if (string/blank? preferred-name) nil preferred-name)
ens-name (or preferred-name
display-name
name)]
(let [display-name (if (string/blank? display-name) nil display-name)
ens-name (or preferred-name
display-name
name)]
;; Preferred name is our own otherwise we make sure it's verified
(if (or preferred-name (and ens-verified name))
ens-name
+1 -1
View File
@@ -5,7 +5,7 @@
[native-module.core :as native-module]
[status-im.ui.components.react :as react]
[utils.re-frame :as rf]
[react-native.platform :as platform]
[status-im.utils.platform :as platform]
[status-im.utils.types :as types]
[utils.security.core :as security]))
+27 -2
View File
@@ -5,6 +5,8 @@
[utils.i18n :as i18n]
[status-im.node.core :as node]
[utils.re-frame :as rf]
[status-im.utils.http :as http]
[status-im.utils.types :as types]
[status-im2.navigation.events :as navigation]))
(def url-regex
@@ -95,8 +97,31 @@
(rf/defn connect
{:events [::connect-network-pressed]}
[{:keys [db] :as cofx} network-id]
(if (get-in db [:networks/networks network-id :config])
(connect-success cofx network-id)
(if-let [config (get-in db [:networks/networks network-id :config])]
(if-let [upstream-url (get-in config [:UpstreamConfig :URL])]
{:http-post {:url upstream-url
:data (types/clj->json {:jsonrpc "2.0"
:method "net_version"
:id 2})
:opts {:headers {"Content-Type" "application/json"}}
:on-success (fn [{:keys [response-body]}]
(let [response (http/parse-payload response-body)
expected-network-id (:NetworkId config)
rpc-network-id (when-let [res (:result response)]
(js/parseInt res))]
(if (and network-id (= expected-network-id rpc-network-id))
(re-frame/dispatch [::connect-success network-id])
(re-frame/dispatch [::connect-failure
(if (not= expected-network-id rpc-network-id)
(i18n/label :t/network-invalid-network-id)
(i18n/label :t/network-invalid-url))]))))
:on-error (fn [{:keys [response-body status-code]}]
(let [reason (if status-code
(i18n/label :t/network-invalid-status-code
{:code status-code})
(str response-body))]
(re-frame/dispatch [::connect-failure reason])))}}
(connect-success cofx network-id))
(connect-failure cofx "A network with the specified id doesn't exist")))
(rf/defn delete
+4 -5
View File
@@ -3,9 +3,9 @@
[native-module.core :as native-module]
[status-im2.config :as config]
[utils.re-frame :as rf]
[status-im.utils.platform :as utils.platform]
[status-im.utils.types :as types]
[clojure.string :as string]
[react-native.platform :as platform]))
[clojure.string :as string]))
(defn- add-custom-bootnodes
[config network all-bootnodes]
@@ -160,7 +160,6 @@
:always
(assoc :LocalNotificationsConfig {:Enabled true}
:KeycardPairingDataFile "/ethereum/mainnet_rpc/keycard/pairings.json"
:BrowsersConfig {:Enabled true}
:PermissionsConfig {:Enabled true}
:MailserversConfig {:Enabled true}
@@ -173,7 +172,7 @@
:WakuV2Config (merge (assoc wakuv2-config :Enabled wakuv2-enabled)
wakuv2-default-config)
:ShhextConfig
{:BackupDisabledDataDir (if platform/android? "/../no_backup" "/")
{:BackupDisabledDataDir (utils.platform/no-backup-directory)
:InstallationID installation-id
:MaxMessageDeliveryAttempts config/max-message-delivery-attempts
:MailServerConfirmations config/mailserver-confirmations-enabled?
@@ -205,7 +204,7 @@
which will take care of building up the proper config based on settings in
app-db"
{:events [::save-new-config]}
[_ config {:keys [on-success]}]
[{:keys [db]} config {:keys [on-success]}]
{:json-rpc/call [{:method "settings_saveSetting"
:params [:node-config config]
:on-success on-success}]})
+1 -1
View File
@@ -4,7 +4,7 @@
[status-im.multiaccounts.update.core :as multiaccounts.update]
[status-im2.config :as config]
[utils.re-frame :as rf]
[react-native.platform :as utils.platform]
[status-im.utils.platform :as utils.platform]
[status-im2.common.json-rpc.events :as json-rpc]
[status-im2.navigation.events :as navigation]
[taoensso.timbre :as log]))

Some files were not shown because too many files have changed in this diff Show More