Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0a617599b0 |
@@ -36,4 +36,3 @@ TEST_NETWORKS_ENABLED=1
|
||||
SHOW_NOT_IMPLEMENTED_FEATURES=0
|
||||
ENABLE_ALERT_BANNER=0
|
||||
FLAG_WALLET_CONNECT_ENABLED=1
|
||||
LOG_REQUEST_GO=1
|
||||
|
||||
@@ -40,4 +40,3 @@ DELETE_MESSAGE_UNDO_TIME_LIMIT=10000
|
||||
ENABLE_ALERT_BANNER=0
|
||||
FLAG_WALLET_CONNECT_ENABLED=1
|
||||
MOBILE_DATA_SYNCING_TOGGLE_ENABLE=0
|
||||
LOG_REQUEST_GO=1
|
||||
|
||||
@@ -37,4 +37,3 @@ FAST_CREATE_COMMUNITY_ENABLED=1
|
||||
TEST_NETWORKS_ENABLED=1
|
||||
ENABLE_ALERT_BANNER=1
|
||||
FLAG_WALLET_CONNECT_ENABLED=1
|
||||
LOG_REQUEST_GO=1
|
||||
|
||||
@@ -24,4 +24,3 @@ FAST_CREATE_COMMUNITY_ENABLED=0
|
||||
TEST_NETWORKS_ENABLED=0
|
||||
ENABLE_ALERT_BANNER=1
|
||||
FLAG_WALLET_CONNECT_ENABLED=1
|
||||
LOG_REQUEST_GO=0
|
||||
|
||||
@@ -21,4 +21,3 @@ FAST_CREATE_COMMUNITY_ENABLED=0
|
||||
TEST_NETWORKS_ENABLED=0
|
||||
STATUS_PROXY_STAGE_NAME=prod
|
||||
FLAG_WALLET_CONNECT_ENABLED=1
|
||||
LOG_REQUEST_GO=0
|
||||
|
||||
@@ -276,7 +276,6 @@ run-android: export TARGET := android
|
||||
# Disabled for debug builds to avoid 'maximum call stack exceeded' errors.
|
||||
# https://github.com/status-im/status-mobile/issues/18493
|
||||
run-android: export ORG_GRADLE_PROJECT_hermesEnabled := false
|
||||
run-android: export ORG_GRADLE_PROJECT_universalApk := false
|
||||
run-android: ##@run Build Android APK and start it on the device
|
||||
@scripts/run-android.sh
|
||||
|
||||
|
||||
@@ -211,7 +211,7 @@ android {
|
||||
reset()
|
||||
enable getEnvOrConfig('ANDROID_ABI_SPLIT').toBoolean()
|
||||
include getEnvOrConfig('ANDROID_ABI_INCLUDE').split(";")
|
||||
universalApk getEnvOrConfig('ORG_GRADLE_PROJECT_universalApk').toBoolean()
|
||||
universalApk false
|
||||
}
|
||||
}
|
||||
signingConfigs {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env groovy
|
||||
library 'status-jenkins-lib@v1.9.10'
|
||||
library 'status-jenkins-lib@v1.9.8'
|
||||
|
||||
/* Options section can't access functions in objects. */
|
||||
def isPRBuild = utils.isPRBuild()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env groovy
|
||||
library 'status-jenkins-lib@v1.9.10'
|
||||
library 'status-jenkins-lib@v1.9.8'
|
||||
|
||||
import groovy.json.JsonBuilder
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env groovy
|
||||
library 'status-jenkins-lib@v1.9.10'
|
||||
library 'status-jenkins-lib@v1.9.8'
|
||||
|
||||
pipeline {
|
||||
agent { label 'linux' }
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env groovy
|
||||
library 'status-jenkins-lib@v1.9.10'
|
||||
library 'status-jenkins-lib@v1.9.8'
|
||||
|
||||
/* Options section can't access functions in objects. */
|
||||
def isPRBuild = utils.isPRBuild()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env groovy
|
||||
library 'status-jenkins-lib@v1.9.10'
|
||||
library 'status-jenkins-lib@v1.9.8'
|
||||
|
||||
/* Options section can't access functions in objects. */
|
||||
def isPRBuild = utils.isPRBuild()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env groovy
|
||||
library 'status-jenkins-lib@v1.9.10'
|
||||
library 'status-jenkins-lib@v1.9.8'
|
||||
|
||||
pipeline {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env groovy
|
||||
library 'status-jenkins-lib@v1.9.10'
|
||||
library 'status-jenkins-lib@v1.9.8'
|
||||
|
||||
pipeline {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env groovy
|
||||
library 'status-jenkins-lib@v1.9.10'
|
||||
library 'status-jenkins-lib@v1.9.8'
|
||||
|
||||
pipeline {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env groovy
|
||||
library 'status-jenkins-lib@v1.9.10'
|
||||
library 'status-jenkins-lib@v1.9.8'
|
||||
|
||||
pipeline {
|
||||
agent { label 'macos' }
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env groovy
|
||||
library 'status-jenkins-lib@v1.9.10'
|
||||
library 'status-jenkins-lib@v1.9.8'
|
||||
|
||||
pipeline {
|
||||
agent { label params.AGENT_LABEL }
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env groovy
|
||||
library 'status-jenkins-lib@v1.9.10'
|
||||
library 'status-jenkins-lib@v1.9.8'
|
||||
|
||||
pipeline {
|
||||
agent { label 'linux' }
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env groovy
|
||||
library 'status-jenkins-lib@v1.9.10'
|
||||
library 'status-jenkins-lib@v1.9.8'
|
||||
|
||||
pipeline {
|
||||
agent {
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
## Misc
|
||||
|
||||
- [Importing assets from Figma into project](import-assets.md)
|
||||
- [Importing icons from Figma into project](export-icons.md)
|
||||
- [Updating Status APK builds for the F-Droid Android application catalogue](fdroid.md)
|
||||
- [Troubleshooting for known errors](troubleshooting.md)
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Importing assets from Figma into project
|
||||
# new icons
|
||||
|
||||
## Icons
|
||||
## Export icons
|
||||
|
||||

|
||||
|
||||
@@ -13,11 +13,3 @@
|
||||
```
|
||||
2x@2x
|
||||
4. If you want platform specific icon use `.android` or `.ios` suffixes. Example `icon_name@2x.android.png`.:w
|
||||
|
||||
## Images
|
||||
|
||||
Make sure to compress images before using into project.
|
||||
```
|
||||
make shell
|
||||
./scrips/compress_image.sh image_path
|
||||
```
|
||||
@@ -217,7 +217,6 @@ GEM
|
||||
|
||||
PLATFORMS
|
||||
arm64-darwin-22
|
||||
arm64-darwin-23
|
||||
x86_64-darwin-22
|
||||
|
||||
DEPENDENCIES
|
||||
|
||||
@@ -1485,7 +1485,7 @@ SPEC CHECKSUMS:
|
||||
FBLazyVector: 56e0e498dbb513b96c40bac6284729ba4e62672d
|
||||
FBReactNativeSpec: 146c741a3f40361f6bc13a4ba284678cbedb5881
|
||||
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
|
||||
glog: c5d68082e772fa1c511173d6b30a9de2c05a69a2
|
||||
glog: 36c15c01d70ed395c6e4f3619f98a23ee415b07a
|
||||
hermes-engine: 1d1835b2cc54c381909d94d1b3c8e0a2f1a94a0e
|
||||
HMSegmentedControl: 34c1f54d822d8308e7b24f5d901ec674dfa31352
|
||||
Keycard: ac6df4d91525c3c82635ac24d4ddd9a80aca5fc8
|
||||
@@ -1578,4 +1578,4 @@ SPEC CHECKSUMS:
|
||||
|
||||
PODFILE CHECKSUM: 5dd4a5279260d370bcdf016158c825ceb404ee06
|
||||
|
||||
COCOAPODS: 1.15.2
|
||||
COCOAPODS: 1.13.0
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
00E356F31AD99517003FC87E /* StatusImTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* StatusImTests.m */; };
|
||||
13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; };
|
||||
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
|
||||
22A6156314445AACCFBFE214 /* libPods-Status-StatusImPR.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6B65AA8037F445B3B691C9ED /* libPods-Status-StatusImPR.a */; };
|
||||
25DC9C9DC25846BD8D084888 /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B9A886A2CB448B1ABA0EB62 /* libc++.tbd */; };
|
||||
2D32CCEDFF64E1C3F1FB79AF /* libPods-Status-StatusIm-StatusImTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6081A369F49E04EC54F77E1B /* libPods-Status-StatusIm-StatusImTests.a */; };
|
||||
3870E1E692E24133A80B07DE /* Inter-SemiBold.otf in Resources */ = {isa = PBXBuildFile; fileRef = 693A62DB37BC4CD5A30E5C96 /* Inter-SemiBold.otf */; };
|
||||
393D26E3080B443A998F4A2F /* Inter-Italic.otf in Resources */ = {isa = PBXBuildFile; fileRef = B07176ACDAA1422E8F0A3D6B /* Inter-Italic.otf */; };
|
||||
3A2626CF245C3F2200D5F94B /* Dummy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A2626CE245C3F2200D5F94B /* Dummy.swift */; };
|
||||
@@ -36,6 +36,7 @@
|
||||
3AAD2AD324A3A60E0075D594 /* Inter-SemiBold.otf in Resources */ = {isa = PBXBuildFile; fileRef = 693A62DB37BC4CD5A30E5C96 /* Inter-SemiBold.otf */; };
|
||||
3AAD2AD424A3A60E0075D594 /* Inter-SemiBoldItalic.otf in Resources */ = {isa = PBXBuildFile; fileRef = A4F2BBE8D4DD4140A6CCAC39 /* Inter-SemiBoldItalic.otf */; };
|
||||
3ABC7AF8245FF85900612C45 /* InterStatus-Regular.otf in Resources */ = {isa = PBXBuildFile; fileRef = 9C76AF5A418D4D65A4CAD1D9 /* InterStatus-Regular.otf */; };
|
||||
48BD7F7AF5283037BD52E49A /* libPods-Status-StatusIm-StatusImTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A04127DCB75F4E318A4EBEDD /* libPods-Status-StatusIm-StatusImTests.a */; };
|
||||
57C854A7993C47A3B1AECD32 /* Inter-MediumItalic.otf in Resources */ = {isa = PBXBuildFile; fileRef = C6B1215047604CD59A4C74D6 /* Inter-MediumItalic.otf */; };
|
||||
65F6941925780A4F00A45E76 /* Bridge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65F6941825780A4F00A45E76 /* Bridge.swift */; };
|
||||
65F6941A25780A4F00A45E76 /* Bridge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65F6941825780A4F00A45E76 /* Bridge.swift */; };
|
||||
@@ -57,10 +58,9 @@
|
||||
C1715FFC29C0BCE80088FA8B /* launch-icon.png in Resources */ = {isa = PBXBuildFile; fileRef = C14C5F9229C0ADB5005C58A7 /* launch-icon.png */; };
|
||||
CE4E31B31D8695250033ED64 /* Statusgo.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE4E31B21D8695250033ED64 /* Statusgo.xcframework */; };
|
||||
D1786306E0184916B11F4C37 /* Inter-Medium.otf in Resources */ = {isa = PBXBuildFile; fileRef = B2A38FC3D3954DE7B2B171F8 /* Inter-Medium.otf */; };
|
||||
D791AB0467C983D226FF5713 /* libPods-Status-StatusIm.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E42DDCDBECE60E763EAA5042 /* libPods-Status-StatusIm.a */; };
|
||||
D34A0845D23EC8E3D30E11B1 /* libPods-Status-StatusIm.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 84687C28206CB8457AF2BE74 /* libPods-Status-StatusIm.a */; };
|
||||
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 */; };
|
||||
F9C9188A9398D58C286A2F4B /* libPods-Status-StatusImPR.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C929A693823978C12D329338 /* libPods-Status-StatusImPR.a */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
@@ -108,36 +108,37 @@
|
||||
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>"; };
|
||||
064C446A8C45E401B63D0B7C /* 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>"; };
|
||||
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>"; };
|
||||
203C46547A6E99D27529A8AA /* 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>"; };
|
||||
24F63BCFEB33B4C969305A46 /* 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>"; };
|
||||
344F43B59CCE090C3271FF08 /* 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>"; };
|
||||
337641435F36F3900FEAA11C /* 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>"; };
|
||||
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>"; };
|
||||
415E72A662B5ABF086AB7D7B /* 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>"; };
|
||||
4C16DE0B1F89508700AA10DB /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
|
||||
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; };
|
||||
6081A369F49E04EC54F77E1B /* libPods-Status-StatusIm-StatusImTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Status-StatusIm-StatusImTests.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>"; };
|
||||
65F6941825780A4F00A45E76 /* Bridge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Bridge.swift; sourceTree = "<group>"; };
|
||||
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>"; };
|
||||
70748FF05FFD3CACB6F64CE0 /* 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>"; };
|
||||
6B65AA8037F445B3B691C9ED /* libPods-Status-StatusImPR.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Status-StatusImPR.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
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>"; };
|
||||
84687C28206CB8457AF2BE74 /* libPods-Status-StatusIm.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Status-StatusIm.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
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; };
|
||||
8C0C93A4288955E6949CAFA7 /* 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>"; };
|
||||
922C4CA61F4D5F8B0033C753 /* StatusIm.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = StatusIm.entitlements; path = StatusIm/StatusIm.entitlements; 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>"; };
|
||||
9C8831EF82FB144215B28760 /* 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>"; };
|
||||
9EC0135C1E06FB1900155B5C /* RCTWKWebView.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWKWebView.xcodeproj; path = "../node_modules/react-native-wkwebview-reborn/ios/RCTWKWebView.xcodeproj"; sourceTree = "<group>"; };
|
||||
A04127DCB75F4E318A4EBEDD /* libPods-Status-StatusIm-StatusImTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Status-StatusIm-StatusImTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
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>"; };
|
||||
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; };
|
||||
@@ -145,15 +146,14 @@
|
||||
B2A38FC3D3954DE7B2B171F8 /* Inter-Medium.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "Inter-Medium.otf"; path = "../resources/fonts/Inter-Medium.otf"; sourceTree = "<group>"; };
|
||||
B2F2D1BB1D9D531B00B7B453 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = StatusIm/Images.xcassets; sourceTree = "<group>"; };
|
||||
B321D25F4493470980039457 /* Inter-BoldItalic.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "Inter-BoldItalic.otf"; path = "../resources/fonts/Inter-BoldItalic.otf"; sourceTree = "<group>"; };
|
||||
C1244846434197B450E92912 /* 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>"; };
|
||||
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>"; };
|
||||
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>"; };
|
||||
C929A693823978C12D329338 /* libPods-Status-StatusImPR.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Status-StatusImPR.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
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>"; };
|
||||
E42DDCDBECE60E763EAA5042 /* libPods-Status-StatusIm.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Status-StatusIm.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
F12F9820A9DF3FE08C615B90 /* 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>"; };
|
||||
E15A67A7A7B33C177372338A /* 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>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@@ -161,7 +161,7 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
2D32CCEDFF64E1C3F1FB79AF /* libPods-Status-StatusIm-StatusImTests.a in Frameworks */,
|
||||
48BD7F7AF5283037BD52E49A /* 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 */,
|
||||
D791AB0467C983D226FF5713 /* libPods-Status-StatusIm.a in Frameworks */,
|
||||
D34A0845D23EC8E3D30E11B1 /* 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 */,
|
||||
F9C9188A9398D58C286A2F4B /* libPods-Status-StatusImPR.a in Frameworks */,
|
||||
22A6156314445AACCFBFE214 /* libPods-Status-StatusImPR.a in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -314,9 +314,9 @@
|
||||
CE4E31B21D8695250033ED64 /* Statusgo.xcframework */,
|
||||
8B9A886A2CB448B1ABA0EB62 /* libc++.tbd */,
|
||||
4E586E1B0E544F64AA9F5BD1 /* libz.tbd */,
|
||||
E42DDCDBECE60E763EAA5042 /* libPods-Status-StatusIm.a */,
|
||||
6081A369F49E04EC54F77E1B /* libPods-Status-StatusIm-StatusImTests.a */,
|
||||
C929A693823978C12D329338 /* libPods-Status-StatusImPR.a */,
|
||||
84687C28206CB8457AF2BE74 /* libPods-Status-StatusIm.a */,
|
||||
A04127DCB75F4E318A4EBEDD /* libPods-Status-StatusIm-StatusImTests.a */,
|
||||
6B65AA8037F445B3B691C9ED /* libPods-Status-StatusImPR.a */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
@@ -324,12 +324,12 @@
|
||||
D0D5C8D06825D33BA2D2121E /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
24F63BCFEB33B4C969305A46 /* Pods-Status-StatusIm.debug.xcconfig */,
|
||||
344F43B59CCE090C3271FF08 /* Pods-Status-StatusIm.release.xcconfig */,
|
||||
F12F9820A9DF3FE08C615B90 /* Pods-Status-StatusIm-StatusImTests.debug.xcconfig */,
|
||||
203C46547A6E99D27529A8AA /* Pods-Status-StatusIm-StatusImTests.release.xcconfig */,
|
||||
70748FF05FFD3CACB6F64CE0 /* Pods-Status-StatusImPR.debug.xcconfig */,
|
||||
415E72A662B5ABF086AB7D7B /* Pods-Status-StatusImPR.release.xcconfig */,
|
||||
064C446A8C45E401B63D0B7C /* Pods-Status-StatusIm.debug.xcconfig */,
|
||||
8C0C93A4288955E6949CAFA7 /* Pods-Status-StatusIm.release.xcconfig */,
|
||||
E15A67A7A7B33C177372338A /* Pods-Status-StatusIm-StatusImTests.debug.xcconfig */,
|
||||
337641435F36F3900FEAA11C /* Pods-Status-StatusIm-StatusImTests.release.xcconfig */,
|
||||
C1244846434197B450E92912 /* Pods-Status-StatusImPR.debug.xcconfig */,
|
||||
9C8831EF82FB144215B28760 /* Pods-Status-StatusImPR.release.xcconfig */,
|
||||
);
|
||||
path = Pods;
|
||||
sourceTree = "<group>";
|
||||
@@ -341,12 +341,12 @@
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "StatusImTests" */;
|
||||
buildPhases = (
|
||||
D357C5313A85261FF3DAB74E /* [CP] Check Pods Manifest.lock */,
|
||||
78DBDF1BD1055E83A260EA98 /* [CP] Check Pods Manifest.lock */,
|
||||
00E356EA1AD99517003FC87E /* Sources */,
|
||||
00E356EB1AD99517003FC87E /* Frameworks */,
|
||||
00E356EC1AD99517003FC87E /* Resources */,
|
||||
36051AE6B742BD851884AB9D /* [CP] Embed Pods Frameworks */,
|
||||
3506F0F77B5DE03815A5414A /* [CP] Copy Pods Resources */,
|
||||
0564BBB140EB57AD57BEEAEA /* [CP] Embed Pods Frameworks */,
|
||||
ED9B7873F01EB9B1500CE371 /* [CP] Copy Pods Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -362,15 +362,15 @@
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "StatusIm" */;
|
||||
buildPhases = (
|
||||
D47DE8479514FAAC6B26ACD2 /* [CP] Check Pods Manifest.lock */,
|
||||
410DB9615D9ED5009FD09DB3 /* [CP] Check Pods Manifest.lock */,
|
||||
13B07F871A680F5B00A75B9A /* Sources */,
|
||||
13B07F8C1A680F5B00A75B9A /* Frameworks */,
|
||||
13B07F8E1A680F5B00A75B9A /* Resources */,
|
||||
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
|
||||
20B6B6891D92C42700CC5C6A /* Embed Frameworks */,
|
||||
E3914A731DF919ED00EBB515 /* Run Script */,
|
||||
82219E0CC0028DA612FCC0E3 /* [CP] Embed Pods Frameworks */,
|
||||
389504FC147AAF0616332C3A /* [CP] Copy Pods Resources */,
|
||||
CACB1A448509663CCC23DAD5 /* [CP] Embed Pods Frameworks */,
|
||||
3CD62FBC6B5F738846AA62DD /* [CP] Copy Pods Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -385,15 +385,15 @@
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 3AAD2AD924A3A60E0075D594 /* Build configuration list for PBXNativeTarget "StatusImPR" */;
|
||||
buildPhases = (
|
||||
E507D5CEF6BDEB9FBEBFA1C3 /* [CP] Check Pods Manifest.lock */,
|
||||
59C011634B62CD4307167A35 /* [CP] Check Pods Manifest.lock */,
|
||||
3AAD2ABB24A3A60E0075D594 /* Sources */,
|
||||
3AAD2ABF24A3A60E0075D594 /* Frameworks */,
|
||||
3AAD2AC924A3A60E0075D594 /* Resources */,
|
||||
3AAD2AD524A3A60E0075D594 /* Bundle React Native code and images */,
|
||||
3AAD2AD624A3A60E0075D594 /* Embed Frameworks */,
|
||||
3AAD2AD724A3A60E0075D594 /* Run Script */,
|
||||
13D9129EE9E3EFD2436F82FD /* [CP] Embed Pods Frameworks */,
|
||||
E374B6B7AF37774C15097B39 /* [CP] Copy Pods Resources */,
|
||||
189EFE1146C70E755688AF3D /* [CP] Embed Pods Frameworks */,
|
||||
B4118C9690A731BE596936B2 /* [CP] Copy Pods Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -547,49 +547,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\n\"../node_modules/react-native/scripts/react-native-xcode.sh\"\n";
|
||||
};
|
||||
13D9129EE9E3EFD2436F82FD /* [CP] Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Status-StatusImPR/Pods-Status-StatusImPR-frameworks.sh",
|
||||
"${PODS_XCFRAMEWORKS_BUILD_DIR}/hermes-engine/Pre-built/hermes.framework/hermes",
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
outputPaths = (
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/hermes.framework",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Status-StatusImPR/Pods-Status-StatusImPR-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
3506F0F77B5DE03815A5414A /* [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}/RNPermissions/RNPermissionsPrivacyInfo.bundle",
|
||||
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/RCTI18nStrings.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}/RNPermissionsPrivacyInfo.bundle",
|
||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RCTI18nStrings.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;
|
||||
};
|
||||
36051AE6B742BD851884AB9D /* [CP] Embed Pods Frameworks */ = {
|
||||
0564BBB140EB57AD57BEEAEA /* [CP] Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
@@ -607,28 +565,22 @@
|
||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Status-StatusIm-StatusImTests/Pods-Status-StatusIm-StatusImTests-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
389504FC147AAF0616332C3A /* [CP] Copy Pods Resources */ = {
|
||||
189EFE1146C70E755688AF3D /* [CP] Embed Pods Frameworks */ = {
|
||||
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}/RNPermissions/RNPermissionsPrivacyInfo.bundle",
|
||||
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/RCTI18nStrings.bundle",
|
||||
"${PODS_CONFIGURATION_BUILD_DIR}/TOCropViewController/TOCropViewControllerBundle.bundle",
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Status-StatusImPR/Pods-Status-StatusImPR-frameworks.sh",
|
||||
"${PODS_XCFRAMEWORKS_BUILD_DIR}/hermes-engine/Pre-built/hermes.framework/hermes",
|
||||
);
|
||||
name = "[CP] Copy Pods Resources";
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
outputPaths = (
|
||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/QBImagePicker.bundle",
|
||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RNPermissionsPrivacyInfo.bundle",
|
||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RCTI18nStrings.bundle",
|
||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/TOCropViewControllerBundle.bundle",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/hermes.framework",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Status-StatusIm/Pods-Status-StatusIm-resources.sh\"\n";
|
||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Status-StatusImPR/Pods-Status-StatusImPR-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
3AAD2AD524A3A60E0075D594 /* Bundle React Native code and images */ = {
|
||||
@@ -659,47 +611,31 @@
|
||||
shellPath = "/usr/bin/env sh";
|
||||
shellScript = "\"${PROJECT_DIR}/scripts/set_xcode_version.sh\" > ../logs/set_xcode_version.log 2>&1\n";
|
||||
};
|
||||
82219E0CC0028DA612FCC0E3 /* [CP] Embed Pods Frameworks */ = {
|
||||
3CD62FBC6B5F738846AA62DD /* [CP] Copy Pods Resources */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Status-StatusIm/Pods-Status-StatusIm-frameworks.sh",
|
||||
"${PODS_XCFRAMEWORKS_BUILD_DIR}/hermes-engine/Pre-built/hermes.framework/hermes",
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Status-StatusIm/Pods-Status-StatusIm-resources.sh",
|
||||
"${PODS_CONFIGURATION_BUILD_DIR}/RNImageCropPicker/QBImagePicker.bundle",
|
||||
"${PODS_CONFIGURATION_BUILD_DIR}/RNPermissions/RNPermissionsPrivacyInfo.bundle",
|
||||
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/RCTI18nStrings.bundle",
|
||||
"${PODS_CONFIGURATION_BUILD_DIR}/TOCropViewController/TOCropViewControllerBundle.bundle",
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
name = "[CP] Copy Pods Resources";
|
||||
outputPaths = (
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/hermes.framework",
|
||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/QBImagePicker.bundle",
|
||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RNPermissionsPrivacyInfo.bundle",
|
||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RCTI18nStrings.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-frameworks.sh\"\n";
|
||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Status-StatusIm/Pods-Status-StatusIm-resources.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
D357C5313A85261FF3DAB74E /* [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-StatusImTests-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;
|
||||
};
|
||||
D47DE8479514FAAC6B26ACD2 /* [CP] Check Pods Manifest.lock */ = {
|
||||
410DB9615D9ED5009FD09DB3 /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
@@ -721,7 +657,51 @@
|
||||
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;
|
||||
};
|
||||
E374B6B7AF37774C15097B39 /* [CP] Copy Pods Resources */ = {
|
||||
59C011634B62CD4307167A35 /* [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;
|
||||
};
|
||||
78DBDF1BD1055E83A260EA98 /* [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-StatusImTests-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;
|
||||
};
|
||||
B4118C9690A731BE596936B2 /* [CP] Copy Pods Resources */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
@@ -745,6 +725,24 @@
|
||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Status-StatusImPR/Pods-Status-StatusImPR-resources.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
CACB1A448509663CCC23DAD5 /* [CP] Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Status-StatusIm/Pods-Status-StatusIm-frameworks.sh",
|
||||
"${PODS_XCFRAMEWORKS_BUILD_DIR}/hermes-engine/Pre-built/hermes.framework/hermes",
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
outputPaths = (
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/hermes.framework",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Status-StatusIm/Pods-Status-StatusIm-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
E3914A731DF919ED00EBB515 /* Run Script */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 8;
|
||||
@@ -759,26 +757,28 @@
|
||||
shellPath = "/usr/bin/env sh";
|
||||
shellScript = "\"${PROJECT_DIR}/scripts/set_xcode_version.sh\" > ../logs/set_xcode_version.log 2>&1\n";
|
||||
};
|
||||
E507D5CEF6BDEB9FBEBFA1C3 /* [CP] Check Pods Manifest.lock */ = {
|
||||
ED9B7873F01EB9B1500CE371 /* [CP] Copy Pods Resources */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputFileListPaths = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||
"${PODS_ROOT}/Manifest.lock",
|
||||
);
|
||||
name = "[CP] Check Pods Manifest.lock";
|
||||
outputFileListPaths = (
|
||||
"${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}/RNPermissions/RNPermissionsPrivacyInfo.bundle",
|
||||
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/RCTI18nStrings.bundle",
|
||||
"${PODS_CONFIGURATION_BUILD_DIR}/TOCropViewController/TOCropViewControllerBundle.bundle",
|
||||
);
|
||||
name = "[CP] Copy Pods Resources";
|
||||
outputPaths = (
|
||||
"$(DERIVED_FILE_DIR)/Pods-Status-StatusImPR-checkManifestLockResult.txt",
|
||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/QBImagePicker.bundle",
|
||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RNPermissionsPrivacyInfo.bundle",
|
||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RCTI18nStrings.bundle",
|
||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/TOCropViewControllerBundle.bundle",
|
||||
);
|
||||
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";
|
||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Status-StatusIm-StatusImTests/Pods-Status-StatusIm-StatusImTests-resources.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
@@ -828,7 +828,7 @@
|
||||
/* Begin XCBuildConfiguration section */
|
||||
00E356F61AD99517003FC87E /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = F12F9820A9DF3FE08C615B90 /* Pods-Status-StatusIm-StatusImTests.debug.xcconfig */;
|
||||
baseConfigurationReference = E15A67A7A7B33C177372338A /* Pods-Status-StatusIm-StatusImTests.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
BUNDLE_ID_SUFFIX = .debug;
|
||||
@@ -865,7 +865,7 @@
|
||||
};
|
||||
00E356F71AD99517003FC87E /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 203C46547A6E99D27529A8AA /* Pods-Status-StatusIm-StatusImTests.release.xcconfig */;
|
||||
baseConfigurationReference = 337641435F36F3900FEAA11C /* Pods-Status-StatusIm-StatusImTests.release.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
BUNDLE_ID_SUFFIX = "";
|
||||
@@ -898,7 +898,7 @@
|
||||
};
|
||||
13B07F941A680F5B00A75B9A /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 24F63BCFEB33B4C969305A46 /* Pods-Status-StatusIm.debug.xcconfig */;
|
||||
baseConfigurationReference = 064C446A8C45E401B63D0B7C /* Pods-Status-StatusIm.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon$(BUNDLE_ID_SUFFIX)";
|
||||
BUNDLE_ID_SUFFIX = .debug;
|
||||
@@ -980,7 +980,7 @@
|
||||
};
|
||||
13B07F951A680F5B00A75B9A /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 344F43B59CCE090C3271FF08 /* Pods-Status-StatusIm.release.xcconfig */;
|
||||
baseConfigurationReference = 8C0C93A4288955E6949CAFA7 /* Pods-Status-StatusIm.release.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon$(BUNDLE_ID_SUFFIX)";
|
||||
BUNDLE_ID_SUFFIX = "";
|
||||
@@ -1055,7 +1055,7 @@
|
||||
};
|
||||
3AAD2ADA24A3A60E0075D594 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 70748FF05FFD3CACB6F64CE0 /* Pods-Status-StatusImPR.debug.xcconfig */;
|
||||
baseConfigurationReference = C1244846434197B450E92912 /* Pods-Status-StatusImPR.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon$(BUNDLE_ID_SUFFIX)";
|
||||
BUNDLE_ID_SUFFIX = .debug;
|
||||
@@ -1135,7 +1135,7 @@
|
||||
};
|
||||
3AAD2ADB24A3A60E0075D594 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 415E72A662B5ABF086AB7D7B /* Pods-Status-StatusImPR.release.xcconfig */;
|
||||
baseConfigurationReference = 9C8831EF82FB144215B28760 /* Pods-Status-StatusImPR.release.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = "AppIconPR$(BUNDLE_ID_SUFFIX)";
|
||||
BUNDLE_ID_SUFFIX = "";
|
||||
|
||||
@@ -25,18 +25,13 @@ class LogManager(private val reactContext: ReactApplicationContext) : ReactConte
|
||||
|
||||
override fun getName() = "LogManager"
|
||||
|
||||
private fun getRequestLogFile(): File {
|
||||
val pubDirectory = utils.getPublicStorageDirectory()
|
||||
return File(pubDirectory, requestsLogFileName)
|
||||
}
|
||||
|
||||
private fun getGethLogFile(): File {
|
||||
private fun getLogsFile(): File {
|
||||
val pubDirectory = utils.getPublicStorageDirectory()
|
||||
return File(pubDirectory, gethLogFileName)
|
||||
}
|
||||
|
||||
fun prepareLogsFile(context: Context): File? {
|
||||
val logFile = getGethLogFile()
|
||||
val logFile = utils.getLogsFile()
|
||||
|
||||
try {
|
||||
logFile.setReadable(true)
|
||||
@@ -154,8 +149,7 @@ class LogManager(private val reactContext: ReactApplicationContext) : ReactConte
|
||||
|
||||
val zipFile = File(logsTempDir, logsZipFileName)
|
||||
val statusLogFile = File(logsTempDir, statusLogFileName)
|
||||
val gethLogFile = getGethLogFile()
|
||||
val requestLogFile = getRequestLogFile()
|
||||
val gethLogFile = getLogsFile()
|
||||
|
||||
try {
|
||||
if (zipFile.exists() || zipFile.createNewFile()) {
|
||||
@@ -171,11 +165,7 @@ class LogManager(private val reactContext: ReactApplicationContext) : ReactConte
|
||||
dumpAdbLogsTo(FileOutputStream(statusLogFile))
|
||||
|
||||
val errorList = Stack<String>()
|
||||
val filesToZip = mutableListOf(dbFile, gethLogFile, statusLogFile)
|
||||
if (requestLogFile.exists()) {
|
||||
filesToZip.add(requestLogFile)
|
||||
}
|
||||
val zipped = zip(filesToZip.toTypedArray(), zipFile, errorList)
|
||||
val zipped = zip(arrayOf(dbFile, gethLogFile, statusLogFile), zipFile, errorList)
|
||||
if (zipped && zipFile.exists()) {
|
||||
zipFile.setReadable(true, false)
|
||||
val extUri = FileProvider.getUriForFile(context, "${context.packageName}.provider", zipFile)
|
||||
@@ -196,14 +186,12 @@ class LogManager(private val reactContext: ReactApplicationContext) : ReactConte
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
fun initLogging(enabled: Boolean, mobileSystem: Boolean, logLevel: String, logRequestGo: Boolean, callback: Callback) {
|
||||
fun initLogging(enabled: Boolean, mobileSystem: Boolean, logLevel: String, callback: Callback) {
|
||||
val jsonConfig = JSONObject().apply {
|
||||
put("Enabled", enabled)
|
||||
put("MobileSystem", mobileSystem)
|
||||
put("Level", logLevel)
|
||||
put("File", getGethLogFile().absolutePath)
|
||||
put("LogRequestGo", logRequestGo)
|
||||
put("LogRequestFile", getRequestLogFile().absolutePath)
|
||||
put("File", getLogsFile().absolutePath)
|
||||
}
|
||||
val config = jsonConfig.toString()
|
||||
utils.executeRunnableStatusGoMethod({ Statusgo.initLogging(config) }, callback)
|
||||
@@ -218,7 +206,6 @@ class LogManager(private val reactContext: ReactApplicationContext) : ReactConte
|
||||
private const val TAG = "LogManager"
|
||||
private const val gethLogFileName = "geth.log"
|
||||
private const val statusLogFileName = "Status.log"
|
||||
private const val requestsLogFileName = "requests.log"
|
||||
private const val logsZipFileName = "Status-debug-logs.zip"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import statusgo.Statusgo
|
||||
class Utils(private val reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) {
|
||||
|
||||
companion object {
|
||||
private const val gethLogFileName = "geth.log"
|
||||
private const val TAG = "Utils"
|
||||
}
|
||||
|
||||
@@ -39,6 +40,11 @@ class Utils(private val reactContext: ReactApplicationContext) : ReactContextBas
|
||||
return reactContext.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS)
|
||||
}
|
||||
|
||||
fun getLogsFile(): File {
|
||||
val pubDirectory = getPublicStorageDirectory()
|
||||
return File(pubDirectory, gethLogFileName)
|
||||
}
|
||||
|
||||
fun getKeyUID(json: String): String {
|
||||
val jsonObj = JSONObject(json)
|
||||
return jsonObj.getString("key-uid")
|
||||
|
||||
@@ -57,8 +57,6 @@ RCT_EXPORT_METHOD(sendLogs:(NSString *)dbJson
|
||||
NSURL *mainGethLogsFile = [rootUrl URLByAppendingPathComponent:@"geth.log"];
|
||||
NSURL *mainLogsFile = [logsFolderName URLByAppendingPathComponent:@"geth.log"];
|
||||
|
||||
NSURL *requestsLogFile = [rootUrl URLByAppendingPathComponent:@"requests.log"];
|
||||
|
||||
[dbJson writeToFile:dbFile.path atomically:YES encoding:NSUTF8StringEncoding error:nil];
|
||||
[jsLogs writeToFile:jsLogsFile.path atomically:YES encoding:NSUTF8StringEncoding error:nil];
|
||||
|
||||
@@ -67,10 +65,6 @@ RCT_EXPORT_METHOD(sendLogs:(NSString *)dbJson
|
||||
[fileManager copyItemAtPath:originalGethLogsFile.path toPath:gethLogsFile.path error:nil];
|
||||
[fileManager copyItemAtPath:goerliGethLogsFile.path toPath:goerliLogsFile.path error:nil];
|
||||
[fileManager copyItemAtPath:mainGethLogsFile.path toPath:mainLogsFile.path error:nil];
|
||||
|
||||
if ([fileManager fileExistsAtPath:requestsLogFile.path]) {
|
||||
[fileManager copyItemAtPath:requestsLogFile.path toPath:[logsFolderName URLByAppendingPathComponent:@"requests.log"].path error:nil];
|
||||
}
|
||||
|
||||
[SSZipArchive createZipFileAtPath:zipFile.path withContentsOfDirectory:logsFolderName.path];
|
||||
[fileManager removeItemAtPath:logsFolderName.path error:nil];
|
||||
@@ -81,20 +75,17 @@ RCT_EXPORT_METHOD(sendLogs:(NSString *)dbJson
|
||||
RCT_EXPORT_METHOD(initLogging:(BOOL)enabled
|
||||
mobileSystem:(BOOL)mobileSystem
|
||||
logLevel:(NSString *)logLevel
|
||||
logRequestGo:(BOOL)logRequestGo
|
||||
callback:(RCTResponseSenderBlock)callback)
|
||||
{
|
||||
NSString *logDirectory = [self logFileDirectory];
|
||||
NSString *logFilePath = [logDirectory stringByAppendingPathComponent:@"geth.log"];
|
||||
NSString *logRequestFilePath = [logDirectory stringByAppendingPathComponent:@"requests.log"];
|
||||
|
||||
NSMutableDictionary *jsonConfig = [NSMutableDictionary dictionary];
|
||||
jsonConfig[@"Enabled"] = @(enabled);
|
||||
jsonConfig[@"MobileSystem"] = @(mobileSystem);
|
||||
jsonConfig[@"Level"] = logLevel;
|
||||
jsonConfig[@"File"] = logFilePath;
|
||||
jsonConfig[@"LogRequestGo"] = @(logRequestGo);
|
||||
jsonConfig[@"LogRequestFile"] = logRequestFilePath;
|
||||
|
||||
NSError *error = nil;
|
||||
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:jsonConfig options:0 error:&error];
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
# Android architectures to build for
|
||||
# Used to detect end-to-end builds
|
||||
androidAbiInclude ? lib.getEnvWithDefault "ANDROID_ABI_INCLUDE" "arm64-v8a",
|
||||
universalApk ? lib.getEnvWithDefault "ORG_GRADLE_PROJECT_universalApk" "false"
|
||||
}:
|
||||
|
||||
let
|
||||
@@ -90,7 +89,6 @@ in stdenv.mkDerivation rec {
|
||||
ORG_GRADLE_PROJECT_commitHash = commitHash;
|
||||
ORG_GRADLE_PROJECT_buildUrl = buildUrl;
|
||||
ORG_GRADLE_PROJECT_hermesEnabled = hermesEnabled;
|
||||
ORG_GRADLE_PROJECT_universalApk = universalApk;
|
||||
|
||||
# Fix for ERR_OSSL_EVP_UNSUPPORTED error.
|
||||
NODE_OPTIONS = "--openssl-legacy-provider";
|
||||
|
||||
@@ -23,7 +23,7 @@ stdenv.mkDerivation {
|
||||
lib.mkFilter {
|
||||
root = path;
|
||||
ignoreVCS = false;
|
||||
include = [
|
||||
include = [
|
||||
"VERSION" "BUILD_NUMBER" "scripts/version/.*"
|
||||
"src/.*" "shadow-cljs.edn"
|
||||
# I want to avoid including the whole .git directory
|
||||
@@ -57,7 +57,7 @@ stdenv.mkDerivation {
|
||||
let anchor = ''{:source-paths ["src" "test/cljs"]'';
|
||||
in ''
|
||||
substituteInPlace shadow-cljs.edn \
|
||||
--replace-quiet '${anchor}' \
|
||||
--replace '${anchor}' \
|
||||
'${anchor}
|
||||
:maven {:local-repo "${deps.clojure}"}'
|
||||
'';
|
||||
|
||||
@@ -51,11 +51,11 @@ in {
|
||||
};
|
||||
|
||||
# Package version adjustments
|
||||
gradle = super.gradle_8.override { java = super.openjdk17_headless; };
|
||||
nodejs = super.nodejs_20;
|
||||
gradle = super.gradle_8;
|
||||
nodejs = super.nodejs-18_x;
|
||||
ruby = super.ruby_3_1;
|
||||
yarn = super.yarn.override { nodejs = super.nodejs_20; };
|
||||
openjdk = super.openjdk17_headless;
|
||||
yarn = super.yarn.override { nodejs = super.nodejs-18_x; };
|
||||
openjdk = super.openjdk11_headless;
|
||||
xcodeWrapper = callPackage ./pkgs/xcodeenv/compose-xcodewrapper.nix { } {
|
||||
versions = ["15.1" "15.2" "15.3" "15.4"];
|
||||
};
|
||||
|
||||
@@ -6,10 +6,11 @@ let
|
||||
# For testing local version of nixpkgs
|
||||
#nixpkgsSrc = (import <nixpkgs> { }).lib.cleanSource "/home/jakubgs/work/nixpkgs";
|
||||
|
||||
# We use a commit from the unstable channel of nixpkgs for gradle 8.8
|
||||
# We follow release 23-11 of nixpkgs
|
||||
# https://github.com/NixOS/nixpkgs/releases/tag/23.11
|
||||
nixpkgsSrc = builtins.fetchTarball {
|
||||
url = "https://github.com/NixOS/nixpkgs/archive/48d567fc7b299de90f70a48e4263e31f690ba03e.tar.gz";
|
||||
sha256 = "sha256:0zynbk52khdfhg4qfv26h3r5156xff5p0cga2cin7b07i7lqminh";
|
||||
url = "https://github.com/NixOS/nixpkgs/archive/224fd9a362487ab2894dac0df161c84ab1d8880b.tar.gz";
|
||||
sha256 = "sha256:1syvl39pi1h8lf5gkd9h7ksn5hp34cj7pa3abr59217kv0bdklhy";
|
||||
};
|
||||
|
||||
# Status specific configuration defaults
|
||||
|
||||
@@ -4,7 +4,7 @@ buildGoModule rec {
|
||||
pname = "go-maven-resolver";
|
||||
version = "v1.1.2";
|
||||
|
||||
vendorHash = "sha256-dlqI+onfeo4tTwmHeq8heVKRzLU1gFEQ+4iv+8egN90=";
|
||||
vendorSha256 = "1p9pl33zpbw8zc85301mnp692lkr46ppm1q99wnqwynzi7x8hnkn";
|
||||
|
||||
src = fetchFromGitHub rec {
|
||||
name = "${repo}-${version}-source";
|
||||
|
||||
@@ -10,7 +10,7 @@ writeScript "patch-maven-srcs" (''
|
||||
|
||||
function patchMavenSource() {
|
||||
grep "$source" $1 > /dev/null && \
|
||||
substituteInPlace $1 --replace-quiet "$2" "$3" 2>/dev/null
|
||||
substituteInPlace $1 --replace "$2" "$3" 2>/dev/null
|
||||
}
|
||||
|
||||
gradleFile="$1"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
go.overrideDerivation (oldAttrs: {
|
||||
postPatch = (oldAttrs.postPatch or "") + ''
|
||||
substituteInPlace "src/cmd/go/internal/work/action.go" --replace-quiet \
|
||||
substituteInPlace "src/cmd/go/internal/work/action.go" --replace \
|
||||
'tmp, err := ioutil.TempDir(os.Getenv("GOTMPDIR"), "go-build")' \
|
||||
'var err error
|
||||
tmp := os.Getenv("NIX_GOWORKDIR")
|
||||
|
||||
@@ -68,7 +68,7 @@ findFilesNewerThan() {
|
||||
\ # related code https://github.com/lugg/react-native-config/blob/v1.5.0/react-native-config.podspec#L52 \
|
||||
-not -path "*/node_modules/react-native-config/ios/ReactNativeConfig/GeneratedDotEnv.m" \
|
||||
\ # generated at runtime by react-native from v0.73.x onwards \
|
||||
-not -path "*/node_modules/react-native/React/Fabric/RCTThirdPartyFabricComponentsProvider.mm" \
|
||||
-not -path "*/node_modules/react-native/React/Fabric/*" \
|
||||
-print
|
||||
}
|
||||
|
||||
|
||||
@@ -24,8 +24,6 @@ in mkShell {
|
||||
clojure maven watchman
|
||||
# other nice to have stuff
|
||||
yarn nodejs python310 maestro
|
||||
# Required for /scripts/compress_image.sh script
|
||||
imagemagick
|
||||
] # and some special cases
|
||||
++ lib.optionals stdenv.isDarwin ([ cocoapods clang tcl idb-companion ] ++ appleSDKFrameworks)
|
||||
++ lib.optionals (!stdenv.isDarwin) [ gcc8 ]
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
, outputFileName ? "status-go-${source.shortRev}-${platform}.aar" }:
|
||||
|
||||
let
|
||||
inherit (lib) concatStringsSep optionalString optional splitString;
|
||||
inherit (lib) concatStringsSep optionalString optional;
|
||||
isIOS = platform == "ios";
|
||||
isAndroid = platform == "android";
|
||||
enforceXCodeAvailable = callPackage ./enforceXCodeAvailable.nix { };
|
||||
@@ -31,7 +31,7 @@ in buildGoPackage {
|
||||
++ optional isAndroid openjdk
|
||||
++ optional isIOS xcodeWrapper;
|
||||
|
||||
ldflags = goBuildLdFlags;
|
||||
ldflags = concatStringsSep " " goBuildLdFlags;
|
||||
|
||||
ANDROID_HOME = optionalString isAndroid androidPkgs.sdk;
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 195 KiB |
|
Before Width: | Height: | Size: 345 KiB |
|
Before Width: | Height: | Size: 124 KiB After Width: | Height: | Size: 424 KiB |
|
Before Width: | Height: | Size: 215 KiB After Width: | Height: | Size: 752 KiB |
|
Before Width: | Height: | Size: 163 KiB After Width: | Height: | Size: 547 KiB |
|
Before Width: | Height: | Size: 306 KiB After Width: | Height: | Size: 1.0 MiB |
@@ -1,23 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [ "$#" -ne 1 ]; then
|
||||
echo "Usage: $0 <input_image.png>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
input_file="$1"
|
||||
backup_file="${input_file%.png}.bak.png"
|
||||
output_file="$input_file"
|
||||
|
||||
cp "$input_file" "$backup_file"
|
||||
|
||||
magick "$input_file" -quality 100 -define png:compression-level=9 -strip -colors 256 "$output_file"
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Image compression completed: $input_file"
|
||||
echo "Backup created: $backup_file"
|
||||
else
|
||||
mv "$backup_file" "$input_file"
|
||||
echo "Error during image compression"
|
||||
exit 1
|
||||
fi
|
||||
@@ -29,7 +29,7 @@ identify_git_sha() {
|
||||
STATUS_GO_MATCHING_REFS=$(git ls-remote ${REPO_URL} ${1})
|
||||
|
||||
# It's possible that there's both a branch and a tag matching the given version
|
||||
STATUS_GO_TAG_SHA1=$(echo "${STATUS_GO_MATCHING_REFS}" | grep "refs/tags/${1}" | cut -f1)
|
||||
STATUS_GO_TAG_SHA1=$(echo "${STATUS_GO_MATCHING_REFS}" | grep 'refs/tags' | cut -f1)
|
||||
STATUS_GO_BRANCH_SHA1=$(echo "${STATUS_GO_MATCHING_REFS}" | grep 'refs/heads' | cut -f1)
|
||||
|
||||
# Prefer tag over branch if both are found
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
(ns legacy.status-im.chat.models.mentions
|
||||
(:require [clojure.set :as set]
|
||||
[taoensso.timbre :as log]
|
||||
[utils.re-frame :as rf]))
|
||||
(:require
|
||||
[clojure.set :as set]
|
||||
[taoensso.timbre :as log]
|
||||
[utils.re-frame :as rf]))
|
||||
|
||||
(defn- transfer-input-segments
|
||||
[segments]
|
||||
@@ -58,20 +59,18 @@
|
||||
|
||||
(defn- transfer-mention-result
|
||||
[result]
|
||||
(let [{:keys [input-segments mentionable-users state chat-id new-text call-id]}
|
||||
(let [{:keys [input-segments mentionable-users state chat-id new-text]}
|
||||
(set/rename-keys result
|
||||
{:InputSegments :input-segments
|
||||
:MentionSuggestions :mentionable-users
|
||||
:MentionState :state
|
||||
:ChatID :chat-id
|
||||
:NewText :new-text
|
||||
:CallID :call-id})]
|
||||
:NewText :new-text})]
|
||||
{:chat-id chat-id
|
||||
:input-segments (transfer-input-segments input-segments)
|
||||
:mentionable-users (rename-mentionable-users mentionable-users)
|
||||
:state (rename-state state)
|
||||
:new-text new-text
|
||||
:call-id call-id}))
|
||||
:new-text new-text}))
|
||||
|
||||
(rf/defn on-error
|
||||
{:events [:mention/on-error]}
|
||||
@@ -92,25 +91,23 @@
|
||||
:on-error #(rf/dispatch [:mention/on-error
|
||||
{:method method
|
||||
:params params} %])}]}))
|
||||
|
||||
(rf/defn on-to-input-field-success
|
||||
{:events [:mention/on-to-input-field-success]}
|
||||
[{:keys [db]} result]
|
||||
(log/debug "[mentions] on-to-input-field-success" {:result result})
|
||||
(let [{:keys [chat-id new-text]} (transfer-mention-result result)]
|
||||
{:effects/set-input-text-value [(get-in db [:chat/inputs chat-id :input-ref]) new-text]
|
||||
:dispatch [:chat.ui/set-chat-input-text new-text chat-id]}))
|
||||
(let [{:keys [input-segments state chat-id new-text]} (transfer-mention-result result)]
|
||||
{:db (-> db
|
||||
(assoc-in [:chats/mentions chat-id :mentions] state)
|
||||
(assoc-in [:chat/inputs-with-mentions chat-id] input-segments))}))
|
||||
|
||||
(rf/defn on-change-text
|
||||
{:events [:mention/on-change-text]}
|
||||
[{:keys [db]} text]
|
||||
(let [chat-id (:current-chat-id db)
|
||||
call-id (inc (get-in db [:chat/inputs chat-id :current-mentions-call-id] 0))
|
||||
params [chat-id text call-id]
|
||||
params [chat-id text]
|
||||
method "wakuext_chatMentionOnChangeText"]
|
||||
(log/debug "[mentions] on-change-text" {:params params})
|
||||
{:db (assoc-in db [:chat/inputs chat-id :current-mentions-call-id] call-id)
|
||||
:json-rpc/call [{:method method
|
||||
{:json-rpc/call [{:method method
|
||||
:params params
|
||||
:on-success #(rf/dispatch [:mention/on-change-text-success %])
|
||||
:on-error #(rf/dispatch [:mention/on-error
|
||||
@@ -121,38 +118,49 @@
|
||||
{:events [:mention/on-change-text-success]}
|
||||
[{:keys [db]} result]
|
||||
(log/debug "[mentions] on-change-text-success" {:result result})
|
||||
(let [{:keys [state chat-id mentionable-users
|
||||
input-segments call-id]} (transfer-mention-result result)
|
||||
current-mentions-call-id (get-in db [:chat/inputs chat-id :current-mentions-call-id])]
|
||||
(when (= call-id current-mentions-call-id)
|
||||
{:db (-> db
|
||||
(assoc-in [:chat/inputs-with-mentions chat-id] input-segments)
|
||||
(assoc-in [:chats/mention-suggestions chat-id] mentionable-users)
|
||||
(assoc-in [:chats/mentions chat-id :mentions] state))})))
|
||||
(let [{:keys [state chat-id mentionable-users input-segments]} (transfer-mention-result result)]
|
||||
{:db (-> db
|
||||
(assoc-in [:chats/mention-suggestions chat-id] mentionable-users)
|
||||
(assoc-in [:chats/mentions chat-id :mentions] state)
|
||||
(assoc-in [:chat/inputs-with-mentions chat-id] input-segments))}))
|
||||
|
||||
(rf/defn on-select-mention-success
|
||||
{:events [:mention/on-select-mention-success]}
|
||||
[{:keys [db]} result primary-name match searched-text public-key]
|
||||
[{:keys [db] :as cofx} result primary-name match searched-text public-key]
|
||||
(log/debug "[mentions] on-select-mention-success"
|
||||
{:result result
|
||||
:primary-name primary-name
|
||||
:match match
|
||||
:searched-text searched-text
|
||||
:public-key public-key})
|
||||
(let [{:keys [new-text chat-id]} (transfer-mention-result result)]
|
||||
{:db (assoc-in db [:chats/mention-suggestions chat-id] nil)
|
||||
:effects/set-input-text-value [(get-in db [:chat/inputs (:current-chat-id db) :input-ref]) new-text]
|
||||
:dispatch [:chat.ui/set-chat-input-text new-text chat-id]}))
|
||||
(let [{:keys [new-text chat-id state input-segments]} (transfer-mention-result result)]
|
||||
{:db (-> db
|
||||
(assoc-in [:chats/mentions chat-id :mentions] state)
|
||||
(assoc-in [:chat/inputs-with-mentions chat-id] input-segments)
|
||||
(assoc-in [:chats/mention-suggestions chat-id] nil))
|
||||
:dispatch [:chat.ui/set-chat-input-text new-text chat-id]}))
|
||||
|
||||
(rf/defn clear-suggestions
|
||||
[{:keys [db]}]
|
||||
(log/debug "[mentions] clear suggestions")
|
||||
(let [chat-id (:current-chat-id db)]
|
||||
{:db (update db :chats/mention-suggestions dissoc chat-id)}))
|
||||
|
||||
(rf/defn clear-mentions
|
||||
[{:keys [db]}]
|
||||
[{:keys [db] :as cofx}]
|
||||
(log/debug "[mentions] clear mentions")
|
||||
(let [chat-id (:current-chat-id db)]
|
||||
{:db (update db :chats/mention-suggestions dissoc chat-id)
|
||||
:json-rpc/call [{:method "wakuext_chatMentionClearMentions"
|
||||
:params [chat-id]
|
||||
:on-success #()
|
||||
:on-error #(log/error "Error while calling wakuext_chatMentionClearMentions"
|
||||
{:error %})}]}))
|
||||
(rf/merge
|
||||
cofx
|
||||
{:db (-> db
|
||||
(update-in [:chats/mentions chat-id] dissoc :mentions)
|
||||
(update :chat/inputs-with-mentions dissoc chat-id))
|
||||
:json-rpc/call [{:method "wakuext_chatMentionClearMentions"
|
||||
:params [chat-id]
|
||||
:on-success #()
|
||||
:on-error #(log/error "Error while calling wakuext_chatMentionClearMentions"
|
||||
{:error %})}]}
|
||||
(clear-suggestions))))
|
||||
|
||||
(rf/defn select-mention
|
||||
{:events [:chat.ui/select-mention]}
|
||||
|
||||
@@ -62,7 +62,6 @@
|
||||
:chatId :chat-id
|
||||
:contactVerificationStatus :contact-verification-status
|
||||
:communityId :community-id
|
||||
:installationId :installation-id
|
||||
:membershipStatus :membership-status
|
||||
:albumMessages :album-messages})
|
||||
(update :last-message #(when % (messages/<-rpc %)))
|
||||
|
||||
@@ -117,24 +117,20 @@
|
||||
|
||||
(deftest parse-notification-counts-response-test
|
||||
(is
|
||||
(= {notification-types/one-to-one-chat 15
|
||||
notification-types/private-group-chat 16
|
||||
notification-types/mention 17
|
||||
notification-types/reply 18
|
||||
notification-types/contact-request 19
|
||||
notification-types/admin 20
|
||||
notification-types/contact-verification 21
|
||||
notification-types/new-installation-received 22
|
||||
notification-types/new-installation-created 23}
|
||||
(= {notification-types/one-to-one-chat 15
|
||||
notification-types/private-group-chat 16
|
||||
notification-types/mention 17
|
||||
notification-types/reply 18
|
||||
notification-types/contact-request 19
|
||||
notification-types/admin 20
|
||||
notification-types/contact-verification 21}
|
||||
(store/parse-notification-counts-response
|
||||
{(keyword (str notification-types/one-to-one-chat)) 15
|
||||
(keyword (str notification-types/private-group-chat)) 16
|
||||
(keyword (str notification-types/mention)) 17
|
||||
(keyword (str notification-types/reply)) 18
|
||||
(keyword (str notification-types/contact-request)) 19
|
||||
(keyword (str notification-types/admin)) 20
|
||||
(keyword (str notification-types/contact-verification)) 21
|
||||
(keyword (str notification-types/new-installation-received)) 22
|
||||
(keyword (str notification-types/new-installation-created)) 23
|
||||
{(keyword (str notification-types/one-to-one-chat)) 15
|
||||
(keyword (str notification-types/private-group-chat)) 16
|
||||
(keyword (str notification-types/mention)) 17
|
||||
(keyword (str notification-types/reply)) 18
|
||||
(keyword (str notification-types/contact-request)) 19
|
||||
(keyword (str notification-types/admin)) 20
|
||||
(keyword (str notification-types/contact-verification)) 21
|
||||
;; Unsupported type in the response is ignored
|
||||
:999 100}))))
|
||||
:999 100}))))
|
||||
|
||||
@@ -57,11 +57,6 @@
|
||||
(fn [options]
|
||||
(permissions/request-permissions options)))
|
||||
|
||||
(re-frame/reg-fx
|
||||
:request-notifications-fx
|
||||
(fn [options]
|
||||
(permissions/request-notifications options)))
|
||||
|
||||
(re-frame/reg-fx
|
||||
:ui/show-error
|
||||
(fn [content]
|
||||
@@ -169,12 +164,6 @@
|
||||
[_ options]
|
||||
{:request-permissions-fx options})
|
||||
|
||||
(rf/reg-event-fx
|
||||
:request-notifications
|
||||
(fn [_ [options]]
|
||||
(prn options)
|
||||
{:request-notifications-fx options}))
|
||||
|
||||
(rf/defn update-window-dimensions
|
||||
{:events [:update-window-dimensions]}
|
||||
[{:keys [db]} dimensions]
|
||||
|
||||
@@ -13,19 +13,17 @@
|
||||
(native-module/logout)))
|
||||
|
||||
(rf/defn initialize-app-db
|
||||
[{{:keys [keycard initials-avatar-font-file biometrics]
|
||||
:network/keys [type status expensive?]
|
||||
:centralized-metrics/keys [user-confirmed?]}
|
||||
[{{:keys [keycard initials-avatar-font-file biometrics]
|
||||
:network/keys [type status expensive?]}
|
||||
:db}]
|
||||
{:db (assoc db/app-db
|
||||
:centralized-metrics/user-confirmed? user-confirmed?
|
||||
:network/type type
|
||||
:network/status status
|
||||
:network/expensive? expensive?
|
||||
:initials-avatar-font-file initials-avatar-font-file
|
||||
:keycard (dissoc keycard :secrets :pin :application-info)
|
||||
:biometrics biometrics
|
||||
:syncing nil)})
|
||||
:network/type type
|
||||
:network/status status
|
||||
:network/expensive? expensive?
|
||||
:initials-avatar-font-file initials-avatar-font-file
|
||||
:keycard (dissoc keycard :secrets :pin :application-info)
|
||||
:biometrics biometrics
|
||||
:syncing nil)})
|
||||
|
||||
(rf/defn logout-method
|
||||
{:events [::logout-method]}
|
||||
|
||||
@@ -243,23 +243,6 @@
|
||||
{}
|
||||
installations))})
|
||||
|
||||
(rf/defn finish-seed-phrase-fallback-syncing
|
||||
{:events [:pairing/finish-seed-phrase-fallback-syncing]}
|
||||
[{:keys [db]}]
|
||||
{:fx [[:json-rpc/call
|
||||
[{:method "wakuext_enableInstallationAndPair"
|
||||
:params [{:installationId (:syncing/installation-id db)}]
|
||||
:js-response true
|
||||
:on-success [:sanitize-messages-and-process-response]}]]]})
|
||||
|
||||
(rf/defn pair-and-sync
|
||||
{:events [:pairing/pair-and-sync]}
|
||||
[cofx installation-id]
|
||||
{:fx [[:json-rpc/call
|
||||
[{:method "wakuext_enableInstallationAndSync"
|
||||
:params [{:installationId installation-id}]
|
||||
:on-success #(log/debug "successfully synced devices")}]]]})
|
||||
|
||||
(rf/defn enable-installation-success
|
||||
{:events [:pairing.callback/enable-installation-success]}
|
||||
[cofx installation-id]
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
[legacy.status-im.ui.components.list.views :as list]
|
||||
[quo.core :as quo]
|
||||
[re-frame.core :as re-frame]
|
||||
[status-im.feature-flags :as ff]
|
||||
[utils.i18n :as i18n]
|
||||
[utils.re-frame :as rf])
|
||||
(:require-macros [legacy.status-im.utils.views :as views]))
|
||||
@@ -16,6 +17,7 @@
|
||||
|
||||
(defn- normal-mode-settings-data
|
||||
[{:keys [current-log-level
|
||||
telemetry-enabled?
|
||||
light-client-enabled?
|
||||
store-confirmations-enabled?
|
||||
current-fleet
|
||||
@@ -58,6 +60,14 @@
|
||||
:on-press
|
||||
#(re-frame/dispatch [:open-modal :peers-stats])
|
||||
:chevron true}
|
||||
(when (ff/enabled? ::ff/settings.telemetry)
|
||||
{:size :small
|
||||
:title "Telemetry"
|
||||
:accessibility-label :telemetry-enabled
|
||||
:container-margin-bottom 8
|
||||
:on-press #(re-frame/dispatch [:profile.settings/toggle-telemetry])
|
||||
:accessory :switch
|
||||
:active telemetry-enabled?})
|
||||
{:size :small
|
||||
:title (i18n/label :t/light-client-enabled)
|
||||
:accessibility-label :light-client-enabled
|
||||
@@ -99,6 +109,7 @@
|
||||
[]
|
||||
(views/letsubs [light-client-enabled? [:profile/light-client-enabled?]
|
||||
store-confirmations-enabled? [:profile/store-confirmations-enabled?]
|
||||
telemetry-enabled? [:profile/telemetry-enabled?]
|
||||
current-log-level [:log-level/current-log-level]
|
||||
current-fleet [:fleets/current-fleet]
|
||||
peer-syncing-enabled? [:profile/peer-syncing-enabled?]]
|
||||
@@ -112,6 +123,7 @@
|
||||
[list/flat-list
|
||||
{:data (flat-list-data
|
||||
{:current-log-level current-log-level
|
||||
:telemetry-enabled? telemetry-enabled?
|
||||
:light-client-enabled? light-client-enabled?
|
||||
:store-confirmations-enabled? store-confirmations-enabled?
|
||||
:current-fleet current-fleet
|
||||
|
||||
@@ -531,8 +531,8 @@
|
||||
(.logFileDirectory ^js (log-manager)))
|
||||
|
||||
(defn init-status-go-logging
|
||||
[{:keys [enable? mobile-system? log-level log-request-go? callback]}]
|
||||
(.initLogging ^js (log-manager) enable? mobile-system? log-level log-request-go? callback))
|
||||
[{:keys [enable? mobile-system? log-level callback]}]
|
||||
(.initLogging ^js (log-manager) enable? mobile-system? log-level callback))
|
||||
|
||||
(defn get-random-mnemonic
|
||||
[callback]
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
[:map {:closed true}
|
||||
[:action? {:optional true} [:maybe boolean?]]
|
||||
[:text {:optional true} [:maybe string?]]
|
||||
[:container-style {:optional true} [:maybe :map]]
|
||||
[:button-text {:optional true} [:maybe string?]]
|
||||
[:on-button-press {:optional true} [:maybe fn?]]]]]
|
||||
:any])
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
(ns quo.components.banners.alert-banner.style
|
||||
(:require [quo.foundations.colors :as colors]))
|
||||
|
||||
(defn container
|
||||
[container-style]
|
||||
(merge
|
||||
{:flex-direction :row
|
||||
:align-items :center
|
||||
:height 50
|
||||
:padding-horizontal 20
|
||||
:padding-vertical 12}
|
||||
container-style))
|
||||
(def container
|
||||
{:flex-direction :row
|
||||
:align-items :center
|
||||
:height 50
|
||||
:padding-horizontal 20
|
||||
:padding-vertical 12})
|
||||
|
||||
(defn label
|
||||
[theme]
|
||||
|
||||
@@ -11,12 +11,12 @@
|
||||
[schema.core :as schema]))
|
||||
|
||||
(defn- view-internal
|
||||
[{:keys [action? text button-text container-style on-button-press]}]
|
||||
[{:keys [action? text button-text on-button-press]}]
|
||||
(let [theme (quo.theme/use-theme)]
|
||||
[rn/view
|
||||
{:accessibility-label :alert-banner}
|
||||
[linear-gradient/linear-gradient
|
||||
{:style (style/container container-style)
|
||||
{:style style/container
|
||||
:start {:x 0 :y 0}
|
||||
:end {:x 0 :y 1}
|
||||
:colors [(colors/theme-colors
|
||||
|
||||
@@ -81,20 +81,12 @@
|
||||
:unread-mentions-count unread-mentions-count
|
||||
:unread-messages? unread-messages?}])]]]]))
|
||||
|
||||
(defn- title-color
|
||||
[unread-messages? muted theme]
|
||||
(cond
|
||||
muted (colors/theme-colors colors/neutral-40 colors/neutral-60 theme)
|
||||
unread-messages? (colors/theme-colors colors/neutral-100 colors/white theme)
|
||||
:else (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)))
|
||||
|
||||
(defn communities-membership-list-item
|
||||
[{:keys [customization-color] :as props}
|
||||
bottom-sheet?
|
||||
{:keys [name muted unviewed-messages-count unviewed-mentions-count status
|
||||
images tokens locked? style]}]
|
||||
(let [theme (quo.theme/use-theme)
|
||||
unread-messages? (pos? unviewed-messages-count)]
|
||||
(let [theme (quo.theme/use-theme)]
|
||||
[rn/touchable-highlight
|
||||
(merge {:underlay-color (colors/theme-colors
|
||||
colors/neutral-5
|
||||
@@ -116,7 +108,11 @@
|
||||
:ellipsize-mode :tail
|
||||
:weight :semi-bold
|
||||
:size :paragraph-1
|
||||
:style {:color (title-color unread-messages? muted theme)}}
|
||||
:style (when muted
|
||||
{:color (colors/theme-colors
|
||||
colors/neutral-40
|
||||
colors/neutral-60
|
||||
theme)})}
|
||||
name]]
|
||||
|
||||
[rn/view
|
||||
@@ -132,4 +128,4 @@
|
||||
:customization-color customization-color
|
||||
:muted? muted
|
||||
:unread-mentions-count unviewed-mentions-count
|
||||
:unread-messages? unread-messages?}])]]]))
|
||||
:unread-messages? (pos? unviewed-messages-count)}])]]]))
|
||||
|
||||
@@ -46,14 +46,11 @@
|
||||
(let [theme (quo.theme/use-theme)]
|
||||
[rn/view {:style (style/container container-style)}
|
||||
[rn/view {:style style/index}
|
||||
(case type
|
||||
:step
|
||||
(if (= type :step)
|
||||
[step/view
|
||||
{:in-blur-view? blur?
|
||||
:customization-color customization-color
|
||||
:type (if customization-color :complete :neutral)} step-number]
|
||||
:lock
|
||||
[icon/icon :i/locked {:color (get-colors theme blur?)}]
|
||||
[icon/icon :i/bullet {:color (get-colors theme blur?)}])]
|
||||
[rn/view {:style style/text-container}
|
||||
(when title
|
||||
|
||||
@@ -126,7 +126,7 @@
|
||||
[:subtitle-type {:optional true} [:maybe [:enum :default :icon :network :account :editable]]]
|
||||
[:size {:optional true} [:maybe [:enum :default :small :large]]]
|
||||
[:title :string]
|
||||
[:subtitle {:optional true} [:maybe [:or :string :double]]]
|
||||
[:subtitle {:optional true} [:maybe :string]]
|
||||
[:custom-subtitle {:optional true} [:maybe fn?]]
|
||||
[:icon {:optional true} [:maybe :keyword]]
|
||||
[:emoji {:optional true} [:maybe :string]]
|
||||
|
||||
@@ -5,7 +5,9 @@
|
||||
(def container
|
||||
{:padding-horizontal 12
|
||||
:padding-top 12
|
||||
:padding-bottom 14})
|
||||
:padding-bottom 14
|
||||
:flex-direction :row
|
||||
:justify-content :space-between})
|
||||
|
||||
(defn left-sub-container
|
||||
[{:keys [tag description]}]
|
||||
|
||||
@@ -108,25 +108,20 @@
|
||||
nil)])
|
||||
|
||||
(defn view
|
||||
[{:keys [title on-press action-props accessibility-label blur? container-style content] :as props}]
|
||||
[{:keys [title on-press action-props accessibility-label blur? container-style] :as props}]
|
||||
[rn/pressable
|
||||
{:style (merge style/container container-style)
|
||||
:on-press (or on-press (:on-change action-props))
|
||||
:accessibility-label accessibility-label}
|
||||
[rn/view
|
||||
{:style {:flex-direction :row
|
||||
:justify-content :space-between}}
|
||||
[rn/view {:style (style/left-sub-container props)}
|
||||
[image-component props]
|
||||
[rn/view {:style (style/left-container (:image props))}
|
||||
[text/text
|
||||
{:weight :medium
|
||||
:style {:color (when blur? colors/white)}}
|
||||
title]
|
||||
[description-component props]
|
||||
[tag-component props]]]
|
||||
[rn/view {:style (style/sub-container (:alignment action-props))}
|
||||
[label-component props]
|
||||
[action-component props]]]
|
||||
(when content
|
||||
content)])
|
||||
[rn/view {:style (style/left-sub-container props)}
|
||||
[image-component props]
|
||||
[rn/view {:style (style/left-container (:image props))}
|
||||
[text/text
|
||||
{:weight :medium
|
||||
:style {:color (when blur? colors/white)}}
|
||||
title]
|
||||
[description-component props]
|
||||
[tag-component props]]]
|
||||
[rn/view {:style (style/sub-container (:alignment action-props))}
|
||||
[label-component props]
|
||||
[action-component props]]])
|
||||
|
||||
@@ -60,12 +60,8 @@
|
||||
shrinkable? (assoc :flex-shrink 1)))
|
||||
|
||||
(defn text
|
||||
([theme]
|
||||
(text theme false))
|
||||
([theme gray-text?]
|
||||
{:color (if gray-text?
|
||||
colors/neutral-50
|
||||
(colors/theme-colors colors/neutral-100 colors/white theme))}))
|
||||
[theme]
|
||||
{:color (colors/theme-colors colors/neutral-100 colors/white theme)})
|
||||
|
||||
(defn token-logo
|
||||
[size]
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
(ns quo.components.tags.context-tag.view
|
||||
(:require
|
||||
[clojure.string :as string]
|
||||
[quo.components.avatars.account-avatar.view :as account-avatar]
|
||||
[quo.components.avatars.group-avatar.view :as group-avatar]
|
||||
[quo.components.avatars.user-avatar.view :as user-avatar]
|
||||
@@ -18,16 +17,15 @@
|
||||
[schema.core :as schema]))
|
||||
|
||||
(defn- tag-skeleton
|
||||
[{:keys [size text theme shrinkable? gray-text?]
|
||||
:or {size 24
|
||||
gray-text? false
|
||||
theme (quo.theme/use-theme)}}
|
||||
[{:keys [size text theme shrinkable?]
|
||||
:or {size 24
|
||||
theme (quo.theme/use-theme)}}
|
||||
logo-component]
|
||||
[rn/view {:style (style/tag-container size)}
|
||||
logo-component
|
||||
[rn/view {:style (style/tag-spacing size shrinkable?)}
|
||||
[text/text
|
||||
{:style (style/text theme gray-text?)
|
||||
{:style (style/text theme)
|
||||
:weight :medium
|
||||
:size (if (= size 24) :paragraph-2 :paragraph-1)
|
||||
:number-of-lines 1
|
||||
@@ -96,107 +94,92 @@
|
||||
state :default
|
||||
theme (quo.theme/use-theme)}
|
||||
:as props}]
|
||||
(let [[image-error? set-image-error] (rn/use-state false)]
|
||||
[rn/view {:style (merge {:align-items :flex-start} container-style)}
|
||||
[rn/view
|
||||
{:style (style/container {:theme theme
|
||||
:type type
|
||||
:size size
|
||||
:state state
|
||||
:blur? blur?
|
||||
:customization-color customization-color})
|
||||
:accessibility-label :context-tag}
|
||||
(case type
|
||||
:default
|
||||
[tag-skeleton {:theme theme :size size :text full-name}
|
||||
[user-avatar/user-avatar
|
||||
{:full-name full-name
|
||||
:profile-picture profile-picture
|
||||
:size (if (= size 24) :xxs 28)
|
||||
:status-indicator? false
|
||||
:ring? false
|
||||
:customization-color customization-color}]]
|
||||
[rn/view {:style (merge {:align-items :flex-start} container-style)}
|
||||
[rn/view
|
||||
{:style (style/container {:theme theme
|
||||
:type type
|
||||
:size size
|
||||
:state state
|
||||
:blur? blur?
|
||||
:customization-color customization-color})
|
||||
:accessibility-label :context-tag}
|
||||
(case type
|
||||
:default
|
||||
[tag-skeleton {:theme theme :size size :text full-name}
|
||||
[user-avatar/user-avatar
|
||||
{:full-name full-name
|
||||
:profile-picture profile-picture
|
||||
:size (if (= size 24) :xxs 28)
|
||||
:status-indicator? false
|
||||
:ring? false
|
||||
:customization-color customization-color}]]
|
||||
|
||||
:multiuser
|
||||
[preview-list/view {:type :user :size :size-20}
|
||||
users]
|
||||
:multiuser
|
||||
[preview-list/view {:type :user :size :size-20}
|
||||
users]
|
||||
|
||||
:multinetwork
|
||||
[preview-list/view {:type :network :size :size-20}
|
||||
networks]
|
||||
:multinetwork
|
||||
[preview-list/view {:type :network :size :size-20}
|
||||
networks]
|
||||
|
||||
:audio
|
||||
[tag-skeleton {:theme theme :text (str duration)}
|
||||
[rn/view {:style (style/audio-tag-icon-container customization-color theme)}
|
||||
[icons/icon :i/play {:color style/audio-tag-icon-color :size 12}]]]
|
||||
:audio
|
||||
[tag-skeleton {:theme theme :text (str duration)}
|
||||
[rn/view {:style (style/audio-tag-icon-container customization-color theme)}
|
||||
[icons/icon :i/play {:color style/audio-tag-icon-color :size 12}]]]
|
||||
|
||||
:group
|
||||
[tag-skeleton {:theme theme :size size :text group-name}
|
||||
[group-avatar/view
|
||||
{:icon-name :i/members
|
||||
:size (if (= size 24) :size-20 :size-28)
|
||||
:customization-color (colors/custom-color customization-color 50)}]]
|
||||
:group
|
||||
[tag-skeleton {:theme theme :size size :text group-name}
|
||||
[group-avatar/view
|
||||
{:icon-name :i/members
|
||||
:size (if (= size 24) :size-20 :size-28)
|
||||
:customization-color (colors/custom-color customization-color 50)}]]
|
||||
|
||||
(:channel :community)
|
||||
[communities-tag (assoc props :channel? (= type :channel))]
|
||||
(:channel :community)
|
||||
[communities-tag (assoc props :channel? (= type :channel))]
|
||||
|
||||
:token
|
||||
[tag-skeleton {:theme theme :size size :text (str amount " " token)}
|
||||
[token/view
|
||||
{:style (style/token-logo size)
|
||||
:token token
|
||||
:size (if (= size 24) :size-20 :size-28)}]]
|
||||
:token
|
||||
[tag-skeleton {:theme theme :size size :text (str amount " " token)}
|
||||
[token/view
|
||||
{:style (style/token-logo size)
|
||||
:token token
|
||||
:size (if (= size 24) :size-20 :size-28)}]]
|
||||
|
||||
:network
|
||||
[tag-skeleton {:theme theme :size size :text network-name}
|
||||
[rn/image {:style (style/circle-logo size) :source network-logo}]]
|
||||
:network
|
||||
[tag-skeleton {:theme theme :size size :text network-name}
|
||||
[rn/image {:style (style/circle-logo size) :source network-logo}]]
|
||||
|
||||
:collectible
|
||||
(let [gray-text? (string/blank? collectible-name)
|
||||
collectible-text (cond
|
||||
gray-text? "UNKNOWN"
|
||||
collectible-number (str collectible-name
|
||||
" #"
|
||||
collectible-number)
|
||||
:else collectible-name)
|
||||
nft-placeholder? (or image-error? (string/blank? collectible))]
|
||||
[tag-skeleton
|
||||
{:theme theme
|
||||
:size size
|
||||
:text collectible-text
|
||||
:shrinkable? true
|
||||
:gray-text? gray-text?}
|
||||
(if nft-placeholder?
|
||||
[icons/icon :i/nft {:size 20}]
|
||||
[rn/image
|
||||
{:style (style/rounded-logo size)
|
||||
:source collectible
|
||||
:on-error #(set-image-error true)}])])
|
||||
:collectible
|
||||
[tag-skeleton
|
||||
{:theme theme
|
||||
:size size
|
||||
:text (str collectible-name " #" collectible-number)
|
||||
:shrinkable? true}
|
||||
[rn/image {:style (style/rounded-logo size) :source collectible}]]
|
||||
|
||||
:account
|
||||
[tag-skeleton {:theme theme :size size :text account-name}
|
||||
[account-avatar/view
|
||||
{:customization-color customization-color
|
||||
:emoji emoji
|
||||
:size (if (= size 24) 20 28)}]]
|
||||
:account
|
||||
[tag-skeleton {:theme theme :size size :text account-name}
|
||||
[account-avatar/view
|
||||
{:customization-color customization-color
|
||||
:emoji emoji
|
||||
:size (if (= size 24) 20 28)}]]
|
||||
|
||||
:address
|
||||
[address-tag props]
|
||||
:address
|
||||
[address-tag props]
|
||||
|
||||
:icon
|
||||
[icon-tag props]
|
||||
:icon
|
||||
[icon-tag props]
|
||||
|
||||
:wallet-user
|
||||
[tag-skeleton {:theme theme :size size :text full-name}
|
||||
[wallet-user-avatar/wallet-user-avatar
|
||||
{:full-name full-name
|
||||
:size (if (= size 24) :size-20 :size-24)
|
||||
:customization-color customization-color}]]
|
||||
:wallet-user
|
||||
[tag-skeleton {:theme theme :size size :text full-name}
|
||||
[wallet-user-avatar/wallet-user-avatar
|
||||
{:full-name full-name
|
||||
:size (if (= size 24) :size-20 :size-24)
|
||||
:customization-color customization-color}]]
|
||||
|
||||
:dapp
|
||||
[tag-skeleton {:theme theme :size size :text dapp-name}
|
||||
[rn/image {:style (style/circle-logo size) :source dapp-logo}]]
|
||||
:dapp
|
||||
[tag-skeleton {:theme theme :size size :text dapp-name}
|
||||
[rn/image {:style (style/circle-logo size) :source dapp-logo}]]
|
||||
|
||||
nil)]]))
|
||||
nil)]])
|
||||
|
||||
(def view (schema/instrument #'view-internal component-schema/?schema))
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
[:token-value :string]
|
||||
[:token-symbol :string]
|
||||
[:container-style {:optional true} [:maybe :map]]
|
||||
[:show-view-button? {:optional true} [:maybe :boolean]]
|
||||
[:button-props {:optional true} [:maybe :map]]
|
||||
[:customization-color {:optional true} [:maybe :schema.common/customization-color]]]]]
|
||||
:any])
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
(defn- view-internal
|
||||
[{:keys [status token-value token-symbol
|
||||
container-style button-props show-view-button?]
|
||||
container-style button-props]
|
||||
:as props}]
|
||||
(let [theme (quo.theme/use-theme)
|
||||
customization-color (or (:customization-color props) :blue)
|
||||
@@ -56,9 +56,7 @@
|
||||
(i18n/label (status-message status)
|
||||
{:amount token-value
|
||||
:symbol token-symbol})]]
|
||||
(when (and button-props
|
||||
(or (= status :approve)
|
||||
(and (not= status :approve) show-view-button?)))
|
||||
(when button-props
|
||||
[button/button
|
||||
(merge {:type (if (= status :approve) :primary :grey)
|
||||
:background (when-not (= status :approve) :blur)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
(ns quo.components.wallet.swap-input.style
|
||||
(:require [quo.foundations.colors :as colors]
|
||||
[quo.foundations.shadows :as shadows]
|
||||
[quo.foundations.typography :as typography]))
|
||||
|
||||
(defn- border-color
|
||||
@@ -12,13 +11,11 @@
|
||||
(colors/theme-colors colors/neutral-5 colors/neutral-90 theme))
|
||||
|
||||
(defn content
|
||||
[typing? theme]
|
||||
(merge
|
||||
{:border-width 1
|
||||
:border-radius 16
|
||||
:border-color (border-color theme)
|
||||
:background-color (colors/theme-colors colors/white colors/neutral-95 theme)}
|
||||
(when typing? (shadows/get 1 theme))))
|
||||
[theme]
|
||||
{:border-width 1
|
||||
:border-radius 16
|
||||
:border-color (border-color theme)
|
||||
:background-color (colors/theme-colors colors/white colors/neutral-95 theme)})
|
||||
|
||||
(defn row-1
|
||||
[loading?]
|
||||
|
||||
@@ -19,15 +19,13 @@
|
||||
[:props
|
||||
[:map {:closed true}
|
||||
[:type {:optional true} [:maybe [:enum :pay :receive]]]
|
||||
[:status {:optional true} [:maybe [:enum :default :typing :disabled :loading]]]
|
||||
[:status {:optional true} [:maybe [:enum :default :disabled :loading]]]
|
||||
[:token {:optional true} [:maybe :string]]
|
||||
[:value {:optional true} [:maybe :string]]
|
||||
[:default-value {:optional true} [:maybe :string]]
|
||||
[:currency-symbol {:optional true} [:maybe :string]]
|
||||
[:fiat-value {:optional true} [:maybe :string]]
|
||||
[:show-approval-label? {:optional true} [:maybe :boolean]]
|
||||
[:auto-focus? {:optional true} [:maybe :boolean]]
|
||||
[:input-disabled? {:optional true} [:maybe :boolean]]
|
||||
[:error? {:optional true} [:maybe :boolean]]
|
||||
[:show-keyboard? {:optional true} [:maybe :boolean]]
|
||||
[:approval-label-props {:optional true} [:maybe approval-label.schema/?schema]]
|
||||
@@ -35,7 +33,6 @@
|
||||
[:on-change-text {:optional true} [:maybe fn?]]
|
||||
[:enable-swap? {:optional true} [:maybe :boolean]]
|
||||
[:on-swap-press {:optional true} [:maybe fn?]]
|
||||
[:on-input-focus {:optional true} [:maybe fn?]]
|
||||
[:on-token-press {:optional true} [:maybe fn?]]
|
||||
[:on-max-press {:optional true} [:maybe fn?]]
|
||||
[:customization-color {:optional true} [:maybe :schema.common/customization-color]]
|
||||
@@ -44,14 +41,13 @@
|
||||
|
||||
(defn view-internal
|
||||
[{:keys [type status token value fiat-value show-approval-label? error? network-tag-props
|
||||
approval-label-props default-value auto-focus? input-disabled? enable-swap?
|
||||
approval-label-props default-value enable-swap?
|
||||
currency-symbol on-change-text show-keyboard?
|
||||
container-style on-swap-press on-token-press on-max-press on-input-focus]}]
|
||||
container-style on-swap-press on-token-press on-max-press]}]
|
||||
(let [theme (quo.theme/use-theme)
|
||||
pay? (= type :pay)
|
||||
disabled? (= status :disabled)
|
||||
loading? (= status :loading)
|
||||
typing? (= status :typing)
|
||||
controlled-input? (some? value)
|
||||
input-ref (rn/use-ref-atom nil)
|
||||
set-input-ref (rn/use-callback (fn [ref] (reset! input-ref ref)) [])
|
||||
@@ -62,7 +58,7 @@
|
||||
[rn/view
|
||||
{:style container-style
|
||||
:accessibility-label :swap-input}
|
||||
[rn/view {:style (style/content typing? theme)}
|
||||
[rn/view {:style (style/content theme)}
|
||||
[rn/view
|
||||
{:style (style/row-1 loading?)}
|
||||
[rn/pressable {:on-press on-token-press}
|
||||
@@ -82,9 +78,7 @@
|
||||
colors/neutral-50
|
||||
theme)
|
||||
:keyboard-type :numeric
|
||||
:editable (not input-disabled?)
|
||||
:auto-focus auto-focus?
|
||||
:on-focus on-input-focus
|
||||
:auto-focus true
|
||||
:on-change-text on-change-text
|
||||
:show-soft-input-on-focus show-keyboard?
|
||||
:default-value default-value
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
(ns react-native.permissions
|
||||
(:require
|
||||
["react-native-permissions" :refer
|
||||
[check openSettings PERMISSIONS requestMultiple requestNotifications
|
||||
RESULTS]]
|
||||
[react-native.platform :as platform]
|
||||
[taoensso.timbre :as log]))
|
||||
["react-native-permissions" :refer (check openSettings requestMultiple PERMISSIONS RESULTS)]
|
||||
[react-native.platform :as platform]))
|
||||
|
||||
(def permissions-map
|
||||
{:read-external-storage (cond
|
||||
@@ -48,20 +45,3 @@
|
||||
(.catch #(on-error %))))
|
||||
|
||||
(def open-settings openSettings)
|
||||
|
||||
(defn request-notifications
|
||||
"`notification-options` is only used on iOS.
|
||||
A map with `:status` and `settings` (only for iOS) is passed to the callbacks.
|
||||
See https://github.com/zoontek/react-native-permissions?tab=readme-ov-file#requestnotifications."
|
||||
[{:keys [notification-options on-allowed on-denied]
|
||||
:or {notification-options #js ["alert"]}}]
|
||||
(-> (requestNotifications notification-options)
|
||||
(.then (fn [js-response]
|
||||
(let [response (js->clj js-response :keywordize-keys true)]
|
||||
(if (= (:status response) "granted")
|
||||
(do
|
||||
(on-allowed response)
|
||||
(log/debug "Notification permission were allowed" response))
|
||||
(do
|
||||
(on-denied response)
|
||||
(log/debug "Notification permission were denied" response))))))))
|
||||
|
||||
@@ -14,11 +14,7 @@
|
||||
[state]
|
||||
(:value state))
|
||||
|
||||
(defn value-numeric
|
||||
[state]
|
||||
(or (parse-double (input-value state)) 0))
|
||||
|
||||
(defn value-bn
|
||||
(defn numeric-value
|
||||
[state]
|
||||
(money/bignumber (input-value state)))
|
||||
|
||||
@@ -31,32 +27,28 @@
|
||||
(assoc state :error? error?))
|
||||
|
||||
(defn upper-limit
|
||||
[state]
|
||||
(:upper-limit state))
|
||||
|
||||
(defn upper-limit-bn
|
||||
[state]
|
||||
(money/bignumber (:upper-limit state)))
|
||||
|
||||
(defn lower-limit
|
||||
[state]
|
||||
(:lower-limit state))
|
||||
|
||||
(defn lower-limit-bn
|
||||
[state]
|
||||
(money/bignumber (:lower-limit state)))
|
||||
|
||||
(defn upper-limit-exceeded?
|
||||
[state]
|
||||
(and (upper-limit state)
|
||||
(when (money/bignumber? (value-bn state))
|
||||
(money/greater-than (value-bn state) (upper-limit-bn state)))))
|
||||
(let [num-value (numeric-value state)]
|
||||
(and
|
||||
(upper-limit state)
|
||||
(when (money/bignumber? num-value)
|
||||
(money/greater-than (numeric-value state) (upper-limit state))))))
|
||||
|
||||
(defn- lower-limit-exceeded?
|
||||
[state]
|
||||
(and (lower-limit state)
|
||||
(when (money/bignumber? (value-bn state))
|
||||
(money/less-than (value-bn state) (lower-limit-bn state)))))
|
||||
(let [num-value (numeric-value state)]
|
||||
(and
|
||||
(lower-limit state)
|
||||
(when (money/bignumber? num-value)
|
||||
(money/less-than (numeric-value state) (lower-limit state))))))
|
||||
|
||||
(defn- recheck-errorness
|
||||
[state]
|
||||
@@ -70,7 +62,7 @@
|
||||
(assoc :value value)
|
||||
recheck-errorness))
|
||||
|
||||
(defn set-value-numeric
|
||||
(defn set-numeric-value
|
||||
[state value]
|
||||
(set-input-value state (str value)))
|
||||
|
||||
@@ -89,11 +81,11 @@
|
||||
|
||||
(defn increase
|
||||
[state]
|
||||
(set-input-value state (str (money/add (value-bn state) 1))))
|
||||
(set-input-value state (str (money/add (numeric-value state) 1))))
|
||||
|
||||
(defn decrease
|
||||
[state]
|
||||
(set-input-value state (str (money/add (value-bn state) -1))))
|
||||
(set-input-value state (str (money/add (numeric-value state) -1))))
|
||||
|
||||
(def ^:private not-digits-or-dot-pattern
|
||||
#"[^0-9+\.]")
|
||||
@@ -130,12 +122,10 @@
|
||||
state))
|
||||
|
||||
(defn delete-last
|
||||
([state]
|
||||
(delete-last state ""))
|
||||
([state default-value]
|
||||
(let [value (input-value state)
|
||||
new-value (subs value 0 (dec (count value)))]
|
||||
(set-input-value state (if (string/blank? new-value) default-value new-value)))))
|
||||
[state]
|
||||
(let [value (input-value state)
|
||||
new-value (subs value 0 (dec (count value)))]
|
||||
(set-input-value state new-value)))
|
||||
|
||||
(defn delete-all
|
||||
[state]
|
||||
@@ -143,7 +133,7 @@
|
||||
|
||||
(defn empty-value?
|
||||
[state]
|
||||
(or (string/blank? (:value state)) (<= (value-numeric state) 0)))
|
||||
(string/blank? (:value state)))
|
||||
|
||||
(defn- fiat->crypto
|
||||
[value conversion-rate]
|
||||
|
||||
@@ -200,13 +200,13 @@
|
||||
(.remove keyboard-hide-listener))))
|
||||
|
||||
(defn screen
|
||||
[{:keys [title keypair navigation-icon recovering-keypair? render-controls]}]
|
||||
(let [[insets _] (rn/use-state (safe-area/get-insets))
|
||||
banner-offset (rf/sub [:alert-banners/top-margin])]
|
||||
[{:keys [initial-insets title keypair navigation-icon recovering-keypair? render-controls]}]
|
||||
(let [{navigation-bar-top :top} initial-insets
|
||||
banner-offset (rf/sub [:alert-banners/top-margin])]
|
||||
[rn/view {:style style/full-layout}
|
||||
[rn/keyboard-avoiding-view {:style style/page-container}
|
||||
[quo/page-nav
|
||||
{:margin-top (:top insets)
|
||||
{:margin-top navigation-bar-top
|
||||
:background :blur
|
||||
:icon-name (or navigation-icon
|
||||
(if recovering-keypair? :i/close :i/arrow-left))
|
||||
@@ -216,14 +216,15 @@
|
||||
:keypair keypair
|
||||
:render-controls render-controls
|
||||
:banner-offset banner-offset
|
||||
:initial-insets insets
|
||||
:initial-insets initial-insets
|
||||
:recovering-keypair? recovering-keypair?}]]]))
|
||||
|
||||
(defn view
|
||||
[]
|
||||
(let [{:keys [recovering-keypair?]} (rf/sub [:get-screen-params])]
|
||||
(rn/use-unmount
|
||||
#(rf/dispatch [:onboarding/clear-navigated-to-enter-seed-phrase-from-screen]))
|
||||
[screen
|
||||
{:title (i18n/label :t/use-recovery-phrase)
|
||||
:recovering-keypair? recovering-keypair?}]))
|
||||
(let [insets (safe-area/get-insets)]
|
||||
(fn []
|
||||
(let [{:keys [recovering-keypair?]} (rf/sub [:get-screen-params])]
|
||||
[screen
|
||||
{:title (i18n/label :t/use-recovery-phrase)
|
||||
:initial-insets insets
|
||||
:recovering-keypair? recovering-keypair?}]))))
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
(:require
|
||||
[clojure.string :as string]
|
||||
[native-module.core :as native-module]
|
||||
[promesa.core :as promesa]
|
||||
[re-frame.core :as re-frame]
|
||||
[react-native.background-timer :as background-timer]
|
||||
[taoensso.timbre :as log]
|
||||
@@ -90,17 +89,6 @@
|
||||
(rf/dispatch (conj on-success result request-id))
|
||||
(on-success result request-id)))))))))))
|
||||
|
||||
(defn call-async
|
||||
"Helper to handle RPC calls to status-go as promises"
|
||||
[method js-response? & args]
|
||||
(promesa/create
|
||||
(fn [p-resolve p-reject]
|
||||
(call {:method method
|
||||
:params args
|
||||
:on-success p-resolve
|
||||
:on-error p-reject
|
||||
:js-response js-response?}))))
|
||||
|
||||
(re-frame/reg-fx
|
||||
:json-rpc/call
|
||||
(fn [params]
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
[clojure.string :as string]
|
||||
[native-module.core :as native-module]
|
||||
[re-frame.core :as re-frame]
|
||||
[status-im.config :as config]
|
||||
[taoensso.timbre :as log]
|
||||
[utils.transforms :as transforms]))
|
||||
|
||||
@@ -25,11 +24,10 @@
|
||||
(let [{:keys [error]} (transforms/json->clj res)]
|
||||
(when-not (string/blank? error)
|
||||
(log/error "init statusgo logging failed" error))))
|
||||
logging-params {:enable? true
|
||||
:mobile-system? false
|
||||
:log-level level
|
||||
:log-request-go? config/log-request-go
|
||||
:callback handle-error}]
|
||||
logging-params {:enable? true
|
||||
:mobile-system? false
|
||||
:log-level level
|
||||
:callback handle-error}]
|
||||
(log/merge-config! {:ns-filter {:allow #{"*"} :deny #{"taoensso.sente"}}})
|
||||
(if (string/blank? level)
|
||||
(native-module/init-status-go-logging (merge logging-params {:log-level "WARN"}))
|
||||
|
||||
@@ -17,16 +17,14 @@
|
||||
[]
|
||||
(rf/dispatch [:hide-bottom-sheet]))
|
||||
|
||||
(def ^:private will-receive-for-current-points
|
||||
[:t/number-of-messages-sent
|
||||
:t/connected-peers
|
||||
:t/successful-messages-rate
|
||||
:t/connection-type
|
||||
:t/os-app-version-bandwidth])
|
||||
(defn- toggle-metrics
|
||||
[enabled?]
|
||||
(rf/dispatch [:centralized-metrics/toggle-centralized-metrics enabled?]))
|
||||
|
||||
(def ^:private will-receive-for-all-points
|
||||
[:t/action-logs
|
||||
:t/ip-addresses-uuid])
|
||||
(def ^:private will-receive-points
|
||||
[:t/ip-address
|
||||
:t/universally-unique-identifiers-of-device
|
||||
:t/logs-of-actions-withing-the-app])
|
||||
|
||||
(def ^:private not-receive-points
|
||||
[:t/your-profile-information
|
||||
@@ -34,7 +32,7 @@
|
||||
:t/information-you-input-and-send])
|
||||
|
||||
(defn- bullet-points
|
||||
[{:keys [title points lock?]}]
|
||||
[{:keys [title points]}]
|
||||
[rn/view
|
||||
[quo/text {:weight :semi-bold}
|
||||
title]
|
||||
@@ -43,36 +41,37 @@
|
||||
[quo/markdown-list
|
||||
{:description (i18n/label label)
|
||||
:blur? true
|
||||
:type (when lock? :lock)
|
||||
:container-style style/item-text}])])
|
||||
|
||||
(defn- on-share-usage
|
||||
[]
|
||||
(rf/dispatch [:centralized-metrics/toggle-centralized-metrics true true])
|
||||
(toggle-metrics true)
|
||||
(hide-bottom-sheet))
|
||||
|
||||
(defn- on-do-not-share
|
||||
[]
|
||||
(rf/dispatch [:centralized-metrics/toggle-centralized-metrics false true])
|
||||
(toggle-metrics false)
|
||||
(hide-bottom-sheet))
|
||||
|
||||
(declare view)
|
||||
|
||||
(defn- on-privacy-policy-press
|
||||
[]
|
||||
[settings?]
|
||||
(rf/dispatch
|
||||
[:show-bottom-sheet
|
||||
{:content privacy/privacy-statement
|
||||
{:content (fn []
|
||||
[quo.theme/provider :dark
|
||||
[privacy/privacy-statement]])
|
||||
:on-close (fn []
|
||||
(rf/dispatch [:show-bottom-sheet
|
||||
{:content view
|
||||
:theme :dark
|
||||
{:content (fn []
|
||||
[quo.theme/provider :dark
|
||||
[view {:settings? settings?}]])
|
||||
:shell? true}]))
|
||||
:theme :dark
|
||||
:shell? true}]))
|
||||
|
||||
(defn- privacy-policy-text
|
||||
[]
|
||||
[settings?]
|
||||
[rn/view {:style style/privacy-policy}
|
||||
[quo/text
|
||||
[quo/text
|
||||
@@ -82,38 +81,39 @@
|
||||
[quo/text
|
||||
{:size :paragraph-2
|
||||
:weight :bold
|
||||
:on-press on-privacy-policy-press}
|
||||
:on-press #(on-privacy-policy-press settings?)}
|
||||
(i18n/label :t/more-details-in-privacy-policy-2)]]])
|
||||
|
||||
(defn view
|
||||
[]
|
||||
[{:keys [settings?]}]
|
||||
(rn/use-mount #(dismiss-keyboard))
|
||||
[:<>
|
||||
[quo/drawer-top
|
||||
{:title (i18n/label :t/help-us-improve-status)
|
||||
:description (i18n/label :t/collecting-usage-data)}]
|
||||
[rn/scroll-view
|
||||
[rn/view {:style style/points-wrapper}
|
||||
[bullet-points
|
||||
{:title (i18n/label :t/we-will-receive-from-all-profiles)
|
||||
:points will-receive-for-all-points}]
|
||||
[bullet-points
|
||||
{:title (i18n/label :t/we-will-receive-from-the-current-profile)
|
||||
:points will-receive-for-current-points}]
|
||||
[bullet-points
|
||||
{:title (i18n/label :t/what-we-wont-receive)
|
||||
:points not-receive-points
|
||||
:lock? true}]
|
||||
[quo/text
|
||||
{:size :paragraph-2
|
||||
:style style/info-text}
|
||||
(i18n/label :t/sharing-usage-data-can-be-turned-off)]]]
|
||||
[rn/view {:style style/points-wrapper}
|
||||
[bullet-points
|
||||
{:title (i18n/label :t/what-we-will-receive)
|
||||
:points will-receive-points}]
|
||||
[bullet-points
|
||||
{:title (i18n/label :t/what-we-wont-receive)
|
||||
:points not-receive-points}]
|
||||
(if settings?
|
||||
[quo/text
|
||||
{:size :paragraph-2
|
||||
:style style/info-text}
|
||||
(i18n/label :t/usage-data-shared-from-all-profiles)]
|
||||
[quo/text
|
||||
{:size :paragraph-2
|
||||
:style style/info-text}
|
||||
(i18n/label :t/usage-data-shared-from-all-profiles)
|
||||
(i18n/label :t/sharing-usage-data-can-be-turned-off)])]
|
||||
[quo/bottom-actions
|
||||
{:actions :two-actions
|
||||
:blur? true
|
||||
:button-one-label (i18n/label :t/help-us-improve-status)
|
||||
:button-one-label (i18n/label :t/share-usage-data)
|
||||
:button-one-props {:on-press on-share-usage}
|
||||
:button-two-label (i18n/label :t/not-now)
|
||||
:button-two-props {:type :grey
|
||||
:on-press on-do-not-share}}]
|
||||
[privacy-policy-text]])
|
||||
[privacy-policy-text settings?]])
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
(ns status-im.common.new-device-sheet.style
|
||||
(:require [quo.foundations.colors :as colors]))
|
||||
|
||||
(def heading
|
||||
{:padding-left 20
|
||||
:padding-bottom 8})
|
||||
|
||||
(def message
|
||||
{:padding-horizontal 20
|
||||
:padding-top 4})
|
||||
|
||||
(def warning
|
||||
{:margin-horizontal 20
|
||||
:margin-top 10})
|
||||
|
||||
(def drawer-container
|
||||
{:padding-horizontal 13
|
||||
:padding-top 16})
|
||||
|
||||
(def settings-subtext
|
||||
{:color colors/white-opa-70
|
||||
:align-self :center
|
||||
:margin-bottom 12})
|
||||
@@ -1,75 +0,0 @@
|
||||
(ns status-im.common.new-device-sheet.view
|
||||
(:require
|
||||
[quo.core :as quo]
|
||||
[react-native.core :as rn]
|
||||
[status-im.common.events-helper :as events-helper]
|
||||
[status-im.common.new-device-sheet.style :as style]
|
||||
[utils.i18n :as i18n]
|
||||
[utils.re-frame :as rf]))
|
||||
|
||||
(defn- pair-and-sync
|
||||
[installation-id]
|
||||
(rf/dispatch [:pairing/pair-and-sync installation-id])
|
||||
(events-helper/hide-bottom-sheet))
|
||||
|
||||
(defn installation-request-receiver-view
|
||||
[installation-id]
|
||||
(rn/use-mount events-helper/dismiss-keyboard)
|
||||
[:<>
|
||||
[quo/text
|
||||
{:weight :semi-bold
|
||||
:size :heading-2
|
||||
:accessibility-label :new-device-sheet-heading
|
||||
:style style/heading}
|
||||
(i18n/label :t/pair-new-device-and-sync)]
|
||||
[quo/text
|
||||
{:weight :regular
|
||||
:size :paragraph-1
|
||||
:accessibility-label :new-device-sheet-message
|
||||
:style style/message}
|
||||
(i18n/label :t/new-device-detected-recovered-device-message)]
|
||||
[quo/text
|
||||
{:weight :semi-bold
|
||||
:size :heading-2
|
||||
:accessibility-label :new-device-installation-id
|
||||
:style style/heading}
|
||||
installation-id]
|
||||
[quo/bottom-actions
|
||||
{:actions :two-actions
|
||||
:blur? true
|
||||
:container-style {:margin-top 12}
|
||||
:button-two-label (i18n/label :t/cancel)
|
||||
:button-two-props {:type :grey
|
||||
:on-press events-helper/hide-bottom-sheet}
|
||||
:button-one-label (i18n/label :t/pair-and-sync)
|
||||
:button-one-props {:on-press #(pair-and-sync installation-id)}}]])
|
||||
|
||||
(defn installation-request-creator-view
|
||||
[installation-id]
|
||||
(rn/use-mount events-helper/dismiss-keyboard)
|
||||
[:<>
|
||||
[quo/text
|
||||
{:weight :semi-bold
|
||||
:size :heading-2
|
||||
:accessibility-label :new-device-sheet-heading
|
||||
:style style/heading}
|
||||
(i18n/label :t/pair-this-device-and-sync)]
|
||||
[quo/text
|
||||
{:weight :regular
|
||||
:size :paragraph-1
|
||||
:accessibility-label :new-device-sheet-message
|
||||
:style style/message}
|
||||
(i18n/label :t/new-device-detected-other-device-message)]
|
||||
[quo/text
|
||||
{:weight :semi-bold
|
||||
:size :heading-2
|
||||
:accessibility-label :new-device-installation-id
|
||||
:style style/heading}
|
||||
installation-id]
|
||||
[quo/bottom-actions
|
||||
{:actions :one-action
|
||||
:blur? true
|
||||
:container-style {:margin-top 12}
|
||||
:button-one-label (i18n/label :t/close)
|
||||
:button-one-props {:type :grey
|
||||
:on-press events-helper/hide-bottom-sheet}}]])
|
||||
@@ -28,7 +28,6 @@
|
||||
:notifications (js/require "../resources/images/ui2/notifications.png")
|
||||
:nfc-prompt (js/require "../resources/images/ui2/nfc-prompt.png")
|
||||
:nfc-success (js/require "../resources/images/ui2/nfc-success.png")
|
||||
:preparing-status (js/require "../resources/images/ui2/preparing-status.png")
|
||||
:syncing-devices (js/require "../resources/images/ui2/syncing_devices.png")
|
||||
:syncing-wrong (js/require "../resources/images/ui2/syncing_wrong.png")})
|
||||
|
||||
|
||||
@@ -76,7 +76,6 @@
|
||||
|
||||
;; CONFIG VALUES
|
||||
(def log-level (string/upper-case (get-config :LOG_LEVEL "")))
|
||||
(def log-request-go (enabled? (get-config :LOG_REQUEST_GO "0")))
|
||||
(def fleet (get-config :FLEET ""))
|
||||
(def apn-topic (get-config :APN_TOPIC "im.status.ethereum"))
|
||||
(def default-network (get-config :DEFAULT_NETWORK "goerli_rpc"))
|
||||
|
||||
@@ -551,7 +551,6 @@
|
||||
(def ^:const send-type-bridge 5)
|
||||
(def ^:const send-type-erc-721-transfer 6)
|
||||
(def ^:const send-type-erc-1155-transfer 7)
|
||||
(def ^:const send-type-swap 8)
|
||||
|
||||
(def ^:const multi-transaction-type-send 0)
|
||||
(def ^:const multi-transaction-type-approve 1)
|
||||
@@ -565,7 +564,6 @@
|
||||
(def ^:const bridge-name-erc-721-transfer "ERC721Transfer")
|
||||
(def ^:const bridge-name-erc-1155-transfer "ERC1155Transfer")
|
||||
(def ^:const bridge-name-hop "Hop")
|
||||
(def ^:const bridge-name-paraswap "Paraswap")
|
||||
|
||||
(def ^:const bridge-assets #{"ETH" "USDT" "USDC" "DAI"})
|
||||
|
||||
@@ -592,20 +590,9 @@
|
||||
(def ^:const default-slippage 0.5)
|
||||
(def ^:const max-recommended-slippage 5)
|
||||
(def ^:const max-slippage-decimal-places 2)
|
||||
(def ^:const swap-provider-paraswap
|
||||
(def ^:const swap-default-provider
|
||||
{:name :paraswap
|
||||
:full-name "Paraswap"
|
||||
:color :blue
|
||||
:contract-address "0xdef171fe48cf0115b1d80b88dc8eab59176fee57"
|
||||
:terms-and-conditions-url "https://files.paraswap.io/tos_v4.pdf"})
|
||||
(def ^:const swap-providers
|
||||
{:paraswap swap-provider-paraswap})
|
||||
|
||||
(def ^:const token-for-fees-symbol "ETH")
|
||||
|
||||
(def ^:const transaction-status-success "Success")
|
||||
(def ^:const transaction-status-pending "Pending")
|
||||
(def ^:const transaction-status-failed "Failed")
|
||||
|
||||
(def ^:const min-token-decimals-to-display 6)
|
||||
(def ^:const swap-proposal-refresh-interval-ms 15000)
|
||||
|
||||
@@ -7,10 +7,17 @@
|
||||
[taoensso.timbre :as log]
|
||||
[utils.re-frame :as rf]))
|
||||
|
||||
(def ^:const user-confirmed-key :centralized-metrics/user-confirmed?)
|
||||
(def ^:const enabled-key :centralized-metrics/enabled?)
|
||||
|
||||
(defn show-confirmation-modal?
|
||||
[db]
|
||||
(not (user-confirmed-key db)))
|
||||
|
||||
(defn push-event?
|
||||
[db]
|
||||
(or (not (:centralized-metrics/user-confirmed? db))
|
||||
(:centralized-metrics/enabled? db)))
|
||||
(or (not (user-confirmed-key db))
|
||||
(enabled-key db)))
|
||||
|
||||
(defn centralized-metrics-interceptor
|
||||
[context]
|
||||
@@ -26,16 +33,17 @@
|
||||
:after centralized-metrics-interceptor))
|
||||
|
||||
(rf/reg-event-fx :centralized-metrics/toggle-centralized-metrics
|
||||
(fn [{:keys [db]} [enabled? onboarding?]]
|
||||
(fn [{:keys [db]} [enabled?]]
|
||||
{:fx [[:effects.centralized-metrics/toggle-metrics enabled?]]
|
||||
:db (-> db
|
||||
(assoc :centralized-metrics/user-confirmed? true)
|
||||
(assoc :centralized-metrics/enabled? enabled?)
|
||||
(assoc :centralized-metrics/onboarding-enabled? (and onboarding? enabled?)))}))
|
||||
:db (assoc db
|
||||
user-confirmed-key
|
||||
true
|
||||
enabled-key
|
||||
enabled?)}))
|
||||
|
||||
(rf/reg-event-fx :centralized-metrics/check-modal
|
||||
(fn [{:keys [db]} [modal-view]]
|
||||
(when-not (:centralized-metrics/user-confirmed? db)
|
||||
(when (show-confirmation-modal? db)
|
||||
{:fx [[:dispatch
|
||||
[:show-bottom-sheet
|
||||
{:content (fn [] [modal-view])
|
||||
|
||||
@@ -6,6 +6,11 @@
|
||||
[status-im.contexts.centralized-metrics.tracking :as tracking]
|
||||
[test-helpers.unit :as h]))
|
||||
|
||||
(deftest show-confirmation-modal-test
|
||||
(testing "returns true if the user confirmed"
|
||||
(is (false? (events/show-confirmation-modal? {events/user-confirmed-key true})))
|
||||
(is (true? (events/show-confirmation-modal? {})))))
|
||||
|
||||
(deftest push-event-test
|
||||
(testing "returns correct boolean value"
|
||||
(is (true? (events/push-event? {:centralized-metrics/user-confirmed? false})))
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
:screen/onboarding.enable-biometrics
|
||||
:screen/onboarding.generating-keys
|
||||
:screen/onboarding.enable-notifications
|
||||
:screen/onboarding.preparing-status
|
||||
:screen/onboarding.sign-in-intro
|
||||
:screen/onboarding.sign-in
|
||||
:screen/onboarding.syncing-progress
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
item])))))
|
||||
|
||||
(defn add-manage-members
|
||||
[{:keys [on-scroll]}]
|
||||
[{:keys [scroll-enabled? on-scroll]}]
|
||||
(let [theme (quo.theme/use-theme)
|
||||
selected-participants (rf/sub [:group-chat/selected-participants])
|
||||
deselected-members (rf/sub [:group-chat/deselected-members])
|
||||
@@ -74,6 +74,7 @@
|
||||
(i18n/label (if admin? :t/manage-members :t/add-members))]
|
||||
[gesture/section-list
|
||||
{:key-fn :title
|
||||
:scroll-enabled @scroll-enabled?
|
||||
:on-scroll on-scroll
|
||||
:sticky-section-headers-enabled false
|
||||
:sections (rf/sub [:contacts/grouped-by-first-letter])
|
||||
|
||||
@@ -146,16 +146,9 @@
|
||||
"")]
|
||||
(subs preview-text 0 (min (count preview-text) max-subheader-length))))
|
||||
|
||||
(defn- last-message-color
|
||||
[unread-messages? muted theme]
|
||||
(cond
|
||||
muted (colors/theme-colors colors/neutral-50 colors/neutral-60 theme)
|
||||
unread-messages? (colors/theme-colors colors/neutral-100 colors/white theme)
|
||||
:else (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)))
|
||||
|
||||
(defn last-message-preview
|
||||
"Render the preview of a last message to a maximum of max-subheader-length characters"
|
||||
[group-chat {:keys [deleted? outgoing from deleted-for-me?] :as message} muted unread-messages?]
|
||||
[group-chat {:keys [deleted? outgoing from deleted-for-me?] :as message}]
|
||||
(let [theme (quo.theme/use-theme)
|
||||
[primary-name _] (rf/sub [:contacts/contact-two-names-by-identity from])
|
||||
preview-text (if deleted-for-me?
|
||||
@@ -169,7 +162,9 @@
|
||||
(preview-text-from-content group-chat primary-name message)))]
|
||||
[quo/text
|
||||
{:size :paragraph-2
|
||||
:style {:color (last-message-color unread-messages? muted theme)
|
||||
:style {:color (colors/theme-colors colors/neutral-50
|
||||
colors/neutral-40
|
||||
theme)
|
||||
:flex 1}
|
||||
:number-of-lines 1
|
||||
:ellipsize-mode :tail
|
||||
@@ -236,16 +231,14 @@
|
||||
unviewed-messages-count]])))
|
||||
|
||||
(defn chat-item
|
||||
[{:keys [chat-id group-chat color name last-message timestamp muted image
|
||||
unviewed-messages-count]
|
||||
[{:keys [chat-id group-chat color name last-message timestamp muted image]
|
||||
:as item}]
|
||||
(let [[primary-name secondary-name]
|
||||
(if group-chat
|
||||
[name ""]
|
||||
(rf/sub [:contacts/contact-two-names-by-identity chat-id]))
|
||||
{:keys [ens-verified added?] :as contact} (when-not group-chat
|
||||
(rf/sub [:contacts/contact-by-address chat-id]))
|
||||
unread-messages? (pos? unviewed-messages-count)]
|
||||
(rf/sub [:contacts/contact-by-address chat-id]))]
|
||||
[rn/view {:style {:flex-direction :row}}
|
||||
[avatar-view
|
||||
{:contact contact
|
||||
@@ -265,7 +258,7 @@
|
||||
:muted? muted
|
||||
:time-str (datetime/to-short-str timestamp)
|
||||
:style {:flex-shrink 1}}]
|
||||
[last-message-preview group-chat last-message muted unread-messages?]]]
|
||||
[last-message-preview group-chat last-message muted]]]
|
||||
[notification item]]))
|
||||
|
||||
(defn chat-user
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
(ns status-im.contexts.chat.messenger.composer.actions.image.view
|
||||
(:require [quo.core :as quo]
|
||||
[react-native.permissions :as permissions]
|
||||
[react-native.platform :as platform]
|
||||
[status-im.common.alert.effects :as alert.effects]
|
||||
[status-im.common.device-permissions :as device-permissions]
|
||||
[status-im.constants :as constants]
|
||||
[utils.i18n :as i18n]
|
||||
[utils.re-frame :as rf]))
|
||||
|
||||
(defn photo-limit-toast
|
||||
[]
|
||||
(rf/dispatch [:toasts/upsert
|
||||
{:id :random-id
|
||||
:type :negative
|
||||
:text (i18n/label :t/hit-photos-limit
|
||||
{:max-photos constants/max-album-photos})}]))
|
||||
|
||||
(defn go-to-camera
|
||||
[images-count]
|
||||
(device-permissions/camera #(if (>= images-count constants/max-album-photos)
|
||||
(photo-limit-toast)
|
||||
(rf/dispatch [:navigate-to :camera-screen]))))
|
||||
|
||||
(defn camera-button
|
||||
[]
|
||||
(let [images-count (count (vals (rf/sub [:chats/sending-image])))]
|
||||
[quo/composer-button
|
||||
{:on-press #(go-to-camera images-count)
|
||||
:accessibility-label :camera-button
|
||||
:icon :i/camera
|
||||
:container-style {:margin-right 12}}]))
|
||||
|
||||
(defn open-photo-selector
|
||||
[input-ref]
|
||||
(permissions/request-permissions
|
||||
{:permissions [(if platform/is-below-android-13? :read-external-storage :read-media-images)
|
||||
:write-external-storage]
|
||||
:on-allowed (fn []
|
||||
(when (and platform/android? @input-ref)
|
||||
(.blur ^js @input-ref))
|
||||
(when platform/ios?
|
||||
(rf/dispatch [:alert-banners/hide]))
|
||||
(rf/dispatch [:photo-selector/navigate-to-photo-selector]))
|
||||
:on-denied #(alert.effects/show-popup (i18n/label :t/error)
|
||||
(i18n/label :t/external-storage-denied))}))
|
||||
|
||||
(defn image-button
|
||||
[input-ref]
|
||||
[quo/composer-button
|
||||
{:on-press #(open-photo-selector input-ref)
|
||||
:accessibility-label :open-images-button
|
||||
:container-style {:margin-right 12}
|
||||
:icon :i/image}])
|
||||
@@ -7,14 +7,26 @@
|
||||
{:height constants/actions-container-height
|
||||
:justify-content :space-between
|
||||
:align-items :center
|
||||
:z-index 2
|
||||
:flex-direction :row})
|
||||
|
||||
(defn send-button
|
||||
[opacity]
|
||||
[opacity z-index]
|
||||
(reanimated/apply-animations-to-style
|
||||
{:opacity opacity}
|
||||
{:position :absolute
|
||||
:right 0
|
||||
:z-index z-index
|
||||
:padding-vertical 3
|
||||
:padding-left 2}))
|
||||
|
||||
(defn record-audio-container
|
||||
[]
|
||||
{:align-items :center
|
||||
:background-color :transparent
|
||||
:flex-direction :row
|
||||
:position :absolute
|
||||
:left -20
|
||||
:right -20
|
||||
:bottom 0
|
||||
:height constants/composer-default-height})
|
||||
|
||||
@@ -2,60 +2,246 @@
|
||||
(:require
|
||||
[quo.core :as quo]
|
||||
[react-native.core :as rn]
|
||||
[react-native.permissions :as permissions]
|
||||
[react-native.platform :as platform]
|
||||
[react-native.reanimated :as reanimated]
|
||||
[reagent.core :as reagent]
|
||||
[status-im.common.alert.effects :as alert.effects]
|
||||
[status-im.common.device-permissions :as device-permissions]
|
||||
[status-im.config :as config]
|
||||
[status-im.constants :as constants]
|
||||
[status-im.contexts.chat.messenger.composer.actions.image.view :as actions.image]
|
||||
[status-im.contexts.chat.messenger.composer.actions.style :as style]
|
||||
[status-im.contexts.chat.messenger.composer.constants :as comp-constants]
|
||||
[utils.i18n :as i18n]
|
||||
[utils.re-frame :as rf]))
|
||||
|
||||
(defn send-message
|
||||
[input-ref edit btn-opacity]
|
||||
(when @input-ref
|
||||
(.clear ^js @input-ref))
|
||||
(reanimated/animate btn-opacity 0)
|
||||
"Minimize composer, animate-out background overlay, clear input and flush state"
|
||||
[{:keys [sending-images? sending-links?]}
|
||||
{:keys [text-value maximized?]}
|
||||
{:keys [height saved-height last-height opacity background-y]}
|
||||
window-height
|
||||
edit]
|
||||
(reanimated/animate height comp-constants/input-height)
|
||||
(reanimated/set-shared-value saved-height comp-constants/input-height)
|
||||
(reanimated/set-shared-value last-height comp-constants/input-height)
|
||||
(reanimated/animate opacity 0)
|
||||
(js/setTimeout #(reanimated/set-shared-value background-y
|
||||
(- window-height))
|
||||
300)
|
||||
(rf/dispatch [:chat.ui/send-current-message])
|
||||
(rf/dispatch [:chat.ui/set-input-maximized false])
|
||||
(rf/dispatch [:chat.ui/set-input-content-height comp-constants/input-height])
|
||||
(rf/dispatch [:chat.ui/set-chat-input-text nil])
|
||||
(reset! maximized? false)
|
||||
(reset! text-value "")
|
||||
(reset! sending-links? false)
|
||||
(reset! sending-images? false)
|
||||
(when-not (some? edit)
|
||||
(rf/dispatch [:chat.ui/scroll-to-bottom])))
|
||||
|
||||
(defn send-button
|
||||
[input-ref edit]
|
||||
(let [btn-opacity (reanimated/use-shared-value 0)
|
||||
chat-input (rf/sub [:chats/current-chat-input])
|
||||
input-text (:input-text chat-input)
|
||||
images? (boolean (seq (rf/sub [:chats/sending-image])))
|
||||
(defn f-send-button
|
||||
[props state animations window-height images? btn-opacity z-index edit]
|
||||
(let [{:keys [text-value]} state
|
||||
profile-customization-color (rf/sub [:profile/customization-color])
|
||||
{:keys [chat-id chat-type]
|
||||
chat-color :color} (rf/sub [:chats/current-chat-chat-view])
|
||||
contact-customization-color (when (= chat-type constants/one-to-one-chat-type)
|
||||
(rf/sub [:contacts/contact-customization-color-by-address
|
||||
chat-id]))
|
||||
on-press (rn/use-callback #(send-message input-ref edit btn-opacity) [edit])]
|
||||
chat-id]))]
|
||||
(rn/use-effect (fn []
|
||||
;; Handle send button opacity animation and z-index when input content changes
|
||||
(if (or (seq input-text) images?)
|
||||
(when (not= (reanimated/get-shared-value btn-opacity) 1)
|
||||
(if (or (seq @text-value) images?)
|
||||
(when (or (not= @z-index 1) (not= (reanimated/get-shared-value btn-opacity) 1))
|
||||
(reset! z-index 1)
|
||||
(js/setTimeout #(reanimated/animate btn-opacity 1) 50))
|
||||
(when (not= (reanimated/get-shared-value btn-opacity) 0)
|
||||
(reanimated/animate btn-opacity 0))))
|
||||
[(and (empty? input-text) (not images?))])
|
||||
(when (or (not= @z-index 0) (not= (reanimated/get-shared-value btn-opacity) 0))
|
||||
(reanimated/animate btn-opacity 0)
|
||||
(js/setTimeout #(when (and (empty? @text-value) (not images?))
|
||||
(reset! z-index 0))
|
||||
300))))
|
||||
[(and (empty? @text-value) (not images?))])
|
||||
[reanimated/view
|
||||
{:style (style/send-button btn-opacity)}
|
||||
{:style (style/send-button btn-opacity @z-index)}
|
||||
[quo/button
|
||||
{:icon-only? true
|
||||
:size 32
|
||||
:customization-color (or contact-customization-color chat-color profile-customization-color)
|
||||
:accessibility-label :send-message-button
|
||||
:on-press on-press}
|
||||
:on-press #(send-message props state animations window-height edit)}
|
||||
:i/arrow-up]]))
|
||||
|
||||
(defn send-button
|
||||
[props {:keys [text-value] :as state} animations window-height images? edit btn-opacity]
|
||||
(let [z-index (reagent/atom (if (and (empty? @text-value) (not images?)) 0 1))]
|
||||
[:f> f-send-button props state animations window-height images? btn-opacity z-index edit]))
|
||||
|
||||
(defn disabled-audio-button
|
||||
[opacity]
|
||||
[reanimated/view {:style (reanimated/apply-animations-to-style {:opacity opacity} {})}
|
||||
[quo/composer-button
|
||||
{:on-press (fn []
|
||||
(rf/dispatch [:chat.ui/set-input-focused false])
|
||||
(rn/dismiss-keyboard!)
|
||||
(js/alert "to be implemented"))
|
||||
:icon :i/audio}]])
|
||||
|
||||
(defn audio-button
|
||||
[{:keys [record-reset-fn input-ref]}
|
||||
{:keys [record-permission? recording? gesture-enabled? focused?]}]
|
||||
(let [audio (rf/sub [:chats/sending-audio])]
|
||||
[rn/view
|
||||
{:style (style/record-audio-container)
|
||||
:pointer-events :box-none}
|
||||
[quo/record-audio
|
||||
{:record-audio-permission-granted @record-permission?
|
||||
:on-init (fn [reset-fn]
|
||||
(reset! record-reset-fn reset-fn))
|
||||
:on-start-recording (fn []
|
||||
(rf/dispatch [:chat.ui/set-recording true])
|
||||
(reset! recording? true)
|
||||
(reset! gesture-enabled? false))
|
||||
:audio-file audio
|
||||
:on-lock (fn []
|
||||
(rf/dispatch [:chat.ui/set-recording false]))
|
||||
:on-reviewing-audio (fn [file]
|
||||
(rf/dispatch [:chat.ui/set-recording false])
|
||||
(rf/dispatch [:chat.ui/set-input-audio file]))
|
||||
:on-send (fn [{:keys [file-path duration]}]
|
||||
(rf/dispatch [:chat.ui/set-recording false])
|
||||
(reset! recording? false)
|
||||
(reset! gesture-enabled? true)
|
||||
(rf/dispatch [:chat/send-audio file-path duration])
|
||||
(when @focused?
|
||||
(js/setTimeout #(when @input-ref (.focus ^js @input-ref))
|
||||
300))
|
||||
(rf/dispatch [:chat.ui/set-input-audio nil]))
|
||||
:on-cancel (fn []
|
||||
(when @recording?
|
||||
(rf/dispatch [:chat.ui/set-recording false])
|
||||
(reset! recording? false)
|
||||
(reset! gesture-enabled? true)
|
||||
(when @focused?
|
||||
(js/setTimeout #(when @input-ref
|
||||
(.focus ^js @input-ref))
|
||||
300))
|
||||
(rf/dispatch [:chat.ui/set-input-audio nil])))
|
||||
:on-check-audio-permissions (fn []
|
||||
(permissions/permission-granted?
|
||||
:record-audio
|
||||
#(reset! record-permission? %)
|
||||
#(reset! record-permission? false)))
|
||||
:on-request-record-audio-permission (fn []
|
||||
(rf/dispatch
|
||||
[:request-permissions
|
||||
{:permissions [:record-audio]
|
||||
:on-allowed
|
||||
#(reset! record-permission? true)
|
||||
:on-denied
|
||||
#(js/setTimeout
|
||||
(fn []
|
||||
(alert.effects/show-popup
|
||||
(i18n/label :t/audio-recorder-error)
|
||||
(i18n/label
|
||||
:t/audio-recorder-permissions-error)
|
||||
nil
|
||||
{:text (i18n/label :t/settings)
|
||||
:accessibility-label :settings-button
|
||||
:onPress (fn [] (permissions/open-settings))}))
|
||||
50)}]))
|
||||
:max-duration-ms constants/audio-max-duration-ms}]]))
|
||||
|
||||
(defn photo-limit-toast
|
||||
[]
|
||||
(rf/dispatch [:toasts/upsert
|
||||
{:id :random-id
|
||||
:type :negative
|
||||
:text (i18n/label :t/hit-photos-limit
|
||||
{:max-photos constants/max-album-photos})}]))
|
||||
|
||||
|
||||
(defn go-to-camera
|
||||
[images-count]
|
||||
(device-permissions/camera #(if (>= images-count constants/max-album-photos)
|
||||
(photo-limit-toast)
|
||||
(rf/dispatch [:navigate-to :camera-screen]))))
|
||||
|
||||
(defn camera-button
|
||||
[edit]
|
||||
(let [images-count (count (vals (rf/sub [:chats/sending-image])))]
|
||||
[quo/composer-button
|
||||
{:on-press (if edit
|
||||
#(js/alert "This feature is temporarily unavailable in edit mode.")
|
||||
#(go-to-camera images-count))
|
||||
:accessibility-label :camera-button
|
||||
:icon :i/camera
|
||||
:container-style {:margin-right 12}}]))
|
||||
|
||||
|
||||
(defn open-photo-selector
|
||||
[{:keys [input-ref]}
|
||||
{:keys [height]}]
|
||||
(permissions/request-permissions
|
||||
{:permissions [(if platform/is-below-android-13? :read-external-storage :read-media-images)
|
||||
:write-external-storage]
|
||||
:on-allowed (fn []
|
||||
(when (and platform/android? @input-ref)
|
||||
(.blur ^js @input-ref))
|
||||
(when platform/ios?
|
||||
(rf/dispatch [:alert-banners/hide]))
|
||||
(rf/dispatch [:chat.ui/set-input-content-height
|
||||
(reanimated/get-shared-value height)])
|
||||
(rf/dispatch [:photo-selector/navigate-to-photo-selector]))
|
||||
:on-denied (fn []
|
||||
(alert.effects/show-popup (i18n/label :t/error)
|
||||
(i18n/label
|
||||
:t/external-storage-denied)))}))
|
||||
|
||||
(defn image-button
|
||||
[props animations edit]
|
||||
[quo/composer-button
|
||||
{:on-press (if edit
|
||||
#(js/alert "This feature is temporarily unavailable in edit mode.")
|
||||
#(open-photo-selector props animations))
|
||||
:accessibility-label :open-images-button
|
||||
:container-style {:margin-right 12}
|
||||
:icon :i/image}])
|
||||
|
||||
(defn reaction-button
|
||||
[]
|
||||
[quo/composer-button
|
||||
{:icon :i/reaction
|
||||
:on-press (fn []
|
||||
(rf/dispatch [:chat.ui/set-input-focused false])
|
||||
(rn/dismiss-keyboard!)
|
||||
(js/alert "to be implemented"))
|
||||
:container-style {:margin-right 12}}])
|
||||
|
||||
(defn format-button
|
||||
[]
|
||||
[quo/composer-button
|
||||
{:on-press (fn []
|
||||
(rf/dispatch [:chat.ui/set-input-focused false])
|
||||
(rn/dismiss-keyboard!)
|
||||
(js/alert "to be implemented"))
|
||||
:icon :i/format}])
|
||||
|
||||
(defn view
|
||||
[input-ref]
|
||||
(let [edit (rf/sub [:chats/edit-message])]
|
||||
[props state animations window-height {:keys [edit images]}]
|
||||
(let [send-btn-opacity (reanimated/use-shared-value 0)
|
||||
audio-btn-opacity (reanimated/interpolate send-btn-opacity [0 1] [1 0])]
|
||||
[rn/view {:style style/actions-container}
|
||||
[rn/view {:style {:flex-direction :row}}
|
||||
(when-not edit
|
||||
[:<>
|
||||
[actions.image/camera-button]
|
||||
[actions.image/image-button input-ref edit]])]
|
||||
[send-button input-ref edit]]))
|
||||
[rn/view
|
||||
{:style {:flex-direction :row
|
||||
:display (if @(:recording? state) :none :flex)}}
|
||||
[camera-button edit]
|
||||
[image-button props animations edit]
|
||||
(when config/show-not-implemented-features?
|
||||
[reaction-button])
|
||||
(when config/show-not-implemented-features?
|
||||
[format-button])]
|
||||
[:f> send-button props state animations window-height images edit send-btn-opacity]
|
||||
(when (and (not edit) (not images) config/show-not-implemented-features?)
|
||||
;; TODO(alwx): needs to be replaced with an `audio-button` later. See
|
||||
;; https://github.com/status-im/status-mobile/issues/16084 for more details.
|
||||
[:f> disabled-audio-button audio-btn-opacity])]))
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
|
||||
(def ^:const line-height (if platform/ios? 18 (:line-height typography/paragraph-1)))
|
||||
|
||||
(def ^:const multiline-minimized-height (+ input-height line-height))
|
||||
|
||||
(def ^:const empty-opacity 0.7)
|
||||
|
||||
(def ^:const images-padding-top 12)
|
||||
(def ^:const images-padding-bottom 8)
|
||||
(def ^:const images-container-height
|
||||
@@ -29,6 +33,16 @@
|
||||
|
||||
(def ^:const mentions-max-height 240)
|
||||
|
||||
(def ^:const extra-content-offset (if platform/ios? 6 -8))
|
||||
|
||||
(def ^:const content-change-threshold 10)
|
||||
|
||||
(def ^:const drag-threshold 30)
|
||||
|
||||
(def ^:const velocity-threshold (if platform/ios? -1000 -500))
|
||||
|
||||
(def ^:const background-threshold 0.75)
|
||||
|
||||
(def ^:const max-text-size 4096)
|
||||
|
||||
(def ^:const unfurl-debounce-ms
|
||||
|
||||
@@ -7,13 +7,12 @@
|
||||
[react-native.reanimated :as reanimated]
|
||||
[status-im.contexts.chat.messenger.composer.constants :as constants]
|
||||
[status-im.contexts.chat.messenger.composer.edit.style :as style]
|
||||
[status-im.contexts.chat.messenger.composer.effects :as effects]
|
||||
[status-im.contexts.chat.messenger.composer.utils :as utils]
|
||||
[utils.i18n :as i18n]
|
||||
[utils.re-frame :as rf]))
|
||||
|
||||
(defn edit-message
|
||||
[input-ref]
|
||||
[{:keys [text-value input-ref input-height]}]
|
||||
(let [theme (quo.theme/use-theme)]
|
||||
[rn/view
|
||||
{:style style/container
|
||||
@@ -33,16 +32,18 @@
|
||||
{:size 24
|
||||
:icon-only? true
|
||||
:accessibility-label :edit-cancel-button
|
||||
:on-press #(utils/cancel-edit-message input-ref)
|
||||
:on-press #(utils/cancel-edit-message text-value input-ref input-height)
|
||||
:type :outline}
|
||||
:i/close]]))
|
||||
|
||||
(defn view
|
||||
[input-ref]
|
||||
(defn- f-view
|
||||
[props]
|
||||
(let [edit (rf/sub [:chats/edit-message])
|
||||
height (reanimated/use-shared-value (if edit constants/edit-container-height 0))]
|
||||
(effects/use-edit input-ref edit)
|
||||
(rn/use-effect #(reanimated/animate height (if edit constants/edit-container-height 0)) [edit])
|
||||
[reanimated/view {:style (reanimated/apply-animations-to-style {:height height} {})}
|
||||
(when edit
|
||||
[edit-message input-ref])]))
|
||||
(when edit [edit-message props])]))
|
||||
|
||||
(defn view
|
||||
[props]
|
||||
[:f> f-view props])
|
||||
|
||||
@@ -1,20 +1,225 @@
|
||||
(ns status-im.contexts.chat.messenger.composer.effects
|
||||
(:require
|
||||
[clojure.string :as string]
|
||||
[oops.core :as oops]
|
||||
[react-native.async-storage :as async-storage]
|
||||
[react-native.core :as rn]
|
||||
[utils.number]))
|
||||
[react-native.platform :as platform]
|
||||
[react-native.reanimated :as reanimated]
|
||||
[reagent.core :as reagent]
|
||||
[status-im.contexts.chat.messenger.composer.constants :as constants]
|
||||
[status-im.contexts.chat.messenger.composer.keyboard :as kb]
|
||||
[status-im.contexts.chat.messenger.composer.utils :as utils]
|
||||
[utils.number]
|
||||
[utils.re-frame :as rf]))
|
||||
|
||||
(defn reenter-screen-effect
|
||||
[{:keys [text-value saved-cursor-position maximized?]}
|
||||
{:keys [content-height]}
|
||||
{:keys [input-content-height input-text input-maximized?]}
|
||||
{:keys [height]}]
|
||||
(let [lines (utils/calc-lines input-content-height)
|
||||
minimized-height (if (or (= lines 1) (empty? input-text))
|
||||
constants/input-height
|
||||
constants/multiline-minimized-height)]
|
||||
(when (and (empty? @text-value) (not= input-text nil))
|
||||
(reset! text-value input-text)
|
||||
(reset! content-height input-content-height)
|
||||
(reset! saved-cursor-position (count input-text))
|
||||
(reanimated/set-shared-value height minimized-height))
|
||||
(when input-maximized?
|
||||
(reset! maximized? true))))
|
||||
|
||||
(defn maximized-effect
|
||||
[{:keys [maximized?]}
|
||||
{:keys [height saved-height last-height]}
|
||||
{:keys [max-height]}
|
||||
{:keys [input-content-height]}]
|
||||
(when (or @maximized? (>= input-content-height max-height))
|
||||
(reanimated/animate height max-height)
|
||||
(reanimated/set-shared-value saved-height max-height)
|
||||
(reanimated/set-shared-value last-height max-height)))
|
||||
|
||||
(defn layout-effect
|
||||
[{:keys [lock-layout?]}]
|
||||
(when-not @lock-layout?
|
||||
(js/setTimeout #(reset! lock-layout? true) 500)))
|
||||
|
||||
(defn kb-default-height-effect
|
||||
[{:keys [kb-default-height kb-height]}]
|
||||
(when (zero? @kb-default-height)
|
||||
(async-storage/get-item :kb-default-height
|
||||
(fn [height]
|
||||
(reset! kb-default-height (utils.number/parse-int height 0))
|
||||
(reset! kb-height (utils.number/parse-int height 0))))))
|
||||
|
||||
(defn background-effect
|
||||
[{:keys [maximized?]}
|
||||
{:keys [opacity background-y]}
|
||||
{:keys [max-height]}
|
||||
{:keys [input-content-height]}]
|
||||
(when (or @maximized? (>= input-content-height (* max-height constants/background-threshold)))
|
||||
(reanimated/set-shared-value background-y 0)
|
||||
(reanimated/animate opacity 1)))
|
||||
|
||||
(defn link-preview-effect
|
||||
[{:keys [text-value]}]
|
||||
(let [text @text-value]
|
||||
(when-not (string/blank? text)
|
||||
(rf/dispatch [:link-preview/unfurl-urls text]))))
|
||||
|
||||
(defn audio-effect
|
||||
[{:keys [recording? gesture-enabled?]}
|
||||
audio]
|
||||
(when (and audio (not @recording?))
|
||||
(reset! recording? true)
|
||||
(reset! gesture-enabled? false)))
|
||||
|
||||
(defn empty-effect
|
||||
[{:keys [empty-input?]} subscriptions]
|
||||
(reanimated/set-shared-value
|
||||
empty-input?
|
||||
(utils/empty-input? subscriptions)))
|
||||
|
||||
(defn component-will-unmount
|
||||
[{:keys [keyboard-show-listener keyboard-hide-listener keyboard-frame-listener]}]
|
||||
(.remove ^js @keyboard-show-listener)
|
||||
(.remove ^js @keyboard-hide-listener)
|
||||
(.remove ^js @keyboard-frame-listener))
|
||||
|
||||
(defn initialize
|
||||
[props state animations {:keys [max-height] :as dimensions}
|
||||
{:keys [chat-input audio input-text images link-previews? reply edit] :as subscriptions}]
|
||||
(rn/use-effect
|
||||
(fn []
|
||||
(maximized-effect state animations dimensions chat-input)
|
||||
(layout-effect state)
|
||||
(kb-default-height-effect state)
|
||||
(background-effect state animations dimensions chat-input)
|
||||
(link-preview-effect state)
|
||||
(audio-effect state audio)
|
||||
(kb/add-kb-listeners props state animations dimensions)
|
||||
#(component-will-unmount props))
|
||||
[max-height])
|
||||
(rn/use-effect
|
||||
(fn []
|
||||
(empty-effect animations subscriptions))
|
||||
[input-text images link-previews? reply edit audio])
|
||||
(rn/use-mount #(reenter-screen-effect state dimensions subscriptions animations)))
|
||||
|
||||
(defn use-edit
|
||||
[input-ref edit]
|
||||
(rn/use-effect
|
||||
(fn []
|
||||
(when (and edit @input-ref)
|
||||
(js/setTimeout #(.focus ^js @input-ref) 600)))
|
||||
[(:message-id edit)]))
|
||||
[{:keys [input-ref]}
|
||||
{:keys [text-value saved-cursor-position cursor-position]}
|
||||
{:keys [edit input-with-mentions]}
|
||||
chat-screen-layout-calculations-complete?]
|
||||
(let [mention? (some #(= :mention (first %)) (seq input-with-mentions))]
|
||||
(rn/use-effect
|
||||
(fn []
|
||||
(let [mention-text (reduce (fn [acc item]
|
||||
(str acc (second item)))
|
||||
""
|
||||
input-with-mentions)
|
||||
edit-text (cond
|
||||
mention? mention-text
|
||||
;; NOTE: using text-value for cases when the user
|
||||
;; leaves the app with an unfinished edit and re-opens
|
||||
;; the chat.
|
||||
(and (seq @text-value)
|
||||
(not (reanimated/get-shared-value
|
||||
chat-screen-layout-calculations-complete?)))
|
||||
@text-value
|
||||
:else (get-in edit [:content :text]))
|
||||
selection-pos (count edit-text)
|
||||
inject-edit-text (fn []
|
||||
(reset! text-value edit-text)
|
||||
(reset! cursor-position selection-pos)
|
||||
(reset! saved-cursor-position selection-pos)
|
||||
(when @input-ref
|
||||
(.setNativeProps ^js @input-ref
|
||||
(clj->js {:text edit-text}))))]
|
||||
|
||||
(when (and edit @input-ref)
|
||||
;; NOTE: A small setTimeout is necessary to ensure the focus is enqueued and is executed
|
||||
;; ASAP. Check https://github.com/software-mansion/react-native-screens/issues/472
|
||||
;;
|
||||
;; The nested setTimeout is necessary to avoid both `on-focus` and
|
||||
;; `on-content-size-change` handlers triggering the height animation simultaneously, as
|
||||
;; this causes a jump in the
|
||||
;; UI. This way, `on-focus` will trigger first without changing the height, after which
|
||||
;; `on-content-size-change` will animate the height of the input based on the injected
|
||||
;; text.
|
||||
(js/setTimeout #(do (when (reanimated/get-shared-value
|
||||
chat-screen-layout-calculations-complete?)
|
||||
(.focus ^js @input-ref))
|
||||
(reagent/next-tick inject-edit-text))
|
||||
600))))
|
||||
[(:message-id edit)])))
|
||||
|
||||
(defn use-reply
|
||||
[input-ref reply]
|
||||
[{:keys [input-ref]}
|
||||
{:keys [reply]}
|
||||
chat-screen-layout-calculations-complete?]
|
||||
(rn/use-effect
|
||||
(fn []
|
||||
(when (and reply @input-ref)
|
||||
(when (and reply @input-ref (reanimated/get-shared-value chat-screen-layout-calculations-complete?))
|
||||
(js/setTimeout #(.focus ^js @input-ref) 600)))
|
||||
[(:message-id reply)]))
|
||||
|
||||
(defn update-input-mention
|
||||
[{:keys [input-ref]}
|
||||
{:keys [text-value]}
|
||||
{:keys [input-text]}]
|
||||
(rn/use-effect
|
||||
(fn []
|
||||
(when (and input-text (not= @text-value input-text))
|
||||
(when @input-ref
|
||||
(.setNativeProps ^js @input-ref (clj->js {:text input-text})))
|
||||
(reset! text-value input-text)
|
||||
(rf/dispatch [:mention/on-change-text input-text])))
|
||||
[input-text]))
|
||||
|
||||
(defn link-previews
|
||||
[{:keys [sending-links?]}
|
||||
{:keys [text-value maximized?]}
|
||||
{:keys [height saved-height]}
|
||||
{:keys [link-previews?]}]
|
||||
(rn/use-effect
|
||||
(fn []
|
||||
(if-not @maximized?
|
||||
(when (not= @sending-links? link-previews?)
|
||||
(reanimated/animate height (reanimated/get-shared-value saved-height)))
|
||||
(let [curr-text @text-value]
|
||||
(reset! text-value (str @text-value " "))
|
||||
(js/setTimeout #(reset! text-value curr-text) 100)))
|
||||
(reset! sending-links? link-previews?))
|
||||
[link-previews?]))
|
||||
|
||||
(defn use-images
|
||||
[{:keys [sending-images? input-ref]}
|
||||
{:keys [text-value maximized?]}
|
||||
{:keys [height saved-height]}
|
||||
{:keys [images]}]
|
||||
(rn/use-effect
|
||||
(fn []
|
||||
(when (and (not @sending-images?) (seq images) @input-ref)
|
||||
(.focus ^js @input-ref))
|
||||
(if-not @maximized?
|
||||
(when (not= @sending-images? (boolean (seq images)))
|
||||
(reanimated/animate height (reanimated/get-shared-value saved-height)))
|
||||
(let [curr-text @text-value]
|
||||
(reset! text-value (str @text-value " "))
|
||||
(js/setTimeout #(reset! text-value curr-text) 100)))
|
||||
(reset! sending-images? (boolean (seq images))))
|
||||
[(boolean (seq images))]))
|
||||
|
||||
(defn did-mount
|
||||
[{:keys [selectable-input-ref input-ref selection-manager]}]
|
||||
(rn/use-mount
|
||||
(fn []
|
||||
(when platform/android?
|
||||
(let [selectable-text-input-handle (rn/find-node-handle @selectable-input-ref)
|
||||
text-input-handle (rn/find-node-handle @input-ref)]
|
||||
(oops/ocall selection-manager
|
||||
:setupMenuItems
|
||||
selectable-text-input-handle
|
||||
text-input-handle))))))
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
[status-im.contexts.chat.messenger.composer.link-preview.events :as link-preview]
|
||||
[status-im.contexts.chat.messenger.messages.transport.events :as messages.transport]
|
||||
[taoensso.timbre :as log]
|
||||
[utils.debounce :as debounce]
|
||||
[utils.emojilib :as emoji]
|
||||
[utils.i18n :as i18n]
|
||||
[utils.re-frame :as rf]
|
||||
@@ -22,12 +21,6 @@
|
||||
(when (empty? new-input)
|
||||
(mentions/clear-mentions)))))
|
||||
|
||||
(rf/defn set-chat-input-ref
|
||||
{:events [:chat/set-input-ref]}
|
||||
[{:keys [db]} input-ref]
|
||||
(let [current-chat-id (:current-chat-id db)]
|
||||
{:db (assoc-in db [:chat/inputs current-chat-id :input-ref] input-ref)}))
|
||||
|
||||
(rf/defn set-input-content-height
|
||||
{:events [:chat.ui/set-input-content-height]}
|
||||
[{db :db} content-height chat-id]
|
||||
@@ -76,14 +69,15 @@
|
||||
[{:keys [db]} message]
|
||||
(let [current-chat-id (:current-chat-id db)
|
||||
text (get-in message [:content :text])]
|
||||
{:db (-> db
|
||||
(assoc-in [:chat/inputs current-chat-id :metadata :editing-message]
|
||||
message)
|
||||
(assoc-in [:chat/inputs current-chat-id :metadata :responding-to-message] nil)
|
||||
(update-in [:chat/inputs current-chat-id :metadata]
|
||||
dissoc
|
||||
:sending-image))
|
||||
:dispatch [:mention/to-input-field text current-chat-id]}))
|
||||
{:db (-> db
|
||||
(assoc-in [:chat/inputs current-chat-id :metadata :editing-message]
|
||||
message)
|
||||
(assoc-in [:chat/inputs current-chat-id :metadata :responding-to-message] nil)
|
||||
(update-in [:chat/inputs current-chat-id :metadata]
|
||||
dissoc
|
||||
:sending-image))
|
||||
:dispatch-n [[:chat.ui/set-chat-input-text nil current-chat-id]
|
||||
[:mention/to-input-field text current-chat-id]]}))
|
||||
|
||||
(rf/defn cancel-message-reply
|
||||
"Cancels stage message reply"
|
||||
@@ -263,13 +257,6 @@
|
||||
[{{:keys [current-chat-id] :as db} :db :as cofx}]
|
||||
(let [{:keys [input-text metadata]} (get-in db [:chat/inputs current-chat-id])
|
||||
editing-message (:editing-message metadata)]
|
||||
(debounce/clear :link-preview/unfurl-urls)
|
||||
(debounce/clear :mention/on-change-text)
|
||||
(if editing-message
|
||||
(send-edited-message cofx input-text editing-message)
|
||||
(send-messages cofx input-text current-chat-id))))
|
||||
|
||||
(rf/reg-fx :effects/set-input-text-value
|
||||
(fn [[input-ref text-value]]
|
||||
(when (and (not (string/blank? text-value)) input-ref)
|
||||
(.setNativeProps ^js input-ref (clj->js {:text (emoji/text->emoji text-value)})))))
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
(ns status-im.contexts.chat.messenger.composer.gesture
|
||||
(:require
|
||||
[oops.core :as oops]
|
||||
[react-native.gesture :as gesture]
|
||||
[react-native.reanimated :as reanimated]
|
||||
[status-im.contexts.chat.messenger.composer.constants :as constants]
|
||||
[status-im.contexts.chat.messenger.composer.utils :as utils]
|
||||
[utils.number]
|
||||
[utils.re-frame :as rf]))
|
||||
|
||||
(defn set-opacity
|
||||
[velocity opacity translation expanding? min-height max-height new-height saved-height]
|
||||
(let [remaining-height (if expanding?
|
||||
(- max-height (reanimated/get-shared-value saved-height))
|
||||
(- (reanimated/get-shared-value saved-height) min-height))
|
||||
progress (if (= new-height min-height) 1 (/ translation remaining-height))
|
||||
currently-expanding? (neg? velocity)
|
||||
max-opacity? (and currently-expanding? (= (reanimated/get-shared-value opacity) 1))
|
||||
min-opacity? (and (not currently-expanding?)
|
||||
(= (reanimated/get-shared-value opacity) 0))]
|
||||
(if (>= translation 0)
|
||||
(when (and (not expanding?) (not min-opacity?))
|
||||
(reanimated/set-shared-value opacity (- 1 progress)))
|
||||
(when (and expanding? (not max-opacity?))
|
||||
(reanimated/set-shared-value opacity (Math/abs progress))))))
|
||||
|
||||
(defn maximize
|
||||
[{:keys [maximized?]}
|
||||
{:keys [height saved-height background-y opacity]}
|
||||
{:keys [max-height]}]
|
||||
(reanimated/animate height max-height)
|
||||
(reanimated/set-shared-value saved-height max-height)
|
||||
(reanimated/set-shared-value background-y 0)
|
||||
(reanimated/animate opacity 1)
|
||||
(js/setTimeout (fn []
|
||||
(reset! maximized? true)
|
||||
(rf/dispatch [:chat.ui/set-input-maximized true]))
|
||||
300))
|
||||
|
||||
(defn minimize
|
||||
[{:keys [input-ref emoji-kb-extra-height saved-emoji-kb-extra-height]}
|
||||
{:keys [maximized?]}]
|
||||
(when @emoji-kb-extra-height
|
||||
(reset! saved-emoji-kb-extra-height @emoji-kb-extra-height)
|
||||
(reset! emoji-kb-extra-height nil))
|
||||
(reset! maximized? false)
|
||||
(rf/dispatch [:chat.ui/set-input-maximized false])
|
||||
(utils/blur-input input-ref))
|
||||
|
||||
(defn bounce-back
|
||||
[{:keys [height saved-height opacity background-y]}
|
||||
{:keys [window-height]}
|
||||
starting-opacity]
|
||||
(reanimated/animate height (reanimated/get-shared-value saved-height))
|
||||
(when (zero? starting-opacity)
|
||||
(reanimated/animate opacity 0)
|
||||
(reanimated/animate-delay background-y (- window-height) 300)))
|
||||
|
||||
(defn drag-gesture
|
||||
[{:keys [input-ref] :as props}
|
||||
{:keys [gesture-enabled?] :as state}
|
||||
{:keys [height saved-height last-height opacity background-y] :as animations}
|
||||
{:keys [max-height lines] :as dimensions}
|
||||
keyboard-shown]
|
||||
(let [expanding? (atom true)
|
||||
starting-opacity (reanimated/get-shared-value opacity)]
|
||||
(-> (gesture/gesture-pan)
|
||||
(gesture/enabled @gesture-enabled?)
|
||||
(gesture/on-start (fn [event]
|
||||
(if-not keyboard-shown
|
||||
(do ; focus and end
|
||||
(when (< (oops/oget event "velocityY") constants/velocity-threshold)
|
||||
(reanimated/set-shared-value last-height max-height)
|
||||
(maximize state animations dimensions))
|
||||
(when @input-ref
|
||||
(.focus ^js @input-ref))
|
||||
(reset! gesture-enabled? false))
|
||||
(do ; else, will start gesture
|
||||
(reanimated/set-shared-value background-y 0)
|
||||
(reset! expanding? (neg? (oops/oget event "velocityY")))))))
|
||||
(gesture/on-update
|
||||
(fn [event]
|
||||
(let [translation (oops/oget event "translationY")
|
||||
min-height (utils/get-min-height lines)
|
||||
new-height (- (reanimated/get-shared-value saved-height) translation)
|
||||
bounded-height (utils.number/value-in-range new-height min-height max-height)]
|
||||
(when keyboard-shown
|
||||
(if (>= new-height min-height)
|
||||
(do ; expand sheet
|
||||
(reanimated/set-shared-value height bounded-height)
|
||||
(set-opacity (oops/oget event "velocityY")
|
||||
opacity
|
||||
translation
|
||||
@expanding?
|
||||
min-height
|
||||
max-height
|
||||
bounded-height
|
||||
saved-height))
|
||||
; sheet at min-height, collapse keyboard
|
||||
(utils/blur-input input-ref))))))
|
||||
(gesture/on-end (fn []
|
||||
(let [diff (- (reanimated/get-shared-value height)
|
||||
(reanimated/get-shared-value saved-height))]
|
||||
(if @gesture-enabled?
|
||||
(if (and @expanding? (>= diff 0))
|
||||
(if (> diff constants/drag-threshold)
|
||||
(maximize state animations dimensions)
|
||||
(bounce-back animations dimensions starting-opacity))
|
||||
(if (> (Math/abs diff) constants/drag-threshold)
|
||||
(minimize props state)
|
||||
(bounce-back animations dimensions starting-opacity)))
|
||||
(reset! gesture-enabled? true))))))))
|
||||
@@ -3,17 +3,139 @@
|
||||
[clojure.string :as string]
|
||||
[oops.core :as oops]
|
||||
[react-native.core :as rn]
|
||||
[react-native.reanimated :as reanimated]
|
||||
[reagent.core :as reagent]
|
||||
[status-im.contexts.chat.messenger.composer.constants :as constants]
|
||||
[status-im.contexts.chat.messenger.composer.keyboard :as kb]
|
||||
[status-im.contexts.chat.messenger.composer.selection :as selection]
|
||||
[status-im.contexts.chat.messenger.composer.utils :as utils]
|
||||
[utils.debounce :as debounce]
|
||||
[utils.number]
|
||||
[utils.re-frame :as rf]))
|
||||
|
||||
(defn focus
|
||||
"Animate to the `saved-height`, display background-overlay if needed, and set cursor position"
|
||||
[{:keys [input-ref] :as props}
|
||||
{:keys [text-value focused? lock-selection? saved-cursor-position maximized?]}
|
||||
{:keys [height saved-height last-height opacity background-y composer-focused?]
|
||||
:as animations}
|
||||
{:keys [max-height] :as dimensions}]
|
||||
(reanimated/set-shared-value composer-focused? true)
|
||||
(reset! focused? true)
|
||||
(rf/dispatch [:chat.ui/set-input-focused true])
|
||||
(let [last-height-value (reanimated/get-shared-value last-height)
|
||||
new-height (min max-height last-height-value)]
|
||||
(reanimated/animate height new-height)
|
||||
(reanimated/set-shared-value saved-height new-height)
|
||||
(when (> last-height-value (* constants/background-threshold max-height))
|
||||
(reset! maximized? true)
|
||||
(reanimated/animate opacity 1)
|
||||
(reanimated/set-shared-value background-y 0)))
|
||||
|
||||
(js/setTimeout #(reset! lock-selection? false) 300)
|
||||
(when (and (not-empty @text-value) @input-ref)
|
||||
(.setNativeProps ^js @input-ref
|
||||
(clj->js {:selection {:start @saved-cursor-position :end @saved-cursor-position}})))
|
||||
(kb/handle-refocus-emoji-kb-ios props animations dimensions))
|
||||
|
||||
(defn blur
|
||||
"Save the current height, minimize the composer, animate-out the background, and save cursor position"
|
||||
[{:keys [text-value focused? lock-selection? cursor-position saved-cursor-position gradient-z-index
|
||||
maximized? recording?]}
|
||||
{:keys [height saved-height last-height gradient-opacity opacity background-y composer-focused?]}
|
||||
{:keys [content-height max-height window-height]}]
|
||||
(when-not @recording?
|
||||
(let [lines (utils/calc-lines (- @content-height constants/extra-content-offset))
|
||||
min-height (utils/get-min-height lines)
|
||||
reopen-height (utils/calc-reopen-height text-value
|
||||
min-height
|
||||
max-height
|
||||
content-height
|
||||
saved-height)]
|
||||
(reanimated/set-shared-value composer-focused? false)
|
||||
(reset! focused? false)
|
||||
(rf/dispatch [:chat.ui/set-input-focused false])
|
||||
(reanimated/set-shared-value last-height reopen-height)
|
||||
(reanimated/animate height min-height)
|
||||
(reanimated/set-shared-value saved-height min-height)
|
||||
(reanimated/animate opacity 0)
|
||||
(js/setTimeout #(reanimated/set-shared-value background-y (- window-height)) 300)
|
||||
(reanimated/animate gradient-opacity 0)
|
||||
(reset! lock-selection? true)
|
||||
(reset! saved-cursor-position @cursor-position)
|
||||
(reset! gradient-z-index (if (= (reanimated/get-shared-value gradient-opacity) 1) -1 0))
|
||||
(when (not= reopen-height max-height)
|
||||
(reset! maximized? false)
|
||||
(rf/dispatch [:chat.ui/set-input-maximized false])))))
|
||||
|
||||
(defn content-size-change
|
||||
"Save new text height, expand composer if possible, show background overlay if needed"
|
||||
[event
|
||||
{:keys [maximized? lock-layout? text-value]}
|
||||
{:keys [height saved-height last-height opacity background-y]}
|
||||
{:keys [content-height window-height max-height]}
|
||||
keyboard-shown]
|
||||
(when keyboard-shown
|
||||
(let [event-size (oops/oget event "nativeEvent.contentSize.height")
|
||||
content-size (+ event-size constants/extra-content-offset)
|
||||
lines (utils/calc-lines event-size)
|
||||
content-size (if (or (= lines 1) (empty? @text-value))
|
||||
constants/input-height
|
||||
(if (= lines 2) constants/multiline-minimized-height content-size))
|
||||
new-height (utils.number/value-in-range content-size
|
||||
constants/input-height
|
||||
max-height)
|
||||
new-height (min new-height max-height)]
|
||||
(reset! content-height content-size)
|
||||
(when (utils/update-height? content-size height max-height)
|
||||
(reanimated/animate height new-height)
|
||||
(reanimated/set-shared-value last-height new-height)
|
||||
(reanimated/set-shared-value saved-height new-height))
|
||||
(when (= new-height max-height)
|
||||
(reset! maximized? true)
|
||||
(rf/dispatch [:chat.ui/set-input-maximized true]))
|
||||
(if (utils/show-background? max-height new-height maximized?)
|
||||
(do
|
||||
(reanimated/set-shared-value background-y 0)
|
||||
(reanimated/animate opacity 1))
|
||||
(when (= (reanimated/get-shared-value opacity) 1)
|
||||
(reanimated/animate opacity 0)
|
||||
(js/setTimeout #(reanimated/set-shared-value background-y (- window-height)) 300)))
|
||||
(rf/dispatch [:chat.ui/set-input-content-height content-size])
|
||||
(reset! lock-layout? (> lines 2)))))
|
||||
|
||||
(defn scroll
|
||||
"Hide or show top gradient while scroll"
|
||||
[event
|
||||
{:keys [scroll-y]}
|
||||
{:keys [gradient-z-index focused?]}
|
||||
{:keys [gradient-opacity]}
|
||||
{:keys [lines max-lines]}]
|
||||
(let [y (oops/oget event "nativeEvent.contentOffset.y")]
|
||||
(reset! scroll-y y)
|
||||
(when (utils/show-top-gradient? y lines max-lines gradient-opacity focused?)
|
||||
(reset! gradient-z-index 1)
|
||||
(js/setTimeout #(reanimated/animate gradient-opacity 1) 0))
|
||||
(when (utils/hide-top-gradient? y gradient-opacity)
|
||||
(reanimated/animate gradient-opacity 0)
|
||||
(js/setTimeout #(reset! gradient-z-index 0) 300))))
|
||||
|
||||
(defn change-text
|
||||
"Update `text-value`, update cursor selection, find links, find mentions"
|
||||
[text]
|
||||
[text
|
||||
{:keys [input-ref record-reset-fn]}
|
||||
{:keys [text-value cursor-position recording?]}]
|
||||
(reset! text-value text)
|
||||
(reagent/next-tick #(when @input-ref
|
||||
(.setNativeProps ^js @input-ref
|
||||
(clj->js {:selection {:start @cursor-position
|
||||
:end @cursor-position}}))))
|
||||
(when @recording?
|
||||
(@record-reset-fn)
|
||||
(reset! recording? false))
|
||||
(rf/dispatch [:chat.ui/set-chat-input-text text])
|
||||
(debounce/debounce-and-dispatch [:link-preview/unfurl-urls text] constants/unfurl-debounce-ms)
|
||||
(debounce/debounce-and-dispatch [:link-preview/unfurl-urls text]
|
||||
constants/unfurl-debounce-ms)
|
||||
(if (string/ends-with? text "@")
|
||||
(rf/dispatch [:mention/on-change-text text])
|
||||
(debounce/debounce-and-dispatch [:mention/on-change-text text] 300)))
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
[rn/view {:style style/remove-photo-inner-container}
|
||||
[quo/icon :i/clear {:size 20 :color colors/neutral-50 :color-2 colors/white}]]]])
|
||||
|
||||
(defn images-list
|
||||
(defn f-images-list
|
||||
[]
|
||||
(let [theme (quo.theme/use-theme)
|
||||
images (rf/sub [:chats/sending-image])
|
||||
@@ -48,3 +48,7 @@
|
||||
:horizontal true
|
||||
:shows-horizontal-scroll-indicator false
|
||||
:keyboard-should-persist-taps :handled}]]))
|
||||
|
||||
(defn images-list
|
||||
[]
|
||||
[:f> f-images-list])
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
(ns status-im.contexts.chat.messenger.composer.keyboard
|
||||
(:require
|
||||
[oops.core :as oops]
|
||||
[react-native.async-storage :as async-storage]
|
||||
[react-native.core :as rn]
|
||||
[react-native.platform :as platform]
|
||||
[react-native.reanimated :as reanimated]
|
||||
[status-im.contexts.chat.messenger.composer.utils :as utils]))
|
||||
|
||||
(defn get-kb-height
|
||||
[curr-height default-height]
|
||||
(if (and default-height (< curr-height default-height))
|
||||
default-height
|
||||
curr-height))
|
||||
|
||||
(defn store-kb-height
|
||||
[event {:keys [kb-default-height kb-height]}]
|
||||
(let [height (- (:height (rn/get-window))
|
||||
(oops/oget event "endCoordinates.screenY"))]
|
||||
(reset! kb-height height)
|
||||
(when (zero? @kb-default-height)
|
||||
(async-storage/set-item! :kb-default-height (str height)))))
|
||||
|
||||
(defn handle-emoji-kb-ios
|
||||
"Opening emoji KB on iOS will cause a flicker up and down due to height differences.
|
||||
This method handles that by adding the extra difference between the keyboards. When the input is
|
||||
expanded to a point where the added difference will make the composer go beyond the screen causing a flicker,
|
||||
we're subtracting the difference so it only reaches the allowed max-height. We're not animating these
|
||||
changes to make it appear seamless during transitions between keyboard types when maximized."
|
||||
[event
|
||||
{:keys [emoji-kb-extra-height]}
|
||||
{:keys [text-value kb-height]}
|
||||
{:keys [height saved-height]}
|
||||
{:keys [max-height]}]
|
||||
(let [start-h (oops/oget event "startCoordinates.height")
|
||||
end-h (oops/oget event "endCoordinates.height")
|
||||
diff (- end-h start-h)
|
||||
max-height-diff (- max-height diff)
|
||||
curr-text @text-value
|
||||
bigger-than-default-kb? (> end-h @kb-height)
|
||||
almost-expanded? (> (reanimated/get-shared-value height) max-height-diff)]
|
||||
(if (and almost-expanded? bigger-than-default-kb? (pos? diff))
|
||||
(do
|
||||
(reanimated/set-shared-value height (- (reanimated/get-shared-value height) diff))
|
||||
(reanimated/set-shared-value saved-height (- (reanimated/get-shared-value saved-height) diff))
|
||||
(reset! text-value (str @text-value " "))
|
||||
(js/setTimeout #(reset! text-value curr-text) 0)
|
||||
(reset! emoji-kb-extra-height diff))
|
||||
(when @emoji-kb-extra-height
|
||||
(reanimated/set-shared-value height
|
||||
(+ (reanimated/get-shared-value height) @emoji-kb-extra-height))
|
||||
(reanimated/set-shared-value saved-height
|
||||
(+ (reanimated/get-shared-value saved-height)
|
||||
@emoji-kb-extra-height))
|
||||
(reset! emoji-kb-extra-height nil)))))
|
||||
|
||||
(defn add-kb-listeners
|
||||
[{:keys [keyboard-show-listener keyboard-frame-listener keyboard-hide-listener input-ref] :as props}
|
||||
state animations dimensions]
|
||||
(reset! keyboard-show-listener (.addListener
|
||||
rn/keyboard
|
||||
"keyboardDidShow"
|
||||
#(store-kb-height % state)))
|
||||
(reset! keyboard-frame-listener (.addListener
|
||||
rn/keyboard
|
||||
"keyboardWillChangeFrame"
|
||||
#(handle-emoji-kb-ios % props state animations dimensions)))
|
||||
(reset! keyboard-hide-listener (.addListener rn/keyboard
|
||||
"keyboardDidHide"
|
||||
#(when platform/android?
|
||||
(utils/blur-input input-ref)))))
|
||||
|
||||
(defn handle-refocus-emoji-kb-ios
|
||||
[{:keys [saved-emoji-kb-extra-height]}
|
||||
{:keys [height saved-height last-height]}
|
||||
{:keys [lines max-lines]}]
|
||||
(when @saved-emoji-kb-extra-height
|
||||
(js/setTimeout (fn []
|
||||
(when (> lines max-lines)
|
||||
(reanimated/animate height
|
||||
(+ (reanimated/get-shared-value last-height)
|
||||
@saved-emoji-kb-extra-height))
|
||||
(reanimated/set-shared-value saved-height
|
||||
(+ (reanimated/get-shared-value last-height)
|
||||
@saved-emoji-kb-extra-height)))
|
||||
(reset! saved-emoji-kb-extra-height nil))
|
||||
600)))
|
||||
@@ -21,7 +21,7 @@
|
||||
[previews?])
|
||||
height))
|
||||
|
||||
(defn view
|
||||
(defn f-view
|
||||
[]
|
||||
(let [previews (rf/sub [:chats/link-previews-unfurled])
|
||||
height (use-animated-height (boolean (seq previews)))]
|
||||
@@ -48,3 +48,7 @@
|
||||
:thumbnail (:data-uri thumbnail)
|
||||
:url url})
|
||||
previews)}]]))
|
||||
|
||||
(defn view
|
||||
[]
|
||||
[:f> f-view])
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
[react-native.reanimated :as reanimated]
|
||||
[status-im.contexts.chat.messenger.composer.constants :as constants]))
|
||||
|
||||
|
||||
(defn shadow
|
||||
[theme]
|
||||
(if platform/ios?
|
||||
@@ -15,12 +16,12 @@
|
||||
{:elevation 10}))
|
||||
|
||||
(defn container
|
||||
[opacity top theme]
|
||||
[opacity bottom theme]
|
||||
(reanimated/apply-animations-to-style
|
||||
{:opacity opacity}
|
||||
(merge
|
||||
{:position :absolute
|
||||
:top (- (+ 8 top))
|
||||
:bottom bottom
|
||||
:left 8
|
||||
:right 8
|
||||
:border-radius 16
|
||||
|
||||
@@ -2,45 +2,70 @@
|
||||
(:require
|
||||
[quo.theme]
|
||||
[react-native.core :as rn]
|
||||
[react-native.platform :as platform]
|
||||
[react-native.reanimated :as reanimated]
|
||||
[react-native.safe-area :as safe-area]
|
||||
[reagent.core :as reagent]
|
||||
[status-im.common.contact-list-item.view :as contact-list-item]
|
||||
[status-im.contexts.chat.messenger.composer.constants :as constants]
|
||||
[status-im.contexts.chat.messenger.composer.mentions.style :as style]
|
||||
[status-im.contexts.chat.messenger.messages.constants :as messages.constants]
|
||||
[status-im.contexts.chat.messenger.composer.utils :as utils]
|
||||
[utils.re-frame :as rf]))
|
||||
|
||||
(defn update-cursor
|
||||
[user {:keys [cursor-position input-ref]}]
|
||||
(when platform/android?
|
||||
(let [new-cursor-pos (+ (count (:primary-name user)) @cursor-position 1)]
|
||||
(reset! cursor-position new-cursor-pos)
|
||||
(reagent/next-tick #(when @input-ref
|
||||
(.setNativeProps ^js @input-ref
|
||||
(clj->js {:selection {:start new-cursor-pos
|
||||
:end
|
||||
new-cursor-pos}})))))))
|
||||
|
||||
(defn mention-item
|
||||
[user]
|
||||
[user _ _ render-data]
|
||||
[contact-list-item/contact-list-item
|
||||
{:on-press #(rf/dispatch [:chat.ui/select-mention user])}
|
||||
{:on-press (fn []
|
||||
(rf/dispatch [:chat.ui/select-mention user])
|
||||
(update-cursor user render-data))}
|
||||
user])
|
||||
|
||||
(defn view
|
||||
[{:keys [layout-height]}]
|
||||
(let [suggestions (rf/sub [:chat/mention-suggestions])
|
||||
suggestions? (seq suggestions)
|
||||
theme (quo.theme/use-theme)
|
||||
opacity (reanimated/use-shared-value (if suggestions? 1 0))
|
||||
[suggestions-state set-suggestions-state] (rn/use-state suggestions)
|
||||
top (min constants/mentions-max-height
|
||||
(* (count suggestions-state) 56)
|
||||
(- @layout-height
|
||||
(+ (safe-area/get-top)
|
||||
messages.constants/top-bar-height
|
||||
5)))]
|
||||
(defn- f-view
|
||||
[suggestions-atom props state animations max-height cursor-pos images link-previews? reply edit]
|
||||
(let [suggestions (rf/sub [:chat/mention-suggestions])
|
||||
theme (quo.theme/use-theme)
|
||||
opacity (reanimated/use-shared-value (if (seq suggestions) 1 0))
|
||||
size (count suggestions)
|
||||
data {:keyboard-height @(:kb-height state)
|
||||
:insets (safe-area/get-insets)
|
||||
:curr-height (reanimated/get-shared-value (:height animations))
|
||||
:window-height (:height (rn/get-window))
|
||||
:images images
|
||||
:link-previews? link-previews?
|
||||
:reply reply
|
||||
:edit edit}
|
||||
mentions-pos
|
||||
(utils/calc-suggestions-position cursor-pos max-height size state data images link-previews?)]
|
||||
(rn/use-effect
|
||||
(fn []
|
||||
(if suggestions?
|
||||
(set-suggestions-state suggestions)
|
||||
(js/setTimeout #(set-suggestions-state suggestions) 300))
|
||||
(reanimated/animate opacity (if suggestions? 1 0)))
|
||||
[suggestions?])
|
||||
(if (seq suggestions)
|
||||
(reset! suggestions-atom suggestions)
|
||||
(js/setTimeout #(reset! suggestions-atom suggestions) 300))
|
||||
(reanimated/animate opacity (if (seq suggestions) 1 0)))
|
||||
[(seq suggestions)])
|
||||
[reanimated/view
|
||||
{:style (style/container opacity top theme)}
|
||||
{:style (style/container opacity mentions-pos theme)}
|
||||
[rn/flat-list
|
||||
{:keyboard-should-persist-taps :always
|
||||
:data (vals suggestions-state)
|
||||
:data (vals @suggestions-atom)
|
||||
:key-fn :key
|
||||
:render-fn mention-item
|
||||
:render-data {:cursor-position (:cursor-position state)
|
||||
:input-ref (:input-ref props)}
|
||||
:accessibility-label :mentions-list}]]))
|
||||
|
||||
(defn view
|
||||
[props state animations max-height cursor-pos images link-previews? reply edit]
|
||||
(let [suggestions-atom (reagent/atom {})]
|
||||
[:f> f-view suggestions-atom props state animations max-height cursor-pos images link-previews? reply
|
||||
edit]))
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
[react-native.reanimated :as reanimated]
|
||||
[status-im.constants :as constant]
|
||||
[status-im.contexts.chat.messenger.composer.constants :as constants]
|
||||
[status-im.contexts.chat.messenger.composer.effects :as effects]
|
||||
[status-im.contexts.chat.messenger.composer.reply.style :as style]
|
||||
[status-im.contexts.chat.messenger.composer.utils :as utils]
|
||||
[utils.ens.stateofus :as stateofus]
|
||||
@@ -165,12 +164,14 @@
|
||||
:end {:x 0.7 :y 0}
|
||||
:style style/gradient}])]))
|
||||
|
||||
(defn view
|
||||
[input-ref]
|
||||
(defn- f-view
|
||||
[recording? input-ref]
|
||||
(let [reply (rf/sub [:chats/reply-message])
|
||||
height (reanimated/use-shared-value (if reply constants/reply-container-height 0))]
|
||||
(effects/use-reply input-ref reply)
|
||||
(rn/use-effect #(reanimated/animate height (if reply constants/reply-container-height 0)) [reply])
|
||||
[reanimated/view {:style (reanimated/apply-animations-to-style {:height height} {})}
|
||||
(when reply
|
||||
[quoted-message reply true false false input-ref])]))
|
||||
(when reply [quoted-message reply true false recording? input-ref])]))
|
||||
|
||||
(defn view
|
||||
[{:keys [recording?]} input-ref]
|
||||
[:f> f-view @recording? input-ref])
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
(:require
|
||||
[quo.foundations.colors :as colors]
|
||||
[quo.foundations.typography :as typography]
|
||||
[react-native.platform :as platform]
|
||||
[react-native.reanimated :as reanimated]
|
||||
[status-im.contexts.chat.messenger.composer.constants :as constants]
|
||||
[status-im.contexts.shell.jump-to.constants :as shell.constants]
|
||||
@@ -9,6 +10,34 @@
|
||||
|
||||
(def border-top-radius 20)
|
||||
|
||||
(defn shadow
|
||||
[theme]
|
||||
(when platform/ios?
|
||||
{:shadow-radius 20
|
||||
:shadow-opacity (colors/theme-colors 0.1 0.7 theme)
|
||||
:shadow-color colors/neutral-100
|
||||
:shadow-offset {:width 0 :height (colors/theme-colors -4 -8 theme)}}))
|
||||
|
||||
(def composer-sheet-and-jump-to-container
|
||||
{:position :absolute
|
||||
:bottom 0
|
||||
:left 0
|
||||
:right 0})
|
||||
|
||||
(defn sheet-container
|
||||
[insets {:keys [container-opacity composer-elevation]} theme]
|
||||
(reanimated/apply-animations-to-style
|
||||
{:opacity container-opacity
|
||||
:elevation composer-elevation}
|
||||
(merge
|
||||
{:border-top-left-radius border-top-radius
|
||||
:border-top-right-radius border-top-radius
|
||||
:padding-horizontal 20
|
||||
:background-color (colors/theme-colors colors/white colors/neutral-95 theme)
|
||||
:z-index 3
|
||||
:padding-bottom (:bottom insets)}
|
||||
(shadow theme))))
|
||||
|
||||
(def bar-container
|
||||
{:height constants/bar-container-height
|
||||
:left 0
|
||||
@@ -25,14 +54,65 @@
|
||||
:border-radius 100
|
||||
:background-color (colors/theme-colors colors/neutral-100-opa-5 colors/white-opa-10 theme)})
|
||||
|
||||
(defn input-container
|
||||
[height max-height]
|
||||
(reanimated/apply-animations-to-style
|
||||
{:height height}
|
||||
{:max-height max-height
|
||||
:z-index 1}))
|
||||
|
||||
(defn input-view
|
||||
[{:keys [recording?]}]
|
||||
{:overflow :hidden
|
||||
:z-index 1
|
||||
:flex 1
|
||||
:display (if @recording? :none :flex)
|
||||
:min-height constants/input-height})
|
||||
|
||||
(defn input-text
|
||||
[theme]
|
||||
[{:keys [saved-emoji-kb-extra-height]}
|
||||
{:keys [focused? maximized?]}
|
||||
{:keys [max-height theme]}]
|
||||
(assoc typography/paragraph-1
|
||||
:color (colors/theme-colors :black :white theme)
|
||||
:text-align-vertical :top
|
||||
:position (if @saved-emoji-kb-extra-height :relative :absolute)
|
||||
:top 0
|
||||
:left 0
|
||||
:max-height 150))
|
||||
:right (when (or focused? platform/ios?) 0)
|
||||
:max-height max-height
|
||||
:padding-bottom (when @maximized? 0)))
|
||||
|
||||
(defn background
|
||||
[opacity background-y window-height]
|
||||
(reanimated/apply-animations-to-style
|
||||
{:opacity opacity
|
||||
:transform [{:translate-y background-y}]}
|
||||
{:position :absolute
|
||||
:left 0
|
||||
:right 0
|
||||
:bottom 0
|
||||
:height window-height
|
||||
:background-color colors/neutral-95-opa-70}))
|
||||
|
||||
(defn blur-container
|
||||
[composer-default-height {:keys [blur-container-elevation]}]
|
||||
[{:elevation blur-container-elevation}
|
||||
{:position :absolute
|
||||
:left 0
|
||||
:right 0
|
||||
:bottom 0
|
||||
:height composer-default-height
|
||||
:border-top-right-radius border-top-radius
|
||||
:border-top-left-radius border-top-radius
|
||||
:overflow :hidden}])
|
||||
|
||||
(defn blur-view
|
||||
[theme]
|
||||
{:style {:flex 1}
|
||||
:blur-radius (if platform/ios? 20 10)
|
||||
:blur-type theme
|
||||
:blur-amount 20})
|
||||
|
||||
(defn shell-button
|
||||
[translate-y opacity]
|
||||
|
||||