Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b8a84e91d4 | ||
|
|
9a0cb79a2e | ||
|
|
cc665a8683 | ||
|
|
30bf4a2d92 | ||
|
|
c04cb79085 | ||
|
|
fd747614f9 | ||
|
|
faaecfaa95 | ||
|
|
f201ebc09f | ||
|
|
9c0361adef | ||
|
|
9d8e6aa224 | ||
|
|
599d293f9a |
@@ -1,18 +1,16 @@
|
||||
{:lint-as {status-im.utils.views/defview clojure.core/defn
|
||||
status-im.utils.views/letsubs clojure.core/let
|
||||
reagent.core/with-let clojure.core/let
|
||||
status-im.utils.fx/defn clj-kondo.lint-as/def-catch-all
|
||||
utils.re-frame/defn clj-kondo.lint-as/def-catch-all
|
||||
quo.react/with-deps-check clojure.core/fn
|
||||
quo.previews.preview/list-comp clojure.core/for
|
||||
status-im.utils.styles/def clojure.core/def
|
||||
status-im.utils.styles/defn clojure.core/defn
|
||||
test-helpers.unit/deftest-sub clojure.core/defn
|
||||
taoensso.tufte/defnp clojure.core/defn}
|
||||
{:lint-as {status-im.utils.views/defview clojure.core/defn
|
||||
status-im.utils.views/letsubs clojure.core/let
|
||||
reagent.core/with-let clojure.core/let
|
||||
status-im.utils.fx/defn clj-kondo.lint-as/def-catch-all
|
||||
utils.re-frame/defn clj-kondo.lint-as/def-catch-all
|
||||
quo.react/with-deps-check clojure.core/fn
|
||||
quo.previews.preview/list-comp clojure.core/for
|
||||
status-im.utils.styles/def clojure.core/def
|
||||
status-im.utils.styles/defn clojure.core/defn
|
||||
status-im.test-helpers/deftest-sub clojure.core/defn
|
||||
taoensso.tufte/defnp clojure.core/defn}
|
||||
:linters {:consistent-alias {:level :error
|
||||
:aliases {clojure.string string
|
||||
clojure.set set
|
||||
clojure.walk walk
|
||||
taoensso.timbre log}}
|
||||
:invalid-arity {:skip-args [status-im.utils.fx/defn utils.re-frame/defn]}
|
||||
;; TODO remove number when this is fixed
|
||||
|
||||
@@ -364,7 +364,7 @@ actually subscribing to them, so reframe's signal graph gets validated too.
|
||||
(is (= expected (recipes [current-user all-recipes location]))))))
|
||||
|
||||
;; good
|
||||
(require '[test-helpers.unit :as h])
|
||||
(require '[status-im.test-helpers :as h])
|
||||
|
||||
(re-frame/reg-sub
|
||||
:user/recipes
|
||||
|
||||
@@ -19,11 +19,6 @@ def getStatusGoSHA1 = { ->
|
||||
android {
|
||||
compileSdkVersion rootProject.ext.compileSdkVersion
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion rootProject.ext.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||
|
||||
@@ -59,12 +59,8 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.HashMap;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.Map;
|
||||
import java.util.Stack;
|
||||
import java.util.zip.ZipEntry;
|
||||
@@ -531,33 +527,45 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL
|
||||
StatusThreadPoolExecutor.getInstance().execute(r);
|
||||
}
|
||||
|
||||
private void executeRunnableStatusGoMethod(Supplier<String> method, Callback callback) throws JSONException {
|
||||
@ReactMethod
|
||||
public void verify(final String address, final String password, final Callback callback) {
|
||||
Log.d(TAG, "verify");
|
||||
if (!checkAvailability()) {
|
||||
callback.invoke(false);
|
||||
return;
|
||||
}
|
||||
|
||||
Runnable runnableTask = () -> {
|
||||
String res = method.get();
|
||||
callback.invoke(res);
|
||||
};
|
||||
|
||||
StatusThreadPoolExecutor.getInstance().execute(runnableTask);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void verify(final String address, final String password, final Callback callback) throws JSONException {
|
||||
Activity currentActivity = getCurrentActivity();
|
||||
|
||||
final String absRootDirPath = this.getNoBackupDirectory();
|
||||
final String newKeystoreDir = pathCombine(absRootDirPath, "keystore");
|
||||
|
||||
executeRunnableStatusGoMethod(() -> Statusgo.verifyAccountPassword(newKeystoreDir, address, password), callback);
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String result = Statusgo.verifyAccountPassword(newKeystoreDir, address, password);
|
||||
|
||||
callback.invoke(result);
|
||||
}
|
||||
};
|
||||
|
||||
StatusThreadPoolExecutor.getInstance().execute(r);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void verifyDatabasePassword(final String keyUID, final String password, final Callback callback) throws JSONException {
|
||||
executeRunnableStatusGoMethod(() -> Statusgo.verifyDatabasePassword(keyUID, password), callback);
|
||||
public void verifyDatabasePassword(final String keyUID, final String password, final Callback callback) {
|
||||
Log.d(TAG, "verifyDatabasePassword");
|
||||
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String result = Statusgo.verifyDatabasePassword(keyUID, password);
|
||||
|
||||
callback.invoke(result);
|
||||
}
|
||||
};
|
||||
|
||||
StatusThreadPoolExecutor.getInstance().execute(r);
|
||||
}
|
||||
|
||||
public String getKeyStorePath(String keyUID) {
|
||||
@@ -727,59 +735,209 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void addPeer(final String enode, final Callback callback) throws JSONException {
|
||||
executeRunnableStatusGoMethod(() -> Statusgo.addPeer(enode), callback);
|
||||
public void addPeer(final String enode, final Callback callback) {
|
||||
Log.d(TAG, "addPeer");
|
||||
if (!checkAvailability()) {
|
||||
callback.invoke(false);
|
||||
return;
|
||||
}
|
||||
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String res = Statusgo.addPeer(enode);
|
||||
|
||||
callback.invoke(res);
|
||||
}
|
||||
};
|
||||
|
||||
StatusThreadPoolExecutor.getInstance().execute(r);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void multiAccountStoreAccount(final String json, final Callback callback) throws JSONException {
|
||||
executeRunnableStatusGoMethod(() -> Statusgo.multiAccountStoreAccount(json), callback);
|
||||
public void multiAccountStoreAccount(final String json, final Callback callback) {
|
||||
Log.d(TAG, "multiAccountStoreAccount");
|
||||
if (!checkAvailability()) {
|
||||
callback.invoke(false);
|
||||
return;
|
||||
}
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String res = Statusgo.multiAccountStoreAccount(json);
|
||||
|
||||
callback.invoke(res);
|
||||
}
|
||||
};
|
||||
|
||||
StatusThreadPoolExecutor.getInstance().execute(r);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void multiAccountLoadAccount(final String json, final Callback callback) throws JSONException {
|
||||
executeRunnableStatusGoMethod(() -> Statusgo.multiAccountLoadAccount(json), callback);
|
||||
public void multiAccountLoadAccount(final String json, final Callback callback) {
|
||||
Log.d(TAG, "multiAccountLoadAccount");
|
||||
if (!checkAvailability()) {
|
||||
callback.invoke(false);
|
||||
return;
|
||||
}
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String res = Statusgo.multiAccountLoadAccount(json);
|
||||
|
||||
callback.invoke(res);
|
||||
}
|
||||
};
|
||||
|
||||
StatusThreadPoolExecutor.getInstance().execute(r);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void multiAccountReset(final Callback callback) throws JSONException {
|
||||
executeRunnableStatusGoMethod(() -> Statusgo.multiAccountReset(), callback);
|
||||
public void multiAccountReset(final Callback callback) {
|
||||
Log.d(TAG, "multiAccountReset");
|
||||
if (!checkAvailability()) {
|
||||
callback.invoke(false);
|
||||
return;
|
||||
}
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String res = Statusgo.multiAccountReset();
|
||||
|
||||
callback.invoke(res);
|
||||
}
|
||||
};
|
||||
|
||||
StatusThreadPoolExecutor.getInstance().execute(r);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void multiAccountDeriveAddresses(final String json, final Callback callback) throws JSONException {
|
||||
executeRunnableStatusGoMethod(() -> Statusgo.multiAccountDeriveAddresses(json), callback);
|
||||
public void multiAccountDeriveAddresses(final String json, final Callback callback) {
|
||||
Log.d(TAG, "multiAccountDeriveAddresses");
|
||||
if (!checkAvailability()) {
|
||||
callback.invoke(false);
|
||||
return;
|
||||
}
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String res = Statusgo.multiAccountDeriveAddresses(json);
|
||||
|
||||
callback.invoke(res);
|
||||
}
|
||||
};
|
||||
|
||||
StatusThreadPoolExecutor.getInstance().execute(r);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void multiAccountGenerateAndDeriveAddresses(final String json, final Callback callback) throws JSONException {
|
||||
executeRunnableStatusGoMethod(() -> Statusgo.multiAccountGenerateAndDeriveAddresses(json), callback);
|
||||
public void multiAccountGenerateAndDeriveAddresses(final String json, final Callback callback) {
|
||||
Log.d(TAG, "multiAccountGenerateAndDeriveAddresses");
|
||||
if (!checkAvailability()) {
|
||||
callback.invoke(false);
|
||||
return;
|
||||
}
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String res = Statusgo.multiAccountGenerateAndDeriveAddresses(json);
|
||||
|
||||
callback.invoke(res);
|
||||
}
|
||||
};
|
||||
|
||||
StatusThreadPoolExecutor.getInstance().execute(r);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void multiAccountStoreDerived(final String json, final Callback callback) throws JSONException {
|
||||
executeRunnableStatusGoMethod(() -> Statusgo.multiAccountStoreDerivedAccounts(json), callback);
|
||||
public void multiAccountStoreDerived(final String json, final Callback callback) {
|
||||
Log.d(TAG, "multiAccountStoreDerived");
|
||||
if (!checkAvailability()) {
|
||||
callback.invoke(false);
|
||||
return;
|
||||
}
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String res = Statusgo.multiAccountStoreDerivedAccounts(json);
|
||||
|
||||
callback.invoke(res);
|
||||
}
|
||||
};
|
||||
|
||||
StatusThreadPoolExecutor.getInstance().execute(r);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void multiAccountImportMnemonic(final String json, final Callback callback) throws JSONException {
|
||||
executeRunnableStatusGoMethod(() -> Statusgo.multiAccountImportMnemonic(json), callback);
|
||||
public void multiAccountImportMnemonic(final String json, final Callback callback) {
|
||||
Log.d(TAG, "multiAccountImportMnemonic");
|
||||
if (!checkAvailability()) {
|
||||
callback.invoke(false);
|
||||
return;
|
||||
}
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String res = Statusgo.multiAccountImportMnemonic(json);
|
||||
callback.invoke(res);
|
||||
}
|
||||
};
|
||||
StatusThreadPoolExecutor.getInstance().execute(r);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void multiAccountImportPrivateKey(final String json, final Callback callback) throws JSONException {
|
||||
executeRunnableStatusGoMethod(() -> Statusgo.multiAccountImportPrivateKey(json), callback);
|
||||
public void multiAccountImportPrivateKey(final String json, final Callback callback) {
|
||||
Log.d(TAG, "multiAccountImportPrivateKey");
|
||||
if (!checkAvailability()) {
|
||||
callback.invoke(false);
|
||||
return;
|
||||
}
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String res = Statusgo.multiAccountImportPrivateKey(json);
|
||||
callback.invoke(res);
|
||||
}
|
||||
};
|
||||
StatusThreadPoolExecutor.getInstance().execute(r);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void hashTransaction(final String txArgsJSON, final Callback callback) throws JSONException {
|
||||
executeRunnableStatusGoMethod(() -> Statusgo.hashTransaction(txArgsJSON), callback);
|
||||
public void hashTransaction(final String txArgsJSON, final Callback callback) {
|
||||
Log.d(TAG, "hashTransaction");
|
||||
if (!checkAvailability()) {
|
||||
callback.invoke(false);
|
||||
return;
|
||||
}
|
||||
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String res = Statusgo.hashTransaction(txArgsJSON);
|
||||
callback.invoke(res);
|
||||
}
|
||||
};
|
||||
|
||||
StatusThreadPoolExecutor.getInstance().execute(r);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void hashMessage(final String message, final Callback callback) throws JSONException {
|
||||
executeRunnableStatusGoMethod(() -> Statusgo.hashMessage(message), callback);
|
||||
public void hashMessage(final String message, final Callback callback) {
|
||||
Log.d(TAG, "hashMessage");
|
||||
if (!checkAvailability()) {
|
||||
callback.invoke(false);
|
||||
return;
|
||||
}
|
||||
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String res = Statusgo.hashMessage(message);
|
||||
callback.invoke(res);
|
||||
}
|
||||
};
|
||||
|
||||
StatusThreadPoolExecutor.getInstance().execute(r);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
@@ -789,7 +947,20 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL
|
||||
final String keyStorePath = this.getKeyStorePath(keyUID);
|
||||
jsonConfig.put("keystorePath", keyStorePath);
|
||||
|
||||
executeRunnableStatusGoMethod(() -> Statusgo.getConnectionStringForBootstrappingAnotherDevice(jsonConfig.toString()), callback);
|
||||
if (!checkAvailability()) {
|
||||
callback.invoke(false);
|
||||
return;
|
||||
}
|
||||
|
||||
Runnable runnableTask = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String res = Statusgo.getConnectionStringForBootstrappingAnotherDevice(jsonConfig.toString());
|
||||
callback.invoke(res);
|
||||
}
|
||||
};
|
||||
|
||||
StatusThreadPoolExecutor.getInstance().execute(runnableTask);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
@@ -798,11 +969,6 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL
|
||||
final String keyStorePath = pathCombine(this.getNoBackupDirectory(), "/keystore");
|
||||
jsonConfig.put("keystorePath", keyStorePath);
|
||||
|
||||
executeRunnableStatusGoMethod(() -> Statusgo.inputConnectionStringForBootstrapping(connectionString, jsonConfig.toString()), callback);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void multiformatSerializePublicKey(final String multiCodecKey, final String base58btc, final Callback callback) throws JSONException {
|
||||
if (!checkAvailability()) {
|
||||
callback.invoke(false);
|
||||
return;
|
||||
@@ -811,7 +977,7 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL
|
||||
Runnable runnableTask = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String res = Statusgo.multiformatSerializePublicKey(multiCodecKey,base58btc);
|
||||
String res = Statusgo.inputConnectionStringForBootstrapping(connectionString,jsonConfig.toString());
|
||||
callback.invoke(res);
|
||||
}
|
||||
};
|
||||
@@ -819,117 +985,157 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL
|
||||
StatusThreadPoolExecutor.getInstance().execute(runnableTask);
|
||||
}
|
||||
|
||||
|
||||
@ReactMethod
|
||||
public void multiformatDeserializePublicKey(final String multiCodecKey, final String base58btc, final Callback callback) throws JSONException {
|
||||
public void hashTypedData(final String data, final Callback callback) {
|
||||
Log.d(TAG, "hashTypedData");
|
||||
if (!checkAvailability()) {
|
||||
callback.invoke(false);
|
||||
return;
|
||||
}
|
||||
|
||||
Runnable runnableTask = new Runnable() {
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String res = Statusgo.multiformatDeserializePublicKey(multiCodecKey,base58btc);
|
||||
String res = Statusgo.hashTypedData(data);
|
||||
callback.invoke(res);
|
||||
}
|
||||
};
|
||||
|
||||
StatusThreadPoolExecutor.getInstance().execute(runnableTask);
|
||||
StatusThreadPoolExecutor.getInstance().execute(r);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void compressPublicKey(final String multiCodecKey, final Callback callback) throws JSONException {
|
||||
public void hashTypedDataV4(final String data, final Callback callback) {
|
||||
Log.d(TAG, "hashTypedDataV4");
|
||||
if (!checkAvailability()) {
|
||||
callback.invoke(false);
|
||||
return;
|
||||
}
|
||||
|
||||
Runnable runnableTask = new Runnable() {
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String res = Statusgo.compressPublicKey(multiCodecKey);
|
||||
String res = Statusgo.hashTypedDataV4(data);
|
||||
callback.invoke(res);
|
||||
}
|
||||
};
|
||||
|
||||
StatusThreadPoolExecutor.getInstance().execute(runnableTask);
|
||||
StatusThreadPoolExecutor.getInstance().execute(r);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void decompressPublicKey(final String multiCodecKey, final Callback callback) throws JSONException {
|
||||
public void sendTransactionWithSignature(final String txArgsJSON, final String signature, final Callback callback) {
|
||||
Log.d(TAG, "sendTransactionWithSignature");
|
||||
if (!checkAvailability()) {
|
||||
callback.invoke(false);
|
||||
return;
|
||||
}
|
||||
|
||||
Runnable runnableTask = new Runnable() {
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String res = Statusgo.decompressPublicKey(multiCodecKey);
|
||||
String res = Statusgo.sendTransactionWithSignature(txArgsJSON, signature);
|
||||
callback.invoke(res);
|
||||
}
|
||||
};
|
||||
|
||||
StatusThreadPoolExecutor.getInstance().execute(runnableTask);
|
||||
StatusThreadPoolExecutor.getInstance().execute(r);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void deserializeAndCompressKey(final String desktopKey, final Callback callback) throws JSONException {
|
||||
public void sendTransaction(final String txArgsJSON, final String password, final Callback callback) {
|
||||
Log.d(TAG, "sendTransaction");
|
||||
if (!checkAvailability()) {
|
||||
callback.invoke(false);
|
||||
return;
|
||||
}
|
||||
|
||||
Runnable runnableTask = new Runnable() {
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String res = Statusgo.deserializeAndCompressKey(desktopKey);
|
||||
String res = Statusgo.sendTransaction(txArgsJSON, password);
|
||||
callback.invoke(res);
|
||||
}
|
||||
};
|
||||
|
||||
StatusThreadPoolExecutor.getInstance().execute(runnableTask);
|
||||
StatusThreadPoolExecutor.getInstance().execute(r);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void hashTypedData(final String data, final Callback callback) throws JSONException {
|
||||
executeRunnableStatusGoMethod(() -> Statusgo.hashTypedData(data), callback);
|
||||
public void signMessage(final String rpcParams, final Callback callback) {
|
||||
Log.d(TAG, "signMessage");
|
||||
if (!checkAvailability()) {
|
||||
callback.invoke(false);
|
||||
return;
|
||||
}
|
||||
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String res = Statusgo.signMessage(rpcParams);
|
||||
callback.invoke(res);
|
||||
}
|
||||
};
|
||||
|
||||
StatusThreadPoolExecutor.getInstance().execute(r);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void hashTypedDataV4(final String data, final Callback callback) throws JSONException {
|
||||
executeRunnableStatusGoMethod(() -> Statusgo.hashTypedDataV4(data), callback);
|
||||
public void recover(final String rpcParams, final Callback callback) {
|
||||
Log.d(TAG, "recover");
|
||||
if (!checkAvailability()) {
|
||||
callback.invoke(false);
|
||||
return;
|
||||
}
|
||||
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String res = Statusgo.recover(rpcParams);
|
||||
callback.invoke(res);
|
||||
}
|
||||
};
|
||||
|
||||
StatusThreadPoolExecutor.getInstance().execute(r);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void sendTransactionWithSignature(final String txArgsJSON, final String signature, final Callback callback) throws JSONException {
|
||||
executeRunnableStatusGoMethod(() -> Statusgo.sendTransactionWithSignature(txArgsJSON, signature), callback);
|
||||
public void signTypedData(final String data, final String account, final String password, final Callback callback) {
|
||||
Log.d(TAG, "signTypedData");
|
||||
if (!checkAvailability()) {
|
||||
callback.invoke(false);
|
||||
return;
|
||||
}
|
||||
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String res = Statusgo.signTypedData(data, account, password);
|
||||
callback.invoke(res);
|
||||
}
|
||||
};
|
||||
|
||||
StatusThreadPoolExecutor.getInstance().execute(r);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void sendTransaction(final String txArgsJSON, final String password, final Callback callback) throws JSONException {
|
||||
executeRunnableStatusGoMethod(() -> Statusgo.sendTransaction(txArgsJSON, password), callback);
|
||||
}
|
||||
public void signTypedDataV4(final String data, final String account, final String password, final Callback callback) {
|
||||
Log.d(TAG, "signTypedDataV4");
|
||||
if (!checkAvailability()) {
|
||||
callback.invoke(false);
|
||||
return;
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void signMessage(final String rpcParams, final Callback callback) throws JSONException {
|
||||
executeRunnableStatusGoMethod(() -> Statusgo.signMessage(rpcParams), callback);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void recover(final String rpcParams, final Callback callback) throws JSONException {
|
||||
executeRunnableStatusGoMethod(() -> Statusgo.recover(rpcParams), callback);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void signTypedData(final String data, final String account, final String password, final Callback callback) throws JSONException {
|
||||
executeRunnableStatusGoMethod(() -> Statusgo.signTypedData(data, account, password), callback);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void signTypedDataV4(final String data, final String account, final String password, final Callback callback) throws JSONException {
|
||||
executeRunnableStatusGoMethod(() -> Statusgo.signTypedDataV4(data, account, password), callback);
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String res = Statusgo.signTypedDataV4(data, account, password);
|
||||
callback.invoke(res);
|
||||
}
|
||||
};
|
||||
|
||||
StatusThreadPoolExecutor.getInstance().execute(r);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
@@ -1034,13 +1240,29 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void callRPC(final String payload, final Callback callback) throws JSONException {
|
||||
executeRunnableStatusGoMethod(() -> Statusgo.callRPC(payload), callback);
|
||||
public void callRPC(final String payload, final Callback callback) {
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String res = Statusgo.callRPC(payload);
|
||||
callback.invoke(res);
|
||||
}
|
||||
};
|
||||
|
||||
StatusThreadPoolExecutor.getInstance().execute(r);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void callPrivateRPC(final String payload, final Callback callback) throws JSONException {
|
||||
executeRunnableStatusGoMethod(() -> Statusgo.callPrivateRPC(payload), callback);
|
||||
public void callPrivateRPC(final String payload, final Callback callback) {
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String res = Statusgo.callPrivateRPC(payload);
|
||||
callback.invoke(res);
|
||||
}
|
||||
};
|
||||
|
||||
StatusThreadPoolExecutor.getInstance().execute(r);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
@@ -1103,30 +1325,105 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void extractGroupMembershipSignatures(final String signaturePairs, final Callback callback) throws JSONException {
|
||||
executeRunnableStatusGoMethod(() -> Statusgo.extractGroupMembershipSignatures(signaturePairs), callback);
|
||||
public void extractGroupMembershipSignatures(final String signaturePairs, final Callback callback) {
|
||||
Log.d(TAG, "extractGroupMembershipSignatures");
|
||||
if (!checkAvailability()) {
|
||||
callback.invoke(false);
|
||||
return;
|
||||
}
|
||||
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String result = Statusgo.extractGroupMembershipSignatures(signaturePairs);
|
||||
|
||||
callback.invoke(result);
|
||||
}
|
||||
};
|
||||
|
||||
StatusThreadPoolExecutor.getInstance().execute(r);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void signGroupMembership(final String content, final Callback callback) throws JSONException {
|
||||
executeRunnableStatusGoMethod(() -> Statusgo.signGroupMembership(content), callback);
|
||||
public void signGroupMembership(final String content, final Callback callback) {
|
||||
Log.d(TAG, "signGroupMembership");
|
||||
if (!checkAvailability()) {
|
||||
callback.invoke(false);
|
||||
return;
|
||||
}
|
||||
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String result = Statusgo.signGroupMembership(content);
|
||||
|
||||
callback.invoke(result);
|
||||
}
|
||||
};
|
||||
|
||||
StatusThreadPoolExecutor.getInstance().execute(r);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void getNodeConfig(final Callback callback) throws JSONException {
|
||||
executeRunnableStatusGoMethod(() -> Statusgo.getNodeConfig(), callback);
|
||||
public void getNodeConfig(final Callback callback) {
|
||||
Log.d(TAG, "getNodeConfig");
|
||||
if (!checkAvailability()) {
|
||||
callback.invoke(false);
|
||||
return;
|
||||
}
|
||||
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String result = Statusgo.getNodeConfig();
|
||||
|
||||
callback.invoke(result);
|
||||
}
|
||||
};
|
||||
|
||||
StatusThreadPoolExecutor.getInstance().execute(r);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void deleteMultiaccount(final String keyUID, final Callback callback) throws JSONException {
|
||||
public void deleteMultiaccount(final String keyUID, final Callback callback) {
|
||||
Log.d(TAG, "deleteMultiaccount");
|
||||
if (!checkAvailability()) {
|
||||
callback.invoke(false);
|
||||
return;
|
||||
}
|
||||
|
||||
final String keyStoreDir = this.getKeyStorePath(keyUID);
|
||||
executeRunnableStatusGoMethod(() -> Statusgo.deleteMultiaccount(keyUID, keyStoreDir), callback);
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String res = Statusgo.deleteMultiaccount(keyUID, keyStoreDir);
|
||||
|
||||
callback.invoke(res);
|
||||
}
|
||||
};
|
||||
|
||||
StatusThreadPoolExecutor.getInstance().execute(r);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void deleteImportedKey(final String keyUID, final String address, final String password, final Callback callback) throws JSONException {
|
||||
public void deleteImportedKey(final String keyUID, final String address, final String password, final Callback callback) {
|
||||
Log.d(TAG, "deleteImportedKey");
|
||||
if (!checkAvailability()) {
|
||||
callback.invoke(false);
|
||||
return;
|
||||
}
|
||||
|
||||
final String keyStoreDir = this.getKeyStorePath(keyUID);
|
||||
executeRunnableStatusGoMethod(() -> Statusgo.deleteImportedKey(address, password, keyStoreDir), callback);
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String res = Statusgo.deleteImportedKey(address, password, keyStoreDir);
|
||||
|
||||
callback.invoke(res);
|
||||
}
|
||||
};
|
||||
|
||||
StatusThreadPoolExecutor.getInstance().execute(r);
|
||||
}
|
||||
|
||||
@ReactMethod(isBlockingSynchronousMethod = true)
|
||||
@@ -1135,8 +1432,24 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void generateAliasAsync(final String seed, final Callback callback) throws JSONException {
|
||||
executeRunnableStatusGoMethod(() -> Statusgo.generateAlias(seed), callback);
|
||||
public void generateAliasAsync(final String seed, final Callback callback) {
|
||||
Log.d(TAG, "generateAliasAsync");
|
||||
if (!checkAvailability()) {
|
||||
callback.invoke(false);
|
||||
return;
|
||||
}
|
||||
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String res = Statusgo.generateAlias(seed);
|
||||
|
||||
Log.d(TAG, res);
|
||||
callback.invoke(res);
|
||||
}
|
||||
};
|
||||
|
||||
StatusThreadPoolExecutor.getInstance().execute(r);
|
||||
}
|
||||
|
||||
@ReactMethod(isBlockingSynchronousMethod = true)
|
||||
@@ -1200,33 +1513,47 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void identiconAsync(final String seed, final Callback callback) throws JSONException {
|
||||
executeRunnableStatusGoMethod(() -> Statusgo.identicon(seed), callback);
|
||||
public void identiconAsync(final String seed, final Callback callback) {
|
||||
Log.d(TAG, "identiconAsync");
|
||||
if (!checkAvailability()) {
|
||||
callback.invoke(false);
|
||||
return;
|
||||
}
|
||||
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String res = Statusgo.identicon(seed);
|
||||
|
||||
Log.d(TAG, res);
|
||||
callback.invoke(res);
|
||||
}
|
||||
};
|
||||
|
||||
StatusThreadPoolExecutor.getInstance().execute(r);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void generateAliasAndIdenticonAsync(final String seed, final Callback callback) {
|
||||
Log.d(TAG, "generateAliasAndIdenticonAsync");
|
||||
if (!checkAvailability()) {
|
||||
callback.invoke(false);
|
||||
return;
|
||||
}
|
||||
|
||||
Log.d(TAG, "generateAliasAndIdenticonAsync");
|
||||
if (!checkAvailability()) {
|
||||
callback.invoke(false);
|
||||
return;
|
||||
}
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String resIdenticon = Statusgo.identicon(seed);
|
||||
String resAlias = Statusgo.generateAlias(seed);
|
||||
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String resIdenticon = Statusgo.identicon(seed);
|
||||
String resAlias = Statusgo.generateAlias(seed);
|
||||
|
||||
Log.d(TAG, resIdenticon);
|
||||
Log.d(TAG, resAlias);
|
||||
callback.invoke(resAlias, resIdenticon);
|
||||
}
|
||||
};
|
||||
|
||||
StatusThreadPoolExecutor.getInstance().execute(r);
|
||||
Log.d(TAG, resIdenticon);
|
||||
Log.d(TAG, resAlias);
|
||||
callback.invoke(resAlias, resIdenticon);
|
||||
}
|
||||
};
|
||||
|
||||
StatusThreadPoolExecutor.getInstance().execute(r);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1248,8 +1575,24 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void validateMnemonic(final String seed, final Callback callback) throws JSONException {
|
||||
executeRunnableStatusGoMethod(() -> Statusgo.validateMnemonic(seed), callback);
|
||||
public void validateMnemonic(final String seed, final Callback callback) {
|
||||
Log.d(TAG, "validateMnemonic");
|
||||
if (!checkAvailability()) {
|
||||
callback.invoke(false);
|
||||
return;
|
||||
}
|
||||
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String resValidateMnemonic = Statusgo.validateMnemonic(seed);
|
||||
|
||||
Log.d(TAG, resValidateMnemonic);
|
||||
callback.invoke(resValidateMnemonic);
|
||||
}
|
||||
};
|
||||
|
||||
StatusThreadPoolExecutor.getInstance().execute(r);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
@@ -1300,14 +1643,35 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void reEncryptDbAndKeystore(final String keyUID, final String password, final String newPassword, final Callback callback) throws JSONException {
|
||||
executeRunnableStatusGoMethod(() -> Statusgo.changeDatabasePassword(keyUID, password, newPassword), callback);
|
||||
public void reEncryptDbAndKeystore(final String keyUID, final String password, final String newPassword, final Callback callback) {
|
||||
Log.d(TAG, "reEncryptDbAndKeyStore");
|
||||
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// changes db password and re-encrypts keystore
|
||||
String result = Statusgo.changeDatabasePassword(keyUID, password, newPassword);
|
||||
callback.invoke(result);
|
||||
}
|
||||
};
|
||||
|
||||
StatusThreadPoolExecutor.getInstance().execute(r);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void convertToKeycardAccount(final String keyUID, final String accountData, final String options, final String password, final String newPassword, final Callback callback) throws JSONException {
|
||||
public void convertToKeycardAccount(final String keyUID, final String accountData, final String options, final String password, final String newPassword, final Callback callback) {
|
||||
Log.d(TAG, "convertToKeycardAccount");
|
||||
|
||||
final String keyStoreDir = this.getKeyStorePath(keyUID);
|
||||
executeRunnableStatusGoMethod(() -> Statusgo.convertToKeycardAccount(keyStoreDir, accountData, options, password, newPassword), callback);
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String result = Statusgo.convertToKeycardAccount(keyStoreDir, accountData, options, password, newPassword);
|
||||
callback.invoke(result);
|
||||
}
|
||||
};
|
||||
|
||||
StatusThreadPoolExecutor.getInstance().execute(r);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -339,38 +339,6 @@ RCT_EXPORT_METHOD(inputConnectionStringForBootstrapping:(NSString *)cs
|
||||
callback(@[result]);
|
||||
}
|
||||
|
||||
RCT_EXPORT_METHOD(multiformatSerializePublicKey:(NSString *)multiCodecKey
|
||||
base58btc:(NSString *)base58btc
|
||||
callback:(RCTResponseSenderBlock)callback) {
|
||||
NSString *result = StatusgoMultiformatSerializePublicKey(multiCodecKey,base58btc);
|
||||
callback(@[result]);
|
||||
}
|
||||
|
||||
RCT_EXPORT_METHOD(multiformatDeserializePublicKey:(NSString *)multiCodecKey
|
||||
base58btc:(NSString *)base58btc
|
||||
callback:(RCTResponseSenderBlock)callback) {
|
||||
NSString *result = StatusgoMultiformatDeserializePublicKey(multiCodecKey,base58btc);
|
||||
callback(@[result]);
|
||||
}
|
||||
|
||||
RCT_EXPORT_METHOD(decompressPublicKey:(NSString *)multiCodecKey
|
||||
callback:(RCTResponseSenderBlock)callback) {
|
||||
NSString *result = StatusgoDecompressPublicKey(multiCodecKey);
|
||||
callback(@[result]);
|
||||
}
|
||||
|
||||
RCT_EXPORT_METHOD(compressPublicKey:(NSString *)multiCodecKey
|
||||
callback:(RCTResponseSenderBlock)callback) {
|
||||
NSString *result = StatusgoCompressPublicKey(multiCodecKey);
|
||||
callback(@[result]);
|
||||
}
|
||||
|
||||
RCT_EXPORT_METHOD(deserializeAndCompressKey:(NSString *)desktopKey
|
||||
callback:(RCTResponseSenderBlock)callback) {
|
||||
NSString *result = StatusgoDeserializeAndCompressKey(desktopKey);
|
||||
callback(@[result]);
|
||||
}
|
||||
|
||||
RCT_EXPORT_METHOD(hashTypedData:(NSString *)data
|
||||
callback:(RCTResponseSenderBlock)callback) {
|
||||
#if DEBUG
|
||||
|
||||
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 878 B |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 2.6 KiB |
@@ -83,7 +83,7 @@
|
||||
:optimizations :simple
|
||||
:target :node-test
|
||||
;; When running tests without a REPL you can uncomment below line to `make test-watch` a specific file
|
||||
;;:ns-regexp "status-im2.subs.subs-test$"
|
||||
;; :ns-regexp "status-im.chat.models-test$"
|
||||
:main
|
||||
status-im.test-runner/main
|
||||
;; set :ui-driven to true to let shadow-cljs inject node-repl
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
[clojure.string :as string]
|
||||
[status-im.goog.i18n :as goog.i18n]))
|
||||
|
||||
(defn setup
|
||||
(defn init
|
||||
[default-device-language translations-by-locale]
|
||||
(set! (.-fallbacks i18n) true)
|
||||
(set! (.-defaultSeparator i18n) "/")
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
(ns quo2.components.avatars.account-avatar
|
||||
(:require [quo2.components.icon :as icons]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[quo2.theme :as theme]
|
||||
[react-native.core :as rn]))
|
||||
|
||||
(def icon-color-value
|
||||
{:dark (get-in colors/customization [:dark :purple])
|
||||
:light (get-in colors/customization [:light :purple])})
|
||||
|
||||
(defn get-border-radius
|
||||
[size]
|
||||
(case size
|
||||
@@ -22,11 +27,12 @@
|
||||
20 11))
|
||||
|
||||
(defn account-avatar
|
||||
[{:keys [size icon color]
|
||||
:or {size 80
|
||||
icon :i/placeholder
|
||||
color :purple}}]
|
||||
(let [icon-color (colors/custom-color-by-theme color 50 60)
|
||||
[{:keys [size icon]
|
||||
:or {size 80
|
||||
icon :main-icons/placeholder}}]
|
||||
(let [icon-color (if (theme/dark?)
|
||||
(:dark icon-color-value)
|
||||
(:light icon-color-value))
|
||||
avatar-border-radius (get-border-radius size)
|
||||
inner-icon-size (get-inner-icon-sizes size)]
|
||||
[rn/view
|
||||
|
||||
@@ -24,9 +24,7 @@
|
||||
:align-items :center
|
||||
:justify-content :center
|
||||
:border-radius (/ container-size 2)
|
||||
;:background-color (colors/custom-color-by-theme color 50 60) ; TODO: this is temporary only.
|
||||
;Issue: https://github.com/status-im/status-mobile/issues/14566
|
||||
:background-color color}
|
||||
:background-color (colors/custom-color-by-theme color 50 60)}
|
||||
[icon/icon :i/group
|
||||
{:size icon-size
|
||||
:color colors/white-opa-70}]])))
|
||||
|
||||
@@ -141,7 +141,7 @@
|
||||
(if profile-picture
|
||||
;; display image
|
||||
[fast-image/fast-image
|
||||
{:source profile-picture
|
||||
{:source {:uri profile-picture}
|
||||
:style (container-styling inner-dimensions outer-dimensions)}]
|
||||
;; else display initials
|
||||
[container inner-dimensions outer-dimensions
|
||||
|
||||
@@ -32,9 +32,9 @@
|
||||
:outline {:icon-color colors/neutral-50
|
||||
:icon-secondary-color colors/neutral-50
|
||||
:label-color colors/neutral-100
|
||||
:border-color {:default colors/neutral-30
|
||||
:border-color {:default colors/neutral-20
|
||||
:pressed colors/neutral-40
|
||||
:disabled colors/neutral-30}}
|
||||
:disabled colors/neutral-20}}
|
||||
:ghost {:icon-color colors/neutral-50
|
||||
:icon-secondary-color colors/neutral-50
|
||||
:label-color colors/neutral-100
|
||||
@@ -138,8 +138,7 @@
|
||||
|
||||
(defn shape-style-container
|
||||
[type icon size]
|
||||
{:height size
|
||||
:border-radius (if (and icon (#{:primary :secondary :danger} type))
|
||||
{:border-radius (if (and icon (#{:primary :secondary :danger} type))
|
||||
24
|
||||
(case size
|
||||
56 12
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
:notification-up :i/arrow-up
|
||||
:search-with-label :i/search
|
||||
:search :i/search
|
||||
:scroll-to-bottom :i/arrow-down)
|
||||
:bottom :i/arrow-down)
|
||||
{:size 12
|
||||
:color (get-icon-and-text-color type)
|
||||
:container-style {:margin-top 6
|
||||
@@ -43,7 +43,7 @@
|
||||
:notification-up 2
|
||||
:search-with-label 8
|
||||
:search 6
|
||||
:scroll-to-bottom 6)
|
||||
:bottom 6)
|
||||
:margin-right (case type
|
||||
:jump-to 8
|
||||
:mention 2
|
||||
@@ -51,12 +51,12 @@
|
||||
:notification-up 8
|
||||
:search-with-label 4
|
||||
:search 6
|
||||
:scroll-to-bottom 6)}}])
|
||||
:bottom 6)}}])
|
||||
|
||||
(defn dynamic-button
|
||||
"[dynamic-button opts]
|
||||
opts
|
||||
{:type :jump-to/:mention/:notification-down/:notification-up/:search/:search-with-label/:scroll-to-bottom
|
||||
{:type :jump-to/:mention/:notification-down/:notification-up/:search/:search-with-label/:bottom
|
||||
:on-press fn
|
||||
:count mentions or notifications count
|
||||
:customization-color customize jump-to and mention button color}"
|
||||
@@ -77,7 +77,7 @@
|
||||
:border-radius 12
|
||||
:background-color (get-button-color type @pressed? (or customization-color :primary))}
|
||||
style)}
|
||||
(when (#{:mention :search :search-with-label :scroll-to-bottom} type)
|
||||
(when (#{:mention :search :search-with-label :bottom} type)
|
||||
[icon-view type])
|
||||
(when (#{:jump-to :mention :notification-down :notification-up :search-with-label} type)
|
||||
[text/text
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
[quo2.components.markdown.text :as text]
|
||||
[quo2.components.tags.token-tag :as token-tag]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[i18n.i18n :as i18n]
|
||||
[status-im.i18n.i18n :as i18n]
|
||||
[status-im.ui.components.fast-image :as fast-image]))
|
||||
|
||||
(def ^:private token-tag-horizontal-spacing 7)
|
||||
|
||||
@@ -41,5 +41,4 @@
|
||||
(get-icons 16)
|
||||
(get-icons 20)
|
||||
(get-icons 24)
|
||||
(get-icons 32)
|
||||
(get-icons 120)))
|
||||
(get-icons 32)))
|
||||
|
||||
@@ -15,24 +15,22 @@
|
||||
:text-color (theme-colors colors/danger-50 colors/danger-60)}))
|
||||
|
||||
(defn menu-item
|
||||
[{:keys [type title accessibility-label icon on-press style-props subtitle subtitle-color]
|
||||
[{:keys [type title accessibility-label icon on-press]
|
||||
:or {type :main}}]
|
||||
(let [{:keys [icon-color text-color background]} (themes type)]
|
||||
[rn/touchable-opacity
|
||||
(merge {:accessibility-label accessibility-label
|
||||
:style (merge style-props
|
||||
{:background-color background
|
||||
:height 48
|
||||
:flex-direction :row
|
||||
:align-items :center})}
|
||||
:style {:background-color background
|
||||
:height 48
|
||||
:flex-direction :row
|
||||
:align-items :center}}
|
||||
(when on-press
|
||||
{:on-press on-press}))
|
||||
[rn/view
|
||||
{:style {:flex-direction :row
|
||||
:flex-grow 0
|
||||
:flex-shrink 1
|
||||
:padding-horizontal 20
|
||||
:align-items :center}}
|
||||
:padding-horizontal 20}}
|
||||
[rn/view
|
||||
{:style {:width 20
|
||||
:height 20
|
||||
@@ -40,19 +38,10 @@
|
||||
:justify-content :center
|
||||
:margin-right 12}}
|
||||
[icons/icon icon {:color icon-color}]]
|
||||
[rn/view
|
||||
[text/text
|
||||
{:weight :medium
|
||||
:style {:color text-color}
|
||||
:ellipsize-mode :tail
|
||||
:number-of-lines 1
|
||||
:size :paragraph-1}
|
||||
title]
|
||||
(when subtitle
|
||||
[text/text
|
||||
{:weight :medium
|
||||
:style {:color subtitle-color}
|
||||
:ellipsize-mode :tail
|
||||
:number-of-lines 1
|
||||
:size :paragraph-1}
|
||||
subtitle])]]]))
|
||||
[text/text
|
||||
{:weight :medium
|
||||
:style {:color text-color}
|
||||
:ellipsize-mode :tail
|
||||
:number-of-lines 1
|
||||
:size :paragraph-1}
|
||||
title]]]))
|
||||
|
||||
@@ -50,4 +50,4 @@
|
||||
[dynamic-button-view :mention dynamic-buttons {:margin-left 8}]
|
||||
[dynamic-button-view :notification-down dynamic-buttons {:margin-left 8}]
|
||||
[dynamic-button-view :notification-up dynamic-buttons {:margin-left 8}]
|
||||
[dynamic-button-view :scroll-to-bottom dynamic-buttons {:margin-left 8}]]]]))]))
|
||||
[dynamic-button-view :bottom dynamic-buttons {:margin-left 8}]]]]))]))
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
[quo2.foundations.colors :as colors]
|
||||
[react-native.core :as rn]
|
||||
[reagent.core :as reagent]
|
||||
[i18n.i18n :as i18n]))
|
||||
[status-im.i18n.i18n :as i18n]))
|
||||
|
||||
(def ^:private max-reply-length
|
||||
280)
|
||||
@@ -81,21 +81,19 @@
|
||||
context))))
|
||||
|
||||
(defn- activity-message
|
||||
[{:keys [title body title-number-of-lines body-number-of-lines]}]
|
||||
[{:keys [title body]}]
|
||||
[rn/view {:style style/message-container}
|
||||
(when title
|
||||
[text/text
|
||||
{:size :paragraph-2
|
||||
:accessibility-label :activity-message-title
|
||||
:style style/message-title
|
||||
:number-of-lines title-number-of-lines}
|
||||
:style style/message-title}
|
||||
title])
|
||||
(if (string? body)
|
||||
[text/text
|
||||
{:style style/message-body
|
||||
:accessibility-label :activity-message-body
|
||||
:size :paragraph-1
|
||||
:number-of-lines body-number-of-lines}
|
||||
:size :paragraph-1}
|
||||
body]
|
||||
body)])
|
||||
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
(ns quo2.components.profile.profile-card.style
|
||||
(:require [quo2.foundations.colors :as colors]))
|
||||
|
||||
(defn card-container
|
||||
[customization-color]
|
||||
{:flex-direction :column
|
||||
:padding 12
|
||||
:flex 1
|
||||
:border-radius 16
|
||||
:background-color (colors/custom-color customization-color 50 40)})
|
||||
|
||||
(def card-header
|
||||
{:flex-direction :row
|
||||
:justify-content :space-between})
|
||||
|
||||
(def name-container
|
||||
{:flex-direction :row
|
||||
:margin-top 8
|
||||
:margin-bottom 2
|
||||
:align-items :center
|
||||
:padding-right 12})
|
||||
|
||||
(def user-name
|
||||
{:margin-right 4
|
||||
:color colors/white})
|
||||
|
||||
(def emoji-hash
|
||||
{:margin-top 10})
|
||||
|
||||
(def user-hash
|
||||
{:color colors/white-opa-60})
|
||||
|
||||
(def sign-button
|
||||
{:margin-top 14})
|
||||
|
||||
(def keycard-icon
|
||||
{:color colors/white-opa-40})
|
||||
|
||||
(def option-button
|
||||
{:background-color colors/white-opa-5})
|
||||
@@ -1,64 +0,0 @@
|
||||
(ns quo2.components.profile.profile-card.view
|
||||
(:require
|
||||
[quo2.components.profile.profile-card.style :as style]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[quo2.components.avatars.user-avatar :as user-avatar]
|
||||
[quo2.components.icon :as icon]
|
||||
[quo2.components.markdown.text :as text]
|
||||
[quo2.components.buttons.button :as button]
|
||||
[react-native.core :as rn]))
|
||||
|
||||
|
||||
(defn profile-card
|
||||
[{:keys [show-sign-profile? key-card? profile-picture name hash customization-color sign-label
|
||||
emoji-hash on-press-dots on-press-sign show-emoji-hash?]
|
||||
:or {show-sign-profile? false
|
||||
show-emoji-hash? false
|
||||
customization-color :turquoise
|
||||
key-card? false}}]
|
||||
[rn/view
|
||||
{:style (style/card-container customization-color)}
|
||||
[rn/view
|
||||
{:style style/card-header}
|
||||
[user-avatar/user-avatar
|
||||
{:full-name name
|
||||
:profile-picture profile-picture
|
||||
:override-theme :dark
|
||||
:size :medium
|
||||
:status-indicator? false
|
||||
:ring? true}]
|
||||
[button/button
|
||||
{:size 32
|
||||
:type :blur-bg
|
||||
:icon true
|
||||
:override-theme :dark
|
||||
:style style/option-button
|
||||
:on-press on-press-dots}
|
||||
:i/options]]
|
||||
[rn/view
|
||||
{:style style/name-container}
|
||||
[text/text
|
||||
{:size :heading-2
|
||||
:weight :semi-bold
|
||||
:number-of-lines 1
|
||||
:style style/user-name} name]
|
||||
(when key-card?
|
||||
(icon/icon
|
||||
:i/keycard
|
||||
style/keycard-icon))]
|
||||
[text/text
|
||||
{:weight :monospace
|
||||
:number-of-lines 1
|
||||
:style style/user-hash} hash]
|
||||
(when (and show-emoji-hash? emoji-hash)
|
||||
[text/text
|
||||
{:weight :monospace
|
||||
:number-of-lines 1
|
||||
:style style/emoji-hash} emoji-hash])
|
||||
(when show-sign-profile?
|
||||
[button/button
|
||||
{:on-press on-press-sign
|
||||
:type :community
|
||||
:community-color (colors/custom-color customization-color 60)
|
||||
:community-text-color colors/white
|
||||
:style style/sign-button} sign-label])])
|
||||
@@ -2,9 +2,7 @@
|
||||
(:require [quo2.components.icon :as icons]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[react-native.core :as rn]
|
||||
[reagent.core :as reagent]
|
||||
[quo2.components.selectors.styles :as style]))
|
||||
|
||||
[reagent.core :as reagent]))
|
||||
|
||||
(defn- get-color
|
||||
[checked? disabled? blurred-background?]
|
||||
@@ -68,13 +66,13 @@
|
||||
(colors/alpha colors/neutral-100 (if disabled? 0.3 1))
|
||||
(colors/alpha colors/white (if disabled? 0.3 1)))}]])]])))
|
||||
|
||||
|
||||
(defn checkbox
|
||||
[{:keys [default-checked?]}]
|
||||
(let [checked? (reagent/atom (or default-checked? false))]
|
||||
(fn [{:keys [on-change disabled? blurred-background? container-style]}]
|
||||
(fn [{:keys [on-change disabled? blurred-background? container-style accessibility-label]}]
|
||||
[rn/touchable-without-feedback
|
||||
{:on-press (handle-press disabled? on-change checked?)}
|
||||
{:accessibility-label accessibility-label
|
||||
:on-press (handle-press disabled? on-change checked?)}
|
||||
[rn/view
|
||||
{:style (merge
|
||||
container-style
|
||||
@@ -110,34 +108,6 @@
|
||||
{:size 20
|
||||
:color colors/white}]])]]])))
|
||||
|
||||
;; TODO (Omar): issue https://github.com/status-im/status-mobile/issues/14681
|
||||
;(defn checkbox
|
||||
; [{:keys [default-checked?]}]
|
||||
; (let [checked? (reagent/atom (or default-checked? false))]
|
||||
; @(reagent/track
|
||||
; (fn [{:keys [on-change disabled? blurred-background? container-style]}]
|
||||
; [rn/touchable-without-feedback
|
||||
; {:on-press (handle-press disabled? on-change checked?)}
|
||||
; [rn/view
|
||||
; {:style (merge
|
||||
; container-style
|
||||
; {:height 20
|
||||
; :width 20})}
|
||||
; [rn/view
|
||||
; {:style (style/checkbox-toggle checked? disabled? blurred-background?)
|
||||
; :accessibility-label (str "checkbox-" (if @checked? "on" "off"))
|
||||
; :accessibility-role :checkbox
|
||||
; :testID "checkbox-component"}
|
||||
; (when @checked?
|
||||
; [rn/view
|
||||
; {:style
|
||||
; {:height 20
|
||||
; :width 20}}
|
||||
; [icons/icon :i/check-small
|
||||
; {:size 20
|
||||
; :color colors/white}]])]]])
|
||||
; checked?)))
|
||||
|
||||
(defn radio
|
||||
[{:keys [default-checked?]}]
|
||||
(let [checked? (reagent/atom (or default-checked? false))]
|
||||
@@ -151,9 +121,7 @@
|
||||
:width 20
|
||||
:border-radius 20
|
||||
:border-width 1
|
||||
:border-color (style/get-color @checked?
|
||||
disabled?
|
||||
blurred-background?)
|
||||
:border-color (get-color @checked? disabled? blurred-background?)
|
||||
:background-color (when-not blurred-background?
|
||||
(colors/theme-colors colors/white
|
||||
(colors/alpha colors/neutral-80
|
||||
@@ -167,7 +135,7 @@
|
||||
{:margin-left :auto
|
||||
:height 14
|
||||
:width 14
|
||||
:background-color (when @checked? (style/get-color @checked? disabled? blurred-background?))
|
||||
:background-color (when @checked? (get-color @checked? disabled? blurred-background?))
|
||||
:border-radius 20
|
||||
:margin-right :auto
|
||||
:margin-top :auto
|
||||
@@ -185,9 +153,7 @@
|
||||
{:height 20
|
||||
:width 30
|
||||
:border-radius 20
|
||||
:background-color (style/get-color @checked?
|
||||
disabled?
|
||||
blurred-background?)})
|
||||
:background-color (get-color @checked? disabled? blurred-background?)})
|
||||
:accessibility-label (str "toggle-" (if @checked? "on" "off"))
|
||||
:accessibility-role :checkbox
|
||||
:testID "toggle-component"}
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
(ns quo2.components.selectors.styles
|
||||
(:require [quo2.foundations.colors :as colors]))
|
||||
|
||||
(defn get-color
|
||||
[checked? disabled? blurred-background?]
|
||||
(cond
|
||||
checked?
|
||||
(colors/custom-color-by-theme
|
||||
:primary
|
||||
50
|
||||
60
|
||||
(when disabled? 30)
|
||||
(when disabled? 30))
|
||||
blurred-background?
|
||||
(colors/theme-colors
|
||||
(colors/alpha colors/neutral-80 (if disabled? 0.05 0.1))
|
||||
(colors/alpha colors/white (if disabled? 0.05 0.1)))
|
||||
:else
|
||||
(colors/theme-colors
|
||||
(colors/alpha colors/neutral-20 (if disabled? 0.4 1))
|
||||
(colors/alpha colors/neutral-70 (if disabled? 0.3 1)))))
|
||||
|
||||
(defn checkbox-toggle
|
||||
[checked? disabled? blurred-background?]
|
||||
{:flex 1
|
||||
:border-radius 6
|
||||
:border-width (if @checked? 0 1)
|
||||
:background-color (cond
|
||||
@checked?
|
||||
(get-color @checked? disabled? blurred-background?)
|
||||
blurred-background?
|
||||
(colors/theme-colors
|
||||
colors/white-opa-5
|
||||
colors/white-opa-10)
|
||||
:else
|
||||
(colors/theme-colors
|
||||
colors/white
|
||||
colors/neutral-80-opa-40))
|
||||
:border-color (if @checked?
|
||||
:none
|
||||
(get-color @checked? disabled? blurred-background?))})
|
||||
@@ -1,71 +0,0 @@
|
||||
(ns quo2.components.settings.accounts.style
|
||||
(:require [quo2.foundations.colors :as colors]))
|
||||
|
||||
(def card
|
||||
{:position :relative
|
||||
:padding 8
|
||||
:border-radius 16
|
||||
:height 160
|
||||
:width 160})
|
||||
|
||||
(defn background-top
|
||||
[custom-color]
|
||||
{:position :absolute
|
||||
:top 0
|
||||
:border-top-left-radius 16
|
||||
:border-top-right-radius 16
|
||||
:width 160
|
||||
:height 64
|
||||
:background-color (-> colors/customization
|
||||
(get-in [custom-color 50])
|
||||
(colors/alpha 0.2))})
|
||||
|
||||
(defn background-bottom
|
||||
[]
|
||||
{:position :absolute
|
||||
:top 40
|
||||
:border-radius 16
|
||||
:width 160
|
||||
:height 120
|
||||
:background-color (colors/theme-colors
|
||||
colors/white
|
||||
colors/neutral-90)})
|
||||
|
||||
(defn avatar-border
|
||||
[]
|
||||
{:margin 2
|
||||
:justify-content :center
|
||||
:align-items :center
|
||||
:width 52
|
||||
:height 52
|
||||
:border-radius 14
|
||||
:border-width 2
|
||||
:border-color (colors/theme-colors
|
||||
colors/white
|
||||
colors/neutral-90)})
|
||||
|
||||
(def menu-button-container
|
||||
{:justify-content :center
|
||||
:align-items :center
|
||||
:align-self :flex-start})
|
||||
(defn menu-button-color
|
||||
[]
|
||||
{:background-color (colors/theme-colors
|
||||
colors/white-opa-40
|
||||
colors/neutral-80-opa-40)})
|
||||
|
||||
(defn address-text
|
||||
[]
|
||||
{:color (colors/theme-colors
|
||||
colors/neutral-50
|
||||
colors/neutral-40)})
|
||||
|
||||
(def card-top
|
||||
{:flex-direction :row
|
||||
:align-items :center
|
||||
:justify-content :space-between})
|
||||
|
||||
(def card-bottom
|
||||
{:flex 1
|
||||
:margin-horizontal 4
|
||||
:margin-top 4})
|
||||
@@ -1,46 +0,0 @@
|
||||
(ns quo2.components.settings.accounts.view
|
||||
(:require [quo2.components.avatars.account-avatar :as account-avatar]
|
||||
[quo2.components.buttons.button :as button]
|
||||
[quo2.components.markdown.text :as text]
|
||||
[quo2.components.settings.accounts.style :as style]
|
||||
[react-native.core :as rn]))
|
||||
|
||||
(defn card-background
|
||||
[{:keys [custom-color]}]
|
||||
[:<>
|
||||
[rn/view {:style (style/background-top custom-color)}]
|
||||
[rn/view {:style (style/background-bottom)}]])
|
||||
|
||||
(defn avatar
|
||||
[avatar-props]
|
||||
[rn/view {:style (style/avatar-border)}
|
||||
[account-avatar/account-avatar (assoc avatar-props :size 48)]])
|
||||
|
||||
(defn menu-button
|
||||
[{:keys [on-press]}]
|
||||
[rn/view {:style style/menu-button-container}
|
||||
[button/button
|
||||
{:style (style/menu-button-color)
|
||||
:type :gray
|
||||
:icon true
|
||||
:size 24
|
||||
:on-press on-press}
|
||||
:i/more]])
|
||||
|
||||
(defn account
|
||||
[{:keys [account-name account-address avatar-icon custom-color on-press-menu]}]
|
||||
[rn/view {:style style/card}
|
||||
[card-background {:custom-color custom-color}]
|
||||
[rn/view {:style style/card-top}
|
||||
[avatar
|
||||
{:color custom-color
|
||||
:icon avatar-icon}]
|
||||
[menu-button {:on-press on-press-menu}]]
|
||||
[rn/view {:style style/card-bottom}
|
||||
[text/text {:size :paragraph-1 :weight :semi-bold}
|
||||
account-name]
|
||||
[text/text
|
||||
{:style (style/address-text)
|
||||
:size :paragraph-2
|
||||
:weight :medium}
|
||||
account-address]]])
|
||||
@@ -6,6 +6,12 @@
|
||||
[quo2.theme :as quo2.theme]
|
||||
[react-native.core :as rn]))
|
||||
|
||||
(defn padding-left-for-type
|
||||
[type]
|
||||
(case type
|
||||
:group-avatar 3
|
||||
8))
|
||||
|
||||
(defn trim-public-key
|
||||
[pk]
|
||||
(str (subs pk 0 6) "..." (subs pk (- (count pk) 3))))
|
||||
@@ -24,7 +30,7 @@
|
||||
:padding-left 8
|
||||
:background-color (if (= theme :light)
|
||||
colors/neutral-10
|
||||
colors/neutral-90)}
|
||||
colors/neutral-80)}
|
||||
style)]
|
||||
children))))
|
||||
|
||||
@@ -34,8 +40,7 @@
|
||||
[base-tag
|
||||
(-> opts
|
||||
(select-keys [:override-theme :style])
|
||||
(assoc-in [:style :padding-left] 3)
|
||||
(assoc-in [:style :padding-vertical] 2))
|
||||
(assoc-in [:style :padding-left] 3))
|
||||
[group-avatar/group-avatar opts]
|
||||
[text/text
|
||||
{:weight :medium
|
||||
@@ -64,7 +69,7 @@
|
||||
[rn/image
|
||||
{:style {:width 20
|
||||
:border-radius 10
|
||||
:background-color :red
|
||||
:background-color :white
|
||||
:height 20}
|
||||
:source photo}]
|
||||
[rn/view
|
||||
@@ -83,44 +88,3 @@
|
||||
[]
|
||||
(fn [params username photo]
|
||||
[context-tag params {:uri photo} username]))
|
||||
|
||||
(defn audio-tag
|
||||
[duration params]
|
||||
[base-tag
|
||||
(merge
|
||||
{:style {:padding-left 2
|
||||
:padding-vertical 2}}
|
||||
params)
|
||||
[rn/view
|
||||
{:width 20
|
||||
:height 20
|
||||
:border-radius 10
|
||||
:align-items :center
|
||||
:justify-content :center
|
||||
:background-color colors/primary-50}
|
||||
[icons/icon
|
||||
:i/play
|
||||
{:color colors/white
|
||||
:size 12}]]
|
||||
[text/text
|
||||
{:weight :medium
|
||||
:size :paragraph-2
|
||||
:style {:margin-left 4
|
||||
:color (colors/theme-colors
|
||||
colors/neutral-100
|
||||
colors/white
|
||||
(:override-theme params))}}
|
||||
duration]])
|
||||
|
||||
(defn community-tag
|
||||
[avatar community-name params]
|
||||
[context-tag
|
||||
(merge
|
||||
{:style {:padding-vertical 2}
|
||||
:text-style {:margin-left 2
|
||||
:color (colors/theme-colors
|
||||
colors/neutral-100
|
||||
colors/white
|
||||
(:override-theme params))}}
|
||||
params)
|
||||
avatar community-name])
|
||||
|
||||
@@ -46,13 +46,11 @@
|
||||
quo2.components.selectors.filter.view
|
||||
quo2.components.selectors.selectors
|
||||
quo2.components.separator
|
||||
quo2.components.settings.accounts.view
|
||||
quo2.components.settings.privacy-option
|
||||
quo2.components.tabs.account-selector
|
||||
quo2.components.tabs.tabs
|
||||
quo2.components.tags.context-tags
|
||||
quo2.components.tags.status-tags
|
||||
quo2.components.profile.profile-card.view
|
||||
quo2.components.tags.tags))
|
||||
|
||||
(def toast quo2.components.notifications.toast/toast)
|
||||
@@ -75,8 +73,6 @@
|
||||
(def user-avatar-tag quo2.components.tags.context-tags/user-avatar-tag)
|
||||
(def context-tag quo2.components.tags.context-tags/context-tag)
|
||||
(def group-avatar-tag quo2.components.tags.context-tags/group-avatar-tag)
|
||||
(def audio-tag quo2.components.tags.context-tags/audio-tag)
|
||||
(def community-tag quo2.components.tags.context-tags/community-tag)
|
||||
(def tabs quo2.components.tabs.tabs/tabs)
|
||||
(def scrollable-tabs quo2.components.tabs.tabs/scrollable-tabs)
|
||||
(def account-selector quo2.components.tabs.account-selector/account-selector)
|
||||
@@ -130,9 +126,5 @@
|
||||
(def notification-dot quo2.components.notifications.notification-dot/notification-dot)
|
||||
(def count-down-circle quo2.components.notifications.count-down-circle/circle-timer)
|
||||
|
||||
;;;; PROFILE
|
||||
(def profile-card quo2.components.profile.profile-card.view/profile-card)
|
||||
|
||||
;;;; SETTINGS
|
||||
(def privacy-option quo2.components.settings.privacy-option/card)
|
||||
(def account quo2.components.settings.accounts.view/account)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
[status-im.ethereum.core :as ethereum]
|
||||
[status-im.ethereum.ens :as ens]
|
||||
[status-im.ethereum.stateofus :as stateofus]
|
||||
[i18n.i18n :as i18n]
|
||||
[status-im.i18n.i18n :as i18n]
|
||||
[status-im.router.core :as router]
|
||||
[status-im.utils.db :as utils.db]
|
||||
[utils.re-frame :as rf]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
(ns status-im.bootnodes.core
|
||||
(:require [clojure.string :as string]
|
||||
[re-frame.core :as re-frame]
|
||||
[i18n.i18n :as i18n]
|
||||
[status-im.i18n.i18n :as i18n]
|
||||
[status-im.multiaccounts.update.core :as multiaccounts.update]
|
||||
[utils.re-frame :as rf]
|
||||
[status-im2.navigation.events :as navigation]))
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
[status-im.constants :as constants]
|
||||
[status-im.ethereum.core :as ethereum]
|
||||
[status-im.ethereum.ens :as ens]
|
||||
[i18n.i18n :as i18n]
|
||||
[status-im.i18n.i18n :as i18n]
|
||||
[status-im.multiaccounts.update.core :as multiaccounts.update]
|
||||
[status-im.native-module.core :as status]
|
||||
[status-im.signing.core :as signing]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
(ns status-im.browser.permissions
|
||||
(:require [status-im.constants :as constants]
|
||||
[i18n.i18n :as i18n]
|
||||
[status-im.i18n.i18n :as i18n]
|
||||
[status-im.qr-scanner.core :as qr-scanner]
|
||||
[utils.re-frame :as rf]
|
||||
[status-im2.navigation.events :as navigation]))
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
[status-im.constants :as constants]
|
||||
[status-im.data-store.chats :as chats-store]
|
||||
[status-im.data-store.contacts :as contacts-store]
|
||||
[i18n.i18n :as i18n]
|
||||
[status-im.i18n.i18n :as i18n]
|
||||
[status-im.mailserver.core :as mailserver]
|
||||
[status-im.multiaccounts.model :as multiaccounts.model]
|
||||
[status-im.ui.screens.chat.state :as chat.state]
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
[clojure.string :as string]
|
||||
[re-frame.core :as re-frame]
|
||||
[status-im.chat.models :as chat]
|
||||
[i18n.i18n :as i18n]
|
||||
[status-im.i18n.i18n :as i18n]
|
||||
[status-im.ui.components.permissions :as permissions]
|
||||
[status-im.ui.components.react :as react]
|
||||
[status-im.utils.config :as config]
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
[status-im.chat.models.message :as chat.message]
|
||||
[status-im.chat.models.message-content :as message-content]
|
||||
[status-im.constants :as constants]
|
||||
[status-im.i18n.i18n :as i18n]
|
||||
[status-im.utils.datetime :as datetime]
|
||||
[utils.re-frame :as rf]
|
||||
[i18n.i18n :as i18n]
|
||||
[utils.datetime :as datetime]
|
||||
[status-im.utils.utils :as utils]
|
||||
[taoensso.timbre :as log]))
|
||||
|
||||
@@ -49,9 +49,10 @@
|
||||
cursor (+ at-sign-idx (count name) 2)]
|
||||
(rf/merge
|
||||
cofx
|
||||
{:db (-> db
|
||||
(assoc-in [:chats/cursor chat-id] cursor)
|
||||
(assoc-in [:chats/mention-suggestions chat-id] nil))}
|
||||
{:db (-> db
|
||||
(assoc-in [:chats/cursor chat-id] cursor)
|
||||
(assoc-in [:chats/mention-suggestions chat-id] nil))
|
||||
:set-text-input-value [chat-id new-text text-input-ref]}
|
||||
(set-chat-input-text new-text chat-id)
|
||||
;; NOTE(rasom): Some keyboards do not react on selection property passed to
|
||||
;; text input (specifically Samsung keyboard with predictive text set on).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
(:require [cljs.test :refer-macros [deftest is testing]]
|
||||
[status-im.chat.constants :as constants]
|
||||
[status-im.chat.models.input :as input]
|
||||
[utils.datetime :as datetime]))
|
||||
[status-im.utils.datetime :as datetime]))
|
||||
|
||||
(deftest text->emoji
|
||||
(is (nil? (input/text->emoji nil)))
|
||||
|
||||
@@ -101,11 +101,6 @@
|
||||
:on-success #(re-frame/dispatch
|
||||
[::mark-all-read-in-community-successful %])}]}))
|
||||
|
||||
;; For example, when a user receives a list of 4 image messages while inside the chat screen we
|
||||
;; shouldn't group the images into albums. When the user exists the chat screen then enters the
|
||||
;; chat screen again, we now need to group the images into albums (like WhatsApp). The albumize?
|
||||
;; boolean is used to know whether we need to group these images into albums now or not. The
|
||||
;; album-id can't be used for this because it will always be there.
|
||||
(defn mark-album
|
||||
[message]
|
||||
(if (:album-id message)
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
(ns status-im.chat.models.message-list
|
||||
(:require ["functional-red-black-tree" :as rb-tree]
|
||||
[status-im.constants :as constants]
|
||||
[utils.re-frame :as rf]
|
||||
[utils.datetime :as datetime]))
|
||||
[status-im.utils.datetime :as time]
|
||||
[utils.re-frame :as rf]))
|
||||
|
||||
(defn- add-datemark
|
||||
[{:keys [whisper-timestamp] :as msg}]
|
||||
;;TODO this is slow
|
||||
(assoc msg :datemark (datetime/day-relative whisper-timestamp)))
|
||||
(assoc msg :datemark (time/day-relative whisper-timestamp)))
|
||||
|
||||
(defn- add-timestamp
|
||||
[{:keys [whisper-timestamp] :as msg}]
|
||||
(assoc msg :timestamp-str (datetime/timestamp->time whisper-timestamp)))
|
||||
(assoc msg :timestamp-str (time/timestamp->time whisper-timestamp)))
|
||||
|
||||
(defn prepare-message
|
||||
[{:keys [message-id
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
(ns status-im.communities.core
|
||||
(:require [clojure.set :as set]
|
||||
(:require [clojure.set :as clojure.set]
|
||||
[clojure.string :as string]
|
||||
[clojure.walk :as walk]
|
||||
[quo.design-system.colors :as colors]
|
||||
@@ -28,10 +28,10 @@
|
||||
|
||||
(defn <-request-to-join-community-rpc
|
||||
[r]
|
||||
(set/rename-keys r
|
||||
{:communityId :community-id
|
||||
:publicKey :public-key
|
||||
:chatId :chat-id}))
|
||||
(clojure.set/rename-keys r
|
||||
{:communityId :community-id
|
||||
:publicKey :public-key
|
||||
:chatId :chat-id}))
|
||||
|
||||
(defn <-requests-to-join-community-rpc
|
||||
[requests]
|
||||
@@ -64,12 +64,12 @@
|
||||
(defn <-rpc
|
||||
[c]
|
||||
(-> c
|
||||
(set/rename-keys {:canRequestAccess :can-request-access?
|
||||
:canManageUsers :can-manage-users?
|
||||
:canDeleteMessageForEveryone :can-delete-message-for-everyone?
|
||||
:canJoin :can-join?
|
||||
:requestedToJoinAt :requested-to-join-at
|
||||
:isMember :is-member?})
|
||||
(clojure.set/rename-keys {:canRequestAccess :can-request-access?
|
||||
:canManageUsers :can-manage-users?
|
||||
:canDeleteMessageForEveryone :can-delete-message-for-everyone?
|
||||
:canJoin :can-join?
|
||||
:requestedToJoinAt :requested-to-join-at
|
||||
:isMember :is-member?})
|
||||
(update :members walk/stringify-keys)
|
||||
(update :chats <-chats-rpc)
|
||||
(update :categories <-categories-rpc)))
|
||||
|
||||
@@ -205,26 +205,9 @@
|
||||
(def ^:const community-member-role-manage-users 2)
|
||||
(def ^:const community-member-role-moderator 3)
|
||||
|
||||
(def ^:const local-pairing-connection-string-identifier
|
||||
(def local-pairing-connection-string-identifier
|
||||
"If any string begins with cs we know its a connection string.
|
||||
This is useful when we read QR codes we know it is a connection string if it begins with this identifier.
|
||||
An example of a connection string is -> cs2:5vd6J6:Jfc:27xMmHKEYwzRGXcvTtuiLZFfXscMx4Mz8d9wEHUxDj4p7:EG7Z13QScfWBJNJ5cprszzDQ5fBVsYMirXo8MaQFJvpF:3 "
|
||||
"cs")
|
||||
|
||||
(def ^:const serialization-key
|
||||
"We pass this serialization key as a parameter to MultiformatSerializePublicKey
|
||||
function at status-go, This key determines the output base of the serialization.
|
||||
according to https://specs.status.im/spec/2#public-key-serialization we serialize
|
||||
keys with base58btc encoding"
|
||||
"z")
|
||||
|
||||
(def ^:const deserialization-key
|
||||
"We pass this deserialization key as a parameter to MultiformatDeserializePublicKey
|
||||
function at status-go, This key determines the output base of the deserialization.
|
||||
according to https://specs.status.im/spec/2#public-key-serialization we deserialize
|
||||
keys with base16 hexadecimal encoding"
|
||||
"f")
|
||||
|
||||
(def ^:const multi-code-prefix
|
||||
"We prefix our keys with 0xe701 prior to serialisation them"
|
||||
"0xe701")
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
(ns status-im.contact.db
|
||||
(:require [clojure.set :as set]
|
||||
(:require [clojure.set :as clojure.set]
|
||||
[clojure.string :as string]
|
||||
[status-im.constants :as constants]
|
||||
[status-im.ethereum.core :as ethereum]
|
||||
@@ -68,8 +68,8 @@
|
||||
(let [current-contact (some->
|
||||
current-account
|
||||
(select-keys [:name :preferred-name :public-key :identicon :images])
|
||||
(set/rename-keys {:name :alias
|
||||
:preferred-name :name}))
|
||||
(clojure.set/rename-keys {:name :alias
|
||||
:preferred-name :name}))
|
||||
all-contacts (cond-> contacts
|
||||
current-contact
|
||||
(assoc public-key current-contact))]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
(ns status-im.data-store.chats
|
||||
(:require [clojure.set :as set]
|
||||
(:require [clojure.set :as clojure.set]
|
||||
[status-im.constants :as constants]
|
||||
[status-im.data-store.messages :as messages]
|
||||
[utils.re-frame :as rf]
|
||||
@@ -58,19 +58,19 @@
|
||||
(defn <-rpc
|
||||
[chat]
|
||||
(-> chat
|
||||
(set/rename-keys {:id :chat-id
|
||||
:communityId :community-id
|
||||
:syncedFrom :synced-from
|
||||
:syncedTo :synced-to
|
||||
:membershipUpdateEvents :membership-update-events
|
||||
:deletedAtClockValue :deleted-at-clock-value
|
||||
:chatType :chat-type
|
||||
:unviewedMessagesCount :unviewed-messages-count
|
||||
:unviewedMentionsCount :unviewed-mentions-count
|
||||
:lastMessage :last-message
|
||||
:lastClockValue :last-clock-value
|
||||
:invitationAdmin :invitation-admin
|
||||
:profile :profile-public-key})
|
||||
(clojure.set/rename-keys {:id :chat-id
|
||||
:communityId :community-id
|
||||
:syncedFrom :synced-from
|
||||
:syncedTo :synced-to
|
||||
:membershipUpdateEvents :membership-update-events
|
||||
:deletedAtClockValue :deleted-at-clock-value
|
||||
:chatType :chat-type
|
||||
:unviewedMessagesCount :unviewed-messages-count
|
||||
:unviewedMentionsCount :unviewed-mentions-count
|
||||
:lastMessage :last-message
|
||||
:lastClockValue :last-clock-value
|
||||
:invitationAdmin :invitation-admin
|
||||
:profile :profile-public-key})
|
||||
rpc->type
|
||||
unmarshal-members
|
||||
(update :last-message #(when % (messages/<-rpc %)))
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
(ns status-im.data-store.contacts
|
||||
(:require [clojure.set :as set]
|
||||
(:require [clojure.set :as clojure.set]
|
||||
[utils.re-frame :as rf]
|
||||
[taoensso.timbre :as log]))
|
||||
|
||||
(defn <-rpc
|
||||
[contact]
|
||||
(-> contact
|
||||
(set/rename-keys
|
||||
(clojure.set/rename-keys
|
||||
{:id :public-key
|
||||
:ensVerifiedAt :ens-verified-at
|
||||
:displayName :display-name
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
(ns status-im.data-store.messages
|
||||
(:require [clojure.set :as set]
|
||||
(:require [clojure.set :as clojure.set]
|
||||
[utils.re-frame :as rf]
|
||||
[taoensso.timbre :as log]))
|
||||
|
||||
@@ -10,40 +10,40 @@
|
||||
(assoc :text (:text content)
|
||||
:sticker (:sticker content))
|
||||
:always
|
||||
(set/rename-keys {:chat-id :chat_id
|
||||
:whisper-timestamp :whisperTimestamp
|
||||
:community-id :communityId
|
||||
:clock-value :clock})))
|
||||
(clojure.set/rename-keys {:chat-id :chat_id
|
||||
:whisper-timestamp :whisperTimestamp
|
||||
:community-id :communityId
|
||||
:clock-value :clock})))
|
||||
|
||||
(defn <-rpc
|
||||
[message]
|
||||
(-> message
|
||||
(set/rename-keys {:id :message-id
|
||||
:whisperTimestamp :whisper-timestamp
|
||||
:editedAt :edited-at
|
||||
:contactVerificationState :contact-verification-state
|
||||
:contactRequestState :contact-request-state
|
||||
:commandParameters :command-parameters
|
||||
:gapParameters :gap-parameters
|
||||
:messageType :message-type
|
||||
:localChatId :chat-id
|
||||
:communityId :community-id
|
||||
:contentType :content-type
|
||||
:clock :clock-value
|
||||
:quotedMessage :quoted-message
|
||||
:outgoingStatus :outgoing-status
|
||||
:audioDurationMs :audio-duration-ms
|
||||
:deleted :deleted?
|
||||
:deletedForMe :deleted-for-me?
|
||||
:albumId :album-id
|
||||
:new :new?})
|
||||
(clojure.set/rename-keys {:id :message-id
|
||||
:whisperTimestamp :whisper-timestamp
|
||||
:editedAt :edited-at
|
||||
:contactVerificationState :contact-verification-state
|
||||
:contactRequestState :contact-request-state
|
||||
:commandParameters :command-parameters
|
||||
:gapParameters :gap-parameters
|
||||
:messageType :message-type
|
||||
:localChatId :chat-id
|
||||
:communityId :community-id
|
||||
:contentType :content-type
|
||||
:clock :clock-value
|
||||
:quotedMessage :quoted-message
|
||||
:outgoingStatus :outgoing-status
|
||||
:audioDurationMs :audio-duration-ms
|
||||
:deleted :deleted?
|
||||
:deletedForMe :deleted-for-me?
|
||||
:albumId :album-id
|
||||
:new :new?})
|
||||
|
||||
(update :quoted-message
|
||||
set/rename-keys
|
||||
clojure.set/rename-keys
|
||||
{:parsedText :parsed-text :communityId :community-id})
|
||||
(update :outgoing-status keyword)
|
||||
(update :command-parameters
|
||||
set/rename-keys
|
||||
clojure.set/rename-keys
|
||||
{:transactionHash :transaction-hash
|
||||
:commandState :command-state})
|
||||
(assoc :content {:chat-id (:chatId message)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
(ns status-im.data-store.pin-messages
|
||||
(:require [clojure.set :as set]
|
||||
(:require [clojure.set :as clojure.set]
|
||||
[status-im.data-store.messages :as messages]
|
||||
[utils.re-frame :as rf]
|
||||
[taoensso.timbre :as log]))
|
||||
@@ -8,8 +8,8 @@
|
||||
[message]
|
||||
(-> message
|
||||
(merge (messages/<-rpc (message :message)))
|
||||
(set/rename-keys {:pinnedAt :pinned-at
|
||||
:pinnedBy :pinned-by})
|
||||
(clojure.set/rename-keys {:pinnedAt :pinned-at
|
||||
:pinnedBy :pinned-by})
|
||||
(dissoc :message)))
|
||||
|
||||
(defn pinned-message-by-chat-id-rpc
|
||||
@@ -21,9 +21,9 @@
|
||||
{:json-rpc/call [{:method "wakuext_chatPinnedMessages"
|
||||
:params [chat-id cursor limit]
|
||||
:on-success (fn [result]
|
||||
(let [result (set/rename-keys result
|
||||
{:pinnedMessages
|
||||
:pinned-messages})]
|
||||
(let [result (clojure.set/rename-keys result
|
||||
{:pinnedMessages
|
||||
:pinned-messages})]
|
||||
(on-success (update result :pinned-messages #(map <-rpc %)))))
|
||||
:on-error on-error}]})
|
||||
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
(ns status-im.data-store.reactions
|
||||
(:require [clojure.set :as set]))
|
||||
(:require [clojure.set :as clojure.set]))
|
||||
|
||||
(defn ->rpc
|
||||
[message]
|
||||
(-> message
|
||||
(set/rename-keys {:message-id :messageId
|
||||
:emoji-id :emojiId
|
||||
:chat-id :localChatId
|
||||
:message-type :messageType
|
||||
:emoji-reaction-id :id})))
|
||||
(clojure.set/rename-keys {:message-id :messageId
|
||||
:emoji-id :emojiId
|
||||
:chat-id :localChatId
|
||||
:message-type :messageType
|
||||
:emoji-reaction-id :id})))
|
||||
|
||||
(defn <-rpc
|
||||
[message]
|
||||
(-> message
|
||||
(dissoc :chat_id)
|
||||
(set/rename-keys {:messageId :message-id
|
||||
:localChatId :chat-id
|
||||
:emojiId :emoji-id
|
||||
:messageType :message-type
|
||||
:id :emoji-reaction-id})))
|
||||
(clojure.set/rename-keys {:messageId :message-id
|
||||
:localChatId :chat-id
|
||||
:emojiId :emoji-id
|
||||
:messageType :message-type
|
||||
:id :emoji-reaction-id})))
|
||||
|
||||
(defn reactions-by-chat-id-rpc
|
||||
[chat-id
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
(ns status-im.data-store.switcher-cards
|
||||
(:require [clojure.set :as set]
|
||||
[clojure.walk :as walk]
|
||||
[utils.re-frame :as rf]
|
||||
[taoensso.timbre :as log]))
|
||||
|
||||
(defn <-rpc
|
||||
[switcher-cards]
|
||||
(walk/postwalk-replace
|
||||
{:cardId :card-id
|
||||
:screenId :screen-id}
|
||||
switcher-cards))
|
||||
|
||||
(defn rpc->
|
||||
[switcher-card]
|
||||
(set/rename-keys switcher-card
|
||||
{:card-id :cardId
|
||||
:screen-id :screenId}))
|
||||
|
||||
(rf/defn upsert-switcher-card-rpc
|
||||
[_ switcher-card]
|
||||
{:json-rpc/call [{:method "wakuext_upsertSwitcherCard"
|
||||
:params [(rpc-> switcher-card)]
|
||||
:on-success #()
|
||||
:on-error #()}]})
|
||||
|
||||
(rf/defn delete-switcher-card-rpc
|
||||
[_ card-id]
|
||||
{:json-rpc/call [{:method "wakuext_deleteSwitcherCard"
|
||||
:params [card-id]
|
||||
:on-success #()
|
||||
:on-error #()}]})
|
||||
|
||||
(rf/defn fetch-switcher-cards-rpc
|
||||
[_]
|
||||
{:json-rpc/call [{:method "wakuext_switcherCards"
|
||||
:params []
|
||||
:on-success #(rf/dispatch
|
||||
[:shell/switcher-cards-loaded
|
||||
(:switcherCards ^js %)])
|
||||
:on-error #(log/error "Failed to fetch switcher cards" %)}]})
|
||||
@@ -1,18 +1,18 @@
|
||||
(ns status-im.data-store.visibility-status-updates
|
||||
(:require [clojure.set :as set]
|
||||
(:require [clojure.set :as clojure.set]
|
||||
[re-frame.core :as re-frame]
|
||||
[utils.re-frame :as rf]
|
||||
[taoensso.timbre :as log]))
|
||||
|
||||
(defn <-rpc
|
||||
[visibility-status-update]
|
||||
(set/rename-keys visibility-status-update
|
||||
{:publicKey :public-key
|
||||
:statusType :status-type}))
|
||||
(clojure.set/rename-keys visibility-status-update
|
||||
{:publicKey :public-key
|
||||
:statusType :status-type}))
|
||||
(defn <-rpc-settings
|
||||
[settings]
|
||||
(-> settings
|
||||
(set/rename-keys
|
||||
(clojure.set/rename-keys
|
||||
{:current-user-status :current-user-visibility-status})
|
||||
(update :current-user-visibility-status <-rpc)))
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
[status-im.ethereum.ens :as ens]
|
||||
[status-im.ethereum.stateofus :as stateofus]
|
||||
[status-im.multiaccounts.update.core :as multiaccounts.update]
|
||||
[status-im.utils.datetime :as datetime]
|
||||
[utils.re-frame :as rf]
|
||||
[utils.datetime :as datetime]
|
||||
[status-im.utils.random :as random]
|
||||
[status-im2.navigation.events :as navigation]))
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
status-im.ethereum.subscriptions
|
||||
status-im.fleet.core
|
||||
status-im.http.core
|
||||
[i18n.i18n :as i18n]
|
||||
[status-im.i18n.i18n :as i18n]
|
||||
[status-im.keycard.core :as keycard]
|
||||
status-im.log-level.core
|
||||
status-im.mailserver.constants
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
(ns status-im.fleet.core
|
||||
(:require [re-frame.core :as re-frame]
|
||||
[status-im.constants :as constants]
|
||||
[i18n.i18n :as i18n]
|
||||
[status-im.i18n.i18n :as i18n]
|
||||
[status-im.multiaccounts.update.core :as multiaccounts.update]
|
||||
[status-im.node.core :as node]
|
||||
[status-im.utils.config :as config]
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
[re-frame.core :as re-frame]
|
||||
[status-im.chat.models :as models.chat]
|
||||
[status-im.constants :as constants]
|
||||
[status-im.i18n.i18n :as i18n]
|
||||
[utils.re-frame :as rf]
|
||||
[i18n.i18n :as i18n]
|
||||
[status-im2.contexts.activity-center.events :as activity-center]
|
||||
[status-im2.navigation.events :as navigation]))
|
||||
|
||||
@@ -39,16 +39,7 @@
|
||||
{:json-rpc/call [{:method "wakuext_removeMemberFromGroupChat"
|
||||
:params [nil chat-id member]
|
||||
:js-response true
|
||||
:on-success #(re-frame/dispatch [:chat-updated % true])}]})
|
||||
|
||||
(rf/defn remove-members
|
||||
{:events [:group-chats.ui/remove-members-pressed]}
|
||||
[{{:keys [current-chat-id] :group-chat/keys [deselected-members]} :db :as cofx}]
|
||||
{:json-rpc/call [{:method "wakuext_removeMembersFromGroupChat"
|
||||
:params [nil current-chat-id deselected-members]
|
||||
:js-response true
|
||||
:on-success #(re-frame/dispatch [:chat-updated % true])
|
||||
:on-error #()}]})
|
||||
:on-success #(re-frame/dispatch [:chat-updated % do-not-navigate?])}]})
|
||||
|
||||
(rf/defn join-chat
|
||||
{:events [:group-chats.ui/join-pressed]}
|
||||
@@ -88,11 +79,11 @@
|
||||
(rf/defn add-members
|
||||
"Add members to a group chat"
|
||||
{:events [:group-chats.ui/add-members-pressed]}
|
||||
[{{:keys [current-chat-id] :group-chat/keys [selected-participants]} :db :as cofx}]
|
||||
[{{:keys [current-chat-id selected-participants]} :db :as cofx}]
|
||||
{:json-rpc/call [{:method "wakuext_addMembersToGroupChat"
|
||||
:params [nil current-chat-id selected-participants]
|
||||
:js-response true
|
||||
:on-success #(re-frame/dispatch [:chat-updated % true])}]})
|
||||
:on-success #(re-frame/dispatch [:chat-updated %])}]})
|
||||
|
||||
(rf/defn add-members-from-invitation
|
||||
"Add members to a group chat"
|
||||
@@ -188,16 +179,6 @@
|
||||
:type
|
||||
(= constants/invitation-state-removed)))
|
||||
|
||||
(rf/defn deselect-member
|
||||
{:events [:deselect-member]}
|
||||
[{:keys [db]} id]
|
||||
{:db (update db :group-chat/deselected-members conj id)})
|
||||
|
||||
(rf/defn undo-deselect-member
|
||||
{:events [:undo-deselect-member]}
|
||||
[{:keys [db]} id]
|
||||
{:db (update db :group-chat/deselected-members disj id)})
|
||||
|
||||
(rf/defn deselect-contact
|
||||
{:events [:deselect-contact]}
|
||||
[{:keys [db]} id]
|
||||
@@ -211,22 +192,17 @@
|
||||
(rf/defn deselect-participant
|
||||
{:events [:deselect-participant]}
|
||||
[{:keys [db]} id]
|
||||
{:db (update db :group-chat/selected-participants disj id)})
|
||||
{:db (update db :selected-participants disj id)})
|
||||
|
||||
(rf/defn select-participant
|
||||
{:events [:select-participant]}
|
||||
[{:keys [db]} id]
|
||||
{:db (update db :group-chat/selected-participants conj id)})
|
||||
{:db (update db :selected-participants conj id)})
|
||||
|
||||
(rf/defn clear-added-participants
|
||||
{:events [:group/clear-added-participants]}
|
||||
(rf/defn add-participants-toggle-list
|
||||
{:events [:group/add-participants-toggle-list]}
|
||||
[{db :db}]
|
||||
{:db (assoc db :group-chat/selected-participants #{})})
|
||||
|
||||
(rf/defn clear-removed-members
|
||||
{:events [:group/clear-removed-members]}
|
||||
[{db :db}]
|
||||
{:db (assoc db :group-chat/deselected-members #{})})
|
||||
{:db (assoc db :selected-participants #{})})
|
||||
|
||||
(rf/defn show-group-chat-profile
|
||||
{:events [:show-group-chat-profile]}
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
(ns status-im.i18n.i18n
|
||||
(:require ["i18n-js" :as i18n]
|
||||
[clojure.string :as string]
|
||||
[status-im.goog.i18n :as goog.i18n]
|
||||
[status-im.i18n.i18n-resources :as i18n-resources]))
|
||||
;;TODO (14/11/22 flexsurfer) this namespace has been moved to the root level, we keep this only for old
|
||||
;;(status 1.0) code,
|
||||
;; can be removed with old code later
|
||||
|
||||
(set! (.-locale i18n) (name i18n-resources/default-device-language))
|
||||
(set! (.-fallbacks i18n) true)
|
||||
(set! (.-defaultSeparator i18n) "/")
|
||||
|
||||
(set! (.-translations i18n)
|
||||
(clj->js i18n-resources/translations-by-locale))
|
||||
|
||||
(defn set-language
|
||||
[lang]
|
||||
(i18n-resources/load-language lang)
|
||||
(set! (.-locale i18n) lang))
|
||||
|
||||
;;:zh, :zh-hans-xx, :zh-hant-xx have been added until this bug will be fixed
|
||||
;;https://github.com/fnando/i18n-js/issues/460
|
||||
|
||||
(def delimeters
|
||||
"This function is a hack: mobile Safari doesn't support toLocaleString(), so we need to pass
|
||||
this map to WKWebView to make number formatting work."
|
||||
(let [n (.toLocaleString ^js (js/Number 1000.1))
|
||||
delimiter? (= (count n) 7)]
|
||||
(if delimiter?
|
||||
{:delimiter (subs n 1 2)
|
||||
:separator (subs n 5 6)}
|
||||
{:delimiter ""
|
||||
:separator (subs n 4 5)})))
|
||||
|
||||
(defn label-number
|
||||
[number]
|
||||
(when number
|
||||
(let [{:keys [delimiter separator]} delimeters]
|
||||
(.toNumber i18n
|
||||
(string/replace number #"," ".")
|
||||
(clj->js {:precision 10
|
||||
:strip_insignificant_zeros true
|
||||
:delimiter delimiter
|
||||
:separator separator})))))
|
||||
|
||||
(def default-option-value "<no value>")
|
||||
|
||||
(defn label-options
|
||||
[options]
|
||||
;; i18n ignores nil value, leading to misleading messages
|
||||
(into {} (for [[k v] options] [k (or v default-option-value)])))
|
||||
|
||||
(defn label-fn
|
||||
([path] (label-fn path {}))
|
||||
([path options]
|
||||
(if (exists? (.t i18n))
|
||||
(let [options (update options :amount label-number)]
|
||||
(.t i18n (name path) (clj->js (label-options options))))
|
||||
(name path))))
|
||||
|
||||
(def label (memoize label-fn))
|
||||
|
||||
(defn label-pluralize
|
||||
[count path & options]
|
||||
(if (exists? (.t i18n))
|
||||
(.p i18n count (name path) (clj->js options))
|
||||
(name path)))
|
||||
|
||||
(def locale
|
||||
(.-locale i18n))
|
||||
|
||||
(def format-currency goog.i18n/format-currency)
|
||||
@@ -0,0 +1,84 @@
|
||||
(ns status-im.i18n.i18n-resources
|
||||
(:require ["i18n-js" :as i18n-js]
|
||||
["react-native-languages" :default react-native-languages]
|
||||
[clojure.string :as string]))
|
||||
;;TODO (14/11/22 flexsurfer) this namespace has been moved to the status-im2 namespace, we keep this
|
||||
;;only
|
||||
;;for old (status 1.0) code,
|
||||
;; can be removed with old code later
|
||||
|
||||
(def get-keyword
|
||||
(if js/global.__TEST__ str keyword))
|
||||
|
||||
(def default-device-language
|
||||
(get-keyword (.-language react-native-languages)))
|
||||
|
||||
(def languages
|
||||
#{:ar :bn :de :el :en :es :es_419 :es_AR :fil :fr :hi :id :in :it :ja :ko :ms :nl :pl :pt :pt_BR :ru
|
||||
:tr :vi :zh :zh_Hant :zh_TW})
|
||||
|
||||
(defonce loaded-languages
|
||||
(atom
|
||||
(conj #{:en} default-device-language)))
|
||||
|
||||
(defn valid-language
|
||||
[lang]
|
||||
(if (contains? languages lang)
|
||||
(get-keyword lang)
|
||||
(let [parts (string/split (name lang) #"[\-\_]")
|
||||
short-lang (get-keyword (str (first parts) "_" (second parts)))
|
||||
shortest-lang (get-keyword (first parts))]
|
||||
(if (and (> (count parts) 2) (contains? languages short-lang))
|
||||
short-lang
|
||||
(when (contains? languages shortest-lang)
|
||||
shortest-lang)))))
|
||||
|
||||
(defn require-translation
|
||||
[lang-key]
|
||||
(when-let [lang (valid-language (get-keyword lang-key))]
|
||||
(case lang
|
||||
:ar (js/require "../translations/ar.json")
|
||||
:bn (js/require "../translations/bn.json")
|
||||
:de (js/require "../translations/de.json")
|
||||
:el (js/require "../translations/el.json")
|
||||
:en (js/require "../translations/en.json")
|
||||
:es (js/require "../translations/es.json")
|
||||
:es_419 (js/require "../translations/es_419.json")
|
||||
:es_AR (js/require "../translations/es_AR.json")
|
||||
:fil (js/require "../translations/fil.json")
|
||||
:fr (js/require "../translations/fr.json")
|
||||
:hi (js/require "../translations/hi.json")
|
||||
:id (js/require "../translations/id.json")
|
||||
:in (js/require "../translations/id.json")
|
||||
:it (js/require "../translations/it.json")
|
||||
:ja (js/require "../translations/ja.json")
|
||||
:ko (js/require "../translations/ko.json")
|
||||
:ms (js/require "../translations/ms.json")
|
||||
:nl (js/require "../translations/nl.json")
|
||||
:pl (js/require "../translations/pl.json")
|
||||
:pt (js/require "../translations/pt.json")
|
||||
:pt_BR (js/require "../translations/pt_BR.json")
|
||||
:ru (js/require "../translations/ru.json")
|
||||
:tr (js/require "../translations/tr.json")
|
||||
:vi (js/require "../translations/vi.json")
|
||||
:zh (js/require "../translations/zh.json")
|
||||
:zh_Hant (js/require "../translations/zh_hant.json")
|
||||
:zh_TW (js/require "../translations/zh_TW.json"))))
|
||||
|
||||
;; translations
|
||||
(def translations-by-locale
|
||||
(cond-> {:en (require-translation :en)}
|
||||
(not= :en default-device-language)
|
||||
(assoc default-device-language
|
||||
(require-translation (-> (name default-device-language)
|
||||
(string/replace "-" "_")
|
||||
get-keyword)))))
|
||||
|
||||
(defn load-language
|
||||
[lang]
|
||||
(when-let [lang-key (valid-language (get-keyword lang))]
|
||||
(when-not (contains? @loaded-languages lang-key)
|
||||
(aset (.-translations i18n-js)
|
||||
lang
|
||||
(require-translation lang-key))
|
||||
(swap! loaded-languages conj lang-key))))
|
||||
@@ -1,7 +1,7 @@
|
||||
(ns status-im.keycard.backup-key
|
||||
(:require [re-frame.core :as re-frame]
|
||||
[status-im.ethereum.mnemonic :as mnemonic]
|
||||
[i18n.i18n :as i18n]
|
||||
[status-im.i18n.i18n :as i18n]
|
||||
[status-im.keycard.common :as common]
|
||||
[status-im.multiaccounts.recover.core :as multiaccounts.recover]
|
||||
[status-im.signing.core :as signing.core]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
(ns status-im.keycard.change-pin
|
||||
(:require [i18n.i18n :as i18n]
|
||||
(:require [status-im.i18n.i18n :as i18n]
|
||||
[status-im.keycard.common :as common]
|
||||
[status-im.keycard.onboarding :as onboarding]
|
||||
[utils.re-frame :as rf]
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
[re-frame.core :as re-frame]
|
||||
[status-im.bottom-sheet.core :as bottom-sheet]
|
||||
[status-im.ethereum.core :as ethereum]
|
||||
[i18n.i18n :as i18n]
|
||||
[status-im.i18n.i18n :as i18n]
|
||||
[status-im.keycard.nfc :as nfc]
|
||||
[status-im.popover.core :as popover]
|
||||
[status-im.ui.screens.keycard.keycard-interaction :as keycard-sheet]
|
||||
[status-im.utils.datetime :as utils.datetime]
|
||||
[utils.re-frame :as rf]
|
||||
[utils.datetime :as datetime]
|
||||
[status-im.utils.keychain.core :as keychain]
|
||||
[status-im.utils.platform :as platform]
|
||||
[status-im.utils.types :as types]
|
||||
@@ -429,7 +429,7 @@
|
||||
|
||||
(rf/defn update-pairings
|
||||
[{:keys [db]} instance-uid pairing]
|
||||
(let [paired-on (datetime/timestamp)
|
||||
(let [paired-on (utils.datetime/timestamp)
|
||||
pairings (-> (get-in db [:keycard :pairings])
|
||||
(assoc instance-uid {:pairing pairing :paired-on paired-on}))]
|
||||
{:keycard/persist-pairings pairings
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
(ns status-im.keycard.core
|
||||
(:require [re-frame.db]
|
||||
[i18n.i18n :as i18n]
|
||||
[status-im.i18n.i18n :as i18n]
|
||||
status-im.keycard.backup-key
|
||||
[status-im.keycard.card :as card]
|
||||
[status-im.keycard.change-pin :as change-pin]
|
||||
@@ -16,8 +16,8 @@
|
||||
[status-im.keycard.wallet :as wallet]
|
||||
[status-im.multiaccounts.recover.core :as multiaccounts.recover]
|
||||
[status-im.multiaccounts.update.core :as multiaccounts.update]
|
||||
[status-im.utils.datetime :as utils.datetime]
|
||||
[utils.re-frame :as rf]
|
||||
[utils.datetime :as datetime]
|
||||
[status-im2.navigation.events :as navigation]
|
||||
[taoensso.timbre :as log]))
|
||||
|
||||
@@ -485,7 +485,7 @@
|
||||
flow (get-in db [:keycard :flow])
|
||||
instance-uid (get-in db [:keycard :application-info :instance-uid])
|
||||
multiaccount (common/find-multiaccount-by-keycard-instance-uid db instance-uid)
|
||||
paired-on (datetime/timestamp)
|
||||
paired-on (utils.datetime/timestamp)
|
||||
pairings (-> (get-in db [:keycard :pairings])
|
||||
(dissoc (keyword instance-uid))
|
||||
(assoc instance-uid {:pairing pairing :paired-on paired-on}))
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
(:require [clojure.string :as string]
|
||||
[re-frame.core :as re-frame]
|
||||
[status-im.constants :as constants]
|
||||
[i18n.i18n :as i18n]
|
||||
[status-im.i18n.i18n :as i18n]
|
||||
[status-im.keycard.common :as common]
|
||||
status-im.keycard.fx
|
||||
[status-im.keycard.mnemonic :as mnemonic]
|
||||
|
||||
@@ -5,15 +5,15 @@
|
||||
[status-im.constants :as constants]
|
||||
[status-im.ethereum.core :as ethereum]
|
||||
[status-im.ethereum.eip55 :as eip55]
|
||||
[i18n.i18n :as i18n]
|
||||
[status-im.i18n.i18n :as i18n]
|
||||
[status-im.keycard.common :as common]
|
||||
status-im.keycard.fx
|
||||
[status-im.multiaccounts.create.core :as multiaccounts.create]
|
||||
[status-im.multiaccounts.model :as multiaccounts.model]
|
||||
[status-im.native-module.core :as status]
|
||||
[status-im.popover.core :as popover]
|
||||
[status-im.utils.datetime :as utils.datetime]
|
||||
[utils.re-frame :as rf]
|
||||
[utils.datetime :as datetime]
|
||||
[status-im.utils.keychain.core :as keychain]
|
||||
[status-im.utils.platform :as platform]
|
||||
[status-im.utils.types :as types]
|
||||
@@ -40,7 +40,7 @@
|
||||
:keycard.onboarding.pair.ui/next-pressed]}
|
||||
[{:keys [db] :as cofx}]
|
||||
(let [pairing (get-in db [:keycard :secrets :pairing])
|
||||
paired-on (get-in db [:keycard :secrets :paired-on] (datetime/timestamp))]
|
||||
paired-on (get-in db [:keycard :secrets :paired-on] (utils.datetime/timestamp))]
|
||||
(rf/merge cofx
|
||||
(if pairing
|
||||
{:db (-> db
|
||||
@@ -369,7 +369,7 @@
|
||||
(assoc-in [:keycard :pin :status] :verifying)
|
||||
(assoc-in [:keycard :secrets]
|
||||
{:pairing pairing'
|
||||
:paired-on (datetime/timestamp)}))
|
||||
:paired-on (utils.datetime/timestamp)}))
|
||||
:keycard/import-keys
|
||||
{:pin pin
|
||||
:on-success :keycard.callback/on-generate-and-load-key-success}})))
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
[re-frame.db :as re-frame.db]
|
||||
[status-im.constants :as constants]
|
||||
[status-im.ethereum.core :as ethereum]
|
||||
[i18n.i18n :as i18n]
|
||||
[status-im.i18n.i18n :as i18n]
|
||||
[status-im.keycard.keycard :as keycard]
|
||||
[status-im.multiaccounts.create.core :as multiaccounts.create]
|
||||
[status-im.native-module.core :as status]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
(ns status-im.keycard.unpair
|
||||
(:require [re-frame.core :as re-frame]
|
||||
[i18n.i18n :as i18n]
|
||||
[status-im.i18n.i18n :as i18n]
|
||||
[status-im.keycard.common :as common]
|
||||
[status-im.multiaccounts.key-storage.core :as key-storage]
|
||||
[status-im.multiaccounts.update.core :as multiaccounts.update]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
(ns status-im.log-level.core
|
||||
(:require [re-frame.core :as re-frame]
|
||||
[i18n.i18n :as i18n]
|
||||
[status-im.i18n.i18n :as i18n]
|
||||
[status-im.multiaccounts.update.core :as multiaccounts.update]
|
||||
[status-im.node.core :as node]
|
||||
[utils.re-frame :as rf]))
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
(ns ^{:doc "Mailserver events and API"} status-im.mailserver.core
|
||||
(:require [clojure.string :as string]
|
||||
[re-frame.core :as re-frame]
|
||||
[i18n.i18n :as i18n]
|
||||
[status-im.i18n.i18n :as i18n]
|
||||
[status-im.multiaccounts.update.core :as multiaccounts.update]
|
||||
[status-im.node.core :as node]
|
||||
[utils.re-frame :as rf]
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
(:require ["react-native-touch-id" :default touchid]
|
||||
[quo.design-system.colors :as colors]
|
||||
[re-frame.core :as re-frame]
|
||||
[i18n.i18n :as i18n]
|
||||
[status-im.i18n.i18n :as i18n]
|
||||
[status-im.native-module.core :as status]
|
||||
[status-im.popover.core :as popover]
|
||||
[utils.re-frame :as rf]
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
[status-im.data-store.settings :as data-store.settings]
|
||||
[status-im.ethereum.core :as ethereum]
|
||||
[status-im.ethereum.eip55 :as eip55]
|
||||
[i18n.i18n :as i18n]
|
||||
[status-im.i18n.i18n :as i18n]
|
||||
[status-im.native-module.core :as status]
|
||||
[status-im.node.core :as node]
|
||||
[status-im.utils.config :as config]
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
[status-im.bottom-sheet.core :as bottom-sheet]
|
||||
[status-im.ethereum.core :as ethereum]
|
||||
[status-im.ethereum.mnemonic :as mnemonic]
|
||||
[i18n.i18n :as i18n]
|
||||
[status-im.i18n.i18n :as i18n]
|
||||
[status-im.keycard.backup-key :as keycard.backup]
|
||||
[status-im.keycard.common :as common]
|
||||
[status-im.multiaccounts.core :as multiaccounts]
|
||||
|
||||
@@ -9,14 +9,13 @@
|
||||
[status-im.data-store.chats :as data-store.chats]
|
||||
[status-im.data-store.invitations :as data-store.invitations]
|
||||
[status-im.data-store.settings :as data-store.settings]
|
||||
[status-im.data-store.switcher-cards :as switcher-cards-store]
|
||||
[status-im.data-store.visibility-status-updates :as visibility-status-updates-store]
|
||||
[status-im.ethereum.core :as ethereum]
|
||||
[status-im.ethereum.eip55 :as eip55]
|
||||
[status-im.ethereum.tokens :as tokens]
|
||||
[status-im.ethereum.transactions.core :as transactions]
|
||||
[status-im.fleet.core :as fleet]
|
||||
[i18n.i18n :as i18n]
|
||||
[status-im.i18n.i18n :as i18n]
|
||||
[status-im.keycard.common :as keycard.common]
|
||||
[status-im.mobile-sync-settings.core :as mobile-network]
|
||||
[status-im.multiaccounts.biometric.core :as biometric]
|
||||
@@ -474,8 +473,7 @@
|
||||
(multiaccounts/get-profile-picture)
|
||||
(multiaccounts/switch-preview-privacy-mode-flag)
|
||||
(link-preview/request-link-preview-whitelist)
|
||||
(visibility-status-updates-store/fetch-visibility-status-updates-rpc)
|
||||
(switcher-cards-store/fetch-switcher-cards-rpc))))
|
||||
(visibility-status-updates-store/fetch-visibility-status-updates-rpc))))
|
||||
|
||||
(defn get-new-auth-method
|
||||
[auth-method save-password?]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
(ns status-im.multiaccounts.logout.core
|
||||
(:require [re-frame.core :as re-frame]
|
||||
[i18n.i18n :as i18n]
|
||||
[status-im.i18n.i18n :as i18n]
|
||||
[status-im.multiaccounts.core :as multiaccounts]
|
||||
[status-im.native-module.core :as status]
|
||||
[status-im.notifications.core :as notifications]
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
[status-im.constants :as constants]
|
||||
[status-im.ethereum.core :as ethereum]
|
||||
[status-im.ethereum.mnemonic :as mnemonic]
|
||||
[i18n.i18n :as i18n]
|
||||
[status-im.i18n.i18n :as i18n]
|
||||
[status-im.keycard.nfc :as nfc]
|
||||
[status-im.multiaccounts.core :as multiaccounts]
|
||||
[status-im.multiaccounts.create.core :as multiaccounts.create]
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
[status-im.utils.platform :as platform]
|
||||
[status-im.utils.react-native :as react-native-utils]
|
||||
[status-im.utils.types :as types]
|
||||
[taoensso.timbre :as log]
|
||||
[status-im.constants :as constants]))
|
||||
[taoensso.timbre :as log]))
|
||||
|
||||
(defn status
|
||||
[]
|
||||
@@ -279,55 +278,6 @@
|
||||
:connection-string connection-string})
|
||||
(.inputConnectionStringForBootstrapping ^js (status) connection-string config-json callback))
|
||||
|
||||
(defn deserialize-and-compress-key
|
||||
"Provides a community id (public key) to status-go which is first deserialized
|
||||
and then compressed. Example input/output :
|
||||
input key = zQ3shTAten2v9CwyQD1Kc7VXAqNPDcHZAMsfbLHCZEx6nFqk9 and
|
||||
output key = 0x025596a7ff87da36860a84b0908191ce60a504afc94aac93c1abd774f182967ce6"
|
||||
[key callback]
|
||||
(log/info "[native-module] Deserializing and then compressing public key"
|
||||
{:fn :deserialize-and-compress-key
|
||||
:key key})
|
||||
(.deserializeAndCompressKey ^js (status) key callback))
|
||||
|
||||
|
||||
(defn public-key->compressed-key
|
||||
"Provides public key to status-go and gets back a compressed key via serialization"
|
||||
[public-key callback]
|
||||
(let [serialization-key constants/serialization-key
|
||||
multi-code-prefix constants/multi-code-prefix
|
||||
multi-code-key (str multi-code-prefix (subs public-key 2))]
|
||||
(log/info "[native-module] Serializing public key"
|
||||
{:fn :public-key->compressed-key
|
||||
:public-key public-key
|
||||
:multi-code-key multi-code-key})
|
||||
(.multiformatSerializePublicKey ^js (status) multi-code-key serialization-key callback)))
|
||||
|
||||
(defn compressed-key->public-key
|
||||
"Provides compressed key to status-go and gets back the uncompressed public key via deserialization"
|
||||
[public-key callback]
|
||||
(let [deserialization-key constants/deserialization-key]
|
||||
(log/info "[native-module] Deserializing compressed key"
|
||||
{:fn :compressed-key->public-key
|
||||
:public-key public-key})
|
||||
(.multiformatDeserializePublicKey ^js (status) public-key deserialization-key callback)))
|
||||
|
||||
(defn decompress-public-key
|
||||
"Provides compressed key to status-go and gets back the uncompressed public key"
|
||||
[public-key callback]
|
||||
(log/info "[native-module] Decompressing public key"
|
||||
{:fn :decompress-public-key
|
||||
:public-key public-key})
|
||||
(.decompressPublicKey ^js (status) public-key callback))
|
||||
|
||||
(defn compress-public-key
|
||||
"Provides a public key to status-go and gets back a 33bit compressed key back"
|
||||
[public-key callback]
|
||||
(log/info "[native-module] Compressing public key"
|
||||
{:fn :compress-public-key
|
||||
:public-key public-key})
|
||||
(.compressPublicKey ^js (status) public-key callback))
|
||||
|
||||
(defn hash-typed-data
|
||||
"used for keycard"
|
||||
[data callback]
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
(:require ["react-native" :as rn]
|
||||
["react-native-gesture-handler" :refer (gestureHandlerRootHOC)]
|
||||
["react-native-navigation" :refer (Navigation)]
|
||||
[clojure.set :as set]
|
||||
[clojure.set :as clojure.set]
|
||||
[quo.components.text-input :as quo.text-input]
|
||||
[quo.design-system.colors :as quo.colors]
|
||||
[re-frame.core :as re-frame]
|
||||
@@ -299,7 +299,7 @@
|
||||
(fn [^js evn]
|
||||
(let [selected-tab-index (.-selectedTabIndex evn)
|
||||
comp (get tab-root-ids selected-tab-index)
|
||||
tab-key (get (set/map-invert tab-key-idx) selected-tab-index)]
|
||||
tab-key (get (clojure.set/map-invert tab-key-idx) selected-tab-index)]
|
||||
(re-frame/dispatch [:set :current-tab tab-key])
|
||||
(when (= @state/root-comp-id comp)
|
||||
(when (= :chat tab-key)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
(:require [clojure.string :as string]
|
||||
[re-frame.core :as re-frame]
|
||||
[status-im.ethereum.core :as ethereum]
|
||||
[i18n.i18n :as i18n]
|
||||
[status-im.i18n.i18n :as i18n]
|
||||
[status-im.node.core :as node]
|
||||
[utils.re-frame :as rf]
|
||||
[status-im.utils.http :as http]
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
[status-im.chat.models :as chat.models]
|
||||
[status-im.ethereum.decode :as decode]
|
||||
[status-im.ethereum.tokens :as tokens]
|
||||
[i18n.i18n :as i18n]
|
||||
[status-im.i18n.i18n :as i18n]
|
||||
[status-im.notifications.android :as pn-android]
|
||||
[utils.re-frame :as rf]
|
||||
[status-im.utils.money :as money]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
(ns status-im.pairing.core
|
||||
(:require [re-frame.core :as re-frame]
|
||||
[i18n.i18n :as i18n]
|
||||
[status-im.i18n.i18n :as i18n]
|
||||
[status-im.multiaccounts.update.core :as multiaccounts.update]
|
||||
[status-im.utils.config :as config]
|
||||
[utils.re-frame :as rf]
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
[status-im.chat.models :as chat]
|
||||
[status-im.ethereum.core :as ethereum]
|
||||
[status-im.group-chats.core :as group-chats]
|
||||
[i18n.i18n :as i18n]
|
||||
[status-im.i18n.i18n :as i18n]
|
||||
[status-im.router.core :as router]
|
||||
[utils.re-frame :as rf]
|
||||
[status-im.utils.utils :as utils]
|
||||
|
||||
@@ -63,8 +63,7 @@
|
||||
:sticker (js/require "../resources/images/mock/sticker.png")
|
||||
:user-picture-female2 (js/require "../resources/images/mock/user_picture_female2.png")
|
||||
:user-picture-male4 (js/require "../resources/images/mock/user_picture_male4.png")
|
||||
:user-picture-male5 (js/require "../resources/images/mock/user_picture_male5.png")
|
||||
:coinbase (js/require "../resources/images/mock/coinbase.png")})
|
||||
:user-picture-male5 (js/require "../resources/images/mock/user_picture_male5.png")})
|
||||
|
||||
(defn get-theme-image
|
||||
[k]
|
||||
|
||||
@@ -199,12 +199,6 @@
|
||||
{:type :wallet-account
|
||||
:account (when account (string/lower-case account))})
|
||||
|
||||
(defn community-route-type
|
||||
[route-params]
|
||||
(if (string/starts-with? (:community-id route-params) "z")
|
||||
:desktop-community
|
||||
:community))
|
||||
|
||||
(defn handle-uri
|
||||
[chain chats uri cb]
|
||||
(let [{:keys [handler route-params query-params]} (match-uri uri)]
|
||||
@@ -235,8 +229,7 @@
|
||||
(cb {:type handler :community-id (:community-id route-params)})
|
||||
|
||||
(= handler :community)
|
||||
(cb {:type (community-route-type route-params)
|
||||
:community-id (:community-id route-params)})
|
||||
(cb {:type handler :community-id (:community-id route-params)})
|
||||
|
||||
(= handler :community-chat)
|
||||
(cb {:type handler :chat-id (:chat-id route-params)})
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
(:require [status-im.chat.models.link-preview :as link.preview]
|
||||
[status-im.chat.models.message :as models.message]
|
||||
[status-im.ethereum.subscriptions :as ethereum.subscriptions]
|
||||
[i18n.i18n :as i18n]
|
||||
[status-im.i18n.i18n :as i18n]
|
||||
[status-im.mailserver.core :as mailserver]
|
||||
[status-im.multiaccounts.login.core :as login]
|
||||
[status-im.notifications.local :as local-notifications]
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
(ns status-im.signing.core
|
||||
(:require [clojure.set :as set]
|
||||
(:require [clojure.set :as clojure.set]
|
||||
[clojure.string :as string]
|
||||
[re-frame.core :as re-frame]
|
||||
[status-im.constants :as constants]
|
||||
[status-im.ethereum.core :as ethereum]
|
||||
[status-im.ethereum.eip55 :as eip55]
|
||||
[status-im.ethereum.tokens :as tokens]
|
||||
[i18n.i18n :as i18n]
|
||||
[status-im.i18n.i18n :as i18n]
|
||||
[status-im.keycard.card :as keycard.card]
|
||||
[status-im.keycard.common :as keycard.common]
|
||||
[status-im.native-module.core :as status]
|
||||
@@ -596,4 +596,4 @@
|
||||
(sign cofx
|
||||
{:tx-obj (-> tx
|
||||
(select-keys [:from :to :value :input :gas :nonce :hash])
|
||||
(set/rename-keys {:input :data}))})))
|
||||
(clojure.set/rename-keys {:input :data}))})))
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
[re-frame.core :as re-frame]
|
||||
[status-im.bottom-sheet.core :as bottom-sheet]
|
||||
[status-im.ethereum.core :as ethereum]
|
||||
[i18n.i18n :as i18n]
|
||||
[status-im.i18n.i18n :as i18n]
|
||||
[status-im.popover.core :as popover]
|
||||
[status-im.signing.eip1559 :as eip1559]
|
||||
[utils.re-frame :as rf]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
(ns status-im.signing.keycard
|
||||
(:require [re-frame.core :as re-frame]
|
||||
[i18n.i18n :as i18n]
|
||||
[status-im.i18n.i18n :as i18n]
|
||||
[status-im.native-module.core :as status]
|
||||
[utils.re-frame :as rf]
|
||||
[status-im.utils.types :as types]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
(ns test-helpers.unit
|
||||
(ns status-im.test-helpers
|
||||
(:require [clojure.spec.alpha :as s]
|
||||
[clojure.string :as string]
|
||||
[clojure.walk :as walk]))
|
||||
@@ -34,7 +34,7 @@
|
||||
Example:
|
||||
|
||||
```clojure
|
||||
(require '[test-helpers.unit :as h])
|
||||
(require '[status-im.test-helpers :as h])
|
||||
|
||||
(h/deftest-sub :wallet/sorted-tokens
|
||||
[sub-name]
|
||||
@@ -60,7 +60,7 @@
|
||||
"Register log fixture which allows inspecting all calls to `taoensso.timbre/log`.
|
||||
|
||||
Usage: Simply call this macro once per test namespace, and use the
|
||||
`test-helpers.unit/logs` atom to deref the collection of all logs for the
|
||||
`status-im.test-helpers/logs` atom to deref the collection of all logs for the
|
||||
test under execution.
|
||||
|
||||
In Clojure(Script), we can rely on fixtures for each `cljs.deftest`, but not
|
||||
@@ -69,8 +69,8 @@
|
||||
[]
|
||||
`(cljs.test/use-fixtures
|
||||
:each
|
||||
{:before test-helpers.unit/log-fixture-before
|
||||
:after test-helpers.unit/log-fixture-after}))
|
||||
{:before status-im.test-helpers/log-fixture-before
|
||||
:after status-im.test-helpers/log-fixture-after}))
|
||||
|
||||
(defmacro run-test-sync
|
||||
"Wrap around `re-frame.test/run-test-sync` to make it work with our aliased
|
||||
@@ -1,11 +1,11 @@
|
||||
(ns test-helpers.unit
|
||||
(ns status-im.test-helpers
|
||||
"Utilities for simplifying the process of writing tests and improving test
|
||||
readability.
|
||||
|
||||
Avoid coupling this namespace with particularities of the Status' domain, thus
|
||||
prefer to use it for more general purpose concepts, such as the re-frame event
|
||||
layer."
|
||||
(:require-macros test-helpers.unit)
|
||||
(:require-macros status-im.test-helpers)
|
||||
(:require [re-frame.core :as rf]
|
||||
[re-frame.db :as rf-db]
|
||||
[re-frame.events :as rf-events]
|
||||
@@ -4,8 +4,7 @@
|
||||
[clojure.string :as string]
|
||||
[shadow.test :as st]
|
||||
[shadow.test.env :as env]
|
||||
[utils.re-frame :as rf]
|
||||
status-im2.setup.i18n-resources))
|
||||
[utils.re-frame :as rf]))
|
||||
|
||||
(defonce repl? (atom false))
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
(ns status-im.ui.components.action-sheet
|
||||
(:require ["react-native" :refer (ActionSheetIOS)]
|
||||
[i18n.i18n :as i18n]
|
||||
[status-im.i18n.i18n :as i18n]
|
||||
[status-im.utils.core :as utils]))
|
||||
|
||||
(defn- callback
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
(ns status-im.ui.components.badge
|
||||
(:require [quo.design-system.colors :as colors]
|
||||
[i18n.i18n :as i18n]
|
||||
[status-im.i18n.i18n :as i18n]
|
||||
[status-im.ui.components.react :as react]))
|
||||
|
||||
(defn badge
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
(ns status-im.ui.components.common.common
|
||||
(:require [reagent.core :as reagent]
|
||||
[i18n.i18n :as i18n]
|
||||
[status-im.i18n.i18n :as i18n]
|
||||
[status-im.ui.components.common.styles :as styles]
|
||||
[status-im.ui.components.icons.icons :as icons]
|
||||
[status-im.ui.components.react :as react])
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
[quo.core :as quo]
|
||||
[quo.design-system.colors :as colors]
|
||||
[re-frame.core :as re-frame]
|
||||
[i18n.i18n :as i18n]
|
||||
[status-im.i18n.i18n :as i18n]
|
||||
[status-im.ui.components.animation :as animation]
|
||||
[status-im.ui.components.react :as react])
|
||||
(:require-macros [status-im.utils.views :as views :refer [defview letsubs]]))
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
(ns status-im.ui.components.copyable-text
|
||||
(:require [quo.design-system.colors :as colors]
|
||||
[reagent.core :as reagent]
|
||||
[i18n.i18n :as i18n]
|
||||
[status-im.i18n.i18n :as i18n]
|
||||
[status-im.ui.components.animation :as animation]
|
||||
[status-im.ui.components.react :as react]))
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
(ns status-im.ui.components.invite.events
|
||||
(:require [re-frame.core :as re-frame]
|
||||
[i18n.i18n :as i18n]
|
||||
[status-im.i18n.i18n :as i18n]
|
||||
[status-im.ui.components.react :as react]
|
||||
[utils.re-frame :as rf]
|
||||
[status-im.utils.universal-links.utils :as universal-links]))
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
(ns status-im.ui.components.invite.views
|
||||
(:require [quo.core :as quo]
|
||||
[re-frame.core :as re-frame]
|
||||
[i18n.i18n :as i18n]
|
||||
[status-im.i18n.i18n :as i18n]
|
||||
[status-im.ui.components.invite.events :as invite.events]))
|
||||
|
||||
(defn button
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
(ns status-im.ui.components.list-selection
|
||||
(:require [re-frame.core :as re-frame]
|
||||
[i18n.i18n :as i18n]
|
||||
[status-im.i18n.i18n :as i18n]
|
||||
[status-im.ui.components.action-sheet :as action-sheet]
|
||||
[status-im.ui.components.dialog :as dialog]
|
||||
[status-im.ui.components.react :as react]
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
(SafeAreaProvider SafeAreaInsetsContext)]
|
||||
[quo.design-system.colors :as colors]
|
||||
[reagent.core :as reagent]
|
||||
[i18n.i18n :as i18n]
|
||||
[status-im.i18n.i18n :as i18n]
|
||||
[status-im.ui.components.typography :as typography]
|
||||
[status-im.utils.platform :as platform]
|
||||
[status-im.utils.utils :as utils])
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
[quo.design-system.colors :as colors]
|
||||
[quo2.foundations.colors :as quo2.colors]
|
||||
[reagent.core :as reagent]
|
||||
[i18n.i18n :as i18n]))
|
||||
[status-im.i18n.i18n :as i18n]))
|
||||
|
||||
(defn search-input
|
||||
[{:keys [search-active?]}]
|
||||
@@ -93,4 +93,4 @@
|
||||
(let [^js native-event (.-nativeEvent ^js e)
|
||||
text (.-text native-event)]
|
||||
(when on-change
|
||||
(on-change text))))}])))
|
||||
(on-change text))))}])))
|
||||
@@ -1,15 +1,15 @@
|
||||
(ns status-im.ui.components.topbar
|
||||
(:require [re-frame.core :as re-frame]
|
||||
[quo.core :as quo]
|
||||
[quo2.foundations.colors :as quo2.colors]))
|
||||
(:require [quo.core :as quo]
|
||||
[quo2.foundations.colors :as quo2.colors]
|
||||
[re-frame.core :as re-frame]))
|
||||
|
||||
(def default-button-width 48)
|
||||
|
||||
(defn default-navigation
|
||||
[modal? {:keys [on-press label icon]}]
|
||||
(cond-> {:icon (if modal? :i/close :i/arrow-left)
|
||||
(cond-> {:icon (if modal? :main-icons/close :main-icons/arrow-left)
|
||||
:accessibility-label :back-button
|
||||
:on-press #(re-frame/dispatch [:navigate-back :bottom-sheet/hide])}
|
||||
:on-press #(re-frame/dispatch [:navigate-back])}
|
||||
on-press
|
||||
(assoc :on-press on-press)
|
||||
|
||||
@@ -46,4 +46,4 @@
|
||||
{:right-accessories right-accessories})
|
||||
(when new-ui?
|
||||
{:background (quo2.colors/theme-colors quo2.colors/neutral-5
|
||||
quo2.colors/neutral-95)}))])]))
|
||||
quo2.colors/neutral-95)}))])]))
|
||||
@@ -3,7 +3,7 @@
|
||||
[quo.design-system.colors :as colors]
|
||||
[re-frame.core :as re-frame]
|
||||
[status-im.constants :refer [principles-link privacy-policy-link terms-of-service-link]]
|
||||
[i18n.i18n :as i18n]
|
||||
[status-im.i18n.i18n :as i18n]
|
||||
[status-im.ui.components.copyable-text :as copyable-text]
|
||||
[status-im.ui.components.icons.icons :as icons]
|
||||
[status-im.ui.components.react :as react]
|
||||
|
||||