Compare commits

..
371 changed files with 4132 additions and 6945 deletions
+34 -16
View File
@@ -1,26 +1,39 @@
[comment]: # (Please replace ... with your information. Remove < and >)
[comment]: # (To auto-close issue on merge, please insert the related issue number after # i.e fixes #566)
If you submit PR for issue with bounty then write here Fixes #NN where NN is issue number
*otherwise*
fixes #...
## Summary
### Summary
[comment]: # (Summarise the problem and how the pull request solves it)
...
## Review notes
[comment]: # (Optional. Specify if something in particular should be looked at, or ignored, during review)
<!-- (Optional, remove if no changes to documentation) -->
Documentation change PR (review please): https://github.com/status-im/status.im/pull/xxx
## Testing notes
[comment]: # (Optional)
### Review notes
<!-- (Optional. Specify if something in particular should be looked at, or ignored, during review) -->
### Platforms
[comment]: # (Optional. Specify which platforms should be tested)
### Testing notes
<!-- (Optional) -->
#### Platforms
<!-- (Optional. Specify which platforms should be tested) -->
- Android
- iOS
- macOS
- Linux
- Windows
### Areas that may be impacted
[comment]: # (Optional. Specify if some specific areas need to be tested, such as 1-1 chats)
#### Areas that maybe impacted
<!-- (Optional. Specify if some specific areas has to be tested, for example 1-1 chats) -->
#### Functional
##### Functional
- 1-1 chats
- public chats
@@ -35,27 +48,32 @@ fixes #...
- fleet
- bootnodes
#### Non-functional
##### Non-functional
- battery performance
- CPU performance / speed of the app
- network consumption
## Steps to test
[comment]: # (Specify exact steps to test if there are such)
### Steps to test
<!-- (Specify exact steps to test if there are such) -->
- Open Status
- ...
- Step 3, etc.
<!-- (PRs will only be accepted if squashed into single commit.) -->
[comment]: # (Can be ready or wip)
status: ready
### Before and after screenshots comparison
| Figma (if available) | iOS (if available) | Android (if available)
| --- | --- | --- |
| Please embed Image/Video here of the before and after. | Please embed Image/Video here of the before and after. | Please embed Image/Video here of the before and after. |
status: ready <!-- Can be ready or wip -->
<!-- Uncomment this section for status-go upgrade/dogfooding pull requests
- Specify potentially impacted user flows in _Areas that may be impacted*.
- Specify potentially impacted user flows in _Areas that maybe impacted*.
- Ensure that _Steps to test_ is filled in.
### Risk
+4 -4
View File
@@ -43,6 +43,8 @@ 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
@@ -267,11 +269,9 @@ 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 ${RE_FRISK_PORT}
yarn shadow-cljs run re-frisk-remote.core/start
# 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:$(RE_FRISK_PORT) tcp:$(RE_FRISK_PORT) && \
adb reverse tcp:4567 tcp:4567 && \
adb reverse tcp:$(FLOWSTORM_PORT) tcp:$(FLOWSTORM_PORT) && \
adb forward tcp:5561 tcp:5561
-4
View File
@@ -143,10 +143,6 @@ android {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17
}
// Disable default lint checks to remove redundant lintVitalReportRelease task
lintOptions {
checkReleaseBuilds false
}
// https://developer.android.com/studio/projects/install-ndk#vanilla_cmake
externalNativeBuild {
+2 -2
View File
@@ -1,11 +1,11 @@
#!/usr/bin/env groovy
library 'status-jenkins-lib@v1.9.17'
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.24' }
agent { label 'linux && x86_64 && nix-2.19' }
options {
timestamps()
+1 -1
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env groovy
library 'status-jenkins-lib@v1.9.17'
library 'status-jenkins-lib@v1.9.13'
import groovy.json.JsonBuilder
+1 -1
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env groovy
library 'status-jenkins-lib@v1.9.17'
library 'status-jenkins-lib@v1.9.13'
pipeline {
agent { label 'linux' }
+2 -2
View File
@@ -1,11 +1,11 @@
#!/usr/bin/env groovy
library 'status-jenkins-lib@v1.9.17'
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.24 && xcode-16.2' }
agent { label 'macos && arm64 && nix-2.19 && xcode-15.1' }
parameters {
string(
+2 -2
View File
@@ -1,11 +1,11 @@
#!/usr/bin/env groovy
library 'status-jenkins-lib@v1.9.17'
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.24' }
agent { label 'linux && x86_64 && nix-2.19' }
options {
timestamps()
-1
View File
@@ -16,7 +16,6 @@
- [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
View File
@@ -1 +1 @@
Status: محفظة إيثريوم كريبتو
Status: محفظة تشفير اجتماعية
+1 -1
View File
@@ -1 +1 @@
Status: Ethereum Crypto Wallet
Status: Social Crypto Wallet
+1 -1
View File
@@ -1 +1 @@
Status: Billetera Ethereum
Status: Billetera social cripto
+1 -1
View File
@@ -1 +1 @@
Status: Portefeuille Ethereum
Status : Portef. crypto social
+1 -1
View File
@@ -1 +1 @@
Status: イーサリアム クリプト ウォレット
Status: ソーシャル クリプト ウォレット
+1 -1
View File
@@ -1 +1 @@
Status: 이더리움 크립토 지갑
Status: 소셜 크립토 지갑
+1 -1
View File
@@ -1 +1 @@
Status: Carteira Ethereum
Status: Carteira social cripto
+1 -1
View File
@@ -1 +1 @@
Status: Ethereum Криптокошелек
Status: Криптокошелек
+1 -1
View File
@@ -1 +1 @@
Status Ethereum Kripto Cüzdanı
Status: Sosyal Kripto Cüzdanı
+1 -1
View File
@@ -1 +1 @@
Status Ethereum Криптогаманець
Status: Криптогаманець
+1 -1
View File
@@ -1 +1 @@
Status: 以太坊加密钱包
Status: 可以社交的加密货币钱包
+18 -21
View File
@@ -23,18 +23,15 @@ PODS:
- secp256k1
- SSZipArchive
- libevent (2.1.12)
- 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 (1.2.4):
- libwebp/demux (= 1.2.4)
- libwebp/mux (= 1.2.4)
- libwebp/webp (= 1.2.4)
- libwebp/demux (1.2.4):
- libwebp/webp
- libwebp/mux (1.3.2):
- libwebp/mux (1.2.4):
- libwebp/demux
- libwebp/sharpyuv (1.3.2)
- libwebp/webp (1.3.2):
- libwebp/sharpyuv
- libwebp/webp (1.2.4)
- RCT-Folly (2022.05.16.00):
- boost
- DoubleConversion
@@ -1155,15 +1152,15 @@ PODS:
- glog
- RCT-Folly (= 2022.05.16.00)
- React-Core
- RNImageCropPicker (0.41.2):
- RNImageCropPicker (0.40.0):
- React-Core
- React-RCTImage
- RNImageCropPicker/QBImagePickerController (= 0.41.2)
- TOCropViewController (~> 2.7.4)
- RNImageCropPicker/QBImagePickerController (0.41.2):
- RNImageCropPicker/QBImagePickerController (= 0.40.0)
- TOCropViewController
- RNImageCropPicker/QBImagePickerController (0.40.0):
- React-Core
- React-RCTImage
- TOCropViewController (~> 2.7.4)
- TOCropViewController
- RNKeychain (8.1.2):
- React-Core
- RNLinearGradient (3.0.0-alpha.1):
@@ -1192,7 +1189,7 @@ PODS:
- secp256k1 (0.1.6)
- SocketRocket (0.6.1)
- SSZipArchive (2.4.3)
- TOCropViewController (2.7.4)
- TOCropViewController (2.6.1)
- Yoga (1.14.0)
DEPENDENCIES:
@@ -1492,7 +1489,7 @@ CHECKOUT OPTIONS:
:git: https://github.com/status-im/Keycard.swift.git
:tag: 3.1.1
secp256k1:
:commit: 4ab977cc2b2d7319be858bcb30a5d189bb149884
:commit: 46a1fa30d9b8babeae85ff519050f42394ab5fcc
:git: https://github.com/status-im/secp256k1.swift.git
:submodules: true
@@ -1509,7 +1506,7 @@ SPEC CHECKSUMS:
HMSegmentedControl: 34c1f54d822d8308e7b24f5d901ec674dfa31352
Keycard: 3bd24405b9a875b3b3cf1ab1be69b5c30c5f28bc
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
libwebp: 1786c9f4ff8a279e4dac1e8f385004d5fc253009
libwebp: f62cb61d0a484ba548448a4bd52aabf150ff6eef
RCT-Folly: 7169b2b1c44399c76a47b5deaaba715eeeb476c0
RCTRequired: 2544c0f1081a5fa12e108bb8cb40e5f4581ccd87
RCTTypeSafety: 50efabe2b115c11ed03fbf3fd79e2f163ddb5d7c
@@ -1580,7 +1577,7 @@ SPEC CHECKSUMS:
RNFastImage: 1f2cab428712a4baaf78d6169eaec7f622556dd7
RNFS: 2bd9eb49dc82fa9676382f0585b992c424cd59df
RNGestureHandler: 15c6ef51acba34c49ff03003806cf5dd6098f383
RNImageCropPicker: 771e2ca319d2cf92e04ebf334ece892ee9a6728f
RNImageCropPicker: 486e2f7e2b0461ce24321f751410dce1b3b49e6d
RNKeychain: a65256b6ca6ba6976132cc4124b238a5b13b3d9c
RNLinearGradient: ccaaebce083b54180da61d992e7fa56abfe000d6
RNPermissions: 08e619529cced22695f4b6d0efcc0a233e278903
@@ -1593,9 +1590,9 @@ SPEC CHECKSUMS:
secp256k1: f61d67e6fdcb85fd727acf1bf35ace6036db540c
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
SSZipArchive: fe6a26b2a54d5a0890f2567b5cc6de5caa600aef
TOCropViewController: 80b8985ad794298fb69d3341de183f33d1853654
TOCropViewController: edfd4f25713d56905ad1e0b9f5be3fbe0f59c863
Yoga: a716eea57d0d3430219c0a5a233e1e93ee931eb7
PODFILE CHECKSUM: 56d9f695324306d6db368d1172d211dfab55b7cb
PODFILE CHECKSUM: 81a66b45adddb083171ade882c343deb4faf2a8b
COCOAPODS: 1.15.2
-6
View File
@@ -572,7 +572,6 @@
);
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",
@@ -580,7 +579,6 @@
);
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",
@@ -616,7 +614,6 @@
);
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",
@@ -624,7 +621,6 @@
);
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",
@@ -732,7 +728,6 @@
);
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",
@@ -740,7 +735,6 @@
);
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",
@@ -203,6 +203,24 @@ 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()
@@ -87,6 +87,42 @@ 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,6 +195,36 @@ 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,6 +105,48 @@ 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,6 +389,86 @@ 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();
@@ -1300,6 +1380,53 @@ 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();
@@ -1865,6 +1992,8 @@ 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);
@@ -1888,6 +2017,7 @@ 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);
-39
View File
@@ -1,39 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
# Fallback versions for each dependency
readonly FOOJAY_FALLBACK="0.5.0"
readonly KOTLIN_FALLBACK="1.8.0"
readonly TOOLS_FALLBACK="3.5.4"
readonly HERMES_FALLBACK="0.73.5"
GIT_ROOT=$(cd "${BASH_SOURCE%/*}" && git rev-parse --show-toplevel)
cd "${GIT_ROOT}"
get_version() {
local file="$1"
local pattern="$2"
local fallback="$3"
local version
if [[ ! -f "$file" ]]; then
echo "$fallback"
return 0
fi
version=$(grep "$pattern" "$file" 2>/dev/null | grep -o "[0-9]\+\.[0-9]\+\.[0-9]\+\.*[0-9]*" | tail -n1 || echo "$fallback")
echo "$version"
}
foojay_version=$(get_version "./node_modules/@react-native/gradle-plugin/settings.gradle.kts" "foojay.*version" "$FOOJAY_FALLBACK")
kotlin_version=$(get_version "./node_modules/@react-native/gradle-plugin/gradle/libs.versions.toml" "kotlin =" "$KOTLIN_FALLBACK")
tools_version=$(get_version "./patches/BlurView-build.gradle.patch" "gradle:" "$TOOLS_FALLBACK")
hermes_version=$(get_version "./node_modules/react-native/ReactAndroid/gradle.properties" "VERSION_NAME" "$HERMES_FALLBACK")
cat << EOF
org.gradle.toolchains.foojay-resolver-convention:org.gradle.toolchains.foojay-resolver-convention.gradle.plugin:$foojay_version
org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:$kotlin_version
com.android.tools.build:gradle:$tools_version
com.facebook.react:hermes-android:$hermes_version
EOF
+8 -2
View File
@@ -38,10 +38,16 @@ function gen_deps_list() {
echo -e "${CLR}Found ${GRN}$(wc -l < "${DEPS_LIST}")${RST} direct dependencies..."
}
# FIXME: Fix for missing packages.
# FIXME: Temporary fix for missing packages.
# https://github.com/status-im/status-mobile/issues/15447
function add_deps_hack() {
"${CUR_DIR}/deps_versions.sh" >> "${DEPS_LIST}"
echo -n \
'org.gradle.toolchains.foojay-resolver-convention:org.gradle.toolchains.foojay-resolver-convention.gradle.plugin:0.5.0
org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.8.0
com.android.tools.build:gradle:3.5.4
com.android.tools.lint:lint-gradle:31.1.1
com.facebook.react:hermes-android:0.73.5' \
>> "${DEPS_LIST}"
}
# Find download URLs for each dependency.
+2 -2
View File
@@ -1,8 +1,8 @@
#!/usr/bin/env bash
# This script generates a list of dependencies for the main project and its
# sub-projects defined using Gradle config files. It uses github-dependency-graph-gradle-plugin:
# https://github.com/gradle/github-dependency-graph-gradle-plugin?tab=readme-ov-file#using-the-plugin-to-generate-dependency-reports
# sub-projects defined using Gradle config files. It parses Gradle output of
# 'dependencies' and 'buildEnvironment` tasks using AWK.
set -Eeuo pipefail
+1 -1
View File
@@ -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 = ["16.0" "16.1" "16.2"];
versions = ["15.1" "15.2" "15.3" "15.4"];
};
go = super.go_1_21;
clang = super.clang_15;
+2 -2
View File
@@ -38,8 +38,8 @@ nix_install_type() {
"${UID}") echo "single";;
"(${UID})") echo "single";;
"") echo "none";
echo "No Nix installation detected!" >&2;;
*) echo "Unknown Nix installation type!" >&2; exit 1;;
echo "No Nix installtion detected!" >&2;;
*) echo "Unknown Nix installtion type!" >&2; exit 1;;
esac
fi
}
+3 -3
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
export NIX_VERSION="2.24.11"
export NIX_PACKAGE="nixVersions.nix_2_24"
export NIX_VERSION="2.19.3"
export NIX_PACKAGE="nixVersions.nix_2_19"
export NIX_INSTALL_URL="https://nixos.org/releases/nix/nix-${NIX_VERSION}/install"
export NIX_INSTALL_SHA256="5c610a0e97c8a2dd48c1a630608502e43fdecd7d2572463dd4166126106d9188"
export NIX_INSTALL_SHA256="73d47b0ab783fddca1b2d44a03d52a74c97c28a1fc8ff5a29419079302ef9c3d"
export NIX_INSTALL_PATH="/tmp/nix-install-${NIX_VERSION}"
-3
View File
@@ -38,9 +38,6 @@ 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)
+2 -4
View File
@@ -1,4 +1,4 @@
{ callPackage, lib, buildGoPackage, pkgs
{ callPackage, lib, buildGoPackage
, androidPkgs, openjdk, gomobile, xcodeWrapper, removeReferencesTo
, go-bindata, mockgen, protobuf3_20, protoc-gen-go
, meta
@@ -15,8 +15,6 @@ let
isIOS = platform == "ios";
isAndroid = platform == "android";
enforceXCodeAvailable = callPackage ./enforceXCodeAvailable.nix { };
# Fixes fatal: not a git repository (or any of the parent directories): .git
fakeGit = pkgs.writeScriptBin "git" "echo ${source.version}";
in buildGoPackage rec {
pname = source.repo;
@@ -31,7 +29,7 @@ in buildGoPackage rec {
extraSrcPaths = [ gomobile ];
nativeBuildInputs = [
gomobile removeReferencesTo go-bindata mockgen protoc-gen-go protobuf3_20 fakeGit
gomobile removeReferencesTo go-bindata mockgen protoc-gen-go protobuf3_20
] ++ optional isAndroid openjdk
++ optional isIOS xcodeWrapper;
+3 -2
View File
@@ -13,8 +13,8 @@ let
repo = "status-go";
rev = "unknown";
shortRev = rev;
version = "unknown";
cleanVersion = version;
rawVersion = "develop";
cleanVersion = rawVersion;
goPackagePath = "github.com/${owner}/${repo}";
# We use builtins.path so that we can name the resulting derivation,
# Normally the name would not be deterministic, taken from the checkout directory.
@@ -43,6 +43,7 @@ let
inherit (versionJSON) owner repo version;
rev = versionJSON.commit-sha1;
shortRev = strings.substring 0 7 rev;
rawVersion = versionJSON.version;
cleanVersion = lib.sanitizeVersion versionJSON.version;
# Need to pretend this is from status-im to let Go build it.
goPackagePath = "github.com/status-im/${repo}";
+2 -2
View File
@@ -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.41.2",
"react-native-image-crop-picker": "0.40.0",
"react-native-image-resizer": "^1.2.3",
"react-native-keychain": "8.1.2",
"react-native-linear-gradient": "3.0.0-alpha.1",
@@ -66,7 +66,7 @@
"react-native-shake": "^3.3.1",
"react-native-share": "10.0.2",
"react-native-static-safe-area-insets": "^2.2.0",
"react-native-status-keycard": "git+https://github.com/status-im/react-native-status-keycard.git#refs/tags/v2.6.5",
"react-native-status-keycard": "git+https://github.com/status-im/react-native-status-keycard.git#refs/tags/v2.6.4",
"react-native-svg": "13.10.0",
"react-native-webview": "13.6.3",
"react-syntax-highlighter": "^15.5.0"
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 278 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

+41 -52
View File
@@ -1,10 +1,9 @@
Status Terms of Use
Last updated: 10 December 2024
Last updated: 14 August 2024
1. Introduction
1.1 Who we are
Status is developing a set of open source projects that use peer-to-peer technologies to help people transact securely, communicate freely, and organise with confidence. Anyone participating in these projects helps to build technology and tools that empowers people to advance their own sovereign communities.
@@ -15,7 +14,7 @@ Status does not provide any services, such as financial services, to users of St
1.2 About these terms
These terms are a contract between you and Status and apply to your use of Status Software. The term “Status Software” as used herein means a software developed by Status and is composed of a secure messaging tool and a crypto wallet integrated together.
These terms are a contract between you and Status and apply to your use of Status Software. The term “Status Software” as used herein means a software developed by Status and is composed of a secure messaging tool, a crypto wallet, and a Web 3 browser integrated together.
Please read these terms carefully before using Status Software. By installing or using Status Software on any device, you agree to these terms. If you do not agree, you should not install or use Status Software.
@@ -49,56 +48,57 @@ If a dispute arises between you and Status, we will seek to first solve it amica
At Status, we strive to develop open source software that can serve as a secure communication tool that helps to uphold human rights. Status Software is specifically designed to facilitate the free flow of information, protect the right to private, secure communications and promote the sovereignty of individuals.
Status Software is composed of a secure messaging tool and a crypto wallet integrated together. The software developed by Status in this regard is simply called “Status Software” and you can find more details about its development on Status GitHub page.
Status Software is composed of a secure messaging tool, a crypto wallet, and a Web 3 browser integrated together. The software developed by Status in this regard is simply called “Status Software” and you can find more details about its development on Status GitHub page.
Status Software is open source client software that is designed to be user-friendly and can be installed or run in a web browser on your local desktop or mobile device. You can use Status Software to interact with and participate in Web 3 protocols, applications and peer to peer networks (referred to in these terms collectively, as “Web 3”). Please note that Status Software is not a blockchain protocol, or a blockchain network, a platform or a web-based platform.
Status develops Status Software and makes it available for you to run in a web browser or for your local use on your desktop or mobile device. This means that you are solely responsible for your activity and any potential risk or loss you may incur through using the Status Software as further detailed below in these terms.
As a result of the privacy-first design of Status Software:
1. Status does not store nor have access to user data, messages, or content;
2. Status cannot associate content or actions with individual users. However, users may choose to disclose certain limited information to Status voluntarily, such as when opting in to share usage analytics. This data, shared only through explicit consent of the user, is processed in accordance with our Privacy Policy;
3. Status cannot block or ban users from using Status Software features;
4. Status has no means of monitoring, moderating, removing, modifying or regulating users content or activity, except in Community Spaces created and directly managed by Status.
Status develops Status Software and makes it available for you to run in a web browser or for your local use on your desktop or mobile device. This means that you are solely responsible for your activity and any potential risk or loss you may incur through using the Status Software as further detailed below in these terms.
2.1.1 Wallet
Status Software includes a crypto wallet. We will refer to such wallet functionality in these terms as “Wallet”.
The Wallet is your own personal crypto wallet. This type of wallet is sometimes also called “non-custodial”, “self-custodial” or “self-hosted”, which means you are in complete control of the crypto tokens (the “Digital Assets”) in the Wallet. Status will never have access to or control over your seed phrase, private keys or Digital Assets in your Wallet given its design.
Using the Wallet, you are able to send, receive and store Digital Assets and connect to and interact with third-party services that enable the exchange of Digital Assets for fiat currency and Web 3, including certain blockchain bridges and decentralised exchanges.
The Wallet is your own personal crypto wallet. This type of wallet is sometimes also called “non-custodial”, “self-custodial” or “self-hosted”, which means you are in complete control of the crypto tokens (the “Digital Assets”) in the Wallet. Status will never have access to or control over your seed phrase, private keys or Digital Assets in your Wallet given its design.
The Wallet contains the latest security standards, anti-phishing mechanisms and locally generated and stored public and private keys to ensure that your Digital Assets are secured to the highest standards.
Using the Wallet, you are able to send, receive and store Digital Assets and connect to and interact with third-party services that enable the exchange of Digital Assets for fiat currency and Web 3, including certain blockchain bridges and decentralised exchanges.
When generating an account, a randomisation process is started on your own device that generates a key pair. Status does not have visibility of or access to your private keys. You are solely responsible for storing and securing your seed phrase and private keys, and creating, storing and securing their backups. If you fail to maintain the appropriate security measures of your private keys, it may result in you losing access to your Wallet and control of any Digital Assets in your Wallet. If you lose or forget your seed phrase or private keys, Status will not be able to help you recover or replace them and further, Status will not be able to assist you with the recovery of your Digital Assets.
The Wallet contains the latest security standards, anti-phishing mechanisms and locally generated and stored public and private keys to ensure that your Digital Assets are secured to the highest standards.
In order to further enhance the security of storing your private keys, you may also choose to store your keys on a keycard, such as the Status Keycard.
When generating an account, a randomisation process is started on your own device that generates a key pair. Status does not have visibility of or access to your private keys. You are solely responsible for storing and securing your seed phrase and private keys, and creating, storing and securing their backups. If you fail to maintain the appropriate security measures of your private keys, it may result in you losing access to your Wallet and control of any Digital Assets in your Wallet. If you lose or forget your seed phrase or private keys, Status will not be able to help you recover or replace them and further, Status will not be able to assist you with the recovery of your Digital Assets.
In order to further enhance the security of storing your private keys, you may also choose to store your keys on a keycard, such as the Status Keycard.
2.1.2 Messaging
Status Software includes messaging functionality that enables secure communication between users. We will refer to the messaging functionality of Status Software and the Community Spaces collectively in these terms, as “Messaging”.
Status Software includes messaging functionality that enables secure communication between users. We will refer to the messaging functionality of Status Software and the Status Community Spaces collectively in these terms, as “Messaging”.
Messaging uses an open source, peer-to-peer protocol with end-to-end encryption and metadata suppression to protect your messages from third parties (including Status). End-to-end encryption means that only the sender and recipient of a message can read its contents, and no one else. Peer-to-peer communication is accomplished using the Waku peer-to-peer messaging protocol, which relies on a distributed network of nodes instead of a centralised server. This means that there is no central party or server from which messages can be intercepted, modified or blocked. Learn more about Waku and how it works on Wakus relevant website.
Messaging uses an open source, peer-to-peer protocol with end-to-end encryption and metadata suppression to protect your messages from third parties (including Status). End-to-end encryption means that only the sender and recipient of a message can read its contents, and no one else. Peer-to-peer communication is accomplished using the Waku peer-to-peer messaging protocol, which relies on a distributed network of nodes instead of a centralised server. This means that there is no central party or server from which messages can be intercepted, modified or blocked. Learn more about Waku and how it works on Wakus relevant website.
Within Messaging, you will also be able to participate in Community Spaces. This feature allows users to create and join communities with varying access and discoverability options, which may include token-gated communities, private communities and open and public communities, where you can create group chats and engage with your communities. We note that content in all Community Spaces will be accessible to the members of those spaces. For open and public communities, content will be accessible to all other users of Status Software. Nonetheless, all content, regardless of the type of community, will still be protected by the same end-to-end encryption utilised in Status Software.
Within Messaging, you will also be able to participate in Status Community Spaces. This feature allows users to create their own token-gated communities where you can create group chats and engage with your communities, while leveraging the possibilities, functionality and benefits of blockchain technology. You will also be able to create (and join) open and public communities on Status Software that are accessible to other users. We note that content in these open and public communities will be accessible to all other users of Status Software. Nonetheless, all content will still be protected by the same end-to-end encryption utilised in Status Software.
2.1.2 Web 3 browser
Status Software also includes a Web 3 browser through which you may access and interact with Web 3, exchanges, marketplaces, games and more. We will refer to the Web 3 browser in these terms as the “Web 3 Browser”.
3. Privacy
Status processes a limited amount of user data to ensure the technical operation of the Status Software, enhance its functionality, and improve the user experience. For more details on this limited process of user data, please refer to our Privacy Policy.
Status uses an open source, peer-to-peer protocol with end-to-end encryption and metadata suppression, which by design, means that Status (and any third party) is unable to and does not collect, store, own, control or have any visibility or means of access to your identity, Wallet, browsing information, any user private keys, Digital Assets, messages, content, history of interactions, user accounts or any other user information.
Therefore, Status does not (and cannot) monetise any users data or content, such as messages or browser information and Status does not have any interest in doing so.
Status however processes a limited amount of user data to ensure the technical operation of the Status Software, enhance its functionality, and improve the user experience. For more details on this limited process of user data, please refer to our Privacy Policy.
If you use third party services offered through Status Software, your privacy may not be protected and you will be subject to the privacy terms and conditions of such third parties. Please refer to our full terms regarding third party services below.
4. Using third party services and interacting with Web 3
When using Status Software, you may access or use third party products, services or tools (“Third Party Services”) and interact with Web 3. Status Software is only one means of interacting with these Third Party Services and Web 3 and you can independently utilise other means and tools to do so as well.
Your interactions with Web 3 could include many aspects, such as interacting with smart contracts that reside on blockchain networks, for example to swap Digital Assets or use (crypto) bridges, or deploying your own smart contracts through Community Spaces. You may also interact with and participate in peer-to-peer networks which could vary in their level of decentralisation, ranging from more centralised networks controlled by a single party to networks governed by decentralised communities.
Your interactions with Web 3 could include many aspects, such as interacting with smart contracts that reside on blockchain networks, for example to swap Digital Assets or use (crypto) bridges, or deploying your own smart contracts through Status Community Spaces. You may also interact with and participate in peer-to-peer networks which could vary in their level of decentralisation, ranging from more centralised networks controlled by a single party to networks governed by decentralised communities.
When you use Third Party Services or interact with Web 3, you acknowledge that Status does not control or operate any Third Party Service or Web 3. These products, services, or tools are either controlled, operated, owned, or licensed by the third party providing them, or they may operate autonomously, independently of Status or any other party.
@@ -127,7 +127,7 @@ Although security is a top priority for us and many functions of Status Software
7. Content
At Status, we believe in the sovereignty of individuals and we stand for the cause of personal liberty. We aim to promote social, political, and economic freedoms through Status Software, which is built on the principles of the free flow of information and censorship resistance. Through Status Software, particularly when using Messenger and Community Spaces, you will be able to create and interact with various content. We consider content to include anything you (or any other user) create, post, distribute or exchange through Status Software (as well as any future functions that may be added to Status Software), whether its text, links, GIFs, emoji, photos or any other media formats.
At Status, we believe in the sovereignty of individuals and we stand for the cause of personal liberty. We aim to promote social, political, and economic freedoms through Status Software, which is built on the principles of the free flow of information and censorship resistance. Through Status Software, particularly when using Messenger and Status Community Spaces, you will be able to create and interact with various content. We consider content to include anything you (or any other user) create, post, distribute or exchange through Status Software (as well as any future functions that may be added to Status Software), whether its text, links, GIFs, emoji, photos or any other media formats.
You are solely responsible for any content that you create, post, distribute or submit, messages you exchange or any other activity you may engage in related to your content on or through Status Software and any harm or liability that may result from such content.
@@ -145,35 +145,25 @@ You acknowledge that Status has no means of monitoring, moderating, removing, mo
8.1 Adherence to Status Principles
One of Status goals is the widespread adoption of the decentralised web while also staying true to our Principles. These terms are designed to reflect our Principles, while providing important legal protections for Status and setting out guidelines and terms for the Status Software community of users. We ask that you use Status Software in a way that promotes and aligns with the Status Principles, and avoid actions that may harm or disrupt the community of users.
One of Status goals is the widespread adoption of the decentralised web while also staying true to our Principles. These terms are designed to reflect our Principles, while providing important legal protections for Status and setting out guidelines and terms for the Status Software community of users. We ask that you use Status Software in a way that promotes and aligns with the Status Principles.
We strongly encourage users to act responsibly and ethically in their interactions and refrain from (i) inciting harm, violence or illegal activity, (ii) engaging in harassment, abuse or discrimination, and (iii) spreading false or misleading information.
8.2 Limitation on certain uses of and acts in Status Software
If you are a Community Space creator or admin, we encourage you to establish your own guidelines to foster healthy and respectful community environments for your members.
8.2 Community Governance
Community Spaces are self-sovereign environments managed independently by their creators and appointed admins. These users are solely responsible for:
1. establishing and enforcing their own community guidelines;
2. configuring access controls and permissions;
3. managing community membership, including accepting or rejecting requests;
4. moderating content and interactions within their community; and
5. taking actions against community members who violate their community guidelines or behave disruptively, including the ability to exclude or ban members.
By participating in Community Spaces, you acknowledge that community governance lies solely with community creators and their appointed admins. Status cannot monitor, moderate or intervene in community interactions or governance decisions within any Community Space, except in cases where a Community Space is created and directly managed by Status.
8.3 Limitation on certain uses of and acts in Status Software
You agree not to use Status Software, or attempt or assist others to use it, in a manner that:
1. uses unauthorised methods to create or gain access to an account on Status Software;
2. interferes with or disrupts the integrity, safety, security, availability or performance of Status Software;
3. installs or transmits on or through Status Software, any viruses, worms, malware, Trojan horses, or other harmful or destructive code or content;
4. use Status Software, if you are subject to sanctions, or otherwise designated on a list of prohibited or restricted parties as maintained by, the United Nations, the European Union or any of its member states or the Singaporean, Swiss or US government, or intend to interact or transact with such parties;
5. violate, misappropriate or infringe the rights of Status, other users of Status Software, or any other third parties in any way, including but not limited to privacy, publicity, intellectual property, confidentiality, property or other rights;
6. engage in any activity through Status Software that may be in violation of applicable law, rules or regulations in your jurisdiction;
7. interfere, disrupt, negatively affect, or inhibit other users from their use of Status Software; or
8. engage in any attack, hack, denial-of-service attack, interference, or exploit of any smart contract in connection with use of Status Software.
You shall not, nor try to, encourage or assist others using Status Software to:
1. gain or try to gain unauthorised access to Status Software;
2. interfere with or disrupt the integrity, safety, security, availability or performance of Status Software;
3. generate accounts on Status Software through unauthorised means;
4. install or transmit on or through Status Software, any viruses, worms, malware, Trojan horses, or other harmful or destructive code or content;
5. use spam, data mining, or other unsolicited promotional methods, machine generated content, or unethical or unwanted commercial content;
6. engage in phishing, spoofing, or similar fraudulent acts;
7. knowingly spread misinformation or impersonate another person or legal entity;
8. incite, commit or threaten, harm or engage in illegal or inappropriate conduct including stalking, bullying, harassment, intimidation or abuse another individual or group;
9. engage in or organise child sexual exploitation of any kind;
10. use Status Software, if you are subject to sanctions, or otherwise designated on a list of prohibited or restricted parties as maintained by, the United Nations, the European Union or any of its member states or the Singaporean, Swiss or US government, or intend to interact or transact with such parties;
11. violate, misappropriate or infringe the rights of Status, other users of Status Software, or any other third parties in any way, including but not limited to privacy, publicity, intellectual property, confidentiality, property or other rights;
12. engage in any activity through Status Software that may be in violation of applicable law, rules or regulations in your jurisdiction;
13. interfere, disrupt, negatively affect, or inhibit other users from their use of Status Software; or
14. engage in any attack, hack, denial-of-service attack, interference, or exploit of any smart contract in connection with use of Status Software.
9. Fees
@@ -262,7 +252,6 @@ You release Status from all liability related to any claim, cause of action, con
14. Limitation of liability
Status will not be held liable to you under any contract, negligence, strict liability, or other legal or equitable theory for any lost profits, cost of procurement for substitute services, or any special, incidental, or consequential damages related to, arising from, or in any way connected with these terms, Status, your use of Status Software, particularly where Status has indicated that it is not responsible. This includes without limitation, your use of SNT or other Digital Assets (creating, distributing, transacting in or otherwise) even if Status has been advised of the possibility of such damages.
In any event, Status aggregate liability for any claims is limited to EUR 100 (one hundred Euros). This limitation of liability will apply to the extent permitted by applicable law.
-2
View File
@@ -37,8 +37,6 @@ 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'
+3 -9
View File
@@ -58,7 +58,7 @@
:preloads [;; The official recommendation is to
;; load the debugger preload first.
flow-storm.api
dev.re-frisk-preload
re-frisk-remote.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,9 +87,7 @@
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_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/ALCHEMY_OPTIMISM_SEPOLIA_TOKEN #shadow/env "ALCHEMY_OPTIMISM_SEPOLIA_TOKEN"}
:compiler-options {:output-feature-set :es5
;; We disable `:fn-deprecated` warnings because we
;; are managing deprecation via clj-kondo and we
@@ -125,9 +123,7 @@
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_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/ALCHEMY_OPTIMISM_SEPOLIA_TOKEN #shadow/env "ALCHEMY_OPTIMISM_SEPOLIA_TOKEN"}
:compiler-options {:output-feature-set :es6
;;disable for android build as there
;;is an intermittent warning with deftype
@@ -169,8 +165,6 @@
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
-5
View File
@@ -1,5 +0,0 @@
(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)})
+2 -21
View File
@@ -5,6 +5,7 @@
[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]))
@@ -118,26 +119,6 @@
(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
@@ -146,7 +127,7 @@
:deleted-by (:deletedBy %)))
(group-by :chatId)
(mapv (fn [[chat-id messages]]
(delete-messages-locally messages chat-id))))
(delete-message/delete-messages-localy messages chat-id))))
mark-as-seen-fx (mapv
(fn [removed-message]
(let [chat-id (:chatId removed-message)
-1
View File
@@ -7,7 +7,6 @@
legacy.status-im.chat.models.loading
legacy.status-im.data-store.chats
legacy.status-im.data-store.visibility-status-updates
legacy.status-im.ens.core
legacy.status-im.fleet.core
legacy.status-im.group-chats.core
legacy.status-im.log-level.core
-43
View File
@@ -1,43 +0,0 @@
(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,5 +1,6 @@
(ns legacy.status-im.subs.mailservers
(:require
[legacy.status-im.fleet.core :as fleet]
[re-frame.core :as re-frame]))
(re-frame/reg-sub
@@ -16,3 +17,10 @@
:<- [: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)])))
+5
View File
@@ -38,6 +38,11 @@
;;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)
+1 -2
View File
@@ -129,8 +129,7 @@
:transport/confirm-messages-processed
:group-chats/extract-membership-signature
:utils/dispatch-later
:json-rpc/call
:fx})
:json-rpc/call})
(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/pressable
[rn/touchable-without-feedback
(merge {:disabled disabled
:accessibility-label accessibility-label}
(when on-press
@@ -0,0 +1,41 @@
(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})
@@ -0,0 +1,88 @@
(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,6 +12,7 @@
[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]
@@ -112,6 +113,9 @@
: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,7 +7,6 @@
[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]))
@@ -68,10 +67,10 @@
{:size :small
:accessibility-label :offline-messages-settings-button
:title (i18n/label :t/history-nodes)
:on-press (fn []
(clipboard/set-string current-mailserver-name))
:on-press #(re-frame/dispatch [:navigate-to :offline-messaging-settings])
:accessory :text
:accessory-text (when use-mailservers? current-mailserver-name)}]
:accessory-text (when use-mailservers? current-mailserver-name)
:chevron true}]
;; TODO(Ferossgp): Devider componemt
[react/view
{:height 1
+22 -10
View File
@@ -170,6 +170,12 @@
: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")
@@ -253,19 +259,15 @@
(defn hash-typed-data
"used for keycard"
([data]
(native-utils/promisify-native-module-call hash-typed-data data))
([data callback]
(log/debug "[native-module] hash-typed-data")
(.hashTypedData ^js (encryption) data callback)))
[data callback]
(log/debug "[native-module] hash-typed-data")
(.hashTypedData ^js (encryption) data callback))
(defn hash-typed-data-v4
"used for keycard"
([data]
(native-utils/promisify-native-module-call hash-typed-data-v4 data))
([data callback]
(log/debug "[native-module] hash-typed-data-v4")
(.hashTypedDataV4 ^js (encryption) data callback)))
[data callback]
(log/debug "[native-module] hash-typed-data-v4")
(.hashTypedDataV4 ^js (encryption) data callback))
(defn send-transaction-with-signature
"used for keycard"
@@ -386,6 +388,16 @@
;; 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,7 +10,9 @@
:justify-content :center
:border-radius (/ container-size 2)
:overflow :hidden
:background-color (colors/resolve-color customization-color theme)})
:background-color (colors/theme-colors (colors/custom-color customization-color 50)
(colors/custom-color customization-color 60)
theme)})
(defn avatar-identifier
[theme]
@@ -5,13 +5,16 @@
[customization-color neutral? theme]
(if neutral?
(colors/theme-colors colors/neutral-80-opa-5 colors/white-opa-5 theme)
(colors/resolve-color customization-color theme 20)))
(colors/custom-color customization-color 50 20)))
(defn- text-color
[customization-color neutral? theme]
(if neutral?
(colors/theme-colors colors/neutral-80-opa-70 colors/white-opa-70 theme)
(colors/resolve-color customization-color theme)))
(colors/theme-colors
(colors/custom-color customization-color 50)
(colors/custom-color customization-color 60)
theme)))
(defn container
[circle-size customization-color neutral? theme]
+2 -3
View File
@@ -2,10 +2,9 @@
(:require
[quo.foundations.colors :as colors]))
(defn container
[theme]
(def container
{:height 40
:background-color (colors/resolve-color :blue theme 20)
:background-color (colors/custom-color :blue 50 20)
:flex-direction :row
:align-items :center
:padding-right 22
+1 -1
View File
@@ -14,7 +14,7 @@
(when (pos? pins-count)
[rn/touchable-opacity
{:accessibility-label :pinned-banner
:style (style/container theme)
:style style/container
:active-opacity 1
:on-press on-press}
(when-not hide-pin?
+5 -4
View File
@@ -10,10 +10,11 @@
([{:keys [style]} child]
(let [theme (quo.theme/use-theme)]
[rn/view
{:style [style
{:pointer-events :box-none
:background-color (or (:background-color style)
(colors/theme-colors colors/white colors/neutral-80 theme))}]}
{:style (assoc style
:pointer-events :box-none
:background-color
(or (:background-color style)
(colors/theme-colors colors/white colors/neutral-80 theme)))}
child])))
(def view (if platform/ios? blur/view view-android))
@@ -44,7 +44,9 @@
(defn cursor-color
[customization-color theme]
(colors/resolve-color customization-color theme))
(colors/theme-colors (colors/custom-color customization-color 50)
(colors/custom-color customization-color 60)
theme))
(defn placeholder-color
[state blur? theme]
+58 -59
View File
@@ -56,63 +56,62 @@
24 8
12))})
(defn container-styles
(defn style-container
[{:keys [size disabled? border-radius background-color border-color icon-only? icon-top
icon-left icon-right inner-style]}]
[{:height size
:align-items :center
:justify-content :center
:flex-direction (if icon-top :column :row)
:padding-horizontal (when-not (or icon-only? icon-left icon-right)
(case size
56 (if border-color 10 11)
40 16
32 12
24 7
16))
:padding-left (when-not (or icon-only? icon-left)
(case size
56 nil
40 16
32 12
24 8
16))
:padding-right (when-not (or icon-only? icon-right)
(case size
56 nil
40 16
32 12
24 8
16))
:padding-top (when-not (or icon-only? icon-left icon-right)
(case size
56 0
40 (if border-color 8 9)
32 (if border-color 4 5)
24 0
(if border-color 8 9)))
:padding-bottom (when-not (or icon-only? icon-left icon-right)
(case size
56 0
40 9
32 5
24 0
9))
:overflow :hidden
:background-color (if disabled? (colors/alpha background-color 0.3) background-color)
:border-radius (if border-radius
border-radius
(case size
56 12
40 12
32 10
24 8
12))
:border-color border-color
:border-width (when border-color 1)}
(when icon-only?
{:width size})
(when border-color
{:border-color border-color
:border-width 1})
inner-style])
icon-left icon-right]}]
(merge {:height size
:align-items :center
:justify-content :center
:flex-direction (if icon-top :column :row)
:padding-horizontal (when-not (or icon-only? icon-left icon-right)
(case size
56 (if border-color 10 11)
40 16
32 12
24 7
16))
:padding-left (when-not (or icon-only? icon-left)
(case size
56 nil
40 16
32 12
24 8
16))
:padding-right (when-not (or icon-only? icon-right)
(case size
56 nil
40 16
32 12
24 8
16))
:padding-top (when-not (or icon-only? icon-left icon-right)
(case size
56 0
40 (if border-color 8 9)
32 (if border-color 4 5)
24 0
(if border-color 8 9)))
:padding-bottom (when-not (or icon-only? icon-left icon-right)
(case size
56 0
40 9
32 5
24 0
9))
:overflow :hidden
:background-color (if disabled? (colors/alpha background-color 0.3) background-color)
:border-radius (if border-radius
border-radius
(case size
56 12
40 12
32 10
24 8
12))
:border-color border-color
:border-width (when border-color 1)}
(when icon-only?
{:width size})
(when border-color
{:border-color border-color
:border-width 1})))
+68 -64
View File
@@ -54,77 +54,81 @@
(fn []
(set-pressed-state nil)
(when on-press-out (on-press-out))))]
[rn/pressable
[rn/touchable-without-feedback
{: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
:style [(style/shape-style-container size border-radius) container-style]}
:on-long-press on-long-press}
[rn/view
{:style (style/container-styles {: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 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}]])
{:style (merge
(style/shape-style-container size border-radius)
container-style)}
[rn/view
(cond
icon-only?
[quo.icons/icon children
{:color label-color
:size icon-size}]
{: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}]
(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,8 +11,14 @@
[{:keys [type pressed? customization-color theme]}]
(if (= type :mention)
(if pressed?
(colors/resolve-color customization-color (colors/invert-theme theme))
(colors/resolve-color customization-color theme))
(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))
(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))))
@@ -58,7 +58,7 @@
:error
[info-message/view
{:icon :i/alert
{:icon :i/info
:size :default
:status :error}
text]
@@ -41,7 +41,7 @@
:justify-content :space-around}])
(defn track
[{:keys [disabled? customization-color height blur? theme]}]
[{:keys [disabled? customization-color height blur?]}]
{: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 theme blur?)})
:background-color (utils/track-color customization-color blur?)})
(defn track-cover
[interpolate-track]
@@ -6,21 +6,27 @@
(defn main-color
"`customization-color` Customization color"
[customization-color theme]
(colors/resolve-color customization-color theme))
(colors/theme-colors
(colors/custom-color customization-color 50)
(colors/custom-color customization-color 60)
theme))
(defn track-color
"`customization-color` Customization color"
([customization-color theme blur?]
([customization-color blur?]
(if blur?
colors/white-opa-5
(colors/resolve-color customization-color theme 10))))
(colors/custom-color customization-color 50 10))))
(defn text-color
"`customization-color` Customization color"
[customization-color theme blur?]
(if blur?
colors/white-opa-40
(colors/resolve-color customization-color theme)))
(colors/theme-colors
(colors/custom-color customization-color 50)
(colors/custom-color customization-color 60)
theme)))
(defn clamp-value
[value min-value max-value]
@@ -88,8 +88,7 @@
:style (merge (style/track {:disabled? disabled?
:customization-color custom-color
:height (dimensions :track-height)
:blur? blur?
:theme theme})
:blur? blur?})
container-style)
:on-layout on-track-layout}
[reanimated/view {:style (style/track-cover interpolate-track)}
+1 -2
View File
@@ -30,8 +30,7 @@
selected? (assoc :border-top-color (colors/alpha color 0.4)
:border-end-color (colors/alpha color 0.4)
:border-bottom-color (colors/alpha color 0.2)
:border-start-color (colors/alpha color 0.2)
:border-color nil)
:border-start-color (colors/alpha color 0.2))
(zero? idx) (assoc :margin-left -4))))
(defn color-circle
+3 -1
View File
@@ -22,7 +22,9 @@
hex-color (if (= :feng-shui color)
(colors/theme-colors colors/neutral-100 colors/white theme)
(colors/resolve-color color theme))]
(colors/theme-colors (colors/custom-color color 50)
(colors/custom-color color 60)
theme))]
[rn/pressable
{:style (style/color-button hex-color selected? idx window-width)
@@ -7,7 +7,10 @@
(defn dot-background-color
[customization-color theme blur?]
(cond
customization-color (colors/resolve-color customization-color theme)
customization-color (colors/theme-colors
(colors/custom-color customization-color 50)
(colors/custom-color customization-color 60)
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/pressable
[rn/touchable-without-feedback
{:on-press on-press
: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}]]))
: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}]]]))
@@ -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/pressable
[rn/touchable-without-feedback
{:accessibility-label :community-card-item
: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}]]]]]]))
: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}]]]]]]]))
(defn view
[{:keys [loading?] :as props}]
@@ -5,7 +5,9 @@
(defn get-color
[type customization-color theme]
(case type
:default (colors/resolve-color customization-color theme)
:default (colors/theme-colors (colors/custom-color customization-color 50)
(colors/custom-color customization-color 60)
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)
+3 -7
View File
@@ -14,13 +14,9 @@
(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 theme]
(colors/resolve-color customization-color theme 10))
(defn active-background-color [customization-color] (colors/custom-color customization-color 50 10))
(defn complete-background-color
[customization-color]
(colors/resolve-color customization-color :light))
(defn complete-background-color [customization-color] (colors/custom-color customization-color 50))
(defn container
[{:keys [size type in-blur-view? theme customization-color]}]
@@ -33,7 +29,7 @@
:border-color (neutral-border-color in-blur-view? theme))
(= type :active)
(assoc :background-color (active-background-color customization-color theme))
(assoc :background-color (active-background-color customization-color))
(= type :complete)
(assoc :background-color (complete-background-color customization-color))))
@@ -9,15 +9,16 @@
[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/resolve-color :orange nil)
:color (colors/custom-color :orange 60)
:percentage 40}
:okay {:default-text (i18n/label :t/strength-divider-okay-label)
:color (colors/resolve-color :yellow nil)
:color (colors/custom-color :yellow 60)
:percentage 60}
:strong {:default-text (i18n/label :t/strength-divider-strong-label)
:color colors/success-60
@@ -31,8 +31,7 @@
[:scroll? {:optional true} [:maybe :boolean]]
[:blur? {:optional true} [:maybe :boolean]]
[:container-style {:optional true} [:maybe :map]]
[:buttons-container-style {:optional true} [:maybe :map]]
[:buttons-style {:optional true} [:maybe :map]]]]]
[:buttons-container-style {:optional true} [:maybe :map]]]]]
:any])
(def ^:private role-icon
@@ -44,9 +43,10 @@
(defn- view-internal
[{:keys [actions description description-text description-top-text error-message role button-one-label
button-two-label blur? button-one-props button-two-props scroll? container-style
buttons-container-style buttons-style context-tag-props]}]
buttons-container-style context-tag-props]}]
(let [theme (quo.theme/use-theme)]
[rn/view {:style (merge (style/container scroll? blur? theme) container-style)}
[rn/view
{:style (merge (style/container scroll? blur? theme) container-style)}
(when (= description :top-error)
[rn/view {:style style/error-message}
[icon/icon
@@ -82,7 +82,7 @@
[button/button
(merge
{:size 40
:container-style (merge style/button-container buttons-style)
:container-style style/button-container
:background (when (or blur? scroll?) :blur)
:theme theme
:accessibility-label :button-two}
@@ -91,7 +91,7 @@
[button/button
(merge
{:size 40
:container-style (merge style/button-container buttons-style)
:container-style style/button-container
:background (when (or blur? scroll?) :blur)
:theme theme
:accessibility-label :button-one}
@@ -13,11 +13,11 @@
(def content
{:align-items :flex-start
:margin-top 8
:margin-bottom (+ (safe-area/get-bottom) 12)})
(defn title
[theme]
{:color (colors/theme-colors colors/neutral-100
colors/white
theme)
:margin-bottom 8})
{:color (colors/theme-colors colors/neutral-100
colors/white
theme)})
@@ -24,13 +24,12 @@
:always-bounce-vertical false
:content-inset-adjustment-behavior :never}
[rn/view {:style style/container}
(when title
[text/text
{:size :heading-2
:accessibility-label :documentation-drawer-title
:style (style/title theme)
:weight :semi-bold}
title])
[text/text
{:size :heading-2
:accessibility-label :documentation-drawer-title
:style (style/title theme)
:weight :semi-bold}
title]
[rn/view {:style style/content :accessibility-label :documentation-drawer-content}
content
(when show-button?
@@ -57,10 +57,17 @@
:container-style style/keycard-icon}])])
(defn- account-subtitle
[{:keys [description]}]
[address-text/view
{:address description
:format :short}])
[{:keys [networks theme blur? description]}]
(if networks
[address-text/view
{:networks networks
:address description
:format :short}]
[text/text
{:size :paragraph-2
:weight :regular
:style (style/description theme blur?)}
description]))
(defn- default-keypair-subtitle
[{:keys [description theme blur?]}]
@@ -102,7 +109,7 @@
description])
(defn- subtitle
[{:keys [type theme blur? stored description community-name community-logo
[{:keys [type theme blur? stored networks description community-name community-logo
context-tag-type account-name emoji customization-color full-name profile-picture context
icon]}]
(cond
@@ -114,7 +121,8 @@
(= :account type)
[account-subtitle
{:theme theme
{:networks networks
:theme theme
:blur? blur?
:description description}]
@@ -197,11 +205,11 @@
(defn view
[{:keys [title title-icon type description blur? community-name community-logo button-icon
account-name emoji context-tag-type button-type container-style
on-button-press on-button-long-press profile-picture stored label full-name
on-button-press on-button-long-press profile-picture stored networks label full-name
button-disabled? account-avatar-emoji account-avatar-type customization-color icon-avatar
context icon]}]
(let [theme (quo.theme/use-theme)]
[rn/view {:style [style/container container-style]}
[rn/view {:style (merge style/container container-style)}
(when (left-image-supported-types type)
[rn/view {:style style/left-container}
[left-image
@@ -225,6 +233,7 @@
:theme theme
:blur? blur?
:stored stored
:networks networks
:description description
:community-name community-name
:community-logo community-logo
@@ -39,7 +39,7 @@
:right-icon-color colors/white-opa-20
:right-icon-color-2 colors/white
:label-color colors/white
:background-color (colors/resolve-color customization-color :light)})
:background-color (colors/custom-color customization-color 50)})
(def sizes-to-exclude-blur-in-photo-bg #{:size-40})
@@ -35,4 +35,4 @@
(def image-placeholder
{:width 80
:height 80
:background-color colors/danger-50})
:background-color colors/danger})
@@ -18,5 +18,5 @@
:colors [color-top color-bottom]
:start {:x 0 :y 0}
:end {:x 0 :y 1}
:style [(style/root-container opacity height)
container-style]}])))
:style (merge (style/root-container opacity height)
container-style)}])))
@@ -76,8 +76,10 @@
y-axis-label-background-color (colors/theme-colors colors/white-70-blur-opaque
colors/neutral-95
theme)
customization-color (colors/resolve-color customization-color
(colors/invert-theme theme))
customization-color (colors/theme-colors
(colors/custom-color customization-color 60)
(colors/custom-color customization-color 50)
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,7 +26,10 @@
customization-color customization-color
(= state :positive) :success
:else :danger)]
(colors/resolve-color color-keyword theme)))
(colors/theme-colors
(colors/custom-color color-keyword 50)
(colors/custom-color color-keyword 60)
theme)))
(defn view
[{:keys [data state time-frame customization-color]}]
@@ -37,7 +37,9 @@
[theme]
[rn/view {:style style/clear-icon-container}
[icon/icon :i/positive-state
{:color (colors/resolve-color :success theme)
{:color (colors/theme-colors (colors/custom-color :success 50)
(colors/custom-color :success 60)
theme)
:size 20}]])
(defn- get-placeholder-text-color
@@ -53,7 +55,7 @@
(colors/theme-colors colors/neutral-30 colors/neutral-60 theme)))
(defn address-input
[{:keys [default-value blur? on-change-text on-blur on-focus on-clear on-scan on-paste
[{:keys [default-value blur? on-change-text on-blur on-focus on-clear on-scan
on-detect-ens on-detect-address on-detect-unclassified address-regex ens-regex
valid-ens-or-address? container-style]}]
(let [theme (quo.theme/use-theme)
@@ -82,13 +84,12 @@
(not ens?)
on-detect-unclassified)
(on-detect-unclassified text)))))
on-paste (rn/use-callback #(if (fn? on-paste)
(on-paste on-change)
(clipboard/get-string
(fn [clipboard]
(when-not (empty? clipboard)
(on-change clipboard)))))
[on-paste])
on-paste (rn/use-callback
(fn []
(clipboard/get-string
(fn [clipboard]
(when-not (empty? clipboard)
(on-change clipboard))))))
on-clear (rn/use-callback
(fn []
(on-change "")
+7 -5
View File
@@ -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/resolve-color :blue :light)
:cursor (colors/theme-colors (colors/custom-color :blue 50)
colors/white
theme)}
{:label (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)
@@ -20,7 +20,9 @@
: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/resolve-color :blue theme)}))
:cursor (colors/theme-colors (colors/custom-color :blue 50)
(colors/custom-color :blue 60)
theme)}))
(defn status-colors
[status blur? theme]
@@ -31,7 +33,7 @@
:placeholder (colors/theme-colors colors/neutral-80-opa-20 colors/white-opa-20 theme)
:text (colors/theme-colors colors/neutral-100 colors/white theme)}
:error
{:border-color colors/danger-50-opa-40
{:border-color (colors/theme-colors colors/danger-opa-40 colors/danger-opa-40 theme)
:placeholder (colors/theme-colors colors/neutral-80-opa-40 colors/white-opa-40 theme)
:text (colors/theme-colors colors/neutral-100 colors/white theme)}
:disabled
@@ -48,7 +50,7 @@
:placeholder (colors/theme-colors colors/neutral-30 colors/neutral-60 theme)
:text (colors/theme-colors colors/neutral-100 colors/white theme)}
:error
{:border-color colors/danger-50-opa-40
{:border-color (colors/theme-colors colors/danger-opa-40 colors/danger-opa-40 theme)
:placeholder (colors/theme-colors colors/neutral-40 colors/white-opa-40 theme)
:text (colors/theme-colors colors/neutral-100 colors/white theme)}
:disabled
@@ -131,7 +133,7 @@
[variant-colors]
{:color (:label variant-colors)})
(def right-label-container
(def counter-container
{:flex 1
:align-items :flex-end})
+14 -23
View File
@@ -7,8 +7,8 @@
[react-native.core :as rn]
[react-native.platform :as platform]))
(defn- label-line
[{:keys [label label-right current-chars char-limit variant-colors theme]}]
(defn- label-&-counter
[{:keys [label current-chars char-limit variant-colors theme]}]
[rn/view
{:accessibility-label :input-labels
:style style/texts-container}
@@ -18,24 +18,17 @@
:weight :medium
:size :paragraph-2}
label]]
(when label-right
[rn/view {:style style/right-label-container}
(when-let [count-text (some->> char-limit
(str current-chars "/"))]
[rn/view {:style style/counter-container}
[text/text
{:style (style/label-color variant-colors)
{:style (style/counter-color {:current-chars current-chars
:char-limit char-limit
:variant-colors variant-colors
:theme theme})
:weight :regular
:size :paragraph-2}
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]]))])
count-text]])])
(defn- left-accessory
[{:keys [variant-colors small? icon-name]}]
@@ -72,7 +65,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 label-right]
on-change-text on-char-limit-reach weight default-value on-clear placeholder]
:as props}]
(let [theme (quo.theme/use-theme)
ref (rn/use-ref-atom nil)
@@ -122,16 +115,15 @@
;; 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-right)
[label-line
(when (or label char-limit)
[label-&-counter
{:variant-colors variant-colors
:label label
:label-right label-right
:current-chars char-count
:char-limit char-limit
:theme theme}])
[rn/view
{:style [(style/input-container colors-by-status small? disabled?) input-container-style]}
{:style (merge (style/input-container colors-by-status small? disabled?) input-container-style)}
(when-let [{:keys [icon-name]} left-icon]
[left-accessory
{:variant-colors variant-colors
@@ -207,7 +199,6 @@
- :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/resolve-color customization-color :light 40)
{:background-color (colors/custom-color customization-color 50 40)
:padding-horizontal 12
:padding-top 12
:padding-bottom 10
@@ -36,7 +36,9 @@
(defn cursor-color
[customization-color theme]
(colors/resolve-color customization-color theme))
(colors/theme-colors (colors/custom-color customization-color 50)
(colors/custom-color customization-color 60)
theme))
(defn error-word
[theme]
@@ -25,7 +25,8 @@
[customization-color blur? theme]
(colors/alpha (if blur?
(colors/theme-colors colors/neutral-100 colors/white theme)
(colors/resolve-color customization-color theme))
(colors/custom-color customization-color
(if (= :dark theme) 60 50)))
(if platform/ios? 1 0.2)))
(def text-input-container {:flex 1})

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