Compare commits
27
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d2eb401a16 | ||
|
|
c568a51c60 | ||
|
|
f474edf67d | ||
|
|
dfd90617bf | ||
|
|
9782ba2ac3 | ||
|
|
f0e0c95fe0 | ||
|
|
ef7d977299 | ||
|
|
70a5ed255f | ||
|
|
be1347346c | ||
|
|
803e83ae02 | ||
|
|
64748c939b | ||
|
|
64fb344197 | ||
|
|
f27b402205 | ||
|
|
b22744f81e | ||
|
|
174e44c77d | ||
|
|
35c5d5ae6a | ||
|
|
ae00ecb3e0 | ||
|
|
8687282d63 | ||
|
|
04a97faa43 | ||
|
|
91d3cd8da8 | ||
|
|
e1a7146f4c | ||
|
|
5dc1bfe03b | ||
|
|
2d8ba41d89 | ||
|
|
457ed15e0b | ||
|
|
c11cf22bbb | ||
|
|
6ffdaa4e25 | ||
|
|
f56bd54fd3 |
@@ -43,8 +43,6 @@ export NODE_OPTIONS += --openssl-legacy-provider
|
||||
# The path can be anything, but home is usually safest.
|
||||
export KEYSTORE_PATH ?= $(HOME)/.gradle/status-im.keystore
|
||||
|
||||
# Our custom config is located in nix/nix.conf
|
||||
export NIX_USER_CONF_FILES = $(PWD)/nix/nix.conf
|
||||
# Location of symlinks to derivations that should not be garbage collected
|
||||
export _NIX_GCROOTS = ./.nix-gcroots
|
||||
# Defines which variables will be kept for Nix pure shell, use semicolon as divider
|
||||
@@ -269,9 +267,11 @@ run-metro: export TARGET := clojure
|
||||
run-metro: ##@run Start Metro to build React Native changes
|
||||
@scripts/run-metro.sh
|
||||
|
||||
export RE_FRISK_PORT ?= 4567
|
||||
|
||||
run-re-frisk: export TARGET := clojure
|
||||
run-re-frisk: ##@run Start re-frisk server
|
||||
yarn shadow-cljs run re-frisk-remote.core/start
|
||||
yarn shadow-cljs run re-frisk-remote.core/start ${RE_FRISK_PORT}
|
||||
|
||||
# TODO: Migrate this to a Nix recipe, much the same way as nix/mobile/android/targets/release-android.nix
|
||||
run-android: export TARGET := android
|
||||
@@ -445,7 +445,7 @@ android-ports: export RCT_METRO_PORT ?= 8081
|
||||
android-ports: ##@other Add proxies to Android Device/Simulator
|
||||
adb reverse tcp:$(RCT_METRO_PORT) tcp:$(RCT_METRO_PORT) && \
|
||||
adb reverse tcp:3449 tcp:3449 && \
|
||||
adb reverse tcp:4567 tcp:4567 && \
|
||||
adb reverse tcp:$(RE_FRISK_PORT) tcp:$(RE_FRISK_PORT) && \
|
||||
adb reverse tcp:$(FLOWSTORM_PORT) tcp:$(FLOWSTORM_PORT) && \
|
||||
adb forward tcp:5561 tcp:5561
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#!/usr/bin/env groovy
|
||||
library 'status-jenkins-lib@v1.9.15'
|
||||
library 'status-jenkins-lib@v1.9.13'
|
||||
|
||||
/* Options section can't access functions in objects. */
|
||||
def isPRBuild = utils.isPRBuild()
|
||||
|
||||
pipeline {
|
||||
agent { label 'linux && x86_64 && nix-2.19' }
|
||||
agent { label 'linux && x86_64 && nix-2.24' }
|
||||
|
||||
options {
|
||||
timestamps()
|
||||
@@ -41,7 +41,6 @@ pipeline {
|
||||
BUILD_ENV = 'prod'
|
||||
NIX_CONF_DIR = "${env.WORKSPACE}/nix"
|
||||
FASTLANE_DISABLE_COLORS = 1
|
||||
SENTRY_PRODUCTION = "${utils.isReleaseBuild() ? 'true' : 'false'}"
|
||||
}
|
||||
|
||||
stages {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env groovy
|
||||
library 'status-jenkins-lib@v1.9.15'
|
||||
library 'status-jenkins-lib@v1.9.13'
|
||||
|
||||
import groovy.json.JsonBuilder
|
||||
|
||||
|
||||
+2
-3
@@ -1,11 +1,11 @@
|
||||
#!/usr/bin/env groovy
|
||||
library 'status-jenkins-lib@v1.9.15'
|
||||
library 'status-jenkins-lib@v1.9.13'
|
||||
|
||||
/* Options section can't access functions in objects. */
|
||||
def isPRBuild = utils.isPRBuild()
|
||||
|
||||
pipeline {
|
||||
agent { label 'macos && arm64 && nix-2.19 && xcode-15.1' }
|
||||
agent { label 'macos && arm64 && nix-2.24 && xcode-16.2' }
|
||||
|
||||
parameters {
|
||||
string(
|
||||
@@ -41,7 +41,6 @@ pipeline {
|
||||
NIX_CONF_DIR = "${env.WORKSPACE}/nix"
|
||||
FASTLANE_DISABLE_COLORS = 1
|
||||
BUNDLE_PATH = "${HOME}/.bundle"
|
||||
SENTRY_PRODUCTION = "${utils.isReleaseBuild() ? 'true' : 'false'}"
|
||||
}
|
||||
|
||||
stages {
|
||||
|
||||
@@ -5,7 +5,7 @@ library 'status-jenkins-lib@v1.9.13'
|
||||
def isPRBuild = utils.isPRBuild()
|
||||
|
||||
pipeline {
|
||||
agent { label 'linux && x86_64 && nix-2.19' }
|
||||
agent { label 'linux && x86_64 && nix-2.24' }
|
||||
|
||||
options {
|
||||
timestamps()
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
- [Patching](patching.md)
|
||||
- [Creating a pixel perfect UI](pixel-perfection.md)
|
||||
- [Contributing to status-go](status-go-changes.md)
|
||||
- [Status Backend Server](use-status-backend-server.md)
|
||||
- [Malli schemas (recorded demo)](https://www.youtube.com/watch?v=SlRio70aYVI) ([slides](files/forging-code-with-schemas-sep-2023-slides.pdf))
|
||||
|
||||
## Testing
|
||||
|
||||
@@ -1 +1 @@
|
||||
Status: محفظة تشفير اجتماعية
|
||||
Status: محفظة إيثريوم كريبتو
|
||||
|
||||
@@ -1 +1 @@
|
||||
Status: Social Crypto Wallet
|
||||
Status: Ethereum Crypto Wallet
|
||||
|
||||
@@ -1 +1 @@
|
||||
Status: Billetera social cripto
|
||||
Status: Billetera Ethereum
|
||||
|
||||
@@ -1 +1 @@
|
||||
Status : Portef. crypto social
|
||||
Status: Portefeuille Ethereum
|
||||
|
||||
@@ -1 +1 @@
|
||||
Status: ソーシャル クリプト ウォレット
|
||||
Status: イーサリアム クリプト ウォレット
|
||||
|
||||
@@ -1 +1 @@
|
||||
Status: 소셜 크립토 지갑
|
||||
Status: 이더리움 크립토 지갑
|
||||
|
||||
@@ -1 +1 @@
|
||||
Status: Carteira social cripto
|
||||
Status: Carteira Ethereum
|
||||
|
||||
@@ -1 +1 @@
|
||||
Status: Криптокошелек
|
||||
Status: Ethereum Криптокошелек
|
||||
|
||||
@@ -1 +1 @@
|
||||
Status: Sosyal Kripto Cüzdanı
|
||||
Status Ethereum Kripto Cüzdanı
|
||||
|
||||
@@ -1 +1 @@
|
||||
Status: Криптогаманець
|
||||
Status Ethereum Криптогаманець
|
||||
|
||||
@@ -1 +1 @@
|
||||
Status: 可以社交的加密货币钱包
|
||||
Status: 以太坊加密钱包
|
||||
|
||||
+21
-18
@@ -23,15 +23,18 @@ PODS:
|
||||
- secp256k1
|
||||
- SSZipArchive
|
||||
- libevent (2.1.12)
|
||||
- libwebp (1.2.4):
|
||||
- libwebp/demux (= 1.2.4)
|
||||
- libwebp/mux (= 1.2.4)
|
||||
- libwebp/webp (= 1.2.4)
|
||||
- libwebp/demux (1.2.4):
|
||||
- libwebp (1.3.2):
|
||||
- libwebp/demux (= 1.3.2)
|
||||
- libwebp/mux (= 1.3.2)
|
||||
- libwebp/sharpyuv (= 1.3.2)
|
||||
- libwebp/webp (= 1.3.2)
|
||||
- libwebp/demux (1.3.2):
|
||||
- libwebp/webp
|
||||
- libwebp/mux (1.2.4):
|
||||
- libwebp/mux (1.3.2):
|
||||
- libwebp/demux
|
||||
- libwebp/webp (1.2.4)
|
||||
- libwebp/sharpyuv (1.3.2)
|
||||
- libwebp/webp (1.3.2):
|
||||
- libwebp/sharpyuv
|
||||
- RCT-Folly (2022.05.16.00):
|
||||
- boost
|
||||
- DoubleConversion
|
||||
@@ -1152,15 +1155,15 @@ PODS:
|
||||
- glog
|
||||
- RCT-Folly (= 2022.05.16.00)
|
||||
- React-Core
|
||||
- RNImageCropPicker (0.40.0):
|
||||
- RNImageCropPicker (0.41.2):
|
||||
- React-Core
|
||||
- React-RCTImage
|
||||
- RNImageCropPicker/QBImagePickerController (= 0.40.0)
|
||||
- TOCropViewController
|
||||
- RNImageCropPicker/QBImagePickerController (0.40.0):
|
||||
- RNImageCropPicker/QBImagePickerController (= 0.41.2)
|
||||
- TOCropViewController (~> 2.7.4)
|
||||
- RNImageCropPicker/QBImagePickerController (0.41.2):
|
||||
- React-Core
|
||||
- React-RCTImage
|
||||
- TOCropViewController
|
||||
- TOCropViewController (~> 2.7.4)
|
||||
- RNKeychain (8.1.2):
|
||||
- React-Core
|
||||
- RNLinearGradient (3.0.0-alpha.1):
|
||||
@@ -1189,7 +1192,7 @@ PODS:
|
||||
- secp256k1 (0.1.6)
|
||||
- SocketRocket (0.6.1)
|
||||
- SSZipArchive (2.4.3)
|
||||
- TOCropViewController (2.6.1)
|
||||
- TOCropViewController (2.7.4)
|
||||
- Yoga (1.14.0)
|
||||
|
||||
DEPENDENCIES:
|
||||
@@ -1489,7 +1492,7 @@ CHECKOUT OPTIONS:
|
||||
:git: https://github.com/status-im/Keycard.swift.git
|
||||
:tag: 3.1.1
|
||||
secp256k1:
|
||||
:commit: 46a1fa30d9b8babeae85ff519050f42394ab5fcc
|
||||
:commit: 4ab977cc2b2d7319be858bcb30a5d189bb149884
|
||||
:git: https://github.com/status-im/secp256k1.swift.git
|
||||
:submodules: true
|
||||
|
||||
@@ -1506,7 +1509,7 @@ SPEC CHECKSUMS:
|
||||
HMSegmentedControl: 34c1f54d822d8308e7b24f5d901ec674dfa31352
|
||||
Keycard: 3bd24405b9a875b3b3cf1ab1be69b5c30c5f28bc
|
||||
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
|
||||
libwebp: f62cb61d0a484ba548448a4bd52aabf150ff6eef
|
||||
libwebp: 1786c9f4ff8a279e4dac1e8f385004d5fc253009
|
||||
RCT-Folly: 7169b2b1c44399c76a47b5deaaba715eeeb476c0
|
||||
RCTRequired: 2544c0f1081a5fa12e108bb8cb40e5f4581ccd87
|
||||
RCTTypeSafety: 50efabe2b115c11ed03fbf3fd79e2f163ddb5d7c
|
||||
@@ -1577,7 +1580,7 @@ SPEC CHECKSUMS:
|
||||
RNFastImage: 1f2cab428712a4baaf78d6169eaec7f622556dd7
|
||||
RNFS: 2bd9eb49dc82fa9676382f0585b992c424cd59df
|
||||
RNGestureHandler: 15c6ef51acba34c49ff03003806cf5dd6098f383
|
||||
RNImageCropPicker: 486e2f7e2b0461ce24321f751410dce1b3b49e6d
|
||||
RNImageCropPicker: 771e2ca319d2cf92e04ebf334ece892ee9a6728f
|
||||
RNKeychain: a65256b6ca6ba6976132cc4124b238a5b13b3d9c
|
||||
RNLinearGradient: ccaaebce083b54180da61d992e7fa56abfe000d6
|
||||
RNPermissions: 08e619529cced22695f4b6d0efcc0a233e278903
|
||||
@@ -1590,9 +1593,9 @@ SPEC CHECKSUMS:
|
||||
secp256k1: f61d67e6fdcb85fd727acf1bf35ace6036db540c
|
||||
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
|
||||
SSZipArchive: fe6a26b2a54d5a0890f2567b5cc6de5caa600aef
|
||||
TOCropViewController: edfd4f25713d56905ad1e0b9f5be3fbe0f59c863
|
||||
TOCropViewController: 80b8985ad794298fb69d3341de183f33d1853654
|
||||
Yoga: a716eea57d0d3430219c0a5a233e1e93ee931eb7
|
||||
|
||||
PODFILE CHECKSUM: 81a66b45adddb083171ade882c343deb4faf2a8b
|
||||
PODFILE CHECKSUM: 56d9f695324306d6db368d1172d211dfab55b7cb
|
||||
|
||||
COCOAPODS: 1.15.2
|
||||
|
||||
@@ -572,6 +572,7 @@
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Status-StatusIm-StatusImTests/Pods-Status-StatusIm-StatusImTests-resources.sh",
|
||||
"${PODS_CONFIGURATION_BUILD_DIR}/RNImageCropPicker/RNImageCropPickerPrivacyInfo.bundle",
|
||||
"${PODS_CONFIGURATION_BUILD_DIR}/RNImageCropPicker/QBImagePicker.bundle",
|
||||
"${PODS_CONFIGURATION_BUILD_DIR}/RNPermissions/RNPermissionsPrivacyInfo.bundle",
|
||||
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/RCTI18nStrings.bundle",
|
||||
@@ -579,6 +580,7 @@
|
||||
);
|
||||
name = "[CP] Copy Pods Resources";
|
||||
outputPaths = (
|
||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RNImageCropPickerPrivacyInfo.bundle",
|
||||
"${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",
|
||||
@@ -614,6 +616,7 @@
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Status-StatusIm/Pods-Status-StatusIm-resources.sh",
|
||||
"${PODS_CONFIGURATION_BUILD_DIR}/RNImageCropPicker/RNImageCropPickerPrivacyInfo.bundle",
|
||||
"${PODS_CONFIGURATION_BUILD_DIR}/RNImageCropPicker/QBImagePicker.bundle",
|
||||
"${PODS_CONFIGURATION_BUILD_DIR}/RNPermissions/RNPermissionsPrivacyInfo.bundle",
|
||||
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/RCTI18nStrings.bundle",
|
||||
@@ -621,6 +624,7 @@
|
||||
);
|
||||
name = "[CP] Copy Pods Resources";
|
||||
outputPaths = (
|
||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RNImageCropPickerPrivacyInfo.bundle",
|
||||
"${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",
|
||||
@@ -728,6 +732,7 @@
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Status-StatusImPR/Pods-Status-StatusImPR-resources.sh",
|
||||
"${PODS_CONFIGURATION_BUILD_DIR}/RNImageCropPicker/RNImageCropPickerPrivacyInfo.bundle",
|
||||
"${PODS_CONFIGURATION_BUILD_DIR}/RNImageCropPicker/QBImagePicker.bundle",
|
||||
"${PODS_CONFIGURATION_BUILD_DIR}/RNPermissions/RNPermissionsPrivacyInfo.bundle",
|
||||
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/RCTI18nStrings.bundle",
|
||||
@@ -735,6 +740,7 @@
|
||||
);
|
||||
name = "[CP] Copy Pods Resources";
|
||||
outputPaths = (
|
||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RNImageCropPickerPrivacyInfo.bundle",
|
||||
"${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",
|
||||
|
||||
-18
@@ -203,24 +203,6 @@ class AccountManager(private val reactContext: ReactApplicationContext) : ReactC
|
||||
)
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
fun verify(address: String, password: String, callback: Callback) {
|
||||
val absRootDirPath = utils.getNoBackupDirectory()
|
||||
val newKeystoreDir = utils.pathCombine(absRootDirPath, "keystore")
|
||||
|
||||
val jsonParams = JSONObject()
|
||||
jsonParams.put("keyStoreDir", newKeystoreDir)
|
||||
jsonParams.put("address", address)
|
||||
jsonParams.put("password", password)
|
||||
|
||||
StatusBackendClient.executeStatusGoRequestWithCallback(
|
||||
endpoint = "VerifyAccountPasswordV2",
|
||||
requestBody = jsonParams.toString(),
|
||||
statusgoFunction = { Statusgo.verifyAccountPasswordV2(jsonParams.toString()) },
|
||||
callback
|
||||
)
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
fun verifyDatabasePassword(keyUID: String, password: String, callback: Callback) {
|
||||
val jsonParams = JSONObject()
|
||||
|
||||
-36
@@ -87,42 +87,6 @@ class EncryptionUtils(private val reactContext: ReactApplicationContext) : React
|
||||
)
|
||||
}
|
||||
|
||||
@ReactMethod(isBlockingSynchronousMethod = true)
|
||||
fun encodeTransfer(to: String, value: String): String? {
|
||||
return try {
|
||||
val params = JSONObject().apply {
|
||||
put("to", to)
|
||||
put("value", value)
|
||||
}
|
||||
StatusBackendClient.executeStatusGoRequestWithResult(
|
||||
"EncodeTransferV2",
|
||||
params.toString(),
|
||||
{ Statusgo.encodeTransferV2(params.toString()) }
|
||||
)
|
||||
} catch (e: JSONException) {
|
||||
Log.e(TAG, "Error creating JSON for encodeTransfer: ${e.message}")
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
@ReactMethod(isBlockingSynchronousMethod = true)
|
||||
fun encodeFunctionCall(method: String, paramsJSON: String): String? {
|
||||
return try {
|
||||
val params = JSONObject().apply {
|
||||
put("method", method)
|
||||
put("paramsJSON", JSONObject(paramsJSON))
|
||||
}
|
||||
StatusBackendClient.executeStatusGoRequestWithResult(
|
||||
"EncodeFunctionCallV2",
|
||||
params.toString(),
|
||||
{ Statusgo.encodeFunctionCallV2(params.toString()) }
|
||||
)
|
||||
} catch (e: JSONException) {
|
||||
Log.e(TAG, "Error creating JSON for encodeFunctionCall: ${e.message}")
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
@ReactMethod(isBlockingSynchronousMethod = true)
|
||||
fun decodeParameters(decodeParamJSON: String): String =
|
||||
StatusBackendClient.executeStatusGoRequestWithResult(
|
||||
|
||||
@@ -195,36 +195,6 @@ RCT_EXPORT_METHOD(loginAccount:(NSString *)request) {
|
||||
}];
|
||||
}
|
||||
|
||||
RCT_EXPORT_METHOD(verify:(NSString *)address
|
||||
password:(NSString *)password
|
||||
callback:(RCTResponseSenderBlock)callback) {
|
||||
#if DEBUG
|
||||
NSLog(@"VerifyAccountPasswordV2() method called");
|
||||
#endif
|
||||
NSURL *rootUrl = [Utils getRootUrl];
|
||||
NSString *keystorePath = [rootUrl.path stringByAppendingPathComponent:@"keystore"];
|
||||
|
||||
NSDictionary *params = @{
|
||||
@"keyStoreDir": keystorePath,
|
||||
@"address": address,
|
||||
@"password": password
|
||||
};
|
||||
NSError *error;
|
||||
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:params options:0 error:&error];
|
||||
if (error) {
|
||||
NSLog(@"Error creating JSON: %@", error);
|
||||
return;
|
||||
}
|
||||
NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
|
||||
|
||||
[StatusBackendClient executeStatusGoRequestWithCallback:@"VerifyAccountPasswordV2"
|
||||
body:jsonString
|
||||
statusgoFunction:^NSString *{
|
||||
return StatusgoVerifyAccountPasswordV2(jsonString);
|
||||
}
|
||||
callback:callback];
|
||||
}
|
||||
|
||||
RCT_EXPORT_METHOD(verifyDatabasePassword:(NSString *)keyUID
|
||||
password:(NSString *)password
|
||||
callback:(RCTResponseSenderBlock)callback) {
|
||||
|
||||
@@ -105,48 +105,6 @@ RCT_EXPORT_METHOD(convertToKeycardAccount:(NSString *)keyUID
|
||||
callback:callback];
|
||||
}
|
||||
|
||||
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(encodeTransfer:(NSString *)to
|
||||
value:(NSString *)value) {
|
||||
NSDictionary *params = @{
|
||||
@"to": to,
|
||||
@"value": value
|
||||
};
|
||||
NSError *error;
|
||||
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:params options:0 error:&error];
|
||||
if (error) {
|
||||
NSLog(@"Error creating JSON: %@", [error localizedDescription]);
|
||||
return nil;
|
||||
}
|
||||
NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
|
||||
|
||||
return [StatusBackendClient executeStatusGoRequestWithResult:@"EncodeTransferV2"
|
||||
body:jsonString
|
||||
statusgoFunction:^NSString *{
|
||||
return StatusgoEncodeTransferV2(jsonString);
|
||||
}];
|
||||
}
|
||||
|
||||
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(encodeFunctionCall:(NSString *)method
|
||||
paramsJSON:(NSString *)paramsJSON) {
|
||||
NSDictionary *params = @{
|
||||
@"method": method,
|
||||
@"paramsJSON": paramsJSON
|
||||
};
|
||||
NSError *error;
|
||||
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:params options:0 error:&error];
|
||||
if (error) {
|
||||
NSLog(@"Error creating JSON: %@", [error localizedDescription]);
|
||||
return nil;
|
||||
}
|
||||
NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
|
||||
|
||||
return [StatusBackendClient executeStatusGoRequestWithResult:@"EncodeFunctionCallV2"
|
||||
body:jsonString
|
||||
statusgoFunction:^NSString *{
|
||||
return StatusgoEncodeFunctionCallV2(jsonString);
|
||||
}];
|
||||
}
|
||||
|
||||
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(decodeParameters:(NSString *)decodeParamJSON) {
|
||||
return [StatusBackendClient executeStatusGoRequestWithResult:@"DecodeParameters"
|
||||
body:decodeParamJSON
|
||||
|
||||
@@ -389,86 +389,6 @@ void _StopCPUProfiling(const FunctionCallbackInfo<Value>& args) {
|
||||
|
||||
}
|
||||
|
||||
void _EncodeTransfer(const FunctionCallbackInfo<Value>& args) {
|
||||
Isolate* isolate = args.GetIsolate();
|
||||
Local<Context> context = isolate->GetCurrentContext();
|
||||
|
||||
if (args.Length() != 2) {
|
||||
// Throw an Error that is passed back to JavaScript
|
||||
isolate->ThrowException(Exception::TypeError(
|
||||
String::NewFromUtf8Literal(isolate, "Wrong number of arguments for EncodeTransfer")));
|
||||
return;
|
||||
}
|
||||
|
||||
// Check the argument types
|
||||
|
||||
if (!args[0]->IsString()) {
|
||||
isolate->ThrowException(Exception::TypeError(
|
||||
String::NewFromUtf8Literal(isolate, "Wrong argument type for 'to'")));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!args[1]->IsString()) {
|
||||
isolate->ThrowException(Exception::TypeError(
|
||||
String::NewFromUtf8Literal(isolate, "Wrong argument type for 'value'")));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
String::Utf8Value arg0Obj(isolate, args[0]->ToString(context).ToLocalChecked());
|
||||
char *arg0 = *arg0Obj;
|
||||
String::Utf8Value arg1Obj(isolate, args[1]->ToString(context).ToLocalChecked());
|
||||
char *arg1 = *arg1Obj;
|
||||
|
||||
// Call exported Go function, which returns a C string
|
||||
char *c = EncodeTransfer(arg0, arg1);
|
||||
|
||||
Local<String> ret = String::NewFromUtf8(isolate, c).ToLocalChecked();
|
||||
args.GetReturnValue().Set(ret);
|
||||
delete c;
|
||||
|
||||
}
|
||||
|
||||
void _EncodeFunctionCall(const FunctionCallbackInfo<Value>& args) {
|
||||
Isolate* isolate = args.GetIsolate();
|
||||
Local<Context> context = isolate->GetCurrentContext();
|
||||
|
||||
if (args.Length() != 2) {
|
||||
// Throw an Error that is passed back to JavaScript
|
||||
isolate->ThrowException(Exception::TypeError(
|
||||
String::NewFromUtf8Literal(isolate, "Wrong number of arguments for EncodeFunctionCall")));
|
||||
return;
|
||||
}
|
||||
|
||||
// Check the argument types
|
||||
|
||||
if (!args[0]->IsString()) {
|
||||
isolate->ThrowException(Exception::TypeError(
|
||||
String::NewFromUtf8Literal(isolate, "Wrong argument type for 'method'")));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!args[1]->IsString()) {
|
||||
isolate->ThrowException(Exception::TypeError(
|
||||
String::NewFromUtf8Literal(isolate, "Wrong argument type for 'paramsJSON'")));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
String::Utf8Value arg0Obj(isolate, args[0]->ToString(context).ToLocalChecked());
|
||||
char *arg0 = *arg0Obj;
|
||||
String::Utf8Value arg1Obj(isolate, args[1]->ToString(context).ToLocalChecked());
|
||||
char *arg1 = *arg1Obj;
|
||||
|
||||
// Call exported Go function, which returns a C string
|
||||
char *c = EncodeFunctionCall(arg0, arg1);
|
||||
|
||||
Local<String> ret = String::NewFromUtf8(isolate, c).ToLocalChecked();
|
||||
args.GetReturnValue().Set(ret);
|
||||
delete c;
|
||||
|
||||
}
|
||||
|
||||
void _DecodeParameters(const FunctionCallbackInfo<Value>& args) {
|
||||
Isolate* isolate = args.GetIsolate();
|
||||
Local<Context> context = isolate->GetCurrentContext();
|
||||
@@ -1380,53 +1300,6 @@ void _CallPrivateRPC(const FunctionCallbackInfo<Value>& args) {
|
||||
|
||||
}
|
||||
|
||||
void _VerifyAccountPassword(const FunctionCallbackInfo<Value>& args) {
|
||||
Isolate* isolate = args.GetIsolate();
|
||||
Local<Context> context = isolate->GetCurrentContext();
|
||||
|
||||
if (args.Length() != 3) {
|
||||
// Throw an Error that is passed back to JavaScript
|
||||
isolate->ThrowException(Exception::TypeError(
|
||||
String::NewFromUtf8Literal(isolate, "Wrong number of arguments for VerifyAccountPassword")));
|
||||
return;
|
||||
}
|
||||
|
||||
// Check the argument types
|
||||
|
||||
if (!args[0]->IsString()) {
|
||||
isolate->ThrowException(Exception::TypeError(
|
||||
String::NewFromUtf8Literal(isolate, "Wrong argument type for 'keyStoreDir'")));
|
||||
return;
|
||||
}
|
||||
if (!args[1]->IsString()) {
|
||||
isolate->ThrowException(Exception::TypeError(
|
||||
String::NewFromUtf8Literal(isolate, "Wrong argument type for 'address'")));
|
||||
return;
|
||||
}
|
||||
if (!args[2]->IsString()) {
|
||||
isolate->ThrowException(Exception::TypeError(
|
||||
String::NewFromUtf8Literal(isolate, "Wrong argument type for 'password'")));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
String::Utf8Value arg0Obj(isolate, args[0]->ToString(context).ToLocalChecked());
|
||||
char *arg0 = *arg0Obj;
|
||||
String::Utf8Value arg1Obj(isolate, args[1]->ToString(context).ToLocalChecked());
|
||||
char *arg1 = *arg1Obj;
|
||||
String::Utf8Value arg2Obj(isolate, args[2]->ToString(context).ToLocalChecked());
|
||||
char *arg2 = *arg2Obj;
|
||||
|
||||
// Call exported Go function, which returns a C string
|
||||
char *c = VerifyAccountPassword(arg0, arg1, arg2);
|
||||
|
||||
Local<String> ret = String::NewFromUtf8(isolate, c).ToLocalChecked();
|
||||
args.GetReturnValue().Set(ret);
|
||||
delete c;
|
||||
|
||||
|
||||
}
|
||||
|
||||
void _SendTransactionWithSignature(const FunctionCallbackInfo<Value>& args) {
|
||||
Isolate* isolate = args.GetIsolate();
|
||||
Local<Context> context = isolate->GetCurrentContext();
|
||||
@@ -1992,8 +1865,6 @@ void init(Local<Object> exports) {
|
||||
NODE_SET_METHOD(exports, "acceptTerms", _AcceptTerms);
|
||||
NODE_SET_METHOD(exports, "fleets", _Fleets);
|
||||
NODE_SET_METHOD(exports, "stopCPUProfiling", _StopCPUProfiling);
|
||||
NODE_SET_METHOD(exports, "encodeTransfer", _EncodeTransfer);
|
||||
NODE_SET_METHOD(exports, "encodeFunctionCall", _EncodeFunctionCall);
|
||||
NODE_SET_METHOD(exports, "decodeParameters", _DecodeParameters);
|
||||
NODE_SET_METHOD(exports, "hexToNumber", _HexToNumber);
|
||||
NODE_SET_METHOD(exports, "numberToHex", _NumberToHex);
|
||||
@@ -2017,7 +1888,6 @@ void init(Local<Object> exports) {
|
||||
NODE_SET_METHOD(exports, "openAccounts", _OpenAccounts);
|
||||
NODE_SET_METHOD(exports, "extractGroupMembershipSignatures", _ExtractGroupMembershipSignatures);
|
||||
NODE_SET_METHOD(exports, "callPrivateRPC", _CallPrivateRPC);
|
||||
NODE_SET_METHOD(exports, "verifyAccountPassword", _VerifyAccountPassword);
|
||||
NODE_SET_METHOD(exports, "sendTransactionWithSignature", _SendTransactionWithSignature);
|
||||
NODE_SET_METHOD(exports, "writeHeapProfile", _WriteHeapProfile);
|
||||
NODE_SET_METHOD(exports, "addPeer", _AddPeer);
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@ in {
|
||||
yarn = super.yarn.override { nodejs = super.nodejs_20; };
|
||||
openjdk = super.openjdk17_headless;
|
||||
xcodeWrapper = callPackage ./pkgs/xcodeenv/compose-xcodewrapper.nix { } {
|
||||
versions = ["15.1" "15.2" "15.3" "15.4"];
|
||||
versions = ["16.0" "16.1" "16.2"];
|
||||
};
|
||||
go = super.go_1_21;
|
||||
clang = super.clang_15;
|
||||
|
||||
+2
-2
@@ -38,8 +38,8 @@ nix_install_type() {
|
||||
"${UID}") echo "single";;
|
||||
"(${UID})") echo "single";;
|
||||
"") echo "none";
|
||||
echo "No Nix installtion detected!" >&2;;
|
||||
*) echo "Unknown Nix installtion type!" >&2; exit 1;;
|
||||
echo "No Nix installation detected!" >&2;;
|
||||
*) echo "Unknown Nix installation type!" >&2; exit 1;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
export NIX_VERSION="2.19.3"
|
||||
export NIX_PACKAGE="nixVersions.nix_2_19"
|
||||
export NIX_VERSION="2.24.11"
|
||||
export NIX_PACKAGE="nixVersions.nix_2_24"
|
||||
export NIX_INSTALL_URL="https://nixos.org/releases/nix/nix-${NIX_VERSION}/install"
|
||||
export NIX_INSTALL_SHA256="73d47b0ab783fddca1b2d44a03d52a74c97c28a1fc8ff5a29419079302ef9c3d"
|
||||
export NIX_INSTALL_SHA256="5c610a0e97c8a2dd48c1a630608502e43fdecd7d2572463dd4166126106d9188"
|
||||
export NIX_INSTALL_PATH="/tmp/nix-install-${NIX_VERSION}"
|
||||
|
||||
@@ -38,6 +38,9 @@ in mkShell {
|
||||
LANG="en_US.UTF-8";
|
||||
LANGUAGE="en_US.UTF-8";
|
||||
|
||||
# Important to load our own Nix binary cache.
|
||||
NIX_CONFIG = builtins.readFile ./nix.conf;
|
||||
|
||||
# just a nicety for easy access to node scripts
|
||||
shellHook = ''
|
||||
export STATUS_MOBILE_HOME=$(git rev-parse --show-toplevel)
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
, outputFileName ? "status-go-${source.shortRev}-${platform}.aar" }:
|
||||
|
||||
let
|
||||
inherit (lib) concatStringsSep optionalString optional splitString fileContents;
|
||||
inherit (lib) concatStringsSep optionalString optional splitString;
|
||||
isIOS = platform == "ios";
|
||||
isAndroid = platform == "android";
|
||||
enforceXCodeAvailable = callPackage ./enforceXCodeAvailable.nix { };
|
||||
@@ -46,10 +46,6 @@ in buildGoPackage rec {
|
||||
# TODO: try removing when go is upgraded to 1.22
|
||||
GODEBUG = "netdns=cgo+2";
|
||||
|
||||
# Sentry for status-go
|
||||
SENTRY_CONTEXT_NAME = "status-mobile";
|
||||
SENTRY_CONTEXT_VERSION = version;
|
||||
|
||||
preBuild = ''
|
||||
echo 'Generate static files'
|
||||
pushd go/src/$goPackagePath
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@
|
||||
"react-native-get-random-values": "^1.11.0",
|
||||
"react-native-gifted-charts": "^1.3.2",
|
||||
"react-native-hole-view": "^3.0.0-alpha4",
|
||||
"react-native-image-crop-picker": "0.40.0",
|
||||
"react-native-image-crop-picker": "0.41.2",
|
||||
"react-native-image-resizer": "^1.2.3",
|
||||
"react-native-keychain": "8.1.2",
|
||||
"react-native-linear-gradient": "3.0.0-alpha.1",
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.7 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 52 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 98 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 86 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 156 KiB |
@@ -37,6 +37,8 @@ SECRETS_ENV_VARS=(
|
||||
'ALCHEMY_ARBITRUM_SEPOLIA_TOKEN'
|
||||
'ALCHEMY_OPTIMISM_MAINNET_TOKEN'
|
||||
'ALCHEMY_OPTIMISM_SEPOLIA_TOKEN'
|
||||
'ALCHEMY_BASE_MAINNET_TOKEN'
|
||||
'ALCHEMY_BASE_SEPOLIA_TOKEN'
|
||||
'RARIBLE_MAINNET_API_KEY'
|
||||
'RARIBLE_TESTNET_API_KEY'
|
||||
'INFURA_TOKEN'
|
||||
|
||||
+9
-3
@@ -58,7 +58,7 @@
|
||||
:preloads [;; The official recommendation is to
|
||||
;; load the debugger preload first.
|
||||
flow-storm.api
|
||||
re-frisk-remote.preload
|
||||
dev.re-frisk-preload
|
||||
status-im.setup.schema-preload
|
||||
;; In order to use component test helpers in the REPL we need to
|
||||
;; preload namespaces that are not normally required by
|
||||
@@ -87,7 +87,9 @@
|
||||
status-im.config/ALCHEMY_ARBITRUM_MAINNET_TOKEN #shadow/env "ALCHEMY_ARBITRUM_MAINNET_TOKEN"
|
||||
status-im.config/ALCHEMY_ARBITRUM_SEPOLIA_TOKEN #shadow/env "ALCHEMY_ARBITRUM_SEPOLIA_TOKEN"
|
||||
status-im.config/ALCHEMY_OPTIMISM_MAINNET_TOKEN #shadow/env "ALCHEMY_OPTIMISM_MAINNET_TOKEN"
|
||||
status-im.config/ALCHEMY_OPTIMISM_SEPOLIA_TOKEN #shadow/env "ALCHEMY_OPTIMISM_SEPOLIA_TOKEN"}
|
||||
status-im.config/ALCHEMY_OPTIMISM_SEPOLIA_TOKEN #shadow/env "ALCHEMY_OPTIMISM_SEPOLIA_TOKEN"
|
||||
status-im.config/ALCHEMY_BASE_MAINNET_TOKEN #shadow/env "ALCHEMY_BASE_MAINNET_TOKEN"
|
||||
status-im.config/ALCHEMY_BASE_SEPOLIA_TOKEN #shadow/env "ALCHEMY_BASE_SEPOLIA_TOKEN"}
|
||||
:compiler-options {:output-feature-set :es5
|
||||
;; We disable `:fn-deprecated` warnings because we
|
||||
;; are managing deprecation via clj-kondo and we
|
||||
@@ -123,7 +125,9 @@
|
||||
status-im.config/ALCHEMY_ARBITRUM_MAINNET_TOKEN #shadow/env "ALCHEMY_ARBITRUM_MAINNET_TOKEN"
|
||||
status-im.config/ALCHEMY_ARBITRUM_SEPOLIA_TOKEN #shadow/env "ALCHEMY_ARBITRUM_SEPOLIA_TOKEN"
|
||||
status-im.config/ALCHEMY_OPTIMISM_MAINNET_TOKEN #shadow/env "ALCHEMY_OPTIMISM_MAINNET_TOKEN"
|
||||
status-im.config/ALCHEMY_OPTIMISM_SEPOLIA_TOKEN #shadow/env "ALCHEMY_OPTIMISM_SEPOLIA_TOKEN"}
|
||||
status-im.config/ALCHEMY_OPTIMISM_SEPOLIA_TOKEN #shadow/env "ALCHEMY_OPTIMISM_SEPOLIA_TOKEN"
|
||||
status-im.config/ALCHEMY_BASE_MAINNET_TOKEN #shadow/env "ALCHEMY_BASE_MAINNET_TOKEN"
|
||||
status-im.config/ALCHEMY_BASE_SEPOLIA_TOKEN #shadow/env "ALCHEMY_BASE_SEPOLIA_TOKEN"}
|
||||
:compiler-options {:output-feature-set :es6
|
||||
;;disable for android build as there
|
||||
;;is an intermittent warning with deftype
|
||||
@@ -165,6 +169,8 @@
|
||||
status-im.config/ALCHEMY_ARBITRUM_SEPOLIA_TOKEN #shadow/env "ALCHEMY_ARBITRUM_SEPOLIA_TOKEN"
|
||||
status-im.config/ALCHEMY_OPTIMISM_MAINNET_TOKEN #shadow/env "ALCHEMY_OPTIMISM_MAINNET_TOKEN"
|
||||
status-im.config/ALCHEMY_OPTIMISM_SEPOLIA_TOKEN #shadow/env "ALCHEMY_OPTIMISM_SEPOLIA_TOKEN"
|
||||
status-im.config/ALCHEMY_BASE_MAINNET_TOKEN #shadow/env "ALCHEMY_BASE_MAINNET_TOKEN"
|
||||
status-im.config/ALCHEMY_BASE_SEPOLIA_TOKEN #shadow/env "ALCHEMY_BASE_SEPOLIA_TOKEN"
|
||||
status-im.config/WALLET_CONNECT_PROJECT_ID #shadow/env "WALLET_CONNECT_PROJECT_ID"}
|
||||
:compiler-options
|
||||
{;; needed because we override require and it
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
(ns dev.re-frisk-preload
|
||||
(:require [re-frisk-remote.core :as re-frisk-remote]
|
||||
[status-im.config]))
|
||||
|
||||
(re-frisk-remote/enable {:host (str status-im.config/re-frisk-host ":" status-im.config/re-frisk-port)})
|
||||
@@ -5,7 +5,6 @@
|
||||
[legacy.status-im.data-store.messages :as data-store.messages]
|
||||
[legacy.status-im.utils.deprecated-types :as types]
|
||||
[react-native.platform :as platform]
|
||||
[status-im.contexts.chat.messenger.messages.delete-message.events :as delete-message]
|
||||
[status-im.contexts.chat.messenger.messages.list.events :as message-list]
|
||||
[status-im.contexts.chat.messenger.messages.list.state :as view.state]
|
||||
[utils.re-frame :as rf]))
|
||||
@@ -119,6 +118,26 @@
|
||||
(when (get-in db [:messages chat-id message-id])
|
||||
{:db (assoc-in db [:messages chat-id message-id :outgoing-status] status)}))
|
||||
|
||||
(defn- update-db-delete-locally-without-time-limit
|
||||
"Delete message in re-frame db, used to handle received removed-messages"
|
||||
[db chat-id message-id deleted-by]
|
||||
(when (get-in db [:messages chat-id message-id])
|
||||
(update-in db [:messages chat-id message-id] assoc :deleted? true :deleted-by deleted-by)))
|
||||
|
||||
(rf/defn delete-messages-locally
|
||||
"Mark messages :deleted? localy in client"
|
||||
{:events [:chat.ui/delete-messages-localy]}
|
||||
[{:keys [db]} messages chat-id]
|
||||
(let [new-db (->> messages
|
||||
(filter #(get-in db [:messages chat-id (:message-id %)]))
|
||||
(reduce #(update-db-delete-locally-without-time-limit %1
|
||||
chat-id
|
||||
(:message-id %2)
|
||||
(:deleted-by %2))
|
||||
db))]
|
||||
(when new-db
|
||||
(message-list/rebuild-message-list {:db new-db} chat-id))))
|
||||
|
||||
(rf/defn handle-removed-messages
|
||||
[cofx removed-messages]
|
||||
(let [mark-as-deleted-fx (->> removed-messages
|
||||
@@ -127,7 +146,7 @@
|
||||
:deleted-by (:deletedBy %)))
|
||||
(group-by :chatId)
|
||||
(mapv (fn [[chat-id messages]]
|
||||
(delete-message/delete-messages-localy messages chat-id))))
|
||||
(delete-messages-locally messages chat-id))))
|
||||
mark-as-seen-fx (mapv
|
||||
(fn [removed-message]
|
||||
(let [chat-id (:chatId removed-message)
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
(ns ^{:doc "Mailserver events and API"} legacy.status-im.mailserver.core
|
||||
(:require
|
||||
[legacy.status-im.multiaccounts.update.core :as multiaccounts.update]
|
||||
[taoensso.timbre :as log]
|
||||
[utils.re-frame :as rf]))
|
||||
|
||||
(rf/defn handle-mailserver-changed
|
||||
[{:keys [db]} ms]
|
||||
(when (seq ms)
|
||||
{:db (assoc db :mailserver/current-id (keyword ms))}))
|
||||
|
||||
(rf/defn handle-mailserver-available
|
||||
[{:keys [db]} ms]
|
||||
{:db (assoc db :mailserver/current-id (keyword ms))})
|
||||
|
||||
(rf/defn toggle-use-mailservers
|
||||
[_ value]
|
||||
{:json-rpc/call
|
||||
[{:method "wakuext_toggleUseMailservers"
|
||||
:params [value]
|
||||
:on-success #(log/info "successfully toggled use-mailservers" value)
|
||||
:on-error #(log/error "failed to toggle use-mailserver" value %)}]})
|
||||
|
||||
(rf/defn update-use-mailservers
|
||||
{:events [:mailserver.ui/use-history-switch-pressed]}
|
||||
[cofx use-mailservers?]
|
||||
(rf/merge cofx
|
||||
(multiaccounts.update/optimistic :use-mailservers? use-mailservers?)
|
||||
(toggle-use-mailservers use-mailservers?)))
|
||||
|
||||
(defn add-mailservers
|
||||
[db mailservers]
|
||||
(reduce (fn [db {:keys [fleet id name] :as mailserver}]
|
||||
(let [updated-mailserver
|
||||
(-> mailserver
|
||||
(update :id keyword)
|
||||
(assoc :name (if (seq name) name id))
|
||||
(dissoc :fleet))]
|
||||
(assoc-in db
|
||||
[:mailserver/mailservers (keyword fleet) (keyword id)]
|
||||
updated-mailserver)))
|
||||
db
|
||||
mailservers))
|
||||
@@ -1,6 +1,5 @@
|
||||
(ns legacy.status-im.subs.mailservers
|
||||
(:require
|
||||
[legacy.status-im.fleet.core :as fleet]
|
||||
[re-frame.core :as re-frame]))
|
||||
|
||||
(re-frame/reg-sub
|
||||
@@ -17,10 +16,3 @@
|
||||
:<- [:mailserver/mailservers]
|
||||
(fn [[current-fleet mailservers]]
|
||||
(current-fleet mailservers)))
|
||||
|
||||
(re-frame/reg-sub
|
||||
:mailserver/preferred-id
|
||||
:<- [:profile/profile]
|
||||
(fn [multiaccount]
|
||||
(get-in multiaccount
|
||||
[:pinned-mailservers (fleet/current-fleet-sub multiaccount)])))
|
||||
|
||||
@@ -38,11 +38,6 @@
|
||||
;;mailserver
|
||||
(reg-root-key-sub :mailserver/current-id :mailserver/current-id)
|
||||
(reg-root-key-sub :mailserver/mailservers :mailserver/mailservers)
|
||||
(reg-root-key-sub :mailserver.edit/mailserver :mailserver.edit/mailserver)
|
||||
(reg-root-key-sub :mailserver/state :mailserver/state)
|
||||
(reg-root-key-sub :mailserver/pending-requests :mailserver/pending-requests)
|
||||
(reg-root-key-sub :mailserver/request-error? :mailserver/request-error)
|
||||
(reg-root-key-sub :mailserver/fetching-gaps-in-progress :mailserver/fetching-gaps-in-progress)
|
||||
|
||||
;;contacts
|
||||
(reg-root-key-sub :contacts/contacts-raw :contacts/contacts)
|
||||
|
||||
@@ -129,7 +129,8 @@
|
||||
:transport/confirm-messages-processed
|
||||
:group-chats/extract-membership-signature
|
||||
:utils/dispatch-later
|
||||
:json-rpc/call})
|
||||
:json-rpc/call
|
||||
:fx})
|
||||
|
||||
(let [opts (parse-args args)]
|
||||
(execute-cli opts)))
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
:else theme)
|
||||
{:keys [icon-color background-color text-color border-color]}
|
||||
(themes theme')]
|
||||
[rn/touchable-without-feedback
|
||||
[rn/pressable
|
||||
(merge {:disabled disabled
|
||||
:accessibility-label accessibility-label}
|
||||
(when on-press
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
(ns legacy.status-im.ui.screens.offline-messaging-settings.styles
|
||||
(:require
|
||||
[legacy.status-im.ui.components.colors :as colors]
|
||||
[legacy.status-im.utils.styles :as styles]))
|
||||
|
||||
(def wrapper
|
||||
{:flex 1})
|
||||
|
||||
(styles/defn mailserver-item
|
||||
[]
|
||||
{:flex-direction :row
|
||||
:align-items :center
|
||||
:justify-content :space-between
|
||||
:padding-horizontal 16
|
||||
:ios {:height 64}
|
||||
:android {:height 56}})
|
||||
|
||||
(def mailserver-item-name-text
|
||||
{:typography :title})
|
||||
|
||||
(def switch-container
|
||||
{:height 52})
|
||||
|
||||
(def automatic-selection-container
|
||||
{:border-top-width 1
|
||||
:border-top-color colors/gray-lighter
|
||||
:margin-top 16})
|
||||
|
||||
(def explanation-text
|
||||
{:color colors/gray})
|
||||
|
||||
(def use-history-explanation-text-container
|
||||
{:margin-right 16
|
||||
:margin-left 16
|
||||
:margin-top 8
|
||||
:margin-bottom 16})
|
||||
|
||||
(def history-nodes-label
|
||||
{:color colors/gray
|
||||
:padding-horizontal 16
|
||||
:margin-top 48})
|
||||
@@ -1,88 +0,0 @@
|
||||
(ns legacy.status-im.ui.screens.offline-messaging-settings.views
|
||||
(:require-macros [legacy.status-im.utils.views :as views])
|
||||
(:require
|
||||
[legacy.status-im.ui.components.colors :as colors]
|
||||
[legacy.status-im.ui.components.core :as quo]
|
||||
[legacy.status-im.ui.components.icons.icons :as icons]
|
||||
[legacy.status-im.ui.components.list.views :as list]
|
||||
[legacy.status-im.ui.components.react :as react]
|
||||
[legacy.status-im.ui.components.topbar :as topbar]
|
||||
[legacy.status-im.ui.screens.offline-messaging-settings.styles :as styles]
|
||||
[legacy.status-im.ui.screens.profile.components.views :as profile.components]
|
||||
[re-frame.core :as re-frame]
|
||||
[utils.i18n :as i18n]))
|
||||
|
||||
(defn pinned-state
|
||||
[pinned?]
|
||||
[react/view {:style styles/automatic-selection-container}
|
||||
[react/view {:style styles/switch-container}
|
||||
[profile.components/settings-switch-item
|
||||
{:label-kw :t/mailserver-automatic
|
||||
:value (not pinned?)
|
||||
:action-fn #(if pinned?
|
||||
(re-frame/dispatch [:mailserver.ui/unpin-pressed])
|
||||
(re-frame/dispatch [:mailserver.ui/pin-pressed]))}]]
|
||||
[react/view {:style {:padding-horizontal 16}}
|
||||
[react/text {:style styles/explanation-text}
|
||||
(i18n/label :t/mailserver-automatic-switch-explanation)]]])
|
||||
|
||||
(defn render-row
|
||||
[{:keys [name id custom]} _ _ {:keys [current-mailserver-id preferred-mailserver-id]}]
|
||||
(let [pinned? preferred-mailserver-id
|
||||
connected? (= id current-mailserver-id)
|
||||
visible? (or pinned? ; show everything when auto selection is turned off
|
||||
(and (not pinned?) ; auto selection turned on
|
||||
(= current-mailserver-id id)))] ; show only the selected server
|
||||
|
||||
(when visible?
|
||||
[react/touchable-highlight
|
||||
{:on-press (when pinned?
|
||||
#(if custom
|
||||
(re-frame/dispatch [:mailserver.ui/custom-mailserver-selected id])
|
||||
(re-frame/dispatch [:mailserver.ui/default-mailserver-selected id])))
|
||||
:accessibility-label :mailserver-item}
|
||||
[react/view (styles/mailserver-item)
|
||||
[react/text {:style styles/mailserver-item-name-text}
|
||||
name]
|
||||
|
||||
(if pinned?
|
||||
[quo/radio {:value connected?}]
|
||||
[icons/icon :check {:color colors/blue}])]])))
|
||||
|
||||
(views/defview offline-messaging-settings
|
||||
[]
|
||||
(views/letsubs [current-mailserver-id [:mailserver/current-id]
|
||||
preferred-mailserver-id [:mailserver/preferred-id]
|
||||
mailservers [:mailserver/fleet-mailservers]
|
||||
{:keys [use-mailservers?]} [:profile/profile]]
|
||||
[react/view {:style styles/wrapper}
|
||||
[topbar/topbar
|
||||
{:title (i18n/label :t/history-nodes)
|
||||
:right-accessories
|
||||
[{:icon :main-icons/add-circle
|
||||
:on-press #(re-frame/dispatch [:mailserver.ui/add-pressed])}]}]
|
||||
|
||||
[react/scroll-view
|
||||
[react/view {:style styles/switch-container}
|
||||
[profile.components/settings-switch-item
|
||||
{:label-kw :t/offline-messaging-use-history-nodes
|
||||
:value use-mailservers?
|
||||
:action-fn #(re-frame/dispatch [:mailserver.ui/use-history-switch-pressed
|
||||
(not use-mailservers?)])}]]
|
||||
[react/view {:style styles/use-history-explanation-text-container}
|
||||
[react/text {:style styles/explanation-text}
|
||||
(i18n/label :t/offline-messaging-use-history-explanation)]]
|
||||
|
||||
(when use-mailservers?
|
||||
[:<>
|
||||
[pinned-state preferred-mailserver-id]
|
||||
|
||||
[react/text {:style styles/history-nodes-label}
|
||||
(i18n/label :t/history-nodes)]
|
||||
[list/flat-list
|
||||
{:data (vals mailservers)
|
||||
:default-separator? false
|
||||
:key-fn :name
|
||||
:render-data {:current-mailserver-id current-mailserver-id
|
||||
:preferred-mailserver-id preferred-mailserver-id}
|
||||
:render-fn render-row}]])]]))
|
||||
@@ -12,7 +12,6 @@
|
||||
[legacy.status-im.ui.screens.help-center.views :as help-center]
|
||||
[legacy.status-im.ui.screens.log-level-settings.views :as log-level-settings]
|
||||
[legacy.status-im.ui.screens.notifications-settings.views :as notifications-settings]
|
||||
[legacy.status-im.ui.screens.offline-messaging-settings.views :as offline-messaging-settings]
|
||||
[legacy.status-im.ui.screens.pairing.views :as pairing]
|
||||
[legacy.status-im.ui.screens.peers-stats :as peers-stats]
|
||||
[legacy.status-im.ui.screens.profile.seed.views :as profile.seed]
|
||||
@@ -113,9 +112,6 @@
|
||||
:options {:topBar (topbar-options (i18n/label :t/devices))
|
||||
:insets {:top? true}}
|
||||
:component pairing/installations}
|
||||
{:name :offline-messaging-settings
|
||||
:options {:insets {:top? true}}
|
||||
:component offline-messaging-settings/offline-messaging-settings}
|
||||
{:name :rpc-usage-info
|
||||
:options {:topBar (topbar-options :t/rpc-usage-info)
|
||||
:insets {:top? true}}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
[legacy.status-im.ui.components.react :as react]
|
||||
[quo.core :as quo]
|
||||
[re-frame.core :as re-frame]
|
||||
[react-native.clipboard :as clipboard]
|
||||
[status-im.constants :as constants]
|
||||
[utils.i18n :as i18n]
|
||||
[utils.re-frame :as rf]))
|
||||
@@ -67,10 +68,10 @@
|
||||
{:size :small
|
||||
:accessibility-label :offline-messages-settings-button
|
||||
:title (i18n/label :t/history-nodes)
|
||||
:on-press #(re-frame/dispatch [:navigate-to :offline-messaging-settings])
|
||||
:on-press (fn []
|
||||
(clipboard/set-string current-mailserver-name))
|
||||
:accessory :text
|
||||
:accessory-text (when use-mailservers? current-mailserver-name)
|
||||
:chevron true}]
|
||||
:accessory-text (when use-mailservers? current-mailserver-name)}]
|
||||
;; TODO(Ferossgp): Devider componemt
|
||||
[react/view
|
||||
{:height 1
|
||||
|
||||
@@ -170,12 +170,6 @@
|
||||
:Bip39Passphrase password})
|
||||
callback))
|
||||
|
||||
(defn verify
|
||||
"NOTE: beware, the password has to be sha3 hashed"
|
||||
[address hashed-password callback]
|
||||
(log/debug "[native-module] verify")
|
||||
(.verify ^js (account-manager) address hashed-password callback))
|
||||
|
||||
(defn set-soft-input-mode
|
||||
[mode]
|
||||
(log/debug "[native-module] set-soft-input-mode")
|
||||
@@ -388,16 +382,6 @@
|
||||
;; in unknown scenarios we also consider the device rooted to avoid degrading security
|
||||
:else (callback true)))
|
||||
|
||||
(defn encode-transfer
|
||||
[to-norm amount-hex]
|
||||
(log/debug "[native-module] encode-transfer")
|
||||
(.encodeTransfer ^js (encryption) to-norm amount-hex))
|
||||
|
||||
(defn encode-function-call
|
||||
[method params]
|
||||
(log/debug "[native-module] encode-function-call")
|
||||
(.encodeFunctionCall ^js (encryption) method (types/clj->json params)))
|
||||
|
||||
(defn decode-parameters
|
||||
[bytes-string types]
|
||||
(log/debug "[native-module] decode-parameters")
|
||||
|
||||
@@ -10,9 +10,7 @@
|
||||
:justify-content :center
|
||||
:border-radius (/ container-size 2)
|
||||
:overflow :hidden
|
||||
:background-color (colors/theme-colors (colors/custom-color customization-color 50)
|
||||
(colors/custom-color customization-color 60)
|
||||
theme)})
|
||||
:background-color (colors/resolve-color customization-color theme)})
|
||||
|
||||
(defn avatar-identifier
|
||||
[theme]
|
||||
|
||||
@@ -5,16 +5,13 @@
|
||||
[customization-color neutral? theme]
|
||||
(if neutral?
|
||||
(colors/theme-colors colors/neutral-80-opa-5 colors/white-opa-5 theme)
|
||||
(colors/custom-color customization-color 50 20)))
|
||||
(colors/resolve-color customization-color theme 20)))
|
||||
|
||||
(defn- text-color
|
||||
[customization-color neutral? theme]
|
||||
(if neutral?
|
||||
(colors/theme-colors colors/neutral-80-opa-70 colors/white-opa-70 theme)
|
||||
(colors/theme-colors
|
||||
(colors/custom-color customization-color 50)
|
||||
(colors/custom-color customization-color 60)
|
||||
theme)))
|
||||
(colors/resolve-color customization-color theme)))
|
||||
|
||||
(defn container
|
||||
[circle-size customization-color neutral? theme]
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
(:require
|
||||
[quo.foundations.colors :as colors]))
|
||||
|
||||
(def container
|
||||
(defn container
|
||||
[theme]
|
||||
{:height 40
|
||||
:background-color (colors/custom-color :blue 50 20)
|
||||
:background-color (colors/resolve-color :blue theme 20)
|
||||
:flex-direction :row
|
||||
:align-items :center
|
||||
:padding-right 22
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
(when (pos? pins-count)
|
||||
[rn/touchable-opacity
|
||||
{:accessibility-label :pinned-banner
|
||||
:style style/container
|
||||
:style (style/container theme)
|
||||
:active-opacity 1
|
||||
:on-press on-press}
|
||||
(when-not hide-pin?
|
||||
|
||||
@@ -44,9 +44,7 @@
|
||||
|
||||
(defn cursor-color
|
||||
[customization-color theme]
|
||||
(colors/theme-colors (colors/custom-color customization-color 50)
|
||||
(colors/custom-color customization-color 60)
|
||||
theme))
|
||||
(colors/resolve-color customization-color theme))
|
||||
|
||||
(defn placeholder-color
|
||||
[state blur? theme]
|
||||
|
||||
@@ -54,81 +54,80 @@
|
||||
(fn []
|
||||
(set-pressed-state nil)
|
||||
(when on-press-out (on-press-out))))]
|
||||
[rn/touchable-without-feedback
|
||||
[rn/pressable
|
||||
{:disabled (boolean disabled?)
|
||||
:accessibility-label accessibility-label
|
||||
:on-press-in on-press-in-cb
|
||||
:on-press-out on-press-out-cb
|
||||
:on-press on-press
|
||||
:allow-multiple-presses? allow-multiple-presses?
|
||||
:on-long-press on-long-press}
|
||||
:on-long-press on-long-press
|
||||
:style (merge
|
||||
(style/shape-style-container size border-radius)
|
||||
container-style)}
|
||||
[rn/view
|
||||
{:style (merge
|
||||
(style/shape-style-container size border-radius)
|
||||
container-style)}
|
||||
(style/style-container {:size size
|
||||
:disabled? disabled?
|
||||
:border-radius border-radius
|
||||
:background-color background-color
|
||||
:border-color border-color
|
||||
:icon-only? icon-only?
|
||||
:icon-top icon-top
|
||||
:icon-left icon-left
|
||||
:icon-right icon-right})
|
||||
inner-style)}
|
||||
(when overlay-customization-color
|
||||
[customization-colors/overlay
|
||||
{:customization-color overlay-customization-color
|
||||
:theme theme
|
||||
:pressed? (if pressed? pressed? pressed-state?)}])
|
||||
(when (= background :photo)
|
||||
[blur/view
|
||||
{:blur-radius 20
|
||||
:blur-type blur-type
|
||||
:overlay-color blur-overlay-color
|
||||
:style style/blur-view}])
|
||||
(when icon-top
|
||||
[rn/view
|
||||
[quo.icons/icon icon-top
|
||||
{:container-style {:margin-bottom 2
|
||||
:opacity (when disabled? 0.3)}
|
||||
:color (or icon-top-color icon-color)
|
||||
:size icon-size}]])
|
||||
(when icon-left
|
||||
[rn/view
|
||||
{:style (style/icon-left-icon-style
|
||||
{:size size
|
||||
:icon-size icon-size
|
||||
:disabled? disabled?})}
|
||||
[quo.icons/icon icon-left
|
||||
{:color (or icon-left-color icon-color)
|
||||
:size icon-size}]])
|
||||
[rn/view
|
||||
{:style (merge
|
||||
(style/style-container {:size size
|
||||
:disabled? disabled?
|
||||
:border-radius border-radius
|
||||
:background-color background-color
|
||||
:border-color border-color
|
||||
:icon-only? icon-only?
|
||||
:icon-top icon-top
|
||||
:icon-left icon-left
|
||||
:icon-right icon-right})
|
||||
inner-style)}
|
||||
(when overlay-customization-color
|
||||
[customization-colors/overlay
|
||||
{:customization-color overlay-customization-color
|
||||
:theme theme
|
||||
:pressed? (if pressed? pressed? pressed-state?)}])
|
||||
(when (= background :photo)
|
||||
[blur/view
|
||||
{:blur-radius 20
|
||||
:blur-type blur-type
|
||||
:overlay-color blur-overlay-color
|
||||
:style style/blur-view}])
|
||||
(when icon-top
|
||||
[rn/view
|
||||
[quo.icons/icon icon-top
|
||||
{:container-style {:margin-bottom 2
|
||||
:opacity (when disabled? 0.3)}
|
||||
:color (or icon-top-color icon-color)
|
||||
:size icon-size}]])
|
||||
(when icon-left
|
||||
[rn/view
|
||||
{:style (style/icon-left-icon-style
|
||||
{:size size
|
||||
:icon-size icon-size
|
||||
:disabled? disabled?})}
|
||||
[quo.icons/icon icon-left
|
||||
{:color (or icon-left-color icon-color)
|
||||
:size icon-size}]])
|
||||
[rn/view
|
||||
(cond
|
||||
icon-only?
|
||||
[quo.icons/icon children
|
||||
{:color label-color
|
||||
:size icon-size}]
|
||||
(cond
|
||||
icon-only?
|
||||
[quo.icons/icon children
|
||||
{:color label-color
|
||||
:size icon-size}]
|
||||
|
||||
(string? children)
|
||||
[text/text
|
||||
{:size (when (#{56 24} size) :paragraph-2)
|
||||
:weight :medium
|
||||
:number-of-lines 1
|
||||
:style {:color label-color
|
||||
:opacity (when (and disabled? (= theme :dark)) 0.3)}}
|
||||
children]
|
||||
(string? children)
|
||||
[text/text
|
||||
{:size (when (#{56 24} size) :paragraph-2)
|
||||
:weight :medium
|
||||
:number-of-lines 1
|
||||
:style {:color label-color
|
||||
:opacity (when (and disabled? (= theme :dark)) 0.3)}}
|
||||
children]
|
||||
|
||||
(vector? children)
|
||||
children)]
|
||||
(when icon-right
|
||||
[rn/view
|
||||
{:style (style/icon-right-icon-style
|
||||
{:size size
|
||||
:icon-size icon-size
|
||||
:disabled? disabled?})}
|
||||
[quo.icons/icon icon-right
|
||||
{:color (or icon-right-color icon-color)
|
||||
:size icon-size}]])]]]))
|
||||
(vector? children)
|
||||
children)]
|
||||
(when icon-right
|
||||
[rn/view
|
||||
{:style (style/icon-right-icon-style
|
||||
{:size size
|
||||
:icon-size icon-size
|
||||
:disabled? disabled?})}
|
||||
[quo.icons/icon icon-right
|
||||
{:color (or icon-right-color icon-color)
|
||||
:size icon-size}]])]]))
|
||||
|
||||
@@ -11,14 +11,8 @@
|
||||
[{:keys [type pressed? customization-color theme]}]
|
||||
(if (= type :mention)
|
||||
(if pressed?
|
||||
(colors/theme-colors
|
||||
(colors/custom-color customization-color 60)
|
||||
(colors/custom-color customization-color 50)
|
||||
theme)
|
||||
(colors/theme-colors
|
||||
(colors/custom-color customization-color 50)
|
||||
(colors/custom-color customization-color 60)
|
||||
theme))
|
||||
(colors/resolve-color customization-color (colors/invert-theme theme))
|
||||
(colors/resolve-color customization-color theme))
|
||||
(if pressed?
|
||||
(colors/theme-colors colors/neutral-80-opa-80 colors/white-opa-80 theme)
|
||||
(colors/theme-colors colors/neutral-80-opa-70 colors/white-opa-70 theme))))
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
:justify-content :space-around}])
|
||||
|
||||
(defn track
|
||||
[{:keys [disabled? customization-color height blur?]}]
|
||||
[{:keys [disabled? customization-color height blur? theme]}]
|
||||
{:align-items :flex-start
|
||||
:justify-content :center
|
||||
:border-radius 14
|
||||
@@ -49,7 +49,7 @@
|
||||
:align-self :stretch
|
||||
:padding constants/track-padding
|
||||
:opacity (if disabled? 0.3 1)
|
||||
:background-color (utils/track-color customization-color blur?)})
|
||||
:background-color (utils/track-color customization-color theme blur?)})
|
||||
|
||||
(defn track-cover
|
||||
[interpolate-track]
|
||||
|
||||
@@ -6,27 +6,21 @@
|
||||
(defn main-color
|
||||
"`customization-color` Customization color"
|
||||
[customization-color theme]
|
||||
(colors/theme-colors
|
||||
(colors/custom-color customization-color 50)
|
||||
(colors/custom-color customization-color 60)
|
||||
theme))
|
||||
(colors/resolve-color customization-color theme))
|
||||
|
||||
(defn track-color
|
||||
"`customization-color` Customization color"
|
||||
([customization-color blur?]
|
||||
([customization-color theme blur?]
|
||||
(if blur?
|
||||
colors/white-opa-5
|
||||
(colors/custom-color customization-color 50 10))))
|
||||
(colors/resolve-color customization-color theme 10))))
|
||||
|
||||
(defn text-color
|
||||
"`customization-color` Customization color"
|
||||
[customization-color theme blur?]
|
||||
(if blur?
|
||||
colors/white-opa-40
|
||||
(colors/theme-colors
|
||||
(colors/custom-color customization-color 50)
|
||||
(colors/custom-color customization-color 60)
|
||||
theme)))
|
||||
(colors/resolve-color customization-color theme)))
|
||||
|
||||
(defn clamp-value
|
||||
[value min-value max-value]
|
||||
|
||||
@@ -88,7 +88,8 @@
|
||||
:style (merge (style/track {:disabled? disabled?
|
||||
:customization-color custom-color
|
||||
:height (dimensions :track-height)
|
||||
:blur? blur?})
|
||||
:blur? blur?
|
||||
:theme theme})
|
||||
container-style)
|
||||
:on-layout on-track-layout}
|
||||
[reanimated/view {:style (style/track-cover interpolate-track)}
|
||||
|
||||
@@ -22,9 +22,7 @@
|
||||
|
||||
hex-color (if (= :feng-shui color)
|
||||
(colors/theme-colors colors/neutral-100 colors/white theme)
|
||||
(colors/theme-colors (colors/custom-color color 50)
|
||||
(colors/custom-color color 60)
|
||||
theme))]
|
||||
(colors/resolve-color color theme))]
|
||||
|
||||
[rn/pressable
|
||||
{:style (style/color-button hex-color selected? idx window-width)
|
||||
|
||||
@@ -7,10 +7,7 @@
|
||||
(defn dot-background-color
|
||||
[customization-color theme blur?]
|
||||
(cond
|
||||
customization-color (colors/theme-colors
|
||||
(colors/custom-color customization-color 50)
|
||||
(colors/custom-color customization-color 60)
|
||||
theme)
|
||||
customization-color (colors/resolve-color customization-color theme)
|
||||
blur? (colors/theme-colors colors/neutral-80-opa-40 colors/white-opa-40 theme)
|
||||
:else (colors/theme-colors colors/neutral-40 colors/neutral-50 theme)))
|
||||
|
||||
|
||||
@@ -29,12 +29,12 @@
|
||||
(defn view
|
||||
[{:keys [title description on-press accessibility-label banner style]}]
|
||||
(let [theme (quo.theme/use-theme)]
|
||||
[rn/touchable-without-feedback
|
||||
[rn/pressable
|
||||
{:on-press on-press
|
||||
:accessibility-label accessibility-label}
|
||||
[rn/view {:style (merge (style/community-card theme) style)}
|
||||
[card-title-and-description title description theme]
|
||||
[rn/image
|
||||
{:style style/discover-illustration
|
||||
:source banner
|
||||
:accessibility-label :discover-communities-illustration}]]]))
|
||||
:accessibility-label accessibility-label
|
||||
:style (merge (style/community-card theme) style)}
|
||||
[card-title-and-description title description theme]
|
||||
[rn/image
|
||||
{:style style/discover-illustration
|
||||
:source banner
|
||||
:accessibility-label :discover-communities-illustration}]]))
|
||||
|
||||
@@ -35,39 +35,39 @@
|
||||
[{:keys [community on-press width]}]
|
||||
(let [theme (quo.theme/use-theme)
|
||||
{:keys [name description locked? images cover status tokens tags]} community]
|
||||
[rn/touchable-without-feedback
|
||||
[rn/pressable
|
||||
{:accessibility-label :community-card-item
|
||||
:on-press on-press}
|
||||
[rn/view {:style (style/community-card 20 theme)}
|
||||
[rn/view
|
||||
{:style {:width width
|
||||
:height 230
|
||||
:border-radius 20}
|
||||
:on-press on-press}
|
||||
[rn/view {:style style/detail-container}
|
||||
[rn/view (style/community-cover-container 60)
|
||||
[rn/image
|
||||
{:source cover
|
||||
:style {:flex 1
|
||||
:border-top-right-radius 20
|
||||
:border-top-left-radius 20}}]]
|
||||
[rn/view (style/card-view-content-container 12 theme)
|
||||
[rn/view (style/card-view-chat-icon 48 theme)
|
||||
[icon/community-icon {:images images} 48]]
|
||||
(when (= status :gated)
|
||||
[rn/view (style/permission-tag-styles)
|
||||
[community-view/permission-tag-container
|
||||
{:locked? locked?
|
||||
:status status
|
||||
:tokens tokens}]])
|
||||
[community-view/community-title
|
||||
{:title name
|
||||
:description description}]
|
||||
[rn/view {:style (style/card-stats-position)}
|
||||
[community-view/community-stats-column
|
||||
{:type :card-view}]]
|
||||
[rn/view {:style (style/community-tags-position)}
|
||||
[community-view/community-tags {:tags tags}]]]]]]]))
|
||||
:on-press on-press
|
||||
:style (style/community-card 20 theme)}
|
||||
[rn/view
|
||||
{:style {:width width
|
||||
:height 230
|
||||
:border-radius 20}
|
||||
:on-press on-press}
|
||||
[rn/view {:style style/detail-container}
|
||||
[rn/view (style/community-cover-container 60)
|
||||
[rn/image
|
||||
{:source cover
|
||||
:style {:flex 1
|
||||
:border-top-right-radius 20
|
||||
:border-top-left-radius 20}}]]
|
||||
[rn/view (style/card-view-content-container 12 theme)
|
||||
[rn/view (style/card-view-chat-icon 48 theme)
|
||||
[icon/community-icon {:images images} 48]]
|
||||
(when (= status :gated)
|
||||
[rn/view (style/permission-tag-styles)
|
||||
[community-view/permission-tag-container
|
||||
{:locked? locked?
|
||||
:status status
|
||||
:tokens tokens}]])
|
||||
[community-view/community-title
|
||||
{:title name
|
||||
:description description}]
|
||||
[rn/view {:style (style/card-stats-position)}
|
||||
[community-view/community-stats-column
|
||||
{:type :card-view}]]
|
||||
[rn/view {:style (style/community-tags-position)}
|
||||
[community-view/community-tags {:tags tags}]]]]]]))
|
||||
|
||||
(defn view
|
||||
[{:keys [loading?] :as props}]
|
||||
|
||||
@@ -5,9 +5,7 @@
|
||||
(defn get-color
|
||||
[type customization-color theme]
|
||||
(case type
|
||||
:default (colors/theme-colors (colors/custom-color customization-color 50)
|
||||
(colors/custom-color customization-color 60)
|
||||
theme)
|
||||
:default (colors/resolve-color customization-color theme)
|
||||
:secondary (colors/theme-colors colors/neutral-80-opa-5 colors/white-opa-5 theme)
|
||||
:grey (colors/theme-colors colors/neutral-10 colors/neutral-80 theme)
|
||||
:outline (colors/theme-colors colors/neutral-20 colors/neutral-80 theme)
|
||||
|
||||
@@ -14,9 +14,13 @@
|
||||
(colors/theme-colors colors/neutral-80-opa-5 colors/white-opa-10 theme)
|
||||
(colors/theme-colors colors/neutral-20 colors/neutral-80 theme)))
|
||||
|
||||
(defn active-background-color [customization-color] (colors/custom-color customization-color 50 10))
|
||||
(defn active-background-color
|
||||
[customization-color theme]
|
||||
(colors/resolve-color customization-color theme 10))
|
||||
|
||||
(defn complete-background-color [customization-color] (colors/custom-color customization-color 50))
|
||||
(defn complete-background-color
|
||||
[customization-color]
|
||||
(colors/resolve-color customization-color :light))
|
||||
|
||||
(defn container
|
||||
[{:keys [size type in-blur-view? theme customization-color]}]
|
||||
@@ -29,7 +33,7 @@
|
||||
:border-color (neutral-border-color in-blur-view? theme))
|
||||
|
||||
(= type :active)
|
||||
(assoc :background-color (active-background-color customization-color))
|
||||
(assoc :background-color (active-background-color customization-color theme))
|
||||
|
||||
(= type :complete)
|
||||
(assoc :background-color (complete-background-color customization-color))))
|
||||
|
||||
@@ -9,16 +9,15 @@
|
||||
[react-native.svg :as svg]
|
||||
[utils.i18n :as i18n]))
|
||||
|
||||
|
||||
(def strength-divider-types
|
||||
{:very-weak {:default-text (i18n/label :t/strength-divider-very-weak-label)
|
||||
:color colors/danger-60
|
||||
:percentage 20}
|
||||
:weak {:default-text (i18n/label :t/strength-divider-weak-label)
|
||||
:color (colors/custom-color :orange 60)
|
||||
:color (colors/resolve-color :orange nil)
|
||||
:percentage 40}
|
||||
:okay {:default-text (i18n/label :t/strength-divider-okay-label)
|
||||
:color (colors/custom-color :yellow 60)
|
||||
:color (colors/resolve-color :yellow nil)
|
||||
:percentage 60}
|
||||
:strong {:default-text (i18n/label :t/strength-divider-strong-label)
|
||||
:color colors/success-60
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
:right-icon-color colors/white-opa-20
|
||||
:right-icon-color-2 colors/white
|
||||
:label-color colors/white
|
||||
:background-color (colors/custom-color customization-color 50)})
|
||||
:background-color (colors/resolve-color customization-color :light)})
|
||||
|
||||
(def sizes-to-exclude-blur-in-photo-bg #{:size-40})
|
||||
|
||||
|
||||
@@ -76,10 +76,8 @@
|
||||
y-axis-label-background-color (colors/theme-colors colors/white-70-blur-opaque
|
||||
colors/neutral-95
|
||||
theme)
|
||||
customization-color (colors/theme-colors
|
||||
(colors/custom-color customization-color 60)
|
||||
(colors/custom-color customization-color 50)
|
||||
theme)
|
||||
customization-color (colors/resolve-color customization-color
|
||||
(colors/invert-theme theme))
|
||||
y-axis-label-texts (utils/calculate-y-axis-labels min-value step-value 4)
|
||||
x-axis-label-texts (utils/calculate-x-axis-labels data 5)
|
||||
reference-label-background-color (colors/theme-colors colors/neutral-80-opa-5-opaque
|
||||
|
||||
@@ -26,10 +26,7 @@
|
||||
customization-color customization-color
|
||||
(= state :positive) :success
|
||||
:else :danger)]
|
||||
(colors/theme-colors
|
||||
(colors/custom-color color-keyword 50)
|
||||
(colors/custom-color color-keyword 60)
|
||||
theme)))
|
||||
(colors/resolve-color color-keyword theme)))
|
||||
|
||||
(defn view
|
||||
[{:keys [data state time-frame customization-color]}]
|
||||
|
||||
@@ -37,9 +37,7 @@
|
||||
[theme]
|
||||
[rn/view {:style style/clear-icon-container}
|
||||
[icon/icon :i/positive-state
|
||||
{:color (colors/theme-colors (colors/custom-color :success 50)
|
||||
(colors/custom-color :success 60)
|
||||
theme)
|
||||
{:color (colors/resolve-color :success theme)
|
||||
:size 20}]])
|
||||
|
||||
(defn- get-placeholder-text-color
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
:button-border (colors/theme-colors colors/neutral-80-opa-30 colors/white-opa-10 theme)
|
||||
:password-icon (colors/theme-colors colors/neutral-100 colors/white-opa-70 theme)
|
||||
:clear-icon (colors/theme-colors colors/neutral-80-opa-30 colors/white-opa-10 theme)
|
||||
:cursor (colors/theme-colors (colors/custom-color :blue 50)
|
||||
:cursor (colors/theme-colors (colors/resolve-color :blue :light)
|
||||
colors/white
|
||||
theme)}
|
||||
{:label (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)
|
||||
@@ -20,9 +20,7 @@
|
||||
:button-border (colors/theme-colors colors/neutral-30 colors/neutral-70 theme)
|
||||
:clear-icon (colors/theme-colors colors/neutral-40 colors/neutral-60 theme)
|
||||
:password-icon (colors/theme-colors colors/neutral-50 colors/white theme)
|
||||
:cursor (colors/theme-colors (colors/custom-color :blue 50)
|
||||
(colors/custom-color :blue 60)
|
||||
theme)}))
|
||||
:cursor (colors/resolve-color :blue theme)}))
|
||||
|
||||
(defn status-colors
|
||||
[status blur? theme]
|
||||
@@ -133,7 +131,7 @@
|
||||
[variant-colors]
|
||||
{:color (:label variant-colors)})
|
||||
|
||||
(def counter-container
|
||||
(def right-label-container
|
||||
{:flex 1
|
||||
:align-items :flex-end})
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
[react-native.core :as rn]
|
||||
[react-native.platform :as platform]))
|
||||
|
||||
(defn- label-&-counter
|
||||
[{:keys [label current-chars char-limit variant-colors theme]}]
|
||||
(defn- label-line
|
||||
[{:keys [label label-right current-chars char-limit variant-colors theme]}]
|
||||
[rn/view
|
||||
{:accessibility-label :input-labels
|
||||
:style style/texts-container}
|
||||
@@ -18,17 +18,24 @@
|
||||
:weight :medium
|
||||
:size :paragraph-2}
|
||||
label]]
|
||||
(when-let [count-text (some->> char-limit
|
||||
(str current-chars "/"))]
|
||||
[rn/view {:style style/counter-container}
|
||||
(when label-right
|
||||
[rn/view {:style style/right-label-container}
|
||||
[text/text
|
||||
{:style (style/counter-color {:current-chars current-chars
|
||||
:char-limit char-limit
|
||||
:variant-colors variant-colors
|
||||
:theme theme})
|
||||
{:style (style/label-color variant-colors)
|
||||
:weight :regular
|
||||
:size :paragraph-2}
|
||||
count-text]])])
|
||||
label-right]])
|
||||
(when char-limit
|
||||
(let [count-text (str current-chars "/" char-limit)]
|
||||
[rn/view {:style style/right-label-container}
|
||||
[text/text
|
||||
{:style (style/counter-color {:current-chars current-chars
|
||||
:char-limit char-limit
|
||||
:variant-colors variant-colors
|
||||
:theme theme})
|
||||
:weight :regular
|
||||
:size :paragraph-2}
|
||||
count-text]]))])
|
||||
|
||||
(defn- left-accessory
|
||||
[{:keys [variant-colors small? icon-name]}]
|
||||
@@ -65,7 +72,7 @@
|
||||
(defn- base-input
|
||||
[{:keys [blur? error? right-icon left-icon disabled? small? button
|
||||
label char-limit multiline? clearable? on-focus on-blur container-style input-container-style
|
||||
on-change-text on-char-limit-reach weight default-value on-clear placeholder]
|
||||
on-change-text on-char-limit-reach weight default-value on-clear placeholder label-right]
|
||||
:as props}]
|
||||
(let [theme (quo.theme/use-theme)
|
||||
ref (rn/use-ref-atom nil)
|
||||
@@ -115,10 +122,11 @@
|
||||
;; https://github.com/facebook/react-native/issues/27687
|
||||
modified-placeholder (if platform/android? (str "\u2009" placeholder) placeholder)]
|
||||
[rn/view {:style container-style}
|
||||
(when (or label char-limit)
|
||||
[label-&-counter
|
||||
(when (or label char-limit label-right)
|
||||
[label-line
|
||||
{:variant-colors variant-colors
|
||||
:label label
|
||||
:label-right label-right
|
||||
:current-chars char-count
|
||||
:char-limit char-limit
|
||||
:theme theme}])
|
||||
@@ -199,6 +207,7 @@
|
||||
- :on-clear - Function executed when the clear button is pressed.
|
||||
- :button - Map containing `:on-press` & `:text` keys, if provided renders a button
|
||||
- :label - A string to set as label for this input.
|
||||
- :label-right - Additional label aligned to the right
|
||||
- :char-limit - A number to set a maximum char limit for this input.
|
||||
- :on-char-limit-reach - Function executed each time char limit is reached or exceeded.
|
||||
- :default-shown? - boolean to show password input initially
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
(defn container
|
||||
[customization-color]
|
||||
{:background-color (colors/custom-color customization-color 50 40)
|
||||
{:background-color (colors/resolve-color customization-color :light 40)
|
||||
:padding-horizontal 12
|
||||
:padding-top 12
|
||||
:padding-bottom 10
|
||||
|
||||
@@ -36,9 +36,7 @@
|
||||
|
||||
(defn cursor-color
|
||||
[customization-color theme]
|
||||
(colors/theme-colors (colors/custom-color customization-color 50)
|
||||
(colors/custom-color customization-color 60)
|
||||
theme))
|
||||
(colors/resolve-color customization-color theme))
|
||||
|
||||
(defn error-word
|
||||
[theme]
|
||||
|
||||
@@ -25,8 +25,7 @@
|
||||
[customization-color blur? theme]
|
||||
(colors/alpha (if blur?
|
||||
(colors/theme-colors colors/neutral-100 colors/white theme)
|
||||
(colors/custom-color customization-color
|
||||
(if (= :dark theme) 60 50)))
|
||||
(colors/resolve-color customization-color theme))
|
||||
(if platform/ios? 1 0.2)))
|
||||
|
||||
(def text-input-container {:flex 1})
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
(h/render-with-theme-provider [address/view (with-defaults)])
|
||||
(h/fire-event :on-press-in (h/get-by-label-text :container))
|
||||
(h/wait-for #(h/has-style (h/query-by-label-text :container)
|
||||
{:backgroundColor (colors/custom-color :blue 50 5)})))
|
||||
{:backgroundColor (colors/resolve-color :blue :light 5)})))
|
||||
|
||||
(h/test "on-press-in changes state to :pressed with blur? enabled"
|
||||
(h/render-with-theme-provider [address/view (with-defaults {:blur? true})])
|
||||
@@ -30,7 +30,7 @@
|
||||
(h/fire-event :on-press-in (h/get-by-label-text :container))
|
||||
(h/fire-event :on-press-out (h/get-by-label-text :container))
|
||||
(h/wait-for #(h/has-style (h/query-by-label-text :container)
|
||||
{:backgroundColor (colors/custom-color :blue 50 10)})))
|
||||
{:backgroundColor (colors/resolve-color :blue :light 10)})))
|
||||
|
||||
(h/test "on-press-out changes state to :active with blur? enabled"
|
||||
(h/render-with-theme-provider [address/view (with-defaults {:active-state? true :blur? true})])
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
(defn- background-color
|
||||
[state customization-color blur?]
|
||||
(cond (and (or (= state :pressed) (= state :selected)) (not blur?))
|
||||
(colors/custom-color customization-color 50 5)
|
||||
(colors/resolve-color customization-color :light 5)
|
||||
(and (or (= state :pressed) (= state :selected)) blur?)
|
||||
colors/white-opa-5
|
||||
(and (= state :active) (not blur?))
|
||||
(colors/custom-color customization-color 50 10)
|
||||
(colors/resolve-color customization-color :light 10)
|
||||
(and (= state :active) blur?)
|
||||
colors/white-opa-10
|
||||
(and (= state :pressed) blur?) colors/white-opa-10
|
||||
|
||||
@@ -8,15 +8,15 @@
|
||||
(and pressed? (= theme :dark) blur?) colors/white-opa-5
|
||||
|
||||
pressed? (colors/theme-colors
|
||||
(colors/custom-color customization-color 50 5)
|
||||
(colors/custom-color customization-color 60 5)
|
||||
(colors/override-color customization-color 5 50)
|
||||
(colors/override-color customization-color 5 60)
|
||||
theme)
|
||||
|
||||
(and (= state :active) (= theme :dark) blur?) colors/white-opa-10
|
||||
|
||||
(= state :active) (colors/theme-colors
|
||||
(colors/custom-color customization-color 50 10)
|
||||
(colors/custom-color customization-color 60 10)
|
||||
(colors/override-color customization-color 10 50)
|
||||
(colors/override-color customization-color 10 60)
|
||||
theme)
|
||||
|
||||
:else :transparent))
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
(defn- background-color
|
||||
[{:keys [state blur? customization-color]}]
|
||||
(cond (and (or (= state :pressed) (= state :selected)) (not blur?))
|
||||
(colors/custom-color customization-color 50 5)
|
||||
(colors/resolve-color customization-color :light 5)
|
||||
(and (or (= state :pressed) (= state :selected)) blur?)
|
||||
colors/white-opa-5
|
||||
(and (= state :active) (not blur?))
|
||||
(colors/custom-color customization-color 50 10)
|
||||
(colors/resolve-color customization-color :light 10)
|
||||
(and (= state :active) blur?)
|
||||
colors/white-opa-10
|
||||
(and (= state :pressed) blur?) colors/white-opa-10
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
{:accounts (repeat 1 account)})])
|
||||
(h/fire-event :on-press-in (h/get-by-label-text :container))
|
||||
(h/wait-for #(h/has-style (h/query-by-label-text :container)
|
||||
{:backgroundColor (colors/custom-color :blue 50 5)})))
|
||||
{:backgroundColor (colors/resolve-color :blue :light 5)})))
|
||||
|
||||
(h/test "on-press-out changes state to :active if active-state? is true (default value)"
|
||||
(h/render-with-theme-provider [saved-contact-address/view
|
||||
@@ -46,7 +46,7 @@
|
||||
(h/fire-event :on-press-in (h/get-by-label-text :container))
|
||||
(h/fire-event :on-press-out (h/get-by-label-text :container))
|
||||
(h/wait-for #(h/has-style (h/query-by-label-text :container)
|
||||
{:backgroundColor (colors/custom-color :blue 50 10)})))
|
||||
{:backgroundColor (colors/resolve-color :blue :light 10)})))
|
||||
|
||||
(h/test "on-press-out changes state to :default if active-state? is false"
|
||||
(h/render-with-theme-provider [saved-contact-address/view
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
(defn- background-color
|
||||
[{:keys [state customization-color]}]
|
||||
(cond (or (= state :pressed) (= state :selected))
|
||||
(colors/custom-color customization-color 50 5)
|
||||
(colors/resolve-color customization-color :light 5)
|
||||
(= state :active)
|
||||
(colors/custom-color customization-color 50 10)
|
||||
(colors/resolve-color customization-color :light 10)
|
||||
:else :transparent))
|
||||
|
||||
(defn container
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
|
||||
(defn info-button
|
||||
[on-press]
|
||||
[rn/touchable-without-feedback
|
||||
[rn/pressable
|
||||
{:on-press on-press}
|
||||
[icon/icon "message-gap-info" {:size 12 :no-color true :container-style {:padding 4}}]])
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
:margin-right 2}
|
||||
[timestamp timestamp-far]
|
||||
(when on-info-button-pressed [info-button on-info-button-pressed])]
|
||||
[rn/touchable-without-feedback
|
||||
[rn/pressable
|
||||
{:style {:flex 1 :margin-top 16 :margin-bottom 20}
|
||||
:on-press #(when on-press (on-press))}
|
||||
[text/text warning-label]]
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
:top 6
|
||||
:left 51
|
||||
:position :absolute
|
||||
:background-color (colors/custom-color customization-color 60)})
|
||||
:background-color (colors/resolve-color customization-color nil)})
|
||||
|
||||
(def notification-counter
|
||||
{:position :absolute
|
||||
|
||||
@@ -76,15 +76,15 @@
|
||||
|
||||
(defn- left-section
|
||||
[{:keys [avatar-props on-press customization-color]}]
|
||||
[rn/touchable-without-feedback {:on-press on-press}
|
||||
[rn/view
|
||||
{:accessibility-label :open-profile}
|
||||
[user-avatar/user-avatar
|
||||
(merge {:status-indicator? true
|
||||
:ring? true
|
||||
:customization-color customization-color
|
||||
:size :small}
|
||||
avatar-props)]]])
|
||||
[rn/pressable
|
||||
{:on-press on-press
|
||||
:accessibility-label :open-profile}
|
||||
[user-avatar/user-avatar
|
||||
(merge {:status-indicator? true
|
||||
:ring? true
|
||||
:customization-color customization-color
|
||||
:size :small}
|
||||
avatar-props)]])
|
||||
|
||||
(defn- right-section
|
||||
[{:keys [blur?
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
|
||||
(defn unread-dot
|
||||
[customization-color]
|
||||
{:background-color (colors/custom-color (or customization-color :blue) 60)
|
||||
{:background-color (colors/resolve-color (or customization-color :blue) nil)
|
||||
:border-radius 4
|
||||
:width 8
|
||||
:height 8})
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
subtitle]]])
|
||||
|
||||
(defn- main-variant
|
||||
[{:keys [title subtitle button-label image max-height accessibility-label on-press]}]
|
||||
[{:keys [title subtitle button-label image max-height accessibility-label on-press button-type]}]
|
||||
[rn/view {:style style/main-variant}
|
||||
[rn/view {:style style/main-variant-text-container}
|
||||
[text/text
|
||||
@@ -58,7 +58,7 @@
|
||||
[button/button
|
||||
{:on-press on-press
|
||||
:accessibility-label accessibility-label
|
||||
:type :grey
|
||||
:type (or button-type :grey)
|
||||
:size 40
|
||||
:container-style style/main-button
|
||||
:theme :dark
|
||||
@@ -66,7 +66,7 @@
|
||||
button-label]])
|
||||
|
||||
(defn small-option-card
|
||||
[{:keys [variant title subtitle button-label image max-height on-press accessibility-label]
|
||||
[{:keys [variant title subtitle button-label image max-height on-press accessibility-label button-type]
|
||||
:or {variant :main accessibility-label :small-option-card}}]
|
||||
(let [main-variant? (= variant :main)
|
||||
card-component (if main-variant? main-variant icon-variant)
|
||||
@@ -82,4 +82,5 @@
|
||||
:on-press on-press
|
||||
:accessibility-label accessibility-label
|
||||
:image image
|
||||
:max-height max-height}]]))
|
||||
:max-height max-height
|
||||
:button-type button-type}]]))
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
:border-top-right-radius 16
|
||||
:border-bottom-left-radius border-bottom-radius
|
||||
:border-bottom-right-radius border-bottom-radius
|
||||
:background-color (colors/custom-color customization-color 50 40)})
|
||||
:background-color (colors/resolve-color customization-color :light 40)})
|
||||
|
||||
(def card-header
|
||||
{:flex-direction :row
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
(defn container
|
||||
[customization-color selected?]
|
||||
{:padding 12
|
||||
:background-color (colors/custom-color customization-color 50 40)
|
||||
:background-color (colors/resolve-color customization-color :light 40)
|
||||
:border-width 1
|
||||
:border-radius 16
|
||||
:flex 1
|
||||
|
||||
@@ -11,28 +11,28 @@
|
||||
(defn view
|
||||
[{:keys [checked? blur? accessibility-label container-style on-change icon customization-color]} label]
|
||||
(let [theme (quo.theme/use-theme)]
|
||||
[rn/touchable-without-feedback
|
||||
[rn/pressable
|
||||
{:on-press (when on-change
|
||||
#(on-change (not checked?)))
|
||||
:accessibility-label :disclaimer-touchable-opacity}
|
||||
[rn/view {:style (merge container-style (style/container blur? theme))}
|
||||
[selectors/view
|
||||
{:type :checkbox
|
||||
:accessibility-label accessibility-label
|
||||
:blur? blur?
|
||||
:checked? checked?
|
||||
:on-change on-change
|
||||
:customization-color customization-color}]
|
||||
[text/text
|
||||
{:size :paragraph-2
|
||||
:style style/text}
|
||||
label]
|
||||
(when icon
|
||||
[rn/view {:style style/icon-container}
|
||||
[icons/icon icon
|
||||
{:accessibility-label :disclaimer-icon
|
||||
:color (if blur?
|
||||
(colors/white-opa-70)
|
||||
(colors/theme-colors colors/neutral-50
|
||||
colors/neutral-40
|
||||
theme))}]])]]))
|
||||
:accessibility-label :disclaimer-touchable-opacity
|
||||
:style (merge container-style (style/container blur? theme))}
|
||||
[selectors/view
|
||||
{:type :checkbox
|
||||
:accessibility-label accessibility-label
|
||||
:blur? blur?
|
||||
:checked? checked?
|
||||
:on-change on-change
|
||||
:customization-color customization-color}]
|
||||
[text/text
|
||||
{:size :paragraph-2
|
||||
:style style/text}
|
||||
label]
|
||||
(when icon
|
||||
[rn/view {:style style/icon-container}
|
||||
[icons/icon icon
|
||||
{:accessibility-label :disclaimer-icon
|
||||
:color (if blur?
|
||||
(colors/white-opa-70)
|
||||
(colors/theme-colors colors/neutral-50
|
||||
colors/neutral-40
|
||||
theme))}]])]))
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
[customization-color pressed? theme]
|
||||
(when pressed?
|
||||
(if customization-color
|
||||
(colors/custom-color (or customization-color :blue) 60)
|
||||
(colors/resolve-color (or customization-color :blue) nil)
|
||||
(colors/theme-colors colors/primary-50 colors/primary-60 theme))))
|
||||
|
||||
(defn container-outer
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
on-press-out (fn []
|
||||
(set-pressed (not pressed?))
|
||||
(when on-press-out (on-press-out pressed?)))]
|
||||
[rn/touchable-without-feedback
|
||||
[rn/pressable
|
||||
{:accessibility-label :selector-filter
|
||||
:on-press-out on-press-out}
|
||||
[rn/view {:style (style/container-outer customization-color pressed? theme)}
|
||||
[rn/view {:style (style/container-inner pressed? blur? theme)}
|
||||
[icon/icon :i/unread
|
||||
{:color (style/icon-color pressed? theme)
|
||||
:size 20}]]]]))
|
||||
:on-press-out on-press-out
|
||||
:style (style/container-outer customization-color pressed? theme)}
|
||||
[rn/view {:style (style/container-inner pressed? blur? theme)}
|
||||
[icon/icon :i/unread
|
||||
{:color (style/icon-color pressed? theme)
|
||||
:size 20}]]]))
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
(defn- card-footer
|
||||
[{:keys [active? label on-toggle theme]}]
|
||||
[rn/touchable-without-feedback
|
||||
[rn/pressable
|
||||
[rn/view {:style (style/card-footer theme)}
|
||||
[rn/view {:style style/card-footer-label-container}
|
||||
[text/text {:size :paragraph-2} label]]
|
||||
@@ -54,22 +54,22 @@
|
||||
:or {icon :i/world
|
||||
active? false}}]
|
||||
(let [theme (quo.theme/use-theme)]
|
||||
[rn/touchable-without-feedback
|
||||
[rn/pressable
|
||||
{:on-press on-select
|
||||
:accessibility-label :privacy-option-card
|
||||
:testID :privacy-option-card}
|
||||
[rn/view (style/privacy-option-card active? theme)
|
||||
[card-header
|
||||
{:theme theme
|
||||
:active? active?
|
||||
:icon icon
|
||||
:label header}]
|
||||
[unordered-list
|
||||
{:theme theme
|
||||
:container-style (when-not footer {:margin-bottom 8})} list-items]
|
||||
(when footer
|
||||
[card-footer
|
||||
{:theme theme
|
||||
:active? active?
|
||||
:label footer
|
||||
:on-toggle on-toggle}])]]))
|
||||
:testID :privacy-option-card
|
||||
:style (style/privacy-option-card active? theme)}
|
||||
[card-header
|
||||
{:theme theme
|
||||
:active? active?
|
||||
:icon icon
|
||||
:label header}]
|
||||
[unordered-list
|
||||
{:theme theme
|
||||
:container-style (when-not footer {:margin-bottom 8})} list-items]
|
||||
(when footer
|
||||
[card-footer
|
||||
{:theme theme
|
||||
:active? active?
|
||||
:label footer
|
||||
:on-toggle on-toggle}])]))
|
||||
|
||||
@@ -61,35 +61,35 @@
|
||||
:blur? blur?
|
||||
:disabled disabled
|
||||
:active active})]
|
||||
[rn/touchable-without-feedback
|
||||
[rn/pressable
|
||||
(merge {:disabled disabled
|
||||
:accessibility-label accessibility-label}
|
||||
:accessibility-label accessibility-label
|
||||
:style style/container}
|
||||
(when on-press
|
||||
{:on-press (fn []
|
||||
(on-press id))}))
|
||||
[rn/view {:style style/container}
|
||||
(when show-notification-dot?
|
||||
[notification-dot/view
|
||||
{:style style/notification-dot
|
||||
:customization-color customization-color}])
|
||||
[rn/view
|
||||
{:style (merge
|
||||
(style/tab
|
||||
{:size size
|
||||
:background-color (if (and segmented? (not active))
|
||||
:transparent
|
||||
background-color)
|
||||
:disabled disabled
|
||||
:segmented? segmented?
|
||||
:show-notification-dot? show-notification-dot?})
|
||||
(if active active-item-container-style item-container-style))}
|
||||
(when before
|
||||
[rn/view
|
||||
[icons/icon before {:color icon-color}]])
|
||||
[content {:size size :label label} children]]
|
||||
(when show-notification-dot?
|
||||
[right-side-with-cutout
|
||||
{:width (style/size->padding-left size)
|
||||
:height size
|
||||
:disabled disabled
|
||||
:background-color background-color}])]]))
|
||||
(when show-notification-dot?
|
||||
[notification-dot/view
|
||||
{:style style/notification-dot
|
||||
:customization-color customization-color}])
|
||||
[rn/view
|
||||
{:style (merge
|
||||
(style/tab
|
||||
{:size size
|
||||
:background-color (if (and segmented? (not active))
|
||||
:transparent
|
||||
background-color)
|
||||
:disabled disabled
|
||||
:segmented? segmented?
|
||||
:show-notification-dot? show-notification-dot?})
|
||||
(if active active-item-container-style item-container-style))}
|
||||
(when before
|
||||
[rn/view
|
||||
[icons/icon before {:color icon-color}]])
|
||||
[content {:size size :label label} children]]
|
||||
(when show-notification-dot?
|
||||
[right-side-with-cutout
|
||||
{:width (style/size->padding-left size)
|
||||
:height size
|
||||
:disabled disabled
|
||||
:background-color background-color}])]))
|
||||
|
||||
@@ -21,17 +21,16 @@
|
||||
accessibility-label type labelled?]
|
||||
:or {size 32}}
|
||||
children]
|
||||
[rn/touchable-without-feedback
|
||||
[rn/pressable
|
||||
(merge {:disabled disabled?
|
||||
:accessibility-label accessibility-label}
|
||||
:accessibility-label accessibility-label
|
||||
:style (style-container size
|
||||
disabled?
|
||||
border-color
|
||||
border-width
|
||||
background-color
|
||||
labelled?
|
||||
type)}
|
||||
(when on-press
|
||||
{:on-press #(on-press id)}))
|
||||
[rn/view
|
||||
{:style (merge (style-container size
|
||||
disabled?
|
||||
border-color
|
||||
border-width
|
||||
background-color
|
||||
labelled?
|
||||
type))}
|
||||
children]])
|
||||
children])
|
||||
|
||||
@@ -15,10 +15,7 @@
|
||||
:border-radius 10
|
||||
:align-items :center
|
||||
:justify-content :center
|
||||
:background-color (colors/theme-colors
|
||||
(colors/custom-color customization-color 50)
|
||||
(colors/custom-color customization-color 60)
|
||||
theme)})
|
||||
:background-color (colors/resolve-color customization-color theme)})
|
||||
|
||||
(def audio-tag-icon-color colors/white)
|
||||
|
||||
@@ -31,10 +28,7 @@
|
||||
(not (#{:account :collectible} type)) 16
|
||||
(= size 24) 8
|
||||
:else 10)
|
||||
border-color (colors/theme-colors
|
||||
(colors/custom-color customization-color 50)
|
||||
(colors/custom-color customization-color 60)
|
||||
theme)]
|
||||
border-color (colors/resolve-color customization-color theme)]
|
||||
(cond-> {:padding 2
|
||||
:padding-right 8
|
||||
:flex-direction :row
|
||||
|
||||
@@ -135,7 +135,7 @@
|
||||
[group-avatar/view
|
||||
{:icon-name :i/members
|
||||
:size (if (= size 24) :size-20 :size-28)
|
||||
:customization-color (colors/custom-color customization-color 50)}]]
|
||||
:customization-color (colors/resolve-color customization-color :light)}]]
|
||||
|
||||
(:channel :community)
|
||||
[communities-tag (assoc props :channel? (= type :channel))]
|
||||
|
||||
@@ -8,14 +8,14 @@
|
||||
:align-self :flex-start
|
||||
:background-color (when (= status :error)
|
||||
(colors/theme-colors
|
||||
(colors/custom-color :danger 50 10)
|
||||
(colors/custom-color :danger 60 10)
|
||||
(colors/override-color :danger 10 50)
|
||||
(colors/override-color :danger 10 60)
|
||||
theme))
|
||||
:border-width 1
|
||||
:border-color (cond (= status :error)
|
||||
(colors/theme-colors
|
||||
(colors/custom-color :danger 50 20)
|
||||
(colors/custom-color :danger 60 20)
|
||||
(colors/override-color :danger 20 50)
|
||||
(colors/override-color :danger 20 60)
|
||||
theme)
|
||||
(and blur? (= status :default)) (colors/theme-colors
|
||||
colors/neutral-80-opa-5
|
||||
@@ -32,11 +32,8 @@
|
||||
:padding-bottom 2})
|
||||
|
||||
(defn title-style
|
||||
[{:keys [status theme]}]
|
||||
{:padding-left 4
|
||||
[{:keys [status theme networks-shown?]}]
|
||||
{:padding-left (if networks-shown? 4 0)
|
||||
:margin-top -1
|
||||
:color (when (= status :error)
|
||||
(colors/theme-colors
|
||||
(colors/custom-color :danger 50)
|
||||
(colors/custom-color :danger 60)
|
||||
theme))})
|
||||
(colors/resolve-color :danger theme))})
|
||||
|
||||
@@ -14,14 +14,16 @@
|
||||
:theme theme
|
||||
:blur? blur?})
|
||||
container-style)}
|
||||
[preview-list/view
|
||||
{:type :network
|
||||
:number (count networks)
|
||||
:size :size-16}
|
||||
networks]
|
||||
(when networks
|
||||
[preview-list/view
|
||||
{:type :network
|
||||
:number (count networks)
|
||||
:size :size-16}
|
||||
networks])
|
||||
[text/text
|
||||
{:weight :medium
|
||||
:size :paragraph-2
|
||||
:style (style/title-style {:status status
|
||||
:theme theme})}
|
||||
:style (style/title-style {:status status
|
||||
:theme theme
|
||||
:networks-shown? networks})}
|
||||
title]]))
|
||||
|
||||
@@ -38,17 +38,14 @@
|
||||
|
||||
(defn percentage-change
|
||||
[customization-color theme]
|
||||
{:color (colors/theme-colors
|
||||
(colors/custom-color customization-color 50)
|
||||
(colors/custom-color customization-color 60)
|
||||
theme)
|
||||
{:color (colors/resolve-color customization-color theme)
|
||||
:margin-right 4})
|
||||
|
||||
(defn dot-separator
|
||||
[customization-color theme]
|
||||
{:background-color (colors/theme-colors
|
||||
(colors/custom-color customization-color 60 40)
|
||||
(colors/custom-color customization-color 50 40)
|
||||
(colors/override-color customization-color 40 60)
|
||||
(colors/override-color customization-color 40 50)
|
||||
theme)
|
||||
:margin-right 4
|
||||
:margin-top 8
|
||||
@@ -57,10 +54,7 @@
|
||||
|
||||
(defn currency-change
|
||||
[customization-color theme]
|
||||
{:color (colors/theme-colors
|
||||
(colors/custom-color customization-color 50)
|
||||
(colors/custom-color customization-color 60)
|
||||
theme)
|
||||
{:color (colors/resolve-color customization-color theme)
|
||||
:margin-right 4})
|
||||
|
||||
(defn loading-bar-margin-bottom
|
||||
@@ -97,8 +91,5 @@
|
||||
|
||||
(defn icon-props
|
||||
[customization-color theme]
|
||||
{:color (colors/theme-colors
|
||||
(colors/custom-color customization-color 50)
|
||||
(colors/custom-color customization-color 60)
|
||||
theme)
|
||||
{:color (colors/resolve-color customization-color theme)
|
||||
:size 16})
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user