Compare commits
8
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a35489d1c5 | ||
|
|
3d584bcf3f | ||
|
|
61417c57d7 | ||
|
|
eab026c89c | ||
|
|
9a91d994b7 | ||
|
|
c0079f3cac | ||
|
|
4fc7a2e0bb | ||
|
|
9b00955345 |
@@ -20,15 +20,7 @@
|
||||
;; future, as we progressively fix shadowed
|
||||
;; vars, we should be able to delete this
|
||||
;; option and lint all vars.
|
||||
:include [comparator
|
||||
count
|
||||
identity
|
||||
iter
|
||||
key
|
||||
str
|
||||
symbol
|
||||
time
|
||||
val]}
|
||||
:include [count iter key time]}
|
||||
:invalid-arity {:skip-args [status-im.utils.fx/defn utils.re-frame/defn]}
|
||||
;; TODO remove number when this is fixed
|
||||
;; https://github.com/borkdude/clj-kondo/issues/867
|
||||
|
||||
@@ -22,6 +22,7 @@ KEYCARD_TEST_MENU=0
|
||||
QR_READ_TEST_MENU=1
|
||||
ENABLE_ROOT_ALERT=1
|
||||
ENABLE_QUO_PREVIEW=1
|
||||
MAX_IMAGES_BATCH=5
|
||||
APN_TOPIC=im.status.ethereum.pr
|
||||
COMMUNITIES_ENABLED=1
|
||||
DATABASE_MANAGEMENT_ENABLED=1
|
||||
|
||||
@@ -21,6 +21,7 @@ COMMANDS_ENABLED=1
|
||||
KEYCARD_TEST_MENU=1
|
||||
QR_READ_TEST_MENU=1
|
||||
ENABLE_ROOT_ALERT=0
|
||||
MAX_IMAGES_BATCH=5
|
||||
APN_TOPIC=im.status.ethereum.pr
|
||||
VERIFY_TRANSACTION_CHAIN_ID=5
|
||||
VERIFY_ENS_CHAIN_ID=5
|
||||
|
||||
@@ -26,6 +26,7 @@ VERIFY_TRANSACTION_CHAIN_ID=5
|
||||
VERIFY_ENS_CHAIN_ID=5
|
||||
TEST_STATEOFUS=1
|
||||
BLANK_PREVIEW=0
|
||||
MAX_IMAGES_BATCH=5
|
||||
DATABASE_MANAGEMENT_ENABLED=1
|
||||
COMMUNITIES_ENABLED=1
|
||||
COMMUNITIES_MANAGEMENT_ENABLED=1
|
||||
|
||||
@@ -17,6 +17,7 @@ RPC_NETWORKS_ONLY=0
|
||||
PARTITIONED_TOPIC=0
|
||||
CONTRACT_NODES=1
|
||||
ENABLE_ROOT_ALERT=1
|
||||
MAX_IMAGES_BATCH=5
|
||||
BLANK_PREVIEW=0
|
||||
COMMUNITIES_ENABLED=1
|
||||
DATABASE_MANAGEMENT_ENABLED=1
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
---
|
||||
name: MVPBug Report
|
||||
about: MVPBug Report
|
||||
name: Bug Report
|
||||
about: Bug Report
|
||||
title: ''
|
||||
labels: 'E:Mobile Bugfixes MVP'
|
||||
labels: bug
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
@@ -22,7 +22,8 @@ assignees: ''
|
||||
|
||||
### Reproduction
|
||||
|
||||
1.
|
||||
1) Open Status
|
||||
2)
|
||||
|
||||
### Additional Information
|
||||
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
---
|
||||
name: Wont fix Report
|
||||
about: to facilitate future handling, identify and address non-urgent issues that won't be prioritized in the near future
|
||||
title: ''
|
||||
labels: likely_wont_fix
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
## Problem
|
||||
|
||||
|
||||
#### Expected behavior
|
||||
|
||||
|
||||
#### Actual behavior
|
||||
|
||||
|
||||
### Reproduction
|
||||
|
||||
1.
|
||||
|
||||
### Additional Information
|
||||
|
||||
- Status version: release
|
||||
- Operating System: Android, iOS
|
||||
|
||||
|
||||
[comment]: # (Please, add logs/notes if necessary)
|
||||
|
||||
@@ -782,9 +782,9 @@ Clojure (JVM) codebases which mirror the sources in a top-level test directory.
|
||||
└── models_test.cljs
|
||||
```
|
||||
|
||||
Component tests should be created in the same directory as the source component,
|
||||
and named as `component_spec.cljs`.
|
||||
|
||||
Component tests should be created in a separate directory `__tests__`, colocated
|
||||
with the source. When the entire component implementation is isolated under a
|
||||
single directory, create a test file named `component_spec.cljs` instead.
|
||||
|
||||
```
|
||||
└── filter
|
||||
|
||||
+5
-10
@@ -626,10 +626,10 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void loginWithKeycard(final String accountData, final String password, final String chatKey, final String nodeConfigJSON) {
|
||||
public void loginWithKeycard(final String accountData, final String password, final String chatKey) {
|
||||
Log.d(TAG, "loginWithKeycard");
|
||||
this.migrateKeyStoreDir(accountData, password);
|
||||
String result = Statusgo.loginWithKeycard(accountData, password, chatKey, nodeConfigJSON);
|
||||
String result = Statusgo.loginWithKeycard(accountData, password, chatKey);
|
||||
if (result.startsWith("{\"error\":\"\"")) {
|
||||
Log.d(TAG, "LoginWithKeycard result: " + result);
|
||||
} else {
|
||||
@@ -823,11 +823,6 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL
|
||||
executeRunnableStatusGoMethod(() -> Statusgo.hashMessage(message), callback);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void startSearchForLocalPairingPeers(final Callback callback) throws JSONException {
|
||||
executeRunnableStatusGoMethod(() -> Statusgo.startSearchForLocalPairingPeers(), callback);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void getConnectionStringForBootstrappingAnotherDevice(final String configJSON, final Callback callback) throws JSONException {
|
||||
final JSONObject jsonConfig = new JSONObject(configJSON);
|
||||
@@ -1177,19 +1172,19 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL
|
||||
executeRunnableStatusGoMethod(() -> Statusgo.deleteImportedKey(address, password, keyStoreDir), callback);
|
||||
}
|
||||
|
||||
@ReactMethod(isBlockingSynchronousMethod = true)
|
||||
@ReactMethod(isBlockingSynchronousMethod = true)
|
||||
public String keystoreDir() {
|
||||
final String absRootDirPath = this.getNoBackupDirectory();
|
||||
return pathCombine(absRootDirPath, "keystore");
|
||||
}
|
||||
|
||||
@ReactMethod(isBlockingSynchronousMethod = true)
|
||||
@ReactMethod(isBlockingSynchronousMethod = true)
|
||||
public String backupDisabledDataDir() {
|
||||
return this.getNoBackupDirectory();
|
||||
}
|
||||
|
||||
|
||||
@ReactMethod(isBlockingSynchronousMethod = true)
|
||||
@ReactMethod(isBlockingSynchronousMethod = true)
|
||||
public String logFileDirectory() {
|
||||
return getPublicStorageDirectory().getAbsolutePath();
|
||||
}
|
||||
|
||||
@@ -312,11 +312,6 @@ RCT_EXPORT_METHOD(localPairingPreflightOutboundCheck:(RCTResponseSenderBlock)cal
|
||||
callback(@[result]);
|
||||
}
|
||||
|
||||
RCT_EXPORT_METHOD(startSearchForLocalPairingPeers:(RCTResponseSenderBlock)callback) {
|
||||
NSString *result = StatusgoStartSearchForLocalPairingPeers();
|
||||
callback(@[result]);
|
||||
}
|
||||
|
||||
RCT_EXPORT_METHOD(getConnectionStringForBootstrappingAnotherDevice:(NSString *)configJSON
|
||||
callback:(RCTResponseSenderBlock)callback) {
|
||||
|
||||
@@ -638,15 +633,14 @@ RCT_EXPORT_METHOD(loginAccount:(NSString *)request) {
|
||||
|
||||
RCT_EXPORT_METHOD(loginWithKeycard:(NSString *)accountData
|
||||
password:(NSString *)password
|
||||
chatKey:(NSString *)chatKey
|
||||
nodeConfigJSON:(NSString *)nodeConfigJSON) {
|
||||
chatKey:(NSString *)chatKey) {
|
||||
#if DEBUG
|
||||
NSLog(@"LoginWithKeycard() method called");
|
||||
#endif
|
||||
[self getExportDbFilePath];
|
||||
[self migrateKeystore:accountData password:password];
|
||||
|
||||
NSString *result = StatusgoLoginWithKeycard(accountData, password, chatKey, nodeConfigJSON);
|
||||
NSString *result = StatusgoLoginWithKeycard(accountData, password, chatKey);
|
||||
|
||||
NSLog(@"%@", result);
|
||||
}
|
||||
|
||||
@@ -1041,7 +1041,7 @@ void _LoginWithKeycard(const FunctionCallbackInfo<Value>& args) {
|
||||
Isolate* isolate = args.GetIsolate();
|
||||
Local<Context> context = isolate->GetCurrentContext();
|
||||
|
||||
if (args.Length() != 4) {
|
||||
if (args.Length() != 3) {
|
||||
// Throw an Error that is passed back to JavaScript
|
||||
isolate->ThrowException(Exception::TypeError(
|
||||
String::NewFromUtf8Literal(isolate, "Wrong number of arguments for LoginWithKeycard")));
|
||||
@@ -1065,11 +1065,6 @@ void _LoginWithKeycard(const FunctionCallbackInfo<Value>& args) {
|
||||
String::NewFromUtf8Literal(isolate, "Wrong argument type for 'keyHex'")));
|
||||
return;
|
||||
}
|
||||
if (!args[3]->IsString()) {
|
||||
isolate->ThrowException(Exception::TypeError(
|
||||
String::NewFromUtf8Literal(isolate, "Wrong argument type for 'nodeConfigJSON'")));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
String::Utf8Value arg0Obj(isolate, args[0]->ToString(context).ToLocalChecked());
|
||||
@@ -1078,11 +1073,9 @@ void _LoginWithKeycard(const FunctionCallbackInfo<Value>& args) {
|
||||
char *arg1 = *arg1Obj;
|
||||
String::Utf8Value arg2Obj(isolate, args[2]->ToString(context).ToLocalChecked());
|
||||
char *arg2 = *arg2Obj;
|
||||
String::Utf8Value arg3Obj(isolate, args[3]->ToString(context).ToLocalChecked());
|
||||
char *arg3 = *arg3Obj;
|
||||
|
||||
// Call exported Go function, which returns a C string
|
||||
char *c = LoginWithKeycard(arg0, arg1, arg2, arg3);
|
||||
char *c = LoginWithKeycard(arg0, arg1, arg2);
|
||||
|
||||
Local<String> ret = String::NewFromUtf8(isolate, c).ToLocalChecked();
|
||||
args.GetReturnValue().Set(ret);
|
||||
|
||||
+349
-180
@@ -1,4 +1,17 @@
|
||||
[
|
||||
{
|
||||
"path": "args4j/args4j/2.0.26/args4j-2.0.26",
|
||||
"host": "https://repo1.maven.org/maven2",
|
||||
"pom": {
|
||||
"sha1": "f0aada195340b361a1a45aa9c3d417c7cbb0a6b5",
|
||||
"sha256": "0151vnbmbjnr5089ik8np91r3a4g2ylcahih22zr49a3ilri6f80"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "01ebb18ebb3b379a74207d5af4ea7c8338ebd78b",
|
||||
"sha256": "193i0xgn295bdz5gk4zrk4ncfa29x8vl97bfd01kl1za44ixm6wq"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "bidi/bidi/2.1.6/bidi-2.1.6",
|
||||
"host": "https://repo.clojars.org",
|
||||
@@ -26,15 +39,15 @@
|
||||
},
|
||||
|
||||
{
|
||||
"path": "binaryage/oops/0.7.2/oops-0.7.2",
|
||||
"path": "binaryage/oops/0.7.0/oops-0.7.0",
|
||||
"host": "https://repo.clojars.org",
|
||||
"pom": {
|
||||
"sha1": "bdce8b7dc9f2b569f5c42a4d6108325899970eb9",
|
||||
"sha256": "1rc4slg4836pnxds447sam9hsiwd4x2al1ykazp6iglc10ix9igd"
|
||||
"sha1": "de223223c4272ce9ee75c81f8764e894029630b4",
|
||||
"sha256": "0sz21344v8lxd6mjlrb8r8yyz934h4lnkwqlpg3csgsi11mppya3"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "2f47298f9aa41ef6f2c4f2c49f472eb113e94ae7",
|
||||
"sha256": "0c9f7wylwl0lxcn4vqncprlzmdddqhxzb3vdaawdm0da0xh010hb"
|
||||
"sha1": "9729401b4c6551f6becf44cf0818d04255410099",
|
||||
"sha256": "0jkdybj37q3a4vvay3asj47ms7l3qjpidhkk30293w0zc7jk18k8"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -52,28 +65,28 @@
|
||||
},
|
||||
|
||||
{
|
||||
"path": "cider/cider-nrepl/0.29.0/cider-nrepl-0.29.0",
|
||||
"path": "cider/cider-nrepl/0.25.3/cider-nrepl-0.25.3",
|
||||
"host": "https://repo.clojars.org",
|
||||
"pom": {
|
||||
"sha1": "d2dd4e969cf44bfffd8609d0d4945a4a561b5a58",
|
||||
"sha256": "0f4yxk0wx1i13inkq9zjd1450bbly5lf62216a88clmn4l5x8knn"
|
||||
"sha1": "3a39a7a1690b4ee6b48a4f0c65d089eacf47e8a5",
|
||||
"sha256": "1qhz6q1afg22j5d8zyxzqsbbinix3zh4lyy2acij8hrp02f274wj"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "45f6034b26a14138e74145b7a4059628c0fedcd1",
|
||||
"sha256": "1dy1l6y8cb8xiqq97a4lf8giyiicq4wfl4s2lxn5fb6614cjxqx2"
|
||||
"sha1": "5ae0efd9377a5e60c084bdaf4a2ce094f759ce23",
|
||||
"sha256": "0drxf9nm23i1pcgrkwbcr09msq37csilzww38709add0hz8spjhq"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "cider/piggieback/0.5.2/piggieback-0.5.2",
|
||||
"path": "cider/piggieback/0.4.1/piggieback-0.4.1",
|
||||
"host": "https://repo.clojars.org",
|
||||
"pom": {
|
||||
"sha1": "7e88493d18a4aaf13aff9d0319dcd82178d95f1d",
|
||||
"sha256": "08w5y48bpvnlyqbdjs0h7nz9dp35rc7b46hsvh1a0vpdszisxh0p"
|
||||
"sha1": "c432ffbdd51b67bf82e4a63f1f4f102ba55f4ddf",
|
||||
"sha256": "191wpjlq78s08d509hq2yrxsdzm3qfkqf2zdiwxxlmmh14dg65rx"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "ecfd5c286a85db3f059e75c37fca5722d9e26f79",
|
||||
"sha256": "1ps9yf3cxmlm447hqkidjb5xry90n0wl3jk0jn28fagq31lzylkl"
|
||||
"sha1": "0a02a3e2ecd7a126ab60d8a44793342f20ced79b",
|
||||
"sha256": "142vl5np33akcrnn6pksi0rjfsmmi528villxsj6cwcndvybiw4m"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -194,6 +207,162 @@
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "com/google/code/findbugs/jsr305/3.0.1/jsr305-3.0.1",
|
||||
"host": "https://repo1.maven.org/maven2",
|
||||
"pom": {
|
||||
"sha1": "d04690f71f3393e23f30998d9534365274fa5f9f",
|
||||
"sha256": "1khlag991h7326xsjnpx6hnyip5cwawsmxz6m20kkzavvihsfw21"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "f7be08ec23c21485b9b5a1cf1654c2ec8c58168d",
|
||||
"sha256": "1k9zl76xi2nykixaynss2gk4h861zipdb9xl6q1br0ln4hscx1f8"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "com/google/code/gson/gson/2.7/gson-2.7",
|
||||
"host": "https://repo1.maven.org/maven2",
|
||||
"pom": {
|
||||
"sha1": "09f9e39f9b791aeb73ba428ad30872f1a703edb3",
|
||||
"sha256": "1phf2qksjf75ykwgp39189jdbqsn5zrmi07g8h522yxq0zn3cfbj"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "751f548c85fa49f330cecbb1875893f971b33c4e",
|
||||
"sha256": "0clda1xrjfja969xsbrhc61ip588xvsi9k054kpd4cz1m5gfnhrd"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "com/google/elemental2/elemental2-core/1.0.0-RC1/elemental2-core-1.0.0-RC1",
|
||||
"host": "https://repo1.maven.org/maven2",
|
||||
"pom": {
|
||||
"sha1": "2ccdbc92bc4dfbc9159bf43cf794c240ec37621f",
|
||||
"sha256": "04gmnxv7fpsn66wvmsip4s9hqcc1wphsy3bg13vx262kg9w35j19"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "7e6e9ec8574d2ff6503f3f774c43695d0276f8f4",
|
||||
"sha256": "1l6g27a361nyl90ln9k2xamjds9xm3kjrfb9xcqz1gqhjgmnml7i"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "com/google/errorprone/error_prone_annotations/2.3.1/error_prone_annotations-2.3.1",
|
||||
"host": "https://repo1.maven.org/maven2",
|
||||
"pom": {
|
||||
"sha1": "19c878e6870c8382864dcc459de1c6bfe7f36e54",
|
||||
"sha256": "16l1kbc7wbisjmjvkfac854ddyql0b5smdxr2vz8wdms26vydp1y"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "a6a2b2df72fd13ec466216049b303f206bd66c5d",
|
||||
"sha256": "0831h49f21znl7z8lkr2ikywwajdachgxva7zpj8sp7rl2d9998h"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "com/google/guava/guava/25.1-jre/guava-25.1-jre",
|
||||
"host": "https://repo1.maven.org/maven2",
|
||||
"pom": {
|
||||
"sha1": "5dd13f6c0d56f05059c5eba88a20a8699ece583d",
|
||||
"sha256": "1pya5f4vbh8z9zvprnl64i9qqp0rghjfsflx64q9md28w5pb9y35"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "6c57e4b22b44e89e548b5c9f70f0c45fe10fb0b4",
|
||||
"sha256": "1gqaqxdnxhr1gk9haldrifvda8ingj1s4bin5sf455y38jic7c3d"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "com/google/j2objc/j2objc-annotations/1.1/j2objc-annotations-1.1",
|
||||
"host": "https://repo1.maven.org/maven2",
|
||||
"pom": {
|
||||
"sha1": "b964a9414771661bdf35a3f10692a2fb0dd2c866",
|
||||
"sha256": "1gnn7b80krv19qjd9hhacahffqq9iwqgmw4ds56wp9wk3rbqrjgh"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "ed28ded51a8b1c6b112568def5f4b455e6809019",
|
||||
"sha256": "1xpcvmnw2y3fa56hhk8dmknrq8afr6r3kdmzsg9hnwgjg3msg519"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "com/google/javascript/closure-compiler-externs/v20200830/closure-compiler-externs-v20200830",
|
||||
"host": "https://repo1.maven.org/maven2",
|
||||
"pom": {
|
||||
"sha1": "703aed7fd9e61298194db257c105b934c5e0cc12",
|
||||
"sha256": "06wpqr4rpj9qz067dn6j54k37lpaqpljrqzamdfb1lrkpygksb29"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "d5182c2e1bd226e39835c3b97875e27b54ee7401",
|
||||
"sha256": "0f3zgq7k9n1cwm787k2kkyxc9r033h54wlmb60d4nfhd39dbsza3"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "com/google/javascript/closure-compiler-unshaded/v20200830/closure-compiler-unshaded-v20200830",
|
||||
"host": "https://repo1.maven.org/maven2",
|
||||
"pom": {
|
||||
"sha1": "f1ac30ac5c39c2b6a8b9672373bebb1b5521cffa",
|
||||
"sha256": "0nhxzkdyri03mccxf65lxjxn1fafvhdkqvphf8vkxzkjbgiqwjdm"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "a017550b64e2690e3a4a5340d1eb699809b9f775",
|
||||
"sha256": "1kpihfzp4x8vxykgd6lcf4nb1r4f5zp3hpivs2793ny019w73rbn"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "com/google/jsinterop/base/1.0.0/base-1.0.0",
|
||||
"host": "https://repo1.maven.org/maven2",
|
||||
"pom": {
|
||||
"sha1": "9d68520e28ac9b035f86a520692196ea31aaf4f0",
|
||||
"sha256": "0byl8ksnlpvs0nm3a2midrbp6zrgxl7jzqgcz7z1hb1iy3jzfdk1"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "5d2a5cda3092004832cb67cfe7a100a2ef8411f8",
|
||||
"sha256": "04j4r89vimffmfim0ipmgbd54bxx111c0ygs34dn0krqdb13adk0"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "com/google/jsinterop/jsinterop-annotations/1.0.2/jsinterop-annotations-1.0.2",
|
||||
"host": "https://repo1.maven.org/maven2",
|
||||
"pom": {
|
||||
"sha1": "718fc66ea5e7ee1597960c5874d4603542814166",
|
||||
"sha256": "0bslwg7rqjanczf3sz11pgdans4hcl4nbp1f5xyy7dzfnkhyhbhx"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "abd7319f53d018e11108a88f599bd16492448dd2",
|
||||
"sha256": "057hgcrix9ss4cfgkl7pqqlcc7g1xnlx39i8lipn0sjv3xrl9bzw"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "com/google/protobuf/protobuf-java/3.11.1/protobuf-java-3.11.1",
|
||||
"host": "https://repo1.maven.org/maven2",
|
||||
"pom": {
|
||||
"sha1": "599529d980b7ca0b4145ae48d4323f3e85e5b1c5",
|
||||
"sha256": "0a0w96psyxpss3y3va5b8hcqzfxxy2kisng9hc6b4im9f83gj56x"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "1752390841a56e112b01990c9b523e6978abb24f",
|
||||
"sha256": "1wbwasjsqb19xpjk66wyih67492di8sg64qh2n2az7mpfy1dn0aa"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "com/google/re2j/re2j/1.3/re2j-1.3",
|
||||
"host": "https://repo1.maven.org/maven2",
|
||||
"pom": {
|
||||
"sha1": "565024724e6527255f0ae38e507c7f90c55b21ce",
|
||||
"sha256": "0bzj30pnw9bm7jfcwl5ypaqrgvvp3yndf9vdw0qjfyzr9xx39z2d"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "dc7de2b32fa8cc569ab44fb849abadbbc6983b91",
|
||||
"sha256": "06fypacl4jsbiddgby40fxxz6bpck7jvc5ch344f472cqnhhy16q"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "com/googlecode/json-simple/json-simple/1.1.1/json-simple-1.1.1",
|
||||
"host": "https://repo1.maven.org/maven2",
|
||||
@@ -207,19 +376,6 @@
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "com/google/javascript/closure-compiler-unshaded/v20210302/closure-compiler-unshaded-v20210302",
|
||||
"host": "https://repo1.maven.org/maven2",
|
||||
"pom": {
|
||||
"sha1": "1f790dd30fd0c2279cf73d79c4eba6a9f7516532",
|
||||
"sha256": "17vb4r6bn97s4jjwja7xmpwfdnfzknhyigz2vdiqpqyh4a31hb3c"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "14a87750b6bbe6e29932446b6db1f015851fd4e8",
|
||||
"sha256": "11ydn317q2aqh1bkm7gry48r2bakw5ifpx1yrrq192vq5kg7zwhq"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "com/ibm/icu/icu4j/66.1/icu4j-66.1",
|
||||
"host": "https://repo1.maven.org/maven2",
|
||||
@@ -233,58 +389,6 @@
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "commons-codec/commons-codec/1.10/commons-codec-1.10",
|
||||
"host": "https://repo1.maven.org/maven2",
|
||||
"pom": {
|
||||
"sha1": "44b9477418d2942d45550f7e7c66c16262062d0e",
|
||||
"sha256": "1yscxabk7i59vgfjg7c1y3prj39h1d8prnwgxbisc4ni29qdpf5x"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "4b95f4897fa13f2cd904aee711aeafc0c5295cd8",
|
||||
"sha256": "0scm6321zz76dc3bs8sy2qyami755lz4lq5455gl67bi9slxyha2"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "commons-fileupload/commons-fileupload/1.4/commons-fileupload-1.4",
|
||||
"host": "https://repo1.maven.org/maven2",
|
||||
"pom": {
|
||||
"sha1": "65112009d674333c1acfafb4e198ff250d710764",
|
||||
"sha256": "007nyd66fqp3fbrmnsbfp1fpkhmr2lk33qmkp3salqld3xd7qlc8"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "f95188e3d372e20e7328706c37ef366e5d7859b0",
|
||||
"sha256": "1xyyl54sfxsdcwxdyq6b0azmr31b4dwqns850jjkw9a9dwrh5v54"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "commons-io/commons-io/2.6/commons-io-2.6",
|
||||
"host": "https://repo1.maven.org/maven2",
|
||||
"pom": {
|
||||
"sha1": "5060835593e5b6ed18c82fc2e782f0a3c30a00b1",
|
||||
"sha256": "0q4a6fp6xkyd86ikymkyv2plhf9vj8aqvggxg9d1yad2jcw8c8qc"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "815893df5f31da2ece4040fe0a12fd44b577afaf",
|
||||
"sha256": "04v5fg53jl9gbn6pyz3l7kbpxv0xjzyasnw6yd1a3hhacq2d6xzq"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "compojure/compojure/1.5.2/compojure-1.5.2",
|
||||
"host": "https://repo.clojars.org",
|
||||
"pom": {
|
||||
"sha1": "9e8da477b6682094d56802cb155291a2acb829bd",
|
||||
"sha256": "036z64iprypccz03iq7lqxvw99xjh4xlsfmfwbs37pmhfnfmbdnx"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "0b5258d0616ffc5f64c2b6d95f09de56d24df439",
|
||||
"sha256": "1s2k05lwnlm9a66mxnsss437i9gp70dny8y2rlfkl090s6mdqsaf"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "com/taoensso/encore/2.105.0/encore-2.105.0",
|
||||
"host": "https://repo.clojars.org",
|
||||
@@ -363,6 +467,58 @@
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "commons-codec/commons-codec/1.10/commons-codec-1.10",
|
||||
"host": "https://repo1.maven.org/maven2",
|
||||
"pom": {
|
||||
"sha1": "44b9477418d2942d45550f7e7c66c16262062d0e",
|
||||
"sha256": "1yscxabk7i59vgfjg7c1y3prj39h1d8prnwgxbisc4ni29qdpf5x"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "4b95f4897fa13f2cd904aee711aeafc0c5295cd8",
|
||||
"sha256": "0scm6321zz76dc3bs8sy2qyami755lz4lq5455gl67bi9slxyha2"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "commons-fileupload/commons-fileupload/1.4/commons-fileupload-1.4",
|
||||
"host": "https://repo1.maven.org/maven2",
|
||||
"pom": {
|
||||
"sha1": "65112009d674333c1acfafb4e198ff250d710764",
|
||||
"sha256": "007nyd66fqp3fbrmnsbfp1fpkhmr2lk33qmkp3salqld3xd7qlc8"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "f95188e3d372e20e7328706c37ef366e5d7859b0",
|
||||
"sha256": "1xyyl54sfxsdcwxdyq6b0azmr31b4dwqns850jjkw9a9dwrh5v54"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "commons-io/commons-io/2.6/commons-io-2.6",
|
||||
"host": "https://repo1.maven.org/maven2",
|
||||
"pom": {
|
||||
"sha1": "5060835593e5b6ed18c82fc2e782f0a3c30a00b1",
|
||||
"sha256": "0q4a6fp6xkyd86ikymkyv2plhf9vj8aqvggxg9d1yad2jcw8c8qc"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "815893df5f31da2ece4040fe0a12fd44b577afaf",
|
||||
"sha256": "04v5fg53jl9gbn6pyz3l7kbpxv0xjzyasnw6yd1a3hhacq2d6xzq"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "compojure/compojure/1.5.2/compojure-1.5.2",
|
||||
"host": "https://repo.clojars.org",
|
||||
"pom": {
|
||||
"sha1": "9e8da477b6682094d56802cb155291a2acb829bd",
|
||||
"sha256": "036z64iprypccz03iq7lqxvw99xjh4xlsfmfwbs37pmhfnfmbdnx"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "0b5258d0616ffc5f64c2b6d95f09de56d24df439",
|
||||
"sha256": "1s2k05lwnlm9a66mxnsss437i9gp70dny8y2rlfkl090s6mdqsaf"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "crypto-equality/crypto-equality/1.0.0/crypto-equality-1.0.0",
|
||||
"host": "https://repo.clojars.org",
|
||||
@@ -507,15 +663,15 @@
|
||||
},
|
||||
|
||||
{
|
||||
"path": "io/undertow/undertow-core/2.2.4.Final/undertow-core-2.2.4.Final",
|
||||
"path": "io/undertow/undertow-core/2.1.3.Final/undertow-core-2.1.3.Final",
|
||||
"host": "https://repo1.maven.org/maven2",
|
||||
"pom": {
|
||||
"sha1": "0c0f3b7a6b2c2b4e73d719362b4595e77fbe98cd",
|
||||
"sha256": "14z0577jgx3r510zgjrzd2vcz9md3d5qpb81ir14zis9vdn5pwxf"
|
||||
"sha1": "28ef70062f9f9442f346d345fb7403d1181c2603",
|
||||
"sha256": "0khc267iljd5b3wlb9rks3zr9blqiz55dky2y0lgx5slxvr5ww95"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "78650b4029dd9280c4769d9425b5559f12cb83bf",
|
||||
"sha256": "1brpkd2l98byf76jga6hj5drv5sj2d93lxlq2xz0rxpqyqas1xm4"
|
||||
"sha1": "ea86fcf86ad8d283c5b14a6820061a6bd203839e",
|
||||
"sha256": "00z8d052wp0ba0f64ki08867d7hsx3w1zrhngpbm45qcqs2hphai"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -585,15 +741,28 @@
|
||||
},
|
||||
|
||||
{
|
||||
"path": "nrepl/nrepl/1.0.0/nrepl-1.0.0",
|
||||
"path": "nrepl/nrepl/0.7.0/nrepl-0.7.0",
|
||||
"host": "https://repo.clojars.org",
|
||||
"pom": {
|
||||
"sha1": "79b3e7030f2da9c4b8a20e4e5b44b401fbaccefc",
|
||||
"sha256": "0wnsyd2vwikqljl8si3040s5b89fm8j9zfa4a1c8g3lzj4npjwvl"
|
||||
"sha1": "913a846875363d8255bcede71d1186082f0f05d5",
|
||||
"sha256": "1f1ii5k975fmlcqj6dydc28mzbpiyyq9hqzv9lnzm9n15fgggafa"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "f47774c43493efdc879d36b95ebd67ea0d9c890a",
|
||||
"sha256": "1fx5ssmixgqmklliw0ng8fjz41kkhys56x8dbwv9yqrfzws9f2x3"
|
||||
"sha1": "55dabf4f271d30e7a8f0e198055c000398991e14",
|
||||
"sha256": "1h9zin2z4ll3jfr0cqp7zfvy6d2axrjjnyv8qbir0krjsss13ikw"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "org/checkerframework/checker-qual/2.0.0/checker-qual-2.0.0",
|
||||
"host": "https://repo1.maven.org/maven2",
|
||||
"pom": {
|
||||
"sha1": "17ab37f0fb0338647a70ab40f15c2c685e4185e3",
|
||||
"sha256": "0s0062lnqk8vq23dil7qma7rl5x1h16h2x4bah7fw6rbvm9h7cfy"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "518929596ee3249127502a8573b2e008e2d51ed3",
|
||||
"sha256": "15br88i0dk5l0hdh6ikgg6kvdbdir38jdw69j9s579az5xil317w"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -611,15 +780,15 @@
|
||||
},
|
||||
|
||||
{
|
||||
"path": "org/clojure/clojurescript/1.10.844/clojurescript-1.10.844",
|
||||
"path": "org/clojure/clojurescript/1.10.773/clojurescript-1.10.773",
|
||||
"host": "https://repo1.maven.org/maven2",
|
||||
"pom": {
|
||||
"sha1": "f4004d2de394c5f41317a38ae32f79e78826b45f",
|
||||
"sha256": "0nq8mz45gl86aigrmjnkq2fd612caayxfzkyk03dmp5v4sr5zxf6"
|
||||
"sha1": "ae4301ccf5a38dad594760b1c08774fc471fd59c",
|
||||
"sha256": "15vfzdq8vx9slppvkyvgvzndnrgqrc5m2vl0969lnprwizmrv570"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "86bedf67c795c72bde3feb0415b41be8b95f2cbb",
|
||||
"sha256": "03rs4dpwssa5ym9idip6vkxq27np3dwx7mzxms2s0yv4lipla58v"
|
||||
"sha1": "9f9729dbbf9b814c83dc189977b447d2ae92b6cd",
|
||||
"sha256": "1r0b6241ci1jwh6dk2yqb2ylh4aj4f2df5xxzwx3qp33xlday11z"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -715,28 +884,28 @@
|
||||
},
|
||||
|
||||
{
|
||||
"path": "org/clojure/google-closure-library/0.0-20201211-3e6c510d/google-closure-library-0.0-20201211-3e6c510d",
|
||||
"path": "org/clojure/google-closure-library-third-party/0.0-20191016-6ae1f72f/google-closure-library-third-party-0.0-20191016-6ae1f72f",
|
||||
"host": "https://repo1.maven.org/maven2",
|
||||
"pom": {
|
||||
"sha1": "9fbaa40e54d12d1d35afee260600b8e7325034cc",
|
||||
"sha256": "046qdcbqclxz0p4lnahglqkazraw47gymx3cin5jrw2wd7dpmr0l"
|
||||
"sha1": "1aa0b32fd70e6644dcb06b88b55630d6bbb6f188",
|
||||
"sha256": "1wq6gvhlvy3mdhj1cb0w62kclqd7x42dqd0275l40rlla5q5h1z1"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "b8c673dd84d8ed85c6d857e28afee5524a0ef82c",
|
||||
"sha256": "0q84zw1nl0sg69cx9i7g2bkw7996ig2j3m9pw4yfysjsn5aycm1q"
|
||||
"sha1": "4fc15daa4fd1b150e8c6d32755796634446dd86a",
|
||||
"sha256": "1ykw162gng0lcbxn2f387vv1l4d7hfwyayhxgzqqgi9jx211fzw5"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "org/clojure/google-closure-library-third-party/0.0-20201211-3e6c510d/google-closure-library-third-party-0.0-20201211-3e6c510d",
|
||||
"path": "org/clojure/google-closure-library/0.0-20191016-6ae1f72f/google-closure-library-0.0-20191016-6ae1f72f",
|
||||
"host": "https://repo1.maven.org/maven2",
|
||||
"pom": {
|
||||
"sha1": "93650c3e00cf1dc0811d2e347068828cf6700fca",
|
||||
"sha256": "1y6a10n8w98gr02ys8zxkddq2qrz7l5y3462d4hg8jpaq3r2pdm8"
|
||||
"sha1": "dea94d117aa88d75e281f877914454f79df06bf2",
|
||||
"sha256": "1nysls9ywj3b3zvlfwy68kayx47r4bacidmq1vx8w4h043l9kxrr"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "edcb415db3c88ada448cfbf65b021f12c7b131e9",
|
||||
"sha256": "1f5hjr2r323il0g9maamwdbgqxrvm3hg87jsgc13wa7naw4pm9pi"
|
||||
"sha1": "6025affb7181cd40418600864f58eed1ea80055d",
|
||||
"sha256": "0w6waii2qps7vp3nzbj5nai809xdq26ss0cabl4wz1s8fc6js6qw"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -766,19 +935,6 @@
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "org/clojure/tools.analyzer/1.0.0/tools.analyzer-1.0.0",
|
||||
"host": "https://repo1.maven.org/maven2",
|
||||
"pom": {
|
||||
"sha1": "fa72b6392b31762b55e0dc3de1c220ecdc6bb8a7",
|
||||
"sha256": "1yg46a9zbga7rsrhwdv877hh60hcbyaykn37r3i50icxmgqcylq4"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "d2fb65426c7998647fb1fb3db1fb5b222ab91df6",
|
||||
"sha256": "0mj1xi3v03fzcw1smpayvbvbgly2p3ysbgfz7jgfdhmxi4gl6gs6"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "org/clojure/tools.analyzer.jvm/1.1.0/tools.analyzer.jvm-1.1.0",
|
||||
"host": "https://repo1.maven.org/maven2",
|
||||
@@ -792,6 +948,19 @@
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "org/clojure/tools.analyzer/1.0.0/tools.analyzer-1.0.0",
|
||||
"host": "https://repo1.maven.org/maven2",
|
||||
"pom": {
|
||||
"sha1": "fa72b6392b31762b55e0dc3de1c220ecdc6bb8a7",
|
||||
"sha256": "1yg46a9zbga7rsrhwdv877hh60hcbyaykn37r3i50icxmgqcylq4"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "d2fb65426c7998647fb1fb3db1fb5b222ab91df6",
|
||||
"sha256": "0mj1xi3v03fzcw1smpayvbvbgly2p3ysbgfz7jgfdhmxi4gl6gs6"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "org/clojure/tools.cli/1.0.194/tools.cli-1.0.194",
|
||||
"host": "https://repo1.maven.org/maven2",
|
||||
@@ -845,15 +1014,15 @@
|
||||
},
|
||||
|
||||
{
|
||||
"path": "org/graalvm/js/js/20.1.0/js-20.1.0",
|
||||
"path": "org/codehaus/mojo/animal-sniffer-annotations/1.14/animal-sniffer-annotations-1.14",
|
||||
"host": "https://repo1.maven.org/maven2",
|
||||
"pom": {
|
||||
"sha1": "95452a7fdac1d358f1dd66b33e49f4440e986922",
|
||||
"sha256": "0gkazzg8771g3pc90fb99wmlk99rjimcryrmzz6zab742m4dbina"
|
||||
"sha1": "99a56e3312f8ece1d457c8ca0a3c4b69d173d000",
|
||||
"sha256": "09ianw2880ch3x6xq5d2cz2b15ik6f4ndf8hb7ckw7lr0ndg2y8q"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "0abe5e8068014ccb34cf075637a00b7ce37e4a8c",
|
||||
"sha256": "0v5pxjl9p7wwfrrzkkqh6qbvnn0p8n342smxzcqk3qxl4ah3aqnk"
|
||||
"sha1": "775b7e22fb10026eed3f86e8dc556dfafe35f2d5",
|
||||
"sha256": "0pchd4360mim0f0a6vwr33szigihgvv4ic1scz1l9mxssq5k4s10"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -870,6 +1039,19 @@
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "org/graalvm/js/js/20.1.0/js-20.1.0",
|
||||
"host": "https://repo1.maven.org/maven2",
|
||||
"pom": {
|
||||
"sha1": "95452a7fdac1d358f1dd66b33e49f4440e986922",
|
||||
"sha256": "0gkazzg8771g3pc90fb99wmlk99rjimcryrmzz6zab742m4dbina"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "0abe5e8068014ccb34cf075637a00b7ce37e4a8c",
|
||||
"sha256": "0v5pxjl9p7wwfrrzkkqh6qbvnn0p8n342smxzcqk3qxl4ah3aqnk"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "org/graalvm/regex/regex/20.1.0/regex-20.1.0",
|
||||
"host": "https://repo1.maven.org/maven2",
|
||||
@@ -1000,19 +1182,6 @@
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "org/ow2/asm/asm/7.1/asm-7.1",
|
||||
"host": "https://repo1.maven.org/maven2",
|
||||
"pom": {
|
||||
"sha1": "7e40eb6619fd20bd7d98bf775bfdd810aec87ac7",
|
||||
"sha256": "101i3pyrq082kjyz413hfqwkjjsyfnk9kx3rqr38ln56mlp78a8g"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "fa29aa438674ff19d5e1386d2c3527a0267f291e",
|
||||
"sha256": "1pnlb1ick32bihpzc599xl9ppd07qhls6pm0xaqwrj9cdlmzmcja"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "org/ow2/asm/asm-analysis/7.1/asm-analysis-7.1",
|
||||
"host": "https://repo1.maven.org/maven2",
|
||||
@@ -1065,6 +1234,19 @@
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "org/ow2/asm/asm/7.1/asm-7.1",
|
||||
"host": "https://repo1.maven.org/maven2",
|
||||
"pom": {
|
||||
"sha1": "7e40eb6619fd20bd7d98bf775bfdd810aec87ac7",
|
||||
"sha256": "101i3pyrq082kjyz413hfqwkjjsyfnk9kx3rqr38ln56mlp78a8g"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "fa29aa438674ff19d5e1386d2c3527a0267f291e",
|
||||
"sha256": "1pnlb1ick32bihpzc599xl9ppd07qhls6pm0xaqwrj9cdlmzmcja"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "org/wildfly/client/wildfly-client-config/1.0.1.Final/wildfly-client-config-1.0.1.Final",
|
||||
"host": "https://repo1.maven.org/maven2",
|
||||
@@ -1117,19 +1299,6 @@
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "reagent/reagent/1.2.0/reagent-1.2.0",
|
||||
"host": "https://repo.clojars.org",
|
||||
"pom": {
|
||||
"sha1": "d2279922777793edfc0ae9e01d68a832eb5ce52d",
|
||||
"sha256": "1h1gk4cykidm1jx75dq426lrgf8r7900fcir5jz59zp1ka2a0ywb"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "1b9a181b5c7ed3557768d2ea0c66f5616aef5e97",
|
||||
"sha256": "0scvkzfqjs613z10rngh7427v3pxdqablf0fcl65pbpkzz16wgav"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "re-com/re-com/2.8.0/re-com-2.8.0",
|
||||
"host": "https://repo.clojars.org",
|
||||
@@ -1143,19 +1312,6 @@
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "refactor-nrepl/refactor-nrepl/3.6.0/refactor-nrepl-3.6.0",
|
||||
"host": "https://repo.clojars.org",
|
||||
"pom": {
|
||||
"sha1": "699468e940eace1064d6fa7a7553bf87d4ed4026",
|
||||
"sha256": "12djd3mxi22b23c9vrv6amq1r9x9iq9b00s3ywl301rjmq5lqh4l"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "2b3bb82da53b5db9c2b2aa298417816b81d0ed97",
|
||||
"sha256": "1ysqabmlnghki6x0636zngxza2d83c85276wp9ma9wk183mkv52a"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "re-frame/re-frame/1.3.0/re-frame-1.3.0",
|
||||
"host": "https://repo.clojars.org",
|
||||
@@ -1195,6 +1351,32 @@
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "reagent/reagent/1.2.0/reagent-1.2.0",
|
||||
"host": "https://repo.clojars.org",
|
||||
"pom": {
|
||||
"sha1": "d2279922777793edfc0ae9e01d68a832eb5ce52d",
|
||||
"sha256": "1h1gk4cykidm1jx75dq426lrgf8r7900fcir5jz59zp1ka2a0ywb"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "1b9a181b5c7ed3557768d2ea0c66f5616aef5e97",
|
||||
"sha256": "0scvkzfqjs613z10rngh7427v3pxdqablf0fcl65pbpkzz16wgav"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "refactor-nrepl/refactor-nrepl/2.5.0/refactor-nrepl-2.5.0",
|
||||
"host": "https://repo.clojars.org",
|
||||
"pom": {
|
||||
"sha1": "0bce30b420249ba7e4b90cbb3e046b4bb5416389",
|
||||
"sha256": "0zmg5qc8d55pry7832isiwd2q237znfjqjpxchd2hvlpalh5qnva"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "6bc3441afc94f7ca024e41a864ca75e05df7e207",
|
||||
"sha256": "0w8hax99y98l53mixxzx2ja0vcnhjv8dnsaz1zj3vqk775ns5w6i"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "ring-cors/ring-cors/0.1.8/ring-cors-0.1.8",
|
||||
"host": "https://repo.clojars.org",
|
||||
@@ -1274,15 +1456,15 @@
|
||||
},
|
||||
|
||||
{
|
||||
"path": "thheller/shadow-cljs/2.12.0/shadow-cljs-2.12.0-aot",
|
||||
"path": "thheller/shadow-cljs/2.11.16/shadow-cljs-2.11.16-aot",
|
||||
"host": "https://repo.clojars.org",
|
||||
"pom": {
|
||||
"sha1": "e89cabf1b6c7d268ee38343c839bc17c62160eaf",
|
||||
"sha256": "0l9yv2c6acp3n2x5z1g9nqwqx58hl619srls5flnlf2x41f5gn7f"
|
||||
"sha1": "c06750fa2103c3ade8e9580034401d7379558768",
|
||||
"sha256": "09m0yl56b2ld1a9031x6x3wlzys608hfzdf87hrnmpihg8khq5ph"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "4748679d4953be302acf7e791b284a8dc49523d7",
|
||||
"sha256": "1gcbna7wam7fnhrxxfb4v3agq0655la2fmwd7r9a6ip9xxc86z3a"
|
||||
"sha1": "6da05fd411b96fa939fa4df19aa28c0a37b0a87d",
|
||||
"sha256": "1w6xm7bfg216cygmc4skns2laip3b7vp8nvgqmylpgna1k21mps2"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1299,19 +1481,6 @@
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "thheller/shadow-undertow/0.1.0/shadow-undertow-0.1.0",
|
||||
"host": "https://repo.clojars.org",
|
||||
"pom": {
|
||||
"sha1": "456dc9b20bccd14b6012540547d1a8e7c47f7c66",
|
||||
"sha256": "0gwxvbpkfvy84h01gjasd0fnfgqmsaybiilbz0461vaazvcd3v8b"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "e072ad66285641c59df19f5352872a51da106156",
|
||||
"sha256": "1ywcyfsrr3g42kxwchj6jvb2x43md3sdpnnk87h9m5g786ilay3r"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "thheller/shadow-util/0.7.0/shadow-util-0.7.0",
|
||||
"host": "https://repo.clojars.org",
|
||||
|
||||
+33
-20
@@ -1,9 +1,10 @@
|
||||
args4j/args4j/2.0.26/args4j-2.0.26.jar
|
||||
bidi/bidi/2.1.6/bidi-2.1.6.jar
|
||||
binaryage/env-config/0.2.2/env-config-0.2.2.jar
|
||||
binaryage/oops/0.7.2/oops-0.7.2.jar
|
||||
binaryage/oops/0.7.0/oops-0.7.0.jar
|
||||
camel-snake-kebab/camel-snake-kebab/0.4.3/camel-snake-kebab-0.4.3.jar
|
||||
cider/cider-nrepl/0.29.0/cider-nrepl-0.29.0.jar
|
||||
cider/piggieback/0.5.2/piggieback-0.5.2.jar
|
||||
cider/cider-nrepl/0.25.3/cider-nrepl-0.25.3.jar
|
||||
cider/piggieback/0.4.1/piggieback-0.4.1.jar
|
||||
cljs-bean/cljs-bean/1.3.0/cljs-bean-1.3.0.jar
|
||||
clout/clout/2.1.2/clout-2.1.2.jar
|
||||
com/andrewmcveigh/cljs-time/0.5.2/cljs-time-0.5.2.jar
|
||||
@@ -13,19 +14,30 @@ com/cognitect/transit-cljs/0.8.248/transit-cljs-0.8.248.jar
|
||||
com/cognitect/transit-java/1.0.343/transit-java-1.0.343.jar
|
||||
com/cognitect/transit-js/0.8.846/transit-js-0.8.846.jar
|
||||
com/fasterxml/jackson/core/jackson-core/2.8.7/jackson-core-2.8.7.jar
|
||||
com/google/code/findbugs/jsr305/3.0.1/jsr305-3.0.1.jar
|
||||
com/google/code/gson/gson/2.7/gson-2.7.jar
|
||||
com/google/elemental2/elemental2-core/1.0.0-RC1/elemental2-core-1.0.0-RC1.jar
|
||||
com/google/errorprone/error_prone_annotations/2.3.1/error_prone_annotations-2.3.1.jar
|
||||
com/google/guava/guava/25.1-jre/guava-25.1-jre.jar
|
||||
com/google/j2objc/j2objc-annotations/1.1/j2objc-annotations-1.1.jar
|
||||
com/google/javascript/closure-compiler-externs/v20200830/closure-compiler-externs-v20200830.jar
|
||||
com/google/javascript/closure-compiler-unshaded/v20200830/closure-compiler-unshaded-v20200830.jar
|
||||
com/google/jsinterop/base/1.0.0/base-1.0.0.jar
|
||||
com/google/jsinterop/jsinterop-annotations/1.0.2/jsinterop-annotations-1.0.2.jar
|
||||
com/google/protobuf/protobuf-java/3.11.1/protobuf-java-3.11.1.jar
|
||||
com/google/re2j/re2j/1.3/re2j-1.3.jar
|
||||
com/googlecode/json-simple/json-simple/1.1.1/json-simple-1.1.1.jar
|
||||
com/google/javascript/closure-compiler-unshaded/v20210302/closure-compiler-unshaded-v20210302.jar
|
||||
com/ibm/icu/icu4j/66.1/icu4j-66.1.jar
|
||||
commons-codec/commons-codec/1.10/commons-codec-1.10.jar
|
||||
commons-fileupload/commons-fileupload/1.4/commons-fileupload-1.4.jar
|
||||
commons-io/commons-io/2.6/commons-io-2.6.jar
|
||||
compojure/compojure/1.5.2/compojure-1.5.2.jar
|
||||
com/taoensso/encore/2.105.0/encore-2.105.0.jar
|
||||
com/taoensso/timbre/4.10.0/timbre-4.10.0.jar
|
||||
com/taoensso/truss/1.5.0/truss-1.5.0.jar
|
||||
com/taoensso/tufte/2.1.0/tufte-2.1.0.jar
|
||||
com/wsscode/pathom/2.2.31/pathom-2.2.31.jar
|
||||
com/wsscode/spec-inspec/1.0.0-alpha2/spec-inspec-1.0.0-alpha2.jar
|
||||
commons-codec/commons-codec/1.10/commons-codec-1.10.jar
|
||||
commons-fileupload/commons-fileupload/1.4/commons-fileupload-1.4.jar
|
||||
commons-io/commons-io/2.6/commons-io-2.6.jar
|
||||
compojure/compojure/1.5.2/compojure-1.5.2.jar
|
||||
crypto-equality/crypto-equality/1.0.0/crypto-equality-1.0.0.jar
|
||||
crypto-random/crypto-random/1.2.0/crypto-random-1.2.0.jar
|
||||
day8/re-frame/test/0.1.5/test-0.1.5.jar
|
||||
@@ -37,15 +49,16 @@ hickory/hickory/0.7.1/hickory-0.7.1.jar
|
||||
http-kit/http-kit/2.2.0/http-kit-2.2.0.jar
|
||||
instaparse/instaparse/1.4.0/instaparse-1.4.0.jar
|
||||
io/aviso/pretty/0.1.33/pretty-0.1.33.jar
|
||||
io/undertow/undertow-core/2.2.4.Final/undertow-core-2.2.4.Final.jar
|
||||
io/undertow/undertow-core/2.1.3.Final/undertow-core-2.1.3.Final.jar
|
||||
javax/servlet/servlet-api/2.5/servlet-api-2.5.jar
|
||||
javax/xml/bind/jaxb-api/2.3.0/jaxb-api-2.3.0.jar
|
||||
medley/medley/0.8.2/medley-0.8.2.jar
|
||||
mvxcvi/alphabase/1.0.0/alphabase-1.0.0.jar
|
||||
net/cgrand/macrovich/0.2.1/macrovich-0.2.1.jar
|
||||
nrepl/nrepl/1.0.0/nrepl-1.0.0.jar
|
||||
nrepl/nrepl/0.7.0/nrepl-0.7.0.jar
|
||||
org/checkerframework/checker-qual/2.0.0/checker-qual-2.0.0.jar
|
||||
org/clojure/clojure/1.10.1/clojure-1.10.1.jar
|
||||
org/clojure/clojurescript/1.10.844/clojurescript-1.10.844.jar
|
||||
org/clojure/clojurescript/1.10.773/clojurescript-1.10.773.jar
|
||||
org/clojure/core.async/1.3.610/core.async-1.3.610.jar
|
||||
org/clojure/core.cache/1.0.207/core.cache-1.0.207.jar
|
||||
org/clojure/core.memoize/1.0.236/core.memoize-1.0.236.jar
|
||||
@@ -53,18 +66,19 @@ org/clojure/core.rrb-vector/0.1.1/core.rrb-vector-0.1.1.jar
|
||||
org/clojure/core.specs.alpha/0.2.44/core.specs.alpha-0.2.44.jar
|
||||
org/clojure/data.json/1.0.0/data.json-1.0.0.jar
|
||||
org/clojure/data.priority-map/1.0.0/data.priority-map-1.0.0.jar
|
||||
org/clojure/google-closure-library/0.0-20201211-3e6c510d/google-closure-library-0.0-20201211-3e6c510d.jar
|
||||
org/clojure/google-closure-library-third-party/0.0-20201211-3e6c510d/google-closure-library-third-party-0.0-20201211-3e6c510d.jar
|
||||
org/clojure/google-closure-library-third-party/0.0-20191016-6ae1f72f/google-closure-library-third-party-0.0-20191016-6ae1f72f.jar
|
||||
org/clojure/google-closure-library/0.0-20191016-6ae1f72f/google-closure-library-0.0-20191016-6ae1f72f.jar
|
||||
org/clojure/spec.alpha/0.2.176/spec.alpha-0.2.176.jar
|
||||
org/clojure/test.check/1.1.0/test.check-1.1.0.jar
|
||||
org/clojure/tools.analyzer/1.0.0/tools.analyzer-1.0.0.jar
|
||||
org/clojure/tools.analyzer.jvm/1.1.0/tools.analyzer.jvm-1.1.0.jar
|
||||
org/clojure/tools.analyzer/1.0.0/tools.analyzer-1.0.0.jar
|
||||
org/clojure/tools.cli/1.0.194/tools.cli-1.0.194.jar
|
||||
org/clojure/tools.logging/1.1.0/tools.logging-1.1.0.jar
|
||||
org/clojure/tools.macro/0.1.5/tools.macro-0.1.5.jar
|
||||
org/clojure/tools.reader/1.3.3/tools.reader-1.3.3.jar
|
||||
org/graalvm/js/js/20.1.0/js-20.1.0.jar
|
||||
org/codehaus/mojo/animal-sniffer-annotations/1.14/animal-sniffer-annotations-1.14.jar
|
||||
org/graalvm/js/js-scriptengine/20.1.0/js-scriptengine-20.1.0.jar
|
||||
org/graalvm/js/js/20.1.0/js-20.1.0.jar
|
||||
org/graalvm/regex/regex/20.1.0/regex-20.1.0.jar
|
||||
org/graalvm/sdk/graal-sdk/20.1.0/graal-sdk-20.1.0.jar
|
||||
org/graalvm/truffle/truffle-api/20.1.0/truffle-api-20.1.0.jar
|
||||
@@ -75,29 +89,28 @@ org/jboss/xnio/xnio-api/3.8.0.Final/xnio-api-3.8.0.Final.jar
|
||||
org/jboss/xnio/xnio-nio/3.8.0.Final/xnio-nio-3.8.0.Final.jar
|
||||
org/jsoup/jsoup/1.9.2/jsoup-1.9.2.jar
|
||||
org/msgpack/msgpack/0.6.12/msgpack-0.6.12.jar
|
||||
org/ow2/asm/asm/7.1/asm-7.1.jar
|
||||
org/ow2/asm/asm-analysis/7.1/asm-analysis-7.1.jar
|
||||
org/ow2/asm/asm-commons/7.1/asm-commons-7.1.jar
|
||||
org/ow2/asm/asm-tree/7.1/asm-tree-7.1.jar
|
||||
org/ow2/asm/asm-util/7.1/asm-util-7.1.jar
|
||||
org/ow2/asm/asm/7.1/asm-7.1.jar
|
||||
org/wildfly/client/wildfly-client-config/1.0.1.Final/wildfly-client-config-1.0.1.Final.jar
|
||||
org/wildfly/common/wildfly-common/1.5.2.Final/wildfly-common-1.5.2.Final.jar
|
||||
prismatic/schema/1.1.7/schema-1.1.7.jar
|
||||
quoin/quoin/0.1.2/quoin-0.1.2.jar
|
||||
reagent/reagent/1.2.0/reagent-1.2.0.jar
|
||||
re-com/re-com/2.8.0/re-com-2.8.0.jar
|
||||
refactor-nrepl/refactor-nrepl/3.6.0/refactor-nrepl-3.6.0.jar
|
||||
re-frame/re-frame/1.3.0/re-frame-1.3.0.jar
|
||||
re-frisk-remote/re-frisk-remote/1.6.0/re-frisk-remote-1.6.0.jar
|
||||
re-frisk/sente/1.15.0/sente-1.15.0.jar
|
||||
reagent/reagent/1.2.0/reagent-1.2.0.jar
|
||||
refactor-nrepl/refactor-nrepl/2.5.0/refactor-nrepl-2.5.0.jar
|
||||
ring-cors/ring-cors/0.1.8/ring-cors-0.1.8.jar
|
||||
ring/ring-codec/1.1.2/ring-codec-1.1.2.jar
|
||||
ring/ring-core/1.8.1/ring-core-1.8.1.jar
|
||||
spec-coerce/spec-coerce/1.0.0-alpha6/spec-coerce-1.0.0-alpha6.jar
|
||||
status-im/timbre/4.10.0-2-status/timbre-4.10.0-2-status.jar
|
||||
thheller/shadow-client/1.3.3/shadow-client-1.3.3.jar
|
||||
thheller/shadow-cljs/2.12.0/shadow-cljs-2.12.0-aot.jar
|
||||
thheller/shadow-cljs/2.11.16/shadow-cljs-2.11.16-aot.jar
|
||||
thheller/shadow-cljsjs/0.0.21/shadow-cljsjs-0.0.21.jar
|
||||
thheller/shadow-undertow/0.1.0/shadow-undertow-0.1.0.jar
|
||||
thheller/shadow-util/0.7.0/shadow-util-0.7.0.jar
|
||||
viebel/codox-klipse-theme/0.0.1/codox-klipse-theme-0.0.1.jar
|
||||
|
||||
+2
-2
@@ -44,7 +44,7 @@
|
||||
"react-native-camera-kit": "^13.0.0",
|
||||
"react-native-config": "^1.5.0",
|
||||
"react-native-dialogs": "^1.0.4",
|
||||
"react-native-draggable-flatlist": "^4.0.1",
|
||||
"react-native-draggable-flatlist": "^3.0.3",
|
||||
"react-native-fast-image": "^8.5.11",
|
||||
"react-native-fetch-polyfill": "^1.1.2",
|
||||
"react-native-fs": "^2.14.1",
|
||||
@@ -99,7 +99,7 @@
|
||||
"process": "0.11.10",
|
||||
"react-test-renderer": "18.0.0",
|
||||
"rn-snoopy": "git+https://github.com/status-im/rn-snoopy.git#refs/tags/v2.0.2-status",
|
||||
"shadow-cljs": "2.25.0"
|
||||
"shadow-cljs": "2.11.16"
|
||||
},
|
||||
"binary": {
|
||||
"module_name": "status_nodejs_addon",
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.9 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 2.1 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 3.0 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 421 KiB |
+11
-14
@@ -3,27 +3,23 @@
|
||||
|
||||
:dependencies [[reagent "1.2.0"]
|
||||
[re-frame "1.3.0"]
|
||||
[binaryage/oops "0.7.2"]
|
||||
[binaryage/oops "0.7.0"]
|
||||
[com.andrewmcveigh/cljs-time "0.5.2"]
|
||||
[status-im/timbre "4.10.0-2-status"]
|
||||
[com.taoensso/encore "2.105.0"]
|
||||
[hickory "0.7.1"]
|
||||
[cljs-bean "1.3.0"]
|
||||
[com.cognitect/transit-cljs "0.8.248"]
|
||||
[mvxcvi/alphabase "1.0.0"]
|
||||
[camel-snake-kebab "0.4.3"]
|
||||
;; Dev dependencies
|
||||
;; dev dependencies
|
||||
[refactor-nrepl "2.5.0"]
|
||||
[cider/cider-nrepl "0.25.3"]
|
||||
[cider/piggieback "0.4.1"]
|
||||
[re-frisk-remote "1.6.0"]
|
||||
;; We don't use the encore library, but re-frisk requires re-frisk/sente (fork of
|
||||
;; com.taoensso/sente), which in turn requires encore. We need to bump encore to
|
||||
;; 3.21.0+ to remove a warning displayed while shadow-cljs starts (commit
|
||||
;; https://github.com/ptaoussanis/encore/commit/f7a21567b9611a63999609ca183c7fb175034bd6).
|
||||
[com.taoensso/encore "3.21.0"]
|
||||
;; Routing
|
||||
;; routing
|
||||
[bidi "2.1.6"]
|
||||
;; Test dependencies
|
||||
;; test dependencies
|
||||
[day8.re-frame/test "0.1.5"]
|
||||
[com.taoensso/tufte "2.1.0"]]
|
||||
|
||||
@@ -52,9 +48,10 @@
|
||||
:after-load-async status-im2.setup.hot-reload/reload
|
||||
:build-notify status-im2.setup.hot-reload/build-notify
|
||||
:preloads [re-frisk-remote.preload
|
||||
;; In order to use component test helpers in the REPL we
|
||||
;; need to preload namespaces that are not normally required
|
||||
;; by production code, such as
|
||||
;; In order to use component test helpers in
|
||||
;; the REPL we need to preload namespaces
|
||||
;; that are not normally required by
|
||||
;; production code, such as
|
||||
;; @testing-library/react-native.
|
||||
test-helpers.component]}
|
||||
:closure-defines
|
||||
@@ -102,8 +99,8 @@
|
||||
:output-dir "target/test"
|
||||
:optimizations :simple
|
||||
:target :node-test
|
||||
;; Uncomment line below to `make test-watch` a specific file
|
||||
;; :ns-regexp "status-im2.subs.chat.messages-test$"
|
||||
;; When running tests without a REPL you can uncomment below line to `make test-watch` a specific file
|
||||
;; :ns-regexp "status-im2.subs.chat.messages-test$"
|
||||
:main
|
||||
status-im.test-runner/main
|
||||
;; set :ui-driven to true to let shadow-cljs inject node-repl
|
||||
|
||||
@@ -225,12 +225,12 @@
|
||||
(.verifyDatabasePassword ^js (status) key-uid hashed-password callback))
|
||||
|
||||
(defn login-with-keycard
|
||||
[{:keys [key-uid multiaccount-data password chat-key node-config]}]
|
||||
[{:keys [key-uid multiaccount-data password chat-key]}]
|
||||
(log/debug "[native-module] login-with-keycard")
|
||||
(clear-web-data)
|
||||
(init-keystore
|
||||
key-uid
|
||||
#(.loginWithKeycard ^js (status) multiaccount-data password chat-key (types/clj->json node-config))))
|
||||
#(.loginWithKeycard ^js (status) multiaccount-data password chat-key)))
|
||||
|
||||
(defn set-soft-input-mode
|
||||
[mode]
|
||||
@@ -258,13 +258,6 @@
|
||||
(log/debug "[native-module] hash-message")
|
||||
(.hashMessage ^js (status) message callback))
|
||||
|
||||
(defn start-searching-for-local-pairing-peers
|
||||
"starts a UDP multicast beacon that both listens for and broadcasts to LAN peers"
|
||||
[callback]
|
||||
(log/info "[native-module] Start Searching for Local Pairing Peers"
|
||||
{:fn :start-searching-for-local-pairing-peers})
|
||||
(.startSearchForLocalPairingPeers ^js (status) callback))
|
||||
|
||||
(defn local-pairing-preflight-outbound-check
|
||||
"Checks whether the device has allows connecting to the local server"
|
||||
[callback]
|
||||
@@ -468,19 +461,19 @@
|
||||
(.numberToHex ^js (status) (str num)))
|
||||
|
||||
(defn sha3
|
||||
[s]
|
||||
[str]
|
||||
(log/debug "[native-module] sha3")
|
||||
(.sha3 ^js (status) s))
|
||||
(.sha3 ^js (status) str))
|
||||
|
||||
(defn utf8-to-hex
|
||||
[s]
|
||||
[str]
|
||||
(log/debug "[native-module] utf8-to-hex")
|
||||
(.utf8ToHex ^js (status) s))
|
||||
(.utf8ToHex ^js (status) str))
|
||||
|
||||
(defn hex-to-utf8
|
||||
[s]
|
||||
[str]
|
||||
(log/debug "[native-module] hex-to-utf8")
|
||||
(.hexToUtf8 ^js (status) s))
|
||||
(.hexToUtf8 ^js (status) str))
|
||||
|
||||
(defn check-address-checksum
|
||||
[address]
|
||||
|
||||
+14
-14
@@ -82,8 +82,8 @@
|
||||
:restDisplacementThreshold 0.001}})
|
||||
|
||||
(defn set-value
|
||||
[anim v]
|
||||
(ocall anim "setValue" v))
|
||||
[anim val]
|
||||
(ocall anim "setValue" val))
|
||||
|
||||
(def Value (oget animated "Value"))
|
||||
|
||||
@@ -178,20 +178,20 @@
|
||||
(.withOffset ^js redash (clj->js config)))
|
||||
|
||||
(defn with-spring-transition
|
||||
[v config]
|
||||
(.withSpringTransition ^js redash v (clj->js config)))
|
||||
[val config]
|
||||
(.withSpringTransition ^js redash val (clj->js config)))
|
||||
|
||||
(defn with-timing-transition
|
||||
[v config]
|
||||
(.withTimingTransition ^js redash v (clj->js config)))
|
||||
[val config]
|
||||
(.withTimingTransition ^js redash val (clj->js config)))
|
||||
|
||||
(defn use-spring-transition
|
||||
[v config]
|
||||
(.useSpringTransition ^js redash v (clj->js config)))
|
||||
[val config]
|
||||
(.useSpringTransition ^js redash val (clj->js config)))
|
||||
|
||||
(defn use-timing-transition
|
||||
[v config]
|
||||
(.useTimingTransition ^js redash v (clj->js config)))
|
||||
[val config]
|
||||
(.useTimingTransition ^js redash val (clj->js config)))
|
||||
|
||||
(defn re-timing
|
||||
[config]
|
||||
@@ -232,11 +232,11 @@
|
||||
:onGestureEvent (.-onGestureEvent ^js gesture)}))
|
||||
|
||||
(defn snap-point
|
||||
[v velocity snap-points]
|
||||
(.snapPoint ^js redash v velocity (to-array snap-points)))
|
||||
[value velocity snap-points]
|
||||
(.snapPoint ^js redash value velocity (to-array snap-points)))
|
||||
|
||||
(defn with-easing
|
||||
[{v :value
|
||||
[{val :value
|
||||
:keys [snap-points velocity offset state easing duration
|
||||
animation-over]
|
||||
:or {duration 250
|
||||
@@ -257,7 +257,7 @@
|
||||
(set position offset))
|
||||
(cond* (neq state (:end gh/states))
|
||||
[(set animation-over 0)
|
||||
(set position (add offset v))])
|
||||
(set position (add offset val))])
|
||||
(cond* (and* (eq state (:end gh/states))
|
||||
(not* animation-over))
|
||||
[(set position
|
||||
|
||||
+5
-5
@@ -12,9 +12,9 @@
|
||||
|
||||
;; Inspired from UIX, Rum and Rumext
|
||||
(defn set-ref-val!
|
||||
[ref v]
|
||||
(oset! ref "current" v)
|
||||
v)
|
||||
[ref val]
|
||||
(oset! ref "current" val)
|
||||
val)
|
||||
|
||||
(defn set-native-props
|
||||
[^js ref ^js props]
|
||||
@@ -54,8 +54,8 @@
|
||||
#js [value set-value])))
|
||||
|
||||
(defn use-ref
|
||||
[v]
|
||||
(let [ref (react/useRef v)]
|
||||
[val]
|
||||
(let [ref (react/useRef val)]
|
||||
(reify
|
||||
cljs.core/IHash
|
||||
(-hash [_] (goog/getUid ref))
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
:border-radius dimensions}))
|
||||
|
||||
(defn initials-avatar
|
||||
[size draw-ring? customization-color theme]
|
||||
[size draw-ring? customization-color]
|
||||
(let [outer-dimensions (get-in sizes [size :outer])
|
||||
inner-dimensions (get-in sizes [size (if draw-ring? :inner :outer)])]
|
||||
{:position :absolute
|
||||
@@ -52,7 +52,7 @@
|
||||
:border-radius inner-dimensions
|
||||
:justify-content :center
|
||||
:align-items :center
|
||||
:background-color (colors/custom-color-by-theme customization-color 50 60 nil nil theme)}))
|
||||
:background-color (colors/custom-color-by-theme customization-color 50 60)}))
|
||||
|
||||
(def initials-avatar-text
|
||||
{:color colors/white-opa-70})
|
||||
@@ -67,7 +67,7 @@
|
||||
:background-color background}))
|
||||
|
||||
(defn dot
|
||||
[size ring? theme]
|
||||
[size ring?]
|
||||
(let [dimensions (get-in sizes [size :status-indicator])
|
||||
border-width (get-in sizes [size :status-indicator-border])
|
||||
right (case size
|
||||
@@ -89,5 +89,5 @@
|
||||
:height dimensions
|
||||
:border-width border-width
|
||||
:border-radius dimensions
|
||||
:background-color (colors/theme-colors colors/white colors/neutral-100 theme)
|
||||
:border-color (colors/theme-colors colors/white colors/neutral-100 theme)}))
|
||||
:background-color (colors/theme-colors colors/white colors/neutral-100)
|
||||
:border-color (colors/theme-colors colors/white colors/neutral-100)}))
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
(ns quo2.components.avatars.user-avatar.view
|
||||
(:require [quo2.components.avatars.user-avatar.style :as style]
|
||||
[quo2.components.markdown.text :as text]
|
||||
[quo2.theme :as quo.theme]
|
||||
[react-native.core :as rn]
|
||||
[react-native.fast-image :as fast-image]
|
||||
utils.string))
|
||||
|
||||
(defn initials-avatar
|
||||
[{:keys [full-name size draw-ring? customization-color theme]}]
|
||||
[{:keys [full-name size draw-ring? customization-color]}]
|
||||
(let [font-size (get-in style/sizes [size :font-size])
|
||||
amount-initials (if (#{:xs :xxs :xxxs} size) 1 2)]
|
||||
[rn/view
|
||||
{:accessibility-label :initials-avatar
|
||||
:style (style/initials-avatar size draw-ring? customization-color theme)}
|
||||
:style (style/initials-avatar size draw-ring? customization-color)}
|
||||
[text/text
|
||||
{:style style/initials-avatar-text
|
||||
:size font-size
|
||||
@@ -21,12 +20,12 @@
|
||||
|
||||
(def valid-ring-sizes #{:big :medium :small})
|
||||
|
||||
(defn- user-avatar-internal
|
||||
(defn user-avatar
|
||||
"If no `profile-picture` is given, draws the initials based on the `full-name` and
|
||||
uses `ring-background` to display the ring behind the initials when given. Otherwise,
|
||||
shows the `profile-picture` which already comes with the ring drawn."
|
||||
[{:keys [full-name status-indicator? online? size profile-picture ring-background
|
||||
customization-color static? muted? theme]
|
||||
customization-color static? muted?]
|
||||
:or {status-indicator? true
|
||||
online? true
|
||||
size :big
|
||||
@@ -50,14 +49,11 @@
|
||||
{:full-name full-name
|
||||
:size size
|
||||
:draw-ring? draw-ring?
|
||||
:customization-color customization-color
|
||||
:theme theme}])
|
||||
:customization-color customization-color}])
|
||||
(when status-indicator?
|
||||
[rn/view
|
||||
{:accessibility-label :status-indicator
|
||||
:style (style/dot size draw-ring? theme)}
|
||||
:style (style/dot size draw-ring?)}
|
||||
[rn/view
|
||||
{:accessibility-label :inner-status-indicator-dot
|
||||
:style (style/inner-dot size online?)}]])]))
|
||||
|
||||
(def user-avatar (quo.theme/with-theme user-avatar-internal))
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
(ns quo2.components.browser.browser-input.component-spec
|
||||
(:require [quo2.components.browser.browser-input.view :as browser-input]
|
||||
[test-helpers.component :as h]))
|
||||
|
||||
(h/describe "Browser input"
|
||||
(h/test "Renders empty in default state"
|
||||
(h/render [browser-input/browser-input
|
||||
{:on-change-text (h/mock-fn)
|
||||
:value ""}])
|
||||
(h/is-truthy (h/get-by-label-text :browser-input)))
|
||||
|
||||
(h/test "On change text is fired"
|
||||
(let [on-change-text (h/mock-fn)]
|
||||
(h/render [browser-input/browser-input
|
||||
{:on-change-text on-change-text
|
||||
:value "mock text"}])
|
||||
(h/fire-event :change-text (h/get-by-label-text :browser-input) "mock-text-new")
|
||||
(h/was-called on-change-text)))
|
||||
|
||||
(h/describe "Input Label"
|
||||
(h/test "Doesn't render label text when input is focused"
|
||||
(h/render [browser-input/browser-input
|
||||
{:auto-focus true}])
|
||||
(h/is-null (h/query-by-label-text :browser-input-label)))
|
||||
|
||||
(h/test "Renders label text when input has a value and input is not focused"
|
||||
(h/render [browser-input/browser-input
|
||||
{:default-value "mock default"}])
|
||||
(h/is-truthy (h/query-by-label-text :browser-input-label)))
|
||||
|
||||
(h/test "Renders site favicon when specified"
|
||||
(h/render [browser-input/browser-input
|
||||
{:default-value "mock default" :favicon :i/verified}])
|
||||
(h/is-truthy (h/query-by-label-text :browser-input-favicon)))
|
||||
|
||||
(h/test "Renders lock icon when lock is enabled"
|
||||
(h/render [browser-input/browser-input
|
||||
{:default-value "mock default" :locked? true}])
|
||||
(h/is-truthy (h/query-by-label-text :browser-input-locked-icon))))
|
||||
|
||||
(h/describe "Clear button"
|
||||
(h/test "Doesn't render in default state"
|
||||
(h/render [browser-input/browser-input])
|
||||
(h/is-null (h/query-by-label-text :browser-input-clear-button)))
|
||||
|
||||
(h/test "Renders when there is a value"
|
||||
(h/render [browser-input/browser-input
|
||||
{:default-value "mock text"}])
|
||||
(h/is-truthy (h/query-by-label-text :browser-input-clear-button)))
|
||||
|
||||
(h/test "Is pressable"
|
||||
(let [on-clear (h/mock-fn)]
|
||||
(h/render [browser-input/browser-input
|
||||
{:default-value "mock text"
|
||||
:on-clear on-clear}])
|
||||
(h/is-truthy (h/query-by-label-text :browser-input-clear-button))
|
||||
(h/fire-event :press (h/query-by-label-text :browser-input-clear-button))
|
||||
(h/was-called on-clear)))))
|
||||
@@ -1,56 +0,0 @@
|
||||
(ns quo2.components.browser.browser-input.style
|
||||
(:require [quo2.components.markdown.text :as text]
|
||||
[quo2.foundations.colors :as colors]))
|
||||
|
||||
(def clear-icon-container
|
||||
{:align-items :center
|
||||
:height 20
|
||||
:justify-content :center
|
||||
:margin-left 8
|
||||
:top 4
|
||||
:width 20})
|
||||
|
||||
(def favicon-icon-container
|
||||
{:margin-right 2})
|
||||
|
||||
(defn input
|
||||
[disabled?]
|
||||
(assoc (text/text-style {:size :paragraph-1
|
||||
:weight :regular})
|
||||
:flex 1
|
||||
:min-height 36
|
||||
:min-width 120
|
||||
:opacity (if disabled? 0.3 1)))
|
||||
|
||||
(def lock-icon-container
|
||||
{:margin-left 2})
|
||||
|
||||
(defn active-container
|
||||
[display?]
|
||||
{:align-items :center
|
||||
:flex-direction :row
|
||||
:justify-content :center
|
||||
:opacity (if display? 1 0)})
|
||||
|
||||
(def default-container
|
||||
{:align-items :center
|
||||
:bottom 0
|
||||
:flex-direction :row
|
||||
:left 0
|
||||
:padding-horizontal 20
|
||||
:position :absolute
|
||||
:right 0
|
||||
:top 0
|
||||
:z-index 10})
|
||||
|
||||
(defn text
|
||||
[]
|
||||
(assoc (text/text-style {:size :paragraph-1
|
||||
:weight :medium})
|
||||
:color
|
||||
(colors/theme-colors colors/neutral-100 colors/white)))
|
||||
|
||||
(def root-container
|
||||
{:height 60
|
||||
:padding-horizontal 20
|
||||
:padding-vertical 8})
|
||||
@@ -1,144 +0,0 @@
|
||||
(ns quo2.components.browser.browser-input.view
|
||||
(:require [quo2.components.icon :as icon]
|
||||
[quo2.components.browser.browser-input.style :as style]
|
||||
[react-native.core :as rn]
|
||||
[reagent.core :as reagent]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[quo2.theme :as quo2.theme]
|
||||
[clojure.string :as string]
|
||||
[react-native.platform :as platform]))
|
||||
|
||||
(defn remove-http-https-www
|
||||
[value]
|
||||
(string/replace value #"(https?://(www\.)?|http://)" ""))
|
||||
|
||||
(defn clear-icon-color
|
||||
[blur? theme]
|
||||
(if blur?
|
||||
(colors/theme-colors colors/neutral-80-opa-30 colors/white-opa-10 theme)
|
||||
(colors/theme-colors colors/neutral-40 colors/neutral-60 theme)))
|
||||
|
||||
(defn lock-icon-color
|
||||
[blur? theme]
|
||||
(if blur?
|
||||
(colors/theme-colors colors/neutral-80-opa-40 colors/white-opa-40 theme)
|
||||
(colors/theme-colors colors/neutral-50 colors/neutral-40 theme)))
|
||||
|
||||
(defn- clear-button
|
||||
[{:keys [on-press blur? theme]}]
|
||||
[rn/touchable-opacity
|
||||
{:accessibility-label :browser-input-clear-button
|
||||
:on-press on-press
|
||||
:style style/clear-icon-container}
|
||||
[icon/icon :i/clear
|
||||
{:color (clear-icon-color blur? theme)}]])
|
||||
|
||||
(defn lock-icon
|
||||
[{:keys [blur? theme]}]
|
||||
[rn/view
|
||||
[icon/icon :i/locked
|
||||
{:accessibility-label :browser-input-locked-icon
|
||||
:color (lock-icon-color blur? theme)
|
||||
:container-style style/lock-icon-container
|
||||
:size 16}]])
|
||||
|
||||
(defn cursor-color
|
||||
[customization-color theme]
|
||||
(colors/theme-colors (colors/custom-color customization-color 50)
|
||||
(colors/custom-color customization-color 60)
|
||||
theme))
|
||||
|
||||
(defn placeholder-color
|
||||
[state blur? theme]
|
||||
(cond
|
||||
(and blur? (= state :active))
|
||||
(colors/theme-colors colors/neutral-80-opa-20 colors/white-opa-20 theme)
|
||||
|
||||
blur?
|
||||
(colors/theme-colors colors/neutral-80-opa-40 colors/white-opa-30 theme)
|
||||
|
||||
(= state :active)
|
||||
(colors/theme-colors colors/neutral-30 colors/neutral-60 theme)
|
||||
|
||||
:else
|
||||
(colors/theme-colors colors/neutral-40 colors/neutral-50 theme)))
|
||||
|
||||
(def ^:private props-to-remove
|
||||
[:cursor-color :placeholder-text-color :editable :on-change-text :on-focus
|
||||
:on-blur :on-clear :value :disabled? :blur? :customization-color :theme])
|
||||
|
||||
(defn browser-input-internal
|
||||
[{:keys [default-value]
|
||||
:or {default-value ""}}]
|
||||
(let [state (reagent/atom :default)
|
||||
value (reagent/atom default-value)
|
||||
set-active #(reset! state :active)
|
||||
set-default #(reset! state :default)
|
||||
set-value #(reset! value %)
|
||||
ref (atom nil)
|
||||
clear-input (fn []
|
||||
(.clear ^js @ref)
|
||||
(reset! value ""))
|
||||
focus-input (fn []
|
||||
(set-active)
|
||||
(.focus ^js @ref))]
|
||||
(fn [{:keys [disabled? blur? on-change-text customization-color
|
||||
on-clear on-focus on-blur theme get-ref locked?
|
||||
favicon favicon-color favicon-size]
|
||||
:as props}]
|
||||
(let [clean-props (apply dissoc props props-to-remove)]
|
||||
[rn/view {:style style/root-container}
|
||||
(when (and (seq @value) (= @state :default))
|
||||
[rn/touchable-opacity
|
||||
{:style style/default-container
|
||||
:on-press focus-input}
|
||||
(when favicon
|
||||
[icon/icon favicon
|
||||
{:accessibility-label :browser-input-favicon
|
||||
:color favicon-color
|
||||
:container-style style/favicon-icon-container
|
||||
:size favicon-size}])
|
||||
[rn/text
|
||||
{:accessibility-label :browser-input-label
|
||||
:style (style/text)} (remove-http-https-www @value)]
|
||||
(when locked?
|
||||
[lock-icon
|
||||
{:blur? blur?
|
||||
:theme theme}])])
|
||||
[rn/view {:style (style/active-container (or (empty? @value) (= @state :active)))}
|
||||
[rn/text-input
|
||||
(merge
|
||||
clean-props
|
||||
{:accessibility-label :browser-input
|
||||
:auto-capitalize :none
|
||||
:auto-correct false
|
||||
:cursor-color (cursor-color customization-color theme)
|
||||
:editable (not disabled?)
|
||||
:keyboard-appearance (colors/theme-colors :light :dark theme)
|
||||
:keyboard-type :web-search
|
||||
:on-blur (fn []
|
||||
(set-default)
|
||||
(when on-blur (on-blur)))
|
||||
:on-change-text (fn [new-text]
|
||||
(set-value new-text)
|
||||
(when on-change-text (on-change-text new-text)))
|
||||
:on-focus (fn []
|
||||
(set-active)
|
||||
(when on-focus (on-focus)))
|
||||
:placeholder-text-color (placeholder-color @state blur? theme)
|
||||
:ref (fn [r]
|
||||
(reset! ref r)
|
||||
(when get-ref (get-ref r)))
|
||||
:selection-color (when platform/ios?
|
||||
(cursor-color customization-color theme))
|
||||
:select-text-on-focus true
|
||||
:style (style/input disabled?)})]
|
||||
(when (seq @value)
|
||||
[clear-button
|
||||
{:blur? blur?
|
||||
:on-press (fn []
|
||||
(clear-input)
|
||||
(when on-clear (on-clear)))
|
||||
:theme theme}])]]))))
|
||||
|
||||
(def browser-input (quo2.theme/with-theme browser-input-internal))
|
||||
@@ -1,103 +0,0 @@
|
||||
(ns quo2.components.buttons.button.properties
|
||||
(:require [quo2.foundations.colors :as colors]))
|
||||
|
||||
(defn custom-color-type
|
||||
[customization-color icon-only?]
|
||||
{:icon-color colors/white
|
||||
:icon-secondary-color colors/white-opa-70
|
||||
:label-color colors/white
|
||||
:background-color (colors/custom-color customization-color 50)
|
||||
:border-radius (when icon-only? 24)})
|
||||
|
||||
(defn grey-photo
|
||||
[theme pressed?]
|
||||
{:icon-color (colors/theme-colors colors/neutral-100 colors/white theme)
|
||||
:icon-secondary-color (colors/theme-colors colors/neutral-80-opa-40 colors/white-opa-70 theme)
|
||||
:label-color (colors/theme-colors colors/neutral-100 colors/white theme)
|
||||
:icon-background-color (colors/theme-colors colors/neutral-80-opa-10 colors/white-opa-10 theme)
|
||||
:blur-overlay-color (if pressed?
|
||||
(colors/theme-colors colors/white-opa-50
|
||||
colors/neutral-80-opa-50
|
||||
theme)
|
||||
(colors/theme-colors colors/white-opa-40
|
||||
colors/neutral-80-opa-40
|
||||
theme))
|
||||
:blur-type (if (= theme :light) :light :dark)})
|
||||
|
||||
(defn grey-blur
|
||||
[theme pressed?]
|
||||
{:icon-color (colors/theme-colors colors/neutral-100 colors/white theme)
|
||||
:icon-secondary-color (colors/theme-colors colors/neutral-80-opa-40 colors/white-opa-70 theme)
|
||||
:label-color (colors/theme-colors colors/neutral-100 colors/white theme)
|
||||
:background-color (if pressed?
|
||||
(colors/theme-colors colors/neutral-80-opa-10 colors/white-opa-10 theme)
|
||||
(colors/theme-colors colors/neutral-80-opa-5 colors/white-opa-5 theme))})
|
||||
|
||||
(defn outline-blur
|
||||
[theme pressed?]
|
||||
{:icon-color (colors/theme-colors colors/neutral-100 colors/white theme)
|
||||
:icon-secondary-color (colors/theme-colors colors/neutral-80-opa-40 colors/white-opa-40 theme)
|
||||
:label-color (colors/theme-colors colors/neutral-100 colors/white theme)
|
||||
:border-color (if pressed?
|
||||
(colors/theme-colors colors/neutral-80-opa-20 colors/white-opa-20 theme)
|
||||
(colors/theme-colors colors/neutral-80-opa-10 colors/white-opa-10 theme))})
|
||||
|
||||
(defn grey
|
||||
[theme pressed?]
|
||||
{:icon-color (colors/theme-colors colors/neutral-100 colors/white theme)
|
||||
:icon-secondary-color (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)
|
||||
:label-color (colors/theme-colors colors/neutral-100 colors/white theme)
|
||||
:background-color (if pressed?
|
||||
(colors/theme-colors colors/neutral-20 colors/neutral-60 theme)
|
||||
(colors/theme-colors colors/neutral-10 colors/neutral-80 theme))})
|
||||
|
||||
(defn dark-grey
|
||||
[theme pressed?]
|
||||
{:icon-color (colors/theme-colors colors/neutral-100 colors/white theme)
|
||||
:icon-secondary-color (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)
|
||||
:label-color (colors/theme-colors colors/neutral-100 colors/white theme)
|
||||
:background-color (if pressed?
|
||||
(colors/theme-colors colors/neutral-30 colors/neutral-60 theme)
|
||||
(colors/theme-colors colors/neutral-20 colors/neutral-90 theme))})
|
||||
|
||||
(defn outline
|
||||
[theme pressed?]
|
||||
{:icon-color (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)
|
||||
:icon-secondary-color (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)
|
||||
:label-color (colors/theme-colors colors/neutral-100 colors/white theme)
|
||||
:border-color (if pressed?
|
||||
(colors/theme-colors colors/neutral-40 colors/neutral-60 theme)
|
||||
(colors/theme-colors colors/neutral-30 colors/neutral-70 theme))})
|
||||
|
||||
(defn ghost
|
||||
[theme pressed?]
|
||||
{:icon-color (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)
|
||||
:icon-secondary-color (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)
|
||||
:label-color (colors/theme-colors colors/neutral-100 colors/white theme)
|
||||
:background-color (when pressed?
|
||||
(colors/theme-colors colors/neutral-10 colors/neutral-80 theme))})
|
||||
|
||||
(defn black
|
||||
[pressed?]
|
||||
{:icon-color colors/white
|
||||
:label-color colors/white
|
||||
:background-color (if pressed? colors/neutral-80 colors/neutral-95)})
|
||||
|
||||
(defn get-values
|
||||
[{:keys [customization-color theme type background pressed? icon-only?]}]
|
||||
(cond
|
||||
(= type :primary) (custom-color-type customization-color icon-only?)
|
||||
(= type :positive) (custom-color-type customization-color icon-only?)
|
||||
(= type :danger) (custom-color-type customization-color icon-only?)
|
||||
;; TODO Remove type blurred - https://github.com/status-im/status-mobile/issues/16535
|
||||
(and (= :photo background) (= type :grey)) (grey-photo theme pressed?)
|
||||
;; TODO Remove type blur-bg - https://github.com/status-im/status-mobile/issues/16535
|
||||
(or (= type :blur-bg)
|
||||
(and (= :blur background) (= type :grey))) (grey-blur theme pressed?)
|
||||
(and (= :blur background) (= type :outline)) (outline-blur theme pressed?)
|
||||
(= type :grey) (grey theme pressed?)
|
||||
(= type :dark-grey) (dark-grey theme pressed?)
|
||||
(= type :outline) (outline theme pressed?)
|
||||
(= type :ghost) (ghost theme pressed?)
|
||||
;; TODO: remove type shell - https://github.com/status-im/status-mobile/issues/16535
|
||||
(or (= type :shell) (= type :black)) (black pressed?)))
|
||||
@@ -1,4 +1,5 @@
|
||||
(ns quo2.components.buttons.button.style)
|
||||
(ns quo2.components.buttons.button.style
|
||||
(:require [quo2.foundations.colors :as colors]))
|
||||
|
||||
(def blur-view
|
||||
{:position :absolute
|
||||
@@ -7,97 +8,254 @@
|
||||
:right 0
|
||||
:bottom 0})
|
||||
|
||||
(defn icon-style
|
||||
[{:keys [icon-container-size icon-background-color icon-container-rounded?
|
||||
icon-size margin-left margin-right]}]
|
||||
(cond-> (merge {:margin-left margin-left
|
||||
:margin-right margin-right
|
||||
:align-items :center
|
||||
:justify-content :center})
|
||||
icon-container-size
|
||||
(assoc :width icon-container-size :height icon-container-size)
|
||||
icon-background-color
|
||||
(assoc :background-color icon-background-color)
|
||||
icon-container-rounded?
|
||||
(assoc :border-radius (/ (or icon-container-size icon-size) 2))))
|
||||
|
||||
(defn icon-left-icon-style
|
||||
(defn before-icon-style
|
||||
[{:keys [override-margins size icon-container-size icon-background-color icon-container-rounded?
|
||||
icon-size]}]
|
||||
(icon-style
|
||||
{:margin-left (or (get override-margins :left)
|
||||
(if (= size 40) 12 8))
|
||||
:margin-right (or (get override-margins :right) 4)
|
||||
:icon-container-size icon-container-size
|
||||
:icon-background-color icon-background-color
|
||||
:icon-container-rounded? icon-container-rounded?
|
||||
:icon-size icon-size}))
|
||||
(merge
|
||||
{:margin-left (or (get override-margins :left)
|
||||
(if (= size 40) 12 8))
|
||||
:margin-right (or (get override-margins :right) 4)
|
||||
:align-items :center
|
||||
:justify-content :center}
|
||||
(when icon-container-size
|
||||
{:width icon-container-size
|
||||
:height icon-container-size})
|
||||
(when icon-background-color
|
||||
{:background-color icon-background-color})
|
||||
(when icon-container-rounded?
|
||||
{:border-radius (/ (or icon-container-size icon-size) 2)})))
|
||||
|
||||
(defn icon-right-icon-style
|
||||
(defn after-icon-style
|
||||
[{:keys [override-margins size icon-container-size icon-background-color icon-container-rounded?
|
||||
icon-size]}]
|
||||
(icon-style {:margin-left (or (get override-margins :left) 4)
|
||||
:margin-right (or (get override-margins :right)
|
||||
(if (= size 40) 12 8))
|
||||
:icon-container-size icon-container-size
|
||||
:icon-background-color icon-background-color
|
||||
:icon-container-rounded? icon-container-rounded?
|
||||
:icon-size icon-size}))
|
||||
(merge
|
||||
{:margin-left (or (get override-margins :left) 4)
|
||||
:margin-right (or (get override-margins :right)
|
||||
(if (= size 40) 12 8))
|
||||
:align-items :center
|
||||
:justify-content :center}
|
||||
(when icon-container-size
|
||||
{:width icon-container-size
|
||||
:height icon-container-size})
|
||||
(when icon-background-color
|
||||
{:background-color icon-background-color})
|
||||
(when icon-container-rounded?
|
||||
{:border-radius (/ (or icon-container-size icon-size) 2)})))
|
||||
|
||||
(defn themes
|
||||
[customization-color]
|
||||
{:light
|
||||
{:primary {:icon-color colors/white
|
||||
:icon-secondary-color colors/white-opa-70
|
||||
:label-color colors/white
|
||||
:background-color {:default (colors/custom-color customization-color 50)
|
||||
:pressed (colors/custom-color customization-color 60)
|
||||
:disabled (colors/custom-color customization-color 50)}}
|
||||
:secondary {:icon-color colors/primary-50
|
||||
:label-color colors/primary-50
|
||||
:background-color {:default colors/primary-50-opa-20
|
||||
:pressed colors/primary-50-opa-40
|
||||
:disabled colors/primary-50-opa-20}}
|
||||
:grey {:icon-color colors/neutral-100
|
||||
:icon-secondary-color colors/neutral-50
|
||||
:label-color colors/neutral-100
|
||||
:background-color {:default colors/neutral-10
|
||||
:pressed colors/neutral-20
|
||||
:disabled colors/neutral-10}}
|
||||
:dark-grey {:icon-color colors/neutral-100
|
||||
:icon-secondary-color colors/neutral-50
|
||||
:label-color colors/neutral-100
|
||||
:background-color {:default colors/neutral-20
|
||||
:pressed colors/neutral-30
|
||||
:disabled colors/neutral-20}}
|
||||
:outline {:icon-color colors/neutral-50
|
||||
:icon-secondary-color colors/neutral-50
|
||||
:label-color colors/neutral-100
|
||||
:border-color {:default colors/neutral-30
|
||||
:pressed colors/neutral-40
|
||||
:disabled colors/neutral-30}}
|
||||
:ghost {:icon-color colors/neutral-50
|
||||
:icon-secondary-color colors/neutral-50
|
||||
:label-color colors/neutral-100
|
||||
:background-color {:pressed colors/neutral-10}}
|
||||
:danger {:icon-color colors/white
|
||||
:icon-secondary-color colors/white-opa-70
|
||||
:label-color colors/white
|
||||
:background-color {:default colors/danger-50
|
||||
:pressed colors/danger-60
|
||||
:disabled colors/danger-50}}
|
||||
:positive {:icon-color colors/white
|
||||
:icon-secondary-color colors/white-opa-70
|
||||
:label-color colors/white
|
||||
:background-color {:default colors/success-50
|
||||
:pressed colors/success-60
|
||||
:disabled colors/success-50-opa-30}}
|
||||
:photo-bg {:icon-color colors/neutral-100
|
||||
:icon-secondary-color colors/neutral-80-opa-40
|
||||
:label-color colors/neutral-100
|
||||
:background-color {:default colors/white-opa-40
|
||||
:pressed colors/white-opa-50
|
||||
:disabled colors/white-opa-40}}
|
||||
:blur-bg {:icon-color colors/neutral-100
|
||||
:icon-secondary-color colors/neutral-80-opa-40
|
||||
:label-color colors/neutral-100
|
||||
:background-color {:default colors/neutral-80-opa-5
|
||||
:pressed colors/neutral-80-opa-10
|
||||
:disabled colors/neutral-80-opa-5}}
|
||||
:blurred {:icon-color colors/neutral-100
|
||||
:icon-secondary-color colors/neutral-100
|
||||
:icon-background-color {:default colors/neutral-20
|
||||
:blurred colors/neutral-80-opa-10}
|
||||
:label-color colors/neutral-100
|
||||
:background-color {:default colors/neutral-10
|
||||
:pressed colors/neutral-10
|
||||
:disabled colors/neutral-10-opa-10-blur}
|
||||
:blur-overlay-color colors/neutral-10-opa-40-blur
|
||||
:blur-type :light}
|
||||
:blur-bg-outline {:icon-color colors/neutral-100
|
||||
:icon-secondary-color colors/neutral-80-opa-40
|
||||
:label-color colors/neutral-100
|
||||
:border-color {:default colors/neutral-80-opa-10
|
||||
:pressed colors/neutral-80-opa-20
|
||||
:disabled colors/neutral-80-opa-10}}
|
||||
:shell {:icon-color colors/white
|
||||
:label-color colors/white
|
||||
:background-color {:default colors/neutral-95
|
||||
:pressed colors/neutral-95
|
||||
:disabled colors/neutral-95}}}
|
||||
:dark
|
||||
{:primary {:icon-color colors/white
|
||||
:icon-secondary-color colors/white-opa-70
|
||||
:label-color colors/white
|
||||
:background-color {:default (colors/custom-color customization-color 60)
|
||||
:pressed (colors/custom-color customization-color 50)
|
||||
:disabled (colors/custom-color customization-color 60)}}
|
||||
:secondary {:icon-color colors/primary-50
|
||||
:label-color colors/primary-50
|
||||
:background-color {:default colors/primary-50-opa-20
|
||||
:pressed colors/primary-50-opa-30
|
||||
:disabled colors/primary-50-opa-20}}
|
||||
:grey {:icon-color colors/white
|
||||
:icon-secondary-color colors/neutral-40
|
||||
:label-color colors/white
|
||||
:background-color {:default colors/neutral-90
|
||||
:pressed colors/neutral-60
|
||||
:disabled colors/neutral-90}}
|
||||
:dark-grey {:icon-color colors/white
|
||||
:icon-secondary-color colors/neutral-40
|
||||
:label-color colors/white
|
||||
:background-color {:default colors/neutral-70
|
||||
:pressed colors/neutral-60
|
||||
:disabled colors/neutral-70}}
|
||||
:outline {:icon-color colors/neutral-40
|
||||
:icon-secondary-color colors/neutral-40
|
||||
:label-color colors/white
|
||||
:border-color {:default colors/neutral-70
|
||||
:pressed colors/neutral-60
|
||||
:disabled colors/neutral-70}}
|
||||
:ghost {:icon-color colors/neutral-40
|
||||
:icon-secondary-color colors/neutral-40
|
||||
:label-color colors/white
|
||||
:background-color {:pressed colors/neutral-80}}
|
||||
:danger {:icon-color colors/white
|
||||
:icon-secondary-color colors/white-opa-70
|
||||
:label-color colors/white
|
||||
:background-color {:default colors/danger-60
|
||||
:pressed colors/danger-50
|
||||
:disabled colors/danger-60}}
|
||||
:positive {:icon-color colors/white
|
||||
:icon-secondary-color colors/white-opa-70
|
||||
:label-color colors/white
|
||||
:background-color {:default colors/success-60
|
||||
:pressed colors/success-50
|
||||
:disabled colors/success-60-opa-30}}
|
||||
:photo-bg {:icon-color colors/white
|
||||
:icon-secondary-color colors/neutral-30
|
||||
:label-color colors/white
|
||||
:background-color {:default colors/neutral-80-opa-40
|
||||
:pressed colors/neutral-80-opa-50
|
||||
:disabled colors/neutral-80-opa-40}}
|
||||
:blur-bg {:icon-color colors/white
|
||||
:icon-secondary-color colors/white-opa-70
|
||||
:label-color colors/white
|
||||
:background-color {:default colors/white-opa-5
|
||||
:pressed colors/white-opa-10
|
||||
:disabled colors/white-opa-5}}
|
||||
:blurred {:icon-color colors/white
|
||||
:icon-secondary-color colors/white
|
||||
:icon-background-color {:default colors/neutral-80
|
||||
:blurred colors/white-opa-10}
|
||||
:label-color colors/white
|
||||
:background-color {:default colors/neutral-90
|
||||
:pressed colors/neutral-90
|
||||
:disabled colors/neutral-90-opa-10-blur}
|
||||
:blur-overlay-color colors/neutral-80-opa-40
|
||||
:blur-type :dark}
|
||||
:blur-bg-outline {:icon-color colors/white
|
||||
:icon-secondary-color colors/white-opa-40
|
||||
:label-color colors/white
|
||||
:border-color {:default colors/white-opa-10
|
||||
:pressed colors/white-opa-20
|
||||
:disabled colors/white-opa-5}}
|
||||
:shell {:icon-color colors/white
|
||||
:label-color colors/white
|
||||
:background-color {:default colors/neutral-95}}}})
|
||||
|
||||
(defn shape-style-container
|
||||
[size border-radius]
|
||||
[type icon size]
|
||||
{:height size
|
||||
:border-radius (if border-radius
|
||||
border-radius
|
||||
:border-radius (if (and icon (#{:primary :secondary :danger} type))
|
||||
24
|
||||
(case size
|
||||
56 12
|
||||
40 12
|
||||
32 10
|
||||
8))})
|
||||
24 8))})
|
||||
|
||||
(defn style-container
|
||||
[{:keys [size disabled border-radius background-color border-color icon-only? icon-above width
|
||||
icon-left icon-right]}]
|
||||
[{:keys [type size disabled background-color border-color icon above width before after blur-active?]}]
|
||||
(merge {:height size
|
||||
:align-items :center
|
||||
:justify-content :center
|
||||
:flex-direction (if icon-above :column :row)
|
||||
:padding-horizontal (when-not (or icon-only? icon-left icon-right)
|
||||
:flex-direction (if above :column :row)
|
||||
:padding-horizontal (when-not (or icon before after)
|
||||
(case size
|
||||
56 16
|
||||
40 16
|
||||
32 12
|
||||
8))
|
||||
:padding-left (when-not (or icon-only? icon-left)
|
||||
24 8))
|
||||
:padding-left (when-not (or icon before)
|
||||
(case size
|
||||
56 16
|
||||
40 16
|
||||
32 12
|
||||
8))
|
||||
:padding-right (when-not (or icon-only? icon-right)
|
||||
24 8))
|
||||
:padding-right (when-not (or icon after)
|
||||
(case size
|
||||
56 16
|
||||
40 16
|
||||
32 12
|
||||
8))
|
||||
:padding-top (when-not (or icon-only? icon-left icon-right)
|
||||
24 8))
|
||||
:padding-top (when-not (or icon before after)
|
||||
(case size
|
||||
56 0
|
||||
40 9
|
||||
32 5
|
||||
3))
|
||||
:padding-bottom (when-not (or icon-only? icon-left icon-right)
|
||||
24 3))
|
||||
:padding-bottom (when-not (or icon before after)
|
||||
(case size
|
||||
56 0
|
||||
40 9
|
||||
32 5
|
||||
4))
|
||||
:overflow :hidden
|
||||
:background-color background-color}
|
||||
(shape-style-container size border-radius)
|
||||
24 4))
|
||||
:overflow :hidden}
|
||||
(when (or (and (= type :blurred) (not blur-active?))
|
||||
(not= type :blurred))
|
||||
{:background-color background-color})
|
||||
(shape-style-container type icon size)
|
||||
(when width
|
||||
{:width width})
|
||||
(when icon-only?
|
||||
(when icon
|
||||
{:width size})
|
||||
(when border-color
|
||||
{:border-color border-color
|
||||
|
||||
@@ -5,116 +5,110 @@
|
||||
[react-native.core :as rn]
|
||||
[react-native.blur :as blur]
|
||||
[reagent.core :as reagent]
|
||||
[quo2.components.buttons.button.style :as style]
|
||||
[quo2.components.buttons.button.properties :as button-properties]
|
||||
[quo2.foundations.customization-colors :as customization-colors]))
|
||||
[quo2.components.buttons.button.style :as style]))
|
||||
|
||||
(defn- button-internal
|
||||
"with label
|
||||
[button opts \"label\"]
|
||||
opts
|
||||
{on-press callback
|
||||
on-long-press callback
|
||||
disabled boolean
|
||||
:type :primary/:positive:grey/:dark-grey/:outline/:ghost/
|
||||
:danger/:black (TODO remove :photo-bg/:blur-bg/:blur-bg-outline/:shell/:community)
|
||||
background :photo/:blur or nil
|
||||
:size 40 [default] /32/24/56
|
||||
{:type :primary/:secondary/:grey/:dark-grey/:outline/:ghost/
|
||||
:danger/:photo-bg/:blur-bg/:blur-bg-outline/:shell/:community
|
||||
:size 40 [default] /32/24
|
||||
:icon true/false
|
||||
:above :icon-keyword
|
||||
:community-color '#FFFFFF'
|
||||
:community-text-color '#000000'
|
||||
:before :icon-keyword
|
||||
:after :icon-keyword}
|
||||
:customization-color keyword or hexstring
|
||||
:theme :light/:dark
|
||||
|
||||
only icon
|
||||
[button {:icon true} :i/close-circle]"
|
||||
[_ _]
|
||||
(let [pressed? (reagent/atom false)]
|
||||
(let [pressed-in (reagent/atom false)]
|
||||
(fn
|
||||
[{:keys [on-press on-long-press disabled type background size before after above
|
||||
width customization-color theme override-background-color
|
||||
accessibility-label icon style inner-style]
|
||||
[{:keys [on-press disabled type size before after above icon-secondary-no-color
|
||||
width customization-color theme override-background-color pressed
|
||||
on-long-press accessibility-label icon icon-no-color style inner-style test-ID
|
||||
blur-active? override-before-margins override-after-margins icon-size icon-container-size
|
||||
icon-container-rounded?]
|
||||
:or {type :primary
|
||||
size 40
|
||||
customization-color (cond (= type :primary) :blue
|
||||
(= type :positive) :success
|
||||
(= type :danger) :danger
|
||||
:else nil)}}
|
||||
customization-color :primary
|
||||
blur-active? true}}
|
||||
children]
|
||||
(let [icon-only? icon ;; TODO Update external api to icon-only? -
|
||||
;; https://github.com/status-im/status-mobile/issues/16535
|
||||
container-style style ;; TODO Update external api to container-style and remove prop width
|
||||
icon-left before ;; TODO Update external api to icon-left
|
||||
icon-right after ;; TODO Update external api to icon-right
|
||||
icon-above above ;; TODO Update external api to icon-above
|
||||
{:keys [icon-color icon-secondary-color background-color label-color border-color blur-type
|
||||
blur-overlay-color icon-background-color border-radius]}
|
||||
(button-properties/get-values {:customization-color customization-color
|
||||
:background background
|
||||
:type type
|
||||
:theme theme
|
||||
:pressed? @pressed?
|
||||
:icon-only? icon-only?})
|
||||
icon-size (when (= 24 size) 12)
|
||||
(let [{:keys [icon-color icon-secondary-color background-color label-color border-color blur-type
|
||||
blur-overlay-color icon-background-color]}
|
||||
(get-in (style/themes customization-color)
|
||||
[theme type])
|
||||
state (cond disabled :disabled
|
||||
(or @pressed-in pressed) :pressed
|
||||
:else :default)
|
||||
blur-state (if blur-active? :blurred :default)
|
||||
icon-size (or icon-size (when (= 24 size) 12))
|
||||
icon-secondary-color (or icon-secondary-color icon-color)]
|
||||
[rn/touchable-without-feedback
|
||||
{:disabled disabled
|
||||
:accessibility-label accessibility-label
|
||||
:on-press-in #(reset! pressed? true)
|
||||
:on-press-out #(reset! pressed? nil)
|
||||
:on-press on-press
|
||||
:on-long-press on-long-press}
|
||||
(merge {:test-ID test-ID
|
||||
:disabled disabled
|
||||
:accessibility-label accessibility-label
|
||||
:on-press-in #(reset! pressed-in true)
|
||||
:on-press-out #(reset! pressed-in nil)}
|
||||
(when on-press
|
||||
{:on-press on-press})
|
||||
(when on-long-press
|
||||
{:on-long-press on-long-press}))
|
||||
[rn/view
|
||||
{:style (merge
|
||||
(style/shape-style-container size border-radius)
|
||||
(style/shape-style-container type icon size)
|
||||
{:width width}
|
||||
container-style)}
|
||||
style)}
|
||||
[rn/view
|
||||
{:style (merge
|
||||
(style/style-container {:size size
|
||||
(style/style-container {:type type
|
||||
:size size
|
||||
:disabled disabled
|
||||
:border-radius border-radius
|
||||
:background-color
|
||||
(or override-background-color background-color)
|
||||
:border-color border-color
|
||||
:icon-only? icon-only?
|
||||
:icon-above icon-above
|
||||
(or override-background-color (get background-color state))
|
||||
:border-color
|
||||
(get border-color state)
|
||||
:icon icon
|
||||
:above above
|
||||
:width width
|
||||
:icon-left icon-left
|
||||
:icon-right icon-right})
|
||||
:before before
|
||||
:after after
|
||||
:blur-active? blur-active?})
|
||||
(when (= state :pressed) {:opacity 0.9})
|
||||
inner-style)}
|
||||
(when customization-color
|
||||
[customization-colors/overlay
|
||||
{:customization-color customization-color
|
||||
:theme theme
|
||||
:pressed? @pressed?}])
|
||||
(when (= background :photo)
|
||||
(when (and (= type :blurred)
|
||||
blur-active?)
|
||||
[blur/view
|
||||
{:blur-radius 20
|
||||
:blur-type blur-type
|
||||
:overlay-color blur-overlay-color
|
||||
:style style/blur-view}])
|
||||
(when icon-above
|
||||
(when above
|
||||
[rn/view
|
||||
[quo2.icons/icon icon-above
|
||||
[quo2.icons/icon above
|
||||
{:container-style {:margin-bottom 2}
|
||||
:color icon-secondary-color
|
||||
:size icon-size}]])
|
||||
(when icon-left
|
||||
(when before
|
||||
[rn/view
|
||||
{:style (style/icon-left-icon-style
|
||||
{:size size
|
||||
:icon-background-color icon-background-color
|
||||
:icon-size icon-size})}
|
||||
[quo2.icons/icon icon-left
|
||||
{:style (style/before-icon-style
|
||||
{:override-margins override-before-margins
|
||||
:size size
|
||||
:icon-container-size icon-container-size
|
||||
:icon-background-color (get icon-background-color blur-state)
|
||||
:icon-container-rounded? icon-container-rounded?
|
||||
:icon-size icon-size})}
|
||||
[quo2.icons/icon before
|
||||
{:color icon-secondary-color
|
||||
:size icon-size}]])
|
||||
[rn/view
|
||||
(cond
|
||||
icon-only?
|
||||
(or icon icon-no-color)
|
||||
[quo2.icons/icon children
|
||||
{:color icon-color
|
||||
:size icon-size}]
|
||||
{:color icon-color
|
||||
:no-color icon-no-color
|
||||
:size icon-size}]
|
||||
|
||||
(string? children)
|
||||
[text/text
|
||||
@@ -122,18 +116,23 @@
|
||||
:weight :medium
|
||||
:number-of-lines 1
|
||||
:style {:color label-color}}
|
||||
|
||||
children]
|
||||
|
||||
(vector? children)
|
||||
children)]
|
||||
(when icon-right
|
||||
(when after
|
||||
[rn/view
|
||||
{:style (style/icon-right-icon-style
|
||||
{:size size
|
||||
:icon-background-color icon-background-color
|
||||
:icon-size icon-size})}
|
||||
[quo2.icons/icon icon-right
|
||||
{:color icon-secondary-color
|
||||
:size icon-size}]])]]]))))
|
||||
{:style (style/after-icon-style
|
||||
{:override-margins override-after-margins
|
||||
:size size
|
||||
:icon-container-size icon-container-size
|
||||
:icon-background-color (get icon-background-color blur-state)
|
||||
:icon-container-rounded? icon-container-rounded?
|
||||
:icon-size icon-size})}
|
||||
[quo2.icons/icon after
|
||||
{:no-color icon-secondary-no-color
|
||||
:color icon-secondary-color
|
||||
:size icon-size}]])]]]))))
|
||||
|
||||
(def button (theme/with-theme button-internal))
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
(ns quo2.components.calendar.calendar.component-spec
|
||||
(:require [quo2.components.calendar.calendar.view :as calendar]
|
||||
[test-helpers.component :as h]
|
||||
[cljs-time.core :as time]))
|
||||
|
||||
(def start-date (time/date-time (time/year (time/now)) (time/month (time/now)) 5))
|
||||
(def end-date (time/date-time (time/plus start-date (time/days 2))))
|
||||
|
||||
(h/describe "calendar component"
|
||||
(h/test "default render of calendar component"
|
||||
(h/render
|
||||
[calendar/view
|
||||
{:start-date start-date
|
||||
:end-date end-date}])
|
||||
(-> (h/expect (h/query-by-translation-text "Mo"))
|
||||
(h/is-truthy)))
|
||||
|
||||
(h/test "should call on-change with selected date on first click"
|
||||
(let [on-change (h/mock-fn)]
|
||||
(h/render
|
||||
[calendar/view
|
||||
{:start-date nil
|
||||
:end-date nil
|
||||
:on-change on-change}])
|
||||
(h/fire-event :press (h/query-by-text (str (time/day start-date))))
|
||||
(h/was-called-with on-change {:start-date start-date :end-date nil})))
|
||||
|
||||
(h/test "should call on-change with start and end date on second click"
|
||||
(let [on-change (h/mock-fn)]
|
||||
(h/render
|
||||
[calendar/view
|
||||
{:start-date start-date :end-date nil :on-change on-change}])
|
||||
(h/fire-event :press (h/query-by-text (str (time/day end-date))))
|
||||
(h/was-called-with on-change {:start-date start-date :end-date end-date})))
|
||||
|
||||
(h/test "should reset the dates on third click"
|
||||
(let [on-change (h/mock-fn)]
|
||||
(h/render
|
||||
[calendar/view
|
||||
{:start-date start-date
|
||||
:end-date end-date
|
||||
:on-change on-change}])
|
||||
(h/fire-event :press (h/query-by-text (str (time/day start-date))))
|
||||
(h/was-called-with on-change {:start-date start-date :end-date nil})))
|
||||
|
||||
(h/test "should reset dates when start date is clicked again"
|
||||
(let [on-change (h/mock-fn)]
|
||||
(h/render
|
||||
[calendar/view
|
||||
{:start-date start-date
|
||||
:end-date nil
|
||||
:on-change on-change}])
|
||||
(h/fire-event :press (h/query-by-text (str (time/day start-date))))
|
||||
(h/was-called-with on-change {:start-date nil :end-date nil})))
|
||||
|
||||
(h/test "should assign start and end date correctly when upper range selected first"
|
||||
(let [on-change (h/mock-fn)]
|
||||
(h/render
|
||||
[calendar/view
|
||||
{:start-date end-date
|
||||
:end-date nil
|
||||
:on-change on-change}])
|
||||
(h/fire-event :press (h/query-by-text (str (time/day start-date))))
|
||||
(h/was-called-with on-change {:start-date start-date :end-date end-date}))))
|
||||
@@ -1,7 +0,0 @@
|
||||
(ns quo2.components.calendar.calendar.days-grid.style)
|
||||
|
||||
(def container-days
|
||||
{:flex-grow 1
|
||||
:margin-top 4
|
||||
:margin-horizontal 8
|
||||
:overflow :hidden})
|
||||
@@ -1,65 +0,0 @@
|
||||
(ns quo2.components.calendar.calendar.days-grid.utils
|
||||
(:require
|
||||
[utils.number :as utils.number]
|
||||
[cljs-time.core :as time]))
|
||||
|
||||
(defn- day-of-week
|
||||
[date]
|
||||
(let [day (time/day-of-week date)]
|
||||
(mod day 7)))
|
||||
|
||||
(defn- add-days
|
||||
[date days]
|
||||
(time/plus date (time/days days)))
|
||||
|
||||
(defn day-grid
|
||||
[year month]
|
||||
(let [year (utils.number/parse-int year)
|
||||
month (utils.number/parse-int month)
|
||||
first-day (time/date-time year month 1)
|
||||
start-day (add-days first-day (- 0 (day-of-week first-day)))
|
||||
end-day (add-days start-day 34)]
|
||||
(loop [days []
|
||||
current-day start-day]
|
||||
(if (time/after? current-day end-day)
|
||||
days
|
||||
(recur (conj days current-day) (add-days current-day 1))))))
|
||||
|
||||
(defn get-day-state
|
||||
[day today year month start-date end-date]
|
||||
(cond
|
||||
(and start-date (time/equal? day start-date)) :selected
|
||||
(and end-date (time/equal? day end-date)) :selected
|
||||
(and (= (time/year day) (time/year today))
|
||||
(= (time/month day) (time/month today))
|
||||
(= (time/day day) (time/day today))) :today
|
||||
(and (= (time/year day) year) (= (time/month day) month)) :default
|
||||
:else :disabled))
|
||||
|
||||
(defn update-range
|
||||
[day start-date end-date]
|
||||
(let [new-state (cond
|
||||
(and start-date end-date) {:start-date day :end-date nil}
|
||||
(and start-date (time/equal? day start-date)) {:start-date nil :end-date nil}
|
||||
(and end-date (time/equal? day end-date)) {:start-date nil :end-date nil}
|
||||
(nil? start-date) {:start-date day :end-date nil}
|
||||
(nil? end-date) {:start-date start-date :end-date day}
|
||||
:else {:start-date start-date
|
||||
:end-date end-date})]
|
||||
(if (and (:start-date new-state)
|
||||
(:end-date new-state)
|
||||
(time/after? (:start-date new-state) (:end-date new-state)))
|
||||
{:start-date (:end-date new-state) :end-date (:start-date new-state)}
|
||||
new-state)))
|
||||
|
||||
(defn in-range?
|
||||
[day start-date end-date]
|
||||
(and start-date end-date (time/after? day start-date) (time/before? day end-date)))
|
||||
|
||||
(defn get-in-range-pos
|
||||
[day start-date end-date]
|
||||
(cond
|
||||
(or (nil? start-date) (nil? end-date)) nil
|
||||
(and start-date (time/equal? day start-date)) :start
|
||||
(and end-date (time/equal? day end-date)) :end
|
||||
(in-range? day start-date end-date) :middle))
|
||||
@@ -1,51 +0,0 @@
|
||||
(ns quo2.components.calendar.calendar.days-grid.utils-test
|
||||
(:require [cljs.test :refer-macros [deftest is testing]]
|
||||
[quo2.components.calendar.calendar.days-grid.utils :as utils]
|
||||
[cljs-time.core :as time]))
|
||||
|
||||
(deftest day-grid-test
|
||||
(let [day-grid-result (utils/day-grid "2023" "7")]
|
||||
(testing "it returns correct days grid"
|
||||
(is (= 35 (count day-grid-result)))
|
||||
(is (time/equal? (time/date-time 2023 6 25) (first day-grid-result)))
|
||||
(is (time/equal? (time/date-time 2023 7 29) (last day-grid-result))))))
|
||||
|
||||
(deftest get-day-state-test
|
||||
(let [today (time/date-time 2023 7 27)
|
||||
year 2023
|
||||
month 7
|
||||
start-date (time/date-time 2023 7 20)
|
||||
end-date (time/date-time 2023 7 30)]
|
||||
(testing "it returns :today when day equals today"
|
||||
(is (= :today (utils/get-day-state today today year month start-date end-date))))
|
||||
(testing "it returns :selected when day equals start-date and not today"
|
||||
(is
|
||||
(= :selected (utils/get-day-state start-date today year month start-date end-date))))
|
||||
(testing "it returns :selected when day equals end-date and not today"
|
||||
(is
|
||||
(= :selected (utils/get-day-state end-date today year month start-date end-date))))))
|
||||
|
||||
(deftest update-range-test
|
||||
(let [start-date (time/date-time 2023 7 20)
|
||||
end-date (time/date-time 2023 7 30)
|
||||
day (time/date-time 2023 7 27)]
|
||||
(testing "it returns updated range"
|
||||
(is
|
||||
(= {:start-date day :end-date nil} (utils/update-range day start-date end-date))))))
|
||||
|
||||
(deftest in-range-test
|
||||
(let [start-date (time/date-time 2023 7 20)
|
||||
end-date (time/date-time 2023 7 30)
|
||||
day (time/date-time 2023 7 27)]
|
||||
(testing "it returns true when day is within range"
|
||||
(is (utils/in-range? day start-date end-date))
|
||||
(is (not (utils/in-range? (time/date-time 2023 7 19) start-date end-date))))))
|
||||
|
||||
(deftest get-in-range-pos-test
|
||||
(let [start-date (time/date-time 2023 7 20)
|
||||
end-date (time/date-time 2023 7 30)
|
||||
day (time/date-time 2023 7 27)]
|
||||
(testing "it returns correct position within range"
|
||||
(is (= :start (utils/get-in-range-pos start-date start-date end-date)))
|
||||
(is (= :end (utils/get-in-range-pos end-date start-date end-date)))
|
||||
(is (= :middle (utils/get-in-range-pos day start-date end-date))))))
|
||||
@@ -1,41 +0,0 @@
|
||||
(ns quo2.components.calendar.calendar.days-grid.view
|
||||
(:require [react-native.core :as rn]
|
||||
[cljs-time.core :as time]
|
||||
[quo2.components.calendar.calendar.days-grid.utils :as utils]
|
||||
[quo2.components.calendar.calendar-day.view :as calendar-day]
|
||||
[quo2.components.calendar.calendar.days-grid.style :as style]))
|
||||
|
||||
(defn- day-view
|
||||
[day _ _ {:keys [year month selection-range on-press customization-color]}]
|
||||
(let [today (time/now)
|
||||
start-date (:start-date selection-range)
|
||||
end-date (:end-date selection-range)
|
||||
state (utils/get-day-state day today year month start-date end-date)
|
||||
in-range (utils/get-in-range-pos day start-date end-date)
|
||||
on-press #(on-press (time/date-time day))]
|
||||
[calendar-day/view
|
||||
{:customization-color customization-color
|
||||
:state state
|
||||
:in-range in-range
|
||||
:on-press on-press}
|
||||
(str (time/day day))]))
|
||||
|
||||
(defn view
|
||||
[{:keys [year month on-change start-date end-date customization-color]}]
|
||||
(let [on-day-press (fn [day]
|
||||
(let [new-selection (utils/update-range day start-date end-date)]
|
||||
(on-change new-selection)))]
|
||||
[rn/view
|
||||
{:style style/container-days}
|
||||
[rn/flat-list
|
||||
{:data (utils/day-grid year month)
|
||||
:key-fn str
|
||||
:num-columns 7
|
||||
:content-container-style {:margin-horizontal -2}
|
||||
:render-fn day-view
|
||||
:render-data {:customization-color customization-color
|
||||
:year year
|
||||
:month month
|
||||
:on-press on-day-press
|
||||
:selection-range {:start-date start-date
|
||||
:end-date end-date}}}]]))
|
||||
@@ -1,25 +0,0 @@
|
||||
(ns quo2.components.calendar.calendar.month-picker.component-spec
|
||||
(:require [quo2.components.calendar.calendar.month-picker.view :as month-picker]
|
||||
[test-helpers.component :as h]))
|
||||
|
||||
(h/describe "month-picker component"
|
||||
(h/test "default render of month-picker component"
|
||||
(h/render
|
||||
[month-picker/view
|
||||
{:year "2023" :month "7"}])
|
||||
(-> (h/expect (h/query-by-translation-text "July 2023"))
|
||||
(h/is-truthy)))
|
||||
|
||||
(h/test "should call on-change with next month when right button pressed"
|
||||
(let [on-change (h/mock-fn)]
|
||||
(h/render
|
||||
[month-picker/view {:year "2023" :month "7" :on-change on-change}])
|
||||
(h/fire-event :press (h/query-by-label-text :next-month-button))
|
||||
(h/was-called on-change)))
|
||||
|
||||
(h/test "should call on-change with previous month when left button pressed"
|
||||
(let [on-change (h/mock-fn)]
|
||||
(h/render
|
||||
[month-picker/view {:year "2023" :month "1" :on-change on-change}])
|
||||
(h/fire-event :press (h/query-by-label-text :previous-month-button))
|
||||
(h/was-called on-change))))
|
||||
@@ -1,14 +0,0 @@
|
||||
(ns quo2.components.calendar.calendar.month-picker.style
|
||||
(:require [quo2.foundations.colors :as colors]))
|
||||
|
||||
(def container
|
||||
{:align-items :center
|
||||
:flex-direction :row
|
||||
:flex-grow 1
|
||||
:padding-horizontal 12
|
||||
:padding-vertical 9
|
||||
:justify-content :space-between})
|
||||
|
||||
(defn text
|
||||
[theme]
|
||||
{:color (colors/theme-colors colors/neutral-100 colors/white theme)})
|
||||
@@ -1,22 +0,0 @@
|
||||
(ns quo2.components.calendar.calendar.month-picker.utils
|
||||
(:require [utils.datetime :as datetime]))
|
||||
|
||||
(defn format-month-year
|
||||
[year month]
|
||||
(let [month (cond
|
||||
(or (nil? month) (zero? month)) 1
|
||||
(> month 12) 12
|
||||
:else month)]
|
||||
(str (datetime/format-long-month month) " " year)))
|
||||
|
||||
(defn next-month
|
||||
[year month]
|
||||
(let [new-month (if (= month 12) 1 (inc month))
|
||||
new-year (if (= month 12) (inc year) year)]
|
||||
{:year (str new-year) :month (str new-month)}))
|
||||
|
||||
(defn previous-month
|
||||
[year month]
|
||||
(let [new-month (if (= month 1) 12 (dec month))
|
||||
new-year (if (= month 1) (dec year) year)]
|
||||
{:year (str new-year) :month (str new-month)}))
|
||||
@@ -1,20 +0,0 @@
|
||||
(ns quo2.components.calendar.calendar.month-picker.utils-test
|
||||
(:require [cljs.test :refer-macros [deftest is testing]]
|
||||
[quo2.components.calendar.calendar.month-picker.utils :as utils]))
|
||||
|
||||
(deftest format-month-year-test
|
||||
(testing "returns correct format for given year and month"
|
||||
(is (= (utils/format-month-year 2023 1) "January 2023"))
|
||||
(is (= (utils/format-month-year 2023 12) "December 2023"))
|
||||
(is (= (utils/format-month-year 2023 0) "January 2023"))
|
||||
(is (= (utils/format-month-year 2023 13) "December 2023"))))
|
||||
|
||||
(deftest next-month-test
|
||||
(testing "returns the next month and year"
|
||||
(is (= (utils/next-month 2023 1) {:year "2023" :month "2"}))
|
||||
(is (= (utils/next-month 2023 12) {:year "2024" :month "1"}))))
|
||||
|
||||
(deftest previous-month-test
|
||||
(testing "returns the previous month and year"
|
||||
(is (= (utils/previous-month 2023 1) {:year "2022" :month "12"}))
|
||||
(is (= (utils/previous-month 2023 12) {:year "2023" :month "11"}))))
|
||||
@@ -1,36 +0,0 @@
|
||||
(ns quo2.components.calendar.calendar.month-picker.view
|
||||
(:require [react-native.core :as rn]
|
||||
[utils.number :as utils.number]
|
||||
[quo2.theme :as theme]
|
||||
[quo2.components.buttons.button.view :as button]
|
||||
[quo2.components.markdown.text :as text]
|
||||
[quo2.components.calendar.calendar.month-picker.style :as style]
|
||||
[quo2.components.calendar.calendar.month-picker.utils :as utils]))
|
||||
|
||||
(defn- view-internal
|
||||
[{:keys [year month on-change theme]}]
|
||||
(let [year (utils.number/parse-int year)
|
||||
month (utils.number/parse-int month)]
|
||||
[rn/view
|
||||
{:style style/container}
|
||||
[button/button
|
||||
{:icon true
|
||||
:type :outline
|
||||
:accessibility-label :previous-month-button
|
||||
:size 24
|
||||
:on-press #(on-change (utils/previous-month year month))}
|
||||
:i/chevron-left]
|
||||
[text/text
|
||||
{:weight :semi-bold
|
||||
:size :paragraph-1
|
||||
:style (style/text theme)}
|
||||
(utils/format-month-year year month)]
|
||||
[button/button
|
||||
{:icon true
|
||||
:accessibility-label :next-month-button
|
||||
:size 24
|
||||
:type :outline
|
||||
:on-press #(on-change (utils/next-month year month))}
|
||||
:i/chevron-right]]))
|
||||
|
||||
(def view (theme/with-theme view-internal))
|
||||
@@ -1,14 +0,0 @@
|
||||
(ns quo2.components.calendar.calendar.style
|
||||
(:require [quo2.foundations.colors :as colors]))
|
||||
|
||||
(defn container
|
||||
[theme]
|
||||
{:flex-direction :row
|
||||
:height 270
|
||||
:border-color (colors/theme-colors colors/neutral-20 colors/neutral-80 theme)
|
||||
:border-radius 12
|
||||
:border-width 1
|
||||
:background-color (colors/theme-colors colors/white colors/neutral-80-opa-40 theme)})
|
||||
|
||||
(def container-main
|
||||
{:flex-grow 1})
|
||||
@@ -1,25 +0,0 @@
|
||||
(ns quo2.components.calendar.calendar.utils
|
||||
(:require [utils.datetime :as datetime]
|
||||
[utils.number :as utils.number]
|
||||
[clojure.string :as string]))
|
||||
|
||||
(defn generate-years
|
||||
[current-year]
|
||||
(let [current-year current-year]
|
||||
(reverse (vec (range (- current-year 100) (+ current-year 1))))))
|
||||
|
||||
(defn current-year
|
||||
[]
|
||||
(-> (datetime/now)
|
||||
datetime/timestamp->year-month-day-date
|
||||
(string/split #"-")
|
||||
first
|
||||
utils.number/parse-int))
|
||||
|
||||
(defn current-month
|
||||
[]
|
||||
(-> (datetime/now)
|
||||
datetime/timestamp->year-month-day-date
|
||||
(string/split #"-")
|
||||
second
|
||||
utils.number/parse-int))
|
||||
@@ -1,30 +0,0 @@
|
||||
(ns quo2.components.calendar.calendar.utils-test
|
||||
(:require [cljs.test :refer-macros [deftest is testing]]
|
||||
[quo2.components.calendar.calendar.utils :as utils]
|
||||
[utils.datetime :as datetime]
|
||||
[clojure.string :as string]
|
||||
[utils.number :as utils.number]))
|
||||
|
||||
(deftest generate-years-test
|
||||
(testing "returns correct years range"
|
||||
(let [current-year (utils/current-year)]
|
||||
(is (= (last (utils/generate-years current-year)) (- current-year 100)))
|
||||
(is (= (first (utils/generate-years current-year)) current-year)))))
|
||||
|
||||
(deftest current-year-test
|
||||
(testing "returns the current year"
|
||||
(let [current-year (-> (datetime/now)
|
||||
datetime/timestamp->year-month-day-date
|
||||
(string/split #"-")
|
||||
first
|
||||
utils.number/parse-int)]
|
||||
(is (= (utils/current-year) current-year)))))
|
||||
|
||||
(deftest current-month-test
|
||||
(testing "returns the current month"
|
||||
(let [current-month (-> (datetime/now)
|
||||
datetime/timestamp->year-month-day-date
|
||||
(string/split #"-")
|
||||
second
|
||||
utils.number/parse-int)]
|
||||
(is (= (utils/current-month) current-month)))))
|
||||
@@ -1,42 +0,0 @@
|
||||
(ns quo2.components.calendar.calendar.view
|
||||
(:require [react-native.core :as rn]
|
||||
[quo2.theme :as theme]
|
||||
[reagent.core :as reagent]
|
||||
[utils.number :as utils.number]
|
||||
[quo2.components.calendar.calendar.utils :as utils]
|
||||
[quo2.components.calendar.calendar.style :as style]
|
||||
[quo2.components.calendar.calendar.years-list.view :as years-list]
|
||||
[quo2.components.calendar.calendar.days-grid.view :as days-grid]
|
||||
[quo2.components.calendar.calendar.weekdays-header.view :as weekdays-header]
|
||||
[quo2.components.calendar.calendar.month-picker.view :as month-picker]))
|
||||
|
||||
(defn- view-internal
|
||||
[]
|
||||
(let [selected-year (reagent/atom (utils/current-year))
|
||||
selected-month (reagent/atom (utils/current-month))
|
||||
on-change-year #(reset! selected-year %)
|
||||
on-change-month (fn [new-date]
|
||||
(reset! selected-year (utils.number/parse-int (:year new-date)))
|
||||
(reset! selected-month (utils.number/parse-int (:month new-date))))]
|
||||
(fn [{:keys [on-change start-date end-date theme]}]
|
||||
[rn/view
|
||||
{:style (style/container theme)}
|
||||
[years-list/view
|
||||
{:on-change-year on-change-year
|
||||
:year @selected-year}]
|
||||
[rn/view
|
||||
{:style style/container-main}
|
||||
[month-picker/view
|
||||
{:year @selected-year
|
||||
:month @selected-month
|
||||
:on-change on-change-month}]
|
||||
[weekdays-header/view]
|
||||
[days-grid/view
|
||||
{:year @selected-year
|
||||
:month @selected-month
|
||||
:start-date start-date
|
||||
:end-date end-date
|
||||
:on-change on-change
|
||||
:customization-color :blue}]]])))
|
||||
|
||||
(def view (theme/with-theme view-internal))
|
||||
@@ -1,18 +0,0 @@
|
||||
(ns quo2.components.calendar.calendar.weekdays-header.style
|
||||
(:require [quo2.foundations.colors :as colors]))
|
||||
|
||||
(def container-weekday-row
|
||||
{:flex-direction :row
|
||||
:justify-content :space-between
|
||||
:padding-horizontal 8})
|
||||
|
||||
(def container-weekday
|
||||
{:width 32
|
||||
:height 30
|
||||
:padding-top 2
|
||||
:justify-content :center
|
||||
:align-items :center})
|
||||
|
||||
(defn text-weekdays
|
||||
[theme]
|
||||
{:color (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)})
|
||||
@@ -1,23 +0,0 @@
|
||||
(ns quo2.components.calendar.calendar.weekdays-header.view
|
||||
(:require [react-native.core :as rn]
|
||||
[quo2.theme :as theme]
|
||||
[utils.datetime :as datetime]
|
||||
[utils.i18n :as i18n]
|
||||
[quo2.components.markdown.text :as text]
|
||||
[quo2.components.calendar.calendar.weekdays-header.style :as style]))
|
||||
|
||||
(defn- view-internal
|
||||
[theme]
|
||||
[rn/view
|
||||
{:style style/container-weekday-row}
|
||||
(for [weekday datetime/weekday-names]
|
||||
[rn/view
|
||||
{:style style/container-weekday
|
||||
:key weekday}
|
||||
[text/text
|
||||
{:weight :medium
|
||||
:size :paragraph-2
|
||||
:style (style/text-weekdays theme)}
|
||||
(str (i18n/label weekday))]])])
|
||||
|
||||
(def view (theme/with-theme view-internal))
|
||||
@@ -1,33 +0,0 @@
|
||||
(ns quo2.components.calendar.calendar.years-list.style
|
||||
(:require [quo2.foundations.colors :as colors]))
|
||||
|
||||
(defn gradient-start-color
|
||||
[theme]
|
||||
(colors/theme-colors colors/white colors/neutral-90 theme))
|
||||
|
||||
(defn gradient-end-color
|
||||
[theme]
|
||||
(colors/theme-colors colors/white-opa-0 colors/neutral-100-opa-0 theme))
|
||||
|
||||
(def gradient-view
|
||||
{:position :absolute
|
||||
:height 50
|
||||
:border-top-left-radius 12
|
||||
:top 0
|
||||
:left 0
|
||||
:right 0})
|
||||
|
||||
(defn container-years
|
||||
[theme]
|
||||
{:border-width 1
|
||||
:overflow :hidden
|
||||
:padding-left 8
|
||||
:padding-right 7
|
||||
:padding-vertical 8
|
||||
:margin-left -1
|
||||
:margin-top -1
|
||||
:margin-bottom -1
|
||||
:border-style :dashed
|
||||
:border-top-left-radius 12
|
||||
:border-bottom-left-radius 12
|
||||
:border-color (colors/theme-colors colors/neutral-20 colors/neutral-80 theme)})
|
||||
@@ -1,49 +0,0 @@
|
||||
(ns quo2.components.calendar.calendar.years-list.view
|
||||
(:require [react-native.core :as rn]
|
||||
[quo2.theme :as theme]
|
||||
[react-native.linear-gradient :as linear-gradient]
|
||||
[quo2.components.calendar.calendar.utils :as utils]
|
||||
[quo2.components.calendar.calendar-year.view :as calendar-year]
|
||||
[quo2.components.calendar.calendar.years-list.style :as style]))
|
||||
|
||||
(defn- year-view
|
||||
[year _ _ {:keys [selected-year on-press]}]
|
||||
[calendar-year/view
|
||||
{:selected? (= year selected-year)
|
||||
:on-press #(on-press year)}
|
||||
(str year)])
|
||||
|
||||
(defn- separator
|
||||
[]
|
||||
[rn/view {:style {:height 4}}])
|
||||
|
||||
(defn- footer
|
||||
[]
|
||||
[rn/view {:style {:height 32}}])
|
||||
|
||||
(defn- gradiant-overview
|
||||
[theme]
|
||||
[linear-gradient/linear-gradient
|
||||
{:colors [(style/gradient-start-color theme) (style/gradient-end-color theme)]
|
||||
:style style/gradient-view
|
||||
:start {:x 0 :y 0}
|
||||
:end {:x 0 :y 1}}])
|
||||
|
||||
(defn view-internal
|
||||
[{:keys [on-change-year year theme]}]
|
||||
[rn/view
|
||||
{:style (style/container-years theme)}
|
||||
[rn/flat-list
|
||||
{:data (utils/generate-years (utils/current-year))
|
||||
:key-fn str
|
||||
:list-key :years-list
|
||||
:inverted true
|
||||
:shows-vertical-scroll-indicator false
|
||||
:footer [footer]
|
||||
:separator [separator]
|
||||
:render-fn year-view
|
||||
:render-data {:selected-year year
|
||||
:on-press #(on-change-year %)}}]
|
||||
[gradiant-overview theme]])
|
||||
|
||||
(def view (theme/with-theme view-internal))
|
||||
@@ -1,14 +0,0 @@
|
||||
(ns quo2.components.calendar.calendar-day.component-spec
|
||||
(:require [quo2.components.calendar.calendar-day.view :as calendar-day]
|
||||
[test-helpers.component :as h]))
|
||||
|
||||
(h/describe "calendar-day component"
|
||||
(h/test "default render of calendar-day component"
|
||||
(h/render [calendar-day/view {} "25"])
|
||||
(h/is-truthy (h/query-by-text "25")))
|
||||
|
||||
(h/test "should not call on-press when state is :disabled"
|
||||
(let [on-press (h/mock-fn)]
|
||||
(h/render [calendar-day/view {:on-press on-press :state :disabled} "25"])
|
||||
(h/fire-event :press (h/query-by-text "25"))
|
||||
(h/was-not-called on-press))))
|
||||
@@ -1,69 +0,0 @@
|
||||
(ns quo2.components.calendar.calendar-day.style
|
||||
(:require [quo2.foundations.colors :as colors]))
|
||||
|
||||
(def wrapper
|
||||
{:flex 1
|
||||
:margin-vertical 2
|
||||
:justify-content :center
|
||||
:align-items :center})
|
||||
|
||||
(def container-base
|
||||
{:align-items :center
|
||||
:justify-content :center
|
||||
:border-radius 10
|
||||
:height 32
|
||||
:width 32})
|
||||
|
||||
(defn text-base
|
||||
[theme]
|
||||
{:color (colors/theme-colors colors/neutral-100 colors/white theme)
|
||||
:text-align :center})
|
||||
|
||||
(defn in-range-background
|
||||
[{:keys [in-range theme]}]
|
||||
(cond-> {:position :absolute
|
||||
:top 0
|
||||
:right 0
|
||||
:left 0
|
||||
:bottom 0}
|
||||
(= in-range :start)
|
||||
(assoc :background-color
|
||||
(colors/theme-colors colors/neutral-5 colors/neutral-80 theme)
|
||||
:left 20)
|
||||
|
||||
(= in-range :middle)
|
||||
(assoc :background-color
|
||||
(colors/theme-colors colors/neutral-5 colors/neutral-80 theme))
|
||||
|
||||
(= in-range :end)
|
||||
(assoc :background-color
|
||||
(colors/theme-colors colors/neutral-5 colors/neutral-80 theme)
|
||||
:right 20)))
|
||||
|
||||
(defn container
|
||||
[{:keys [state theme customization-color]}]
|
||||
(cond-> container-base
|
||||
(= state :default)
|
||||
(assoc :background-color colors/neutral-100-opa-0)
|
||||
|
||||
(= state :disabled)
|
||||
(assoc :opacity 0.3)
|
||||
|
||||
(= state :selected)
|
||||
(assoc :background-color (colors/custom-color-by-theme customization-color 50 60 nil nil theme))))
|
||||
|
||||
(defn text
|
||||
[{:keys [state theme]}]
|
||||
(cond-> (text-base theme)
|
||||
(= state :selected) (assoc :color colors/white)))
|
||||
|
||||
(defn indicator
|
||||
[{:keys [state theme customization-color]}]
|
||||
{:width 4
|
||||
:position :absolute
|
||||
:bottom 3
|
||||
:height 2
|
||||
:border-radius 8
|
||||
:background-color (if (= state :today)
|
||||
(colors/custom-color-by-theme customization-color 50 60 nil nil theme)
|
||||
colors/neutral-100-opa-0)})
|
||||
@@ -1,31 +0,0 @@
|
||||
(ns quo2.components.calendar.calendar-day.view
|
||||
(:require [react-native.core :as rn]
|
||||
[quo2.theme :as theme]
|
||||
[quo2.components.markdown.text :as text]
|
||||
[quo2.components.calendar.calendar-day.style :as style]))
|
||||
|
||||
(defn- view-internal
|
||||
[{:keys [state in-range on-press customization-color theme]
|
||||
:or {state :default}}
|
||||
day]
|
||||
[rn/view {:style style/wrapper}
|
||||
[rn/view {:style (style/in-range-background {:in-range in-range :theme theme})}]
|
||||
[rn/touchable-opacity
|
||||
{:on-press on-press
|
||||
:style (style/container
|
||||
{:state state
|
||||
:theme theme
|
||||
:customization-color customization-color})
|
||||
:disabled (= state :disabled)}
|
||||
[text/text
|
||||
{:weight :medium
|
||||
:size :paragraph-2
|
||||
:style (style/text {:state state :theme theme})}
|
||||
day]
|
||||
[rn/view
|
||||
{:style (style/indicator
|
||||
{:state state
|
||||
:theme theme
|
||||
:customization-color customization-color})}]]])
|
||||
|
||||
(def view (theme/with-theme view-internal))
|
||||
@@ -1,14 +0,0 @@
|
||||
(ns quo2.components.calendar.calendar-year.component-spec
|
||||
(:require [quo2.components.calendar.calendar-year.view :as calendar-year]
|
||||
[test-helpers.component :as h]))
|
||||
|
||||
(h/describe "calendar-year component"
|
||||
(h/test "default render of calendar-year component"
|
||||
(h/render [calendar-year/view {} "2023"])
|
||||
(h/is-truthy (h/query-by-text "2023")))
|
||||
|
||||
(h/test "should not call on-press when disabled"
|
||||
(let [on-press (h/mock-fn)]
|
||||
(h/render [calendar-year/view {:on-press on-press :disabled? true} "2023"])
|
||||
(h/fire-event :press (h/query-by-text "2023"))
|
||||
(h/was-not-called on-press))))
|
||||
@@ -1,25 +0,0 @@
|
||||
(ns quo2.components.calendar.calendar-year.style
|
||||
(:require [quo2.foundations.colors :as colors]))
|
||||
|
||||
(def container-base
|
||||
{:align-items :center
|
||||
:justify-content :center
|
||||
:border-radius 10
|
||||
:height 32
|
||||
:width 48})
|
||||
|
||||
(defn text-base
|
||||
[theme]
|
||||
{:color (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)})
|
||||
|
||||
(defn container
|
||||
[{:keys [selected? disabled? theme]}]
|
||||
(cond-> container-base
|
||||
disabled? (assoc :opacity 0.3)
|
||||
selected? (assoc :background-color
|
||||
(colors/theme-colors colors/neutral-10 colors/neutral-70 theme))))
|
||||
|
||||
(defn text
|
||||
[{:keys [selected? theme]}]
|
||||
(cond-> (text-base theme)
|
||||
selected? (assoc :color (colors/theme-colors colors/neutral-100 colors/white theme))))
|
||||
@@ -1,24 +0,0 @@
|
||||
(ns quo2.components.calendar.calendar-year.view
|
||||
(:require [react-native.core :as rn]
|
||||
[quo2.theme :as theme]
|
||||
[quo2.components.markdown.text :as text]
|
||||
[quo2.components.calendar.calendar-year.style :as style]))
|
||||
|
||||
(defn- view-internal
|
||||
[{:keys [selected? disabled? on-press theme]} year]
|
||||
[rn/touchable-opacity
|
||||
{:on-press on-press
|
||||
:style (style/container
|
||||
{:selected? selected?
|
||||
:disabled? disabled?
|
||||
:theme theme})
|
||||
:disabled disabled?}
|
||||
[text/text
|
||||
{:weight :medium
|
||||
:size :paragraph-2
|
||||
:style (style/text
|
||||
{:selected? selected?
|
||||
:theme theme})}
|
||||
year]])
|
||||
|
||||
(def view (theme/with-theme view-internal))
|
||||
@@ -2,21 +2,18 @@
|
||||
(:require [quo2.foundations.colors :as colors]))
|
||||
|
||||
(defn community-card
|
||||
[theme]
|
||||
{:shadow-offset {:width 0 :height 2}
|
||||
:shadow-radius 16
|
||||
:shadow-opacity 1
|
||||
:shadow-color colors/shadow
|
||||
:elevation 1
|
||||
:border-radius 16
|
||||
:justify-content :space-between
|
||||
:background-color (colors/theme-colors colors/white colors/neutral-90 theme)
|
||||
:flex-direction :row
|
||||
:margin-horizontal 20
|
||||
:margin-top 8
|
||||
:margin-bottom 8
|
||||
:height 56
|
||||
:padding-right 12})
|
||||
[radius]
|
||||
{:shadow-offset {:width 0
|
||||
:height 2}
|
||||
:shadow-radius radius
|
||||
:shadow-opacity 1
|
||||
:shadow-color colors/shadow
|
||||
:elevation 1
|
||||
:border-radius radius
|
||||
:justify-content :space-between
|
||||
:background-color (colors/theme-colors
|
||||
colors/white
|
||||
colors/neutral-90)})
|
||||
|
||||
(def banner-content
|
||||
{:flex 1
|
||||
@@ -28,6 +25,13 @@
|
||||
{:flex 1
|
||||
:padding-horizontal 12})
|
||||
|
||||
(def banner-card
|
||||
{:flex-direction :row
|
||||
:margin-horizontal 20
|
||||
:margin-vertical 8
|
||||
:height 56
|
||||
:padding-right 12})
|
||||
|
||||
(def discover-illustration
|
||||
{:position :absolute
|
||||
:top -4
|
||||
|
||||
@@ -2,13 +2,14 @@
|
||||
(:require [quo2.components.community.banner.style :as style]
|
||||
[quo2.components.markdown.text :as text]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[quo2.theme :as theme]
|
||||
[react-native.core :as rn]))
|
||||
|
||||
(defn- card-title-and-description
|
||||
[title description theme]
|
||||
[rn/view {:style style/banner-content}
|
||||
[rn/view {:style style/banner-title}
|
||||
[title description]
|
||||
[rn/view
|
||||
{:style style/banner-content}
|
||||
[rn/view
|
||||
{:style style/banner-title}
|
||||
[text/text
|
||||
{:accessibility-label :community-name-text
|
||||
:ellipsize-mode :tail
|
||||
@@ -20,21 +21,26 @@
|
||||
{:accessibility-label :community-name-text
|
||||
:ellipsize-mode :tail
|
||||
:number-of-lines 1
|
||||
:color (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)
|
||||
:color (colors/theme-colors
|
||||
colors/neutral-50
|
||||
colors/neutral-40)
|
||||
:weight :regular
|
||||
:size :paragraph-2}
|
||||
description]]])
|
||||
|
||||
(defn view-internal
|
||||
[{:keys [title description on-press accessibility-label banner style theme]}]
|
||||
(defn view
|
||||
[{:keys [title description on-press accessibility-label banner]}]
|
||||
[rn/touchable-without-feedback
|
||||
{:on-press on-press
|
||||
:accessibility-label accessibility-label}
|
||||
[rn/view {:style (merge (style/community-card theme) style)}
|
||||
[card-title-and-description title description theme]
|
||||
[rn/view
|
||||
(merge (style/community-card 16)
|
||||
{:background-color (colors/theme-colors
|
||||
colors/white
|
||||
colors/neutral-90)}
|
||||
style/banner-card)
|
||||
[card-title-and-description title description]
|
||||
[rn/image
|
||||
{:style style/discover-illustration
|
||||
:source banner
|
||||
:accessibility-label :discover-communities-illustration}]]])
|
||||
|
||||
(def view (theme/with-theme view-internal))
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
{:style (style/token-row padding?)}
|
||||
(doall
|
||||
(map-indexed (fn [token-index token]
|
||||
(let [{:keys [img-src amount sufficient? purchasable? loading?]} token]
|
||||
(let [{:keys [img-src symbol amount sufficient? purchasable? loading?]} token]
|
||||
^{:key token-index}
|
||||
[rn/view {:style style/token-tag-spacing}
|
||||
[token-tag/token-tag
|
||||
{:symbol (:symbol token)
|
||||
{:symbol symbol
|
||||
:value amount
|
||||
:size 24
|
||||
:sufficient? sufficient?
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
(ns quo2.components.counter.component-spec
|
||||
(ns quo2.components.counter.--tests--.counter-component-spec
|
||||
(:require [quo2.components.counter.counter :as counter]
|
||||
[test-helpers.component :as h]))
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
(ns quo2.components.dividers.divider-label-component-spec
|
||||
(ns quo2.components.dividers.--tests--.divider-label-component-spec
|
||||
(:require ["@testing-library/react-native" :as rtl]
|
||||
[quo2.components.dividers.divider-label :as divider-label]
|
||||
[reagent.core :as reagent]))
|
||||
@@ -15,7 +15,7 @@
|
||||
:margin-bottom (+ (safe-area/get-bottom) 8)})
|
||||
|
||||
(defn title
|
||||
[theme]
|
||||
[shell?]
|
||||
{:color (colors/theme-colors colors/neutral-100
|
||||
colors/white
|
||||
theme)})
|
||||
(when shell? :dark))})
|
||||
|
||||
@@ -3,10 +3,9 @@
|
||||
[quo2.components.drawers.documentation-drawers.style :as style]
|
||||
[quo2.components.markdown.text :as text]
|
||||
[react-native.core :as rn]
|
||||
[react-native.gesture :as gesture]
|
||||
[quo2.theme :as quo.theme]))
|
||||
[react-native.gesture :as gesture]))
|
||||
|
||||
(defn- view-internal
|
||||
(defn view
|
||||
"Options
|
||||
- `title` Title text
|
||||
- `show-button?` Show button
|
||||
@@ -16,7 +15,7 @@
|
||||
- `shell?` use shell theme
|
||||
`content` Content of the drawer
|
||||
"
|
||||
[{:keys [title show-button? on-press-button button-label button-icon theme shell?]} content]
|
||||
[{:keys [title show-button? on-press-button button-label button-icon shell?]} content]
|
||||
[gesture/scroll-view
|
||||
{:style style/outer-container
|
||||
:always-bounce-vertical false
|
||||
@@ -25,18 +24,18 @@
|
||||
[text/text
|
||||
{:size :heading-2
|
||||
:accessibility-label :documentation-drawer-title
|
||||
:style (style/title theme)
|
||||
:style (style/title shell?)
|
||||
:weight :semi-bold}
|
||||
title]
|
||||
[rn/view {:style style/content :accessibility-label :documentation-drawer-content}
|
||||
content]
|
||||
(when show-button?
|
||||
[button/button
|
||||
{:size 24
|
||||
:type (if shell? :blur-bg-outline :outline)
|
||||
:on-press on-press-button
|
||||
:accessibility-label :documentation-drawer-button
|
||||
:after button-icon}
|
||||
(cond-> {:size 24
|
||||
:type (if shell? :blur-bg-outline :outline)
|
||||
:on-press on-press-button
|
||||
:accessibility-label :documentation-drawer-button
|
||||
:after button-icon}
|
||||
shell? (assoc :override-theme :dark))
|
||||
button-label])]])
|
||||
|
||||
(def view (quo.theme/with-theme view-internal))
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
(ns quo2.components.dropdowns.dropdown
|
||||
(:require [quo2.components.dropdowns.old-button-view :as old-button]))
|
||||
(:require [quo2.components.buttons.button.view :as button]))
|
||||
|
||||
(defn dropdown
|
||||
[_ _]
|
||||
(fn [{:keys [on-change selected] :as opts} children]
|
||||
;TODO: Dropdown needs to be implemented/refactored to be its own component -
|
||||
;https://github.com/status-im/status-mobile/issues/16456
|
||||
[old-button/button
|
||||
[button/button
|
||||
(merge
|
||||
opts
|
||||
{:after (if selected :i/chevron-top :i/chevron-down)
|
||||
|
||||
@@ -1,264 +0,0 @@
|
||||
(ns quo2.components.dropdowns.old-button-style
|
||||
(:require [quo2.foundations.colors :as colors]))
|
||||
|
||||
(def blur-view
|
||||
{:position :absolute
|
||||
:top 0
|
||||
:left 0
|
||||
:right 0
|
||||
:bottom 0})
|
||||
|
||||
(defn before-icon-style
|
||||
[{:keys [override-margins size icon-container-size icon-background-color icon-container-rounded?
|
||||
icon-size]}]
|
||||
(merge
|
||||
{:margin-left (or (get override-margins :left)
|
||||
(if (= size 40) 12 8))
|
||||
:margin-right (or (get override-margins :right) 4)
|
||||
:align-items :center
|
||||
:justify-content :center}
|
||||
(when icon-container-size
|
||||
{:width icon-container-size
|
||||
:height icon-container-size})
|
||||
(when icon-background-color
|
||||
{:background-color icon-background-color})
|
||||
(when icon-container-rounded?
|
||||
{:border-radius (/ (or icon-container-size icon-size) 2)})))
|
||||
|
||||
(defn after-icon-style
|
||||
[{:keys [override-margins size icon-container-size icon-background-color icon-container-rounded?
|
||||
icon-size]}]
|
||||
(merge
|
||||
{:margin-left (or (get override-margins :left) 4)
|
||||
:margin-right (or (get override-margins :right)
|
||||
(if (= size 40) 12 8))
|
||||
:align-items :center
|
||||
:justify-content :center}
|
||||
(when icon-container-size
|
||||
{:width icon-container-size
|
||||
:height icon-container-size})
|
||||
(when icon-background-color
|
||||
{:background-color icon-background-color})
|
||||
(when icon-container-rounded?
|
||||
{:border-radius (/ (or icon-container-size icon-size) 2)})))
|
||||
|
||||
(defn themes
|
||||
[customization-color]
|
||||
{:light
|
||||
{:primary {:icon-color colors/white
|
||||
:icon-secondary-color colors/white-opa-70
|
||||
:label-color colors/white
|
||||
:background-color {:default (colors/custom-color customization-color 50)
|
||||
:pressed (colors/custom-color customization-color 60)
|
||||
:disabled (colors/custom-color customization-color 50)}}
|
||||
:secondary {:icon-color colors/primary-50
|
||||
:label-color colors/primary-50
|
||||
:background-color {:default colors/primary-50-opa-20
|
||||
:pressed colors/primary-50-opa-40
|
||||
:disabled colors/primary-50-opa-20}}
|
||||
:grey {:icon-color colors/neutral-100
|
||||
:icon-secondary-color colors/neutral-50
|
||||
:label-color colors/neutral-100
|
||||
:background-color {:default colors/neutral-10
|
||||
:pressed colors/neutral-20
|
||||
:disabled colors/neutral-10}}
|
||||
:dark-grey {:icon-color colors/neutral-100
|
||||
:icon-secondary-color colors/neutral-50
|
||||
:label-color colors/neutral-100
|
||||
:background-color {:default colors/neutral-20
|
||||
:pressed colors/neutral-30
|
||||
:disabled colors/neutral-20}}
|
||||
:outline {:icon-color colors/neutral-50
|
||||
:icon-secondary-color colors/neutral-50
|
||||
:label-color colors/neutral-100
|
||||
:border-color {:default colors/neutral-30
|
||||
:pressed colors/neutral-40
|
||||
:disabled colors/neutral-30}}
|
||||
:ghost {:icon-color colors/neutral-50
|
||||
:icon-secondary-color colors/neutral-50
|
||||
:label-color colors/neutral-100
|
||||
:background-color {:pressed colors/neutral-10}}
|
||||
:danger {:icon-color colors/white
|
||||
:icon-secondary-color colors/white-opa-70
|
||||
:label-color colors/white
|
||||
:background-color {:default colors/danger-50
|
||||
:pressed colors/danger-60
|
||||
:disabled colors/danger-50}}
|
||||
:positive {:icon-color colors/white
|
||||
:icon-secondary-color colors/white-opa-70
|
||||
:label-color colors/white
|
||||
:background-color {:default colors/success-50
|
||||
:pressed colors/success-60
|
||||
:disabled colors/success-50-opa-30}}
|
||||
:photo-bg {:icon-color colors/neutral-100
|
||||
:icon-secondary-color colors/neutral-80-opa-40
|
||||
:label-color colors/neutral-100
|
||||
:background-color {:default colors/white-opa-40
|
||||
:pressed colors/white-opa-50
|
||||
:disabled colors/white-opa-40}}
|
||||
:blur-bg {:icon-color colors/neutral-100
|
||||
:icon-secondary-color colors/neutral-80-opa-40
|
||||
:label-color colors/neutral-100
|
||||
:background-color {:default colors/neutral-80-opa-5
|
||||
:pressed colors/neutral-80-opa-10
|
||||
:disabled colors/neutral-80-opa-5}}
|
||||
:blurred {:icon-color colors/neutral-100
|
||||
:icon-secondary-color colors/neutral-100
|
||||
:icon-background-color {:default colors/neutral-20
|
||||
:blurred colors/neutral-80-opa-10}
|
||||
:label-color colors/neutral-100
|
||||
:background-color {:default colors/neutral-10
|
||||
:pressed colors/neutral-10
|
||||
:disabled colors/neutral-10-opa-10-blur}
|
||||
:blur-overlay-color colors/neutral-10-opa-40-blur
|
||||
:blur-type :light}
|
||||
:blur-bg-outline {:icon-color colors/neutral-100
|
||||
:icon-secondary-color colors/neutral-80-opa-40
|
||||
:label-color colors/neutral-100
|
||||
:border-color {:default colors/neutral-80-opa-10
|
||||
:pressed colors/neutral-80-opa-20
|
||||
:disabled colors/neutral-80-opa-10}}
|
||||
:shell {:icon-color colors/white
|
||||
:label-color colors/white
|
||||
:background-color {:default colors/neutral-95
|
||||
:pressed colors/neutral-95
|
||||
:disabled colors/neutral-95}}}
|
||||
:dark
|
||||
{:primary {:icon-color colors/white
|
||||
:icon-secondary-color colors/white-opa-70
|
||||
:label-color colors/white
|
||||
:background-color {:default (colors/custom-color customization-color 60)
|
||||
:pressed (colors/custom-color customization-color 50)
|
||||
:disabled (colors/custom-color customization-color 60)}}
|
||||
:secondary {:icon-color colors/primary-50
|
||||
:label-color colors/primary-50
|
||||
:background-color {:default colors/primary-50-opa-20
|
||||
:pressed colors/primary-50-opa-30
|
||||
:disabled colors/primary-50-opa-20}}
|
||||
:grey {:icon-color colors/white
|
||||
:icon-secondary-color colors/neutral-40
|
||||
:label-color colors/white
|
||||
:background-color {:default colors/neutral-90
|
||||
:pressed colors/neutral-60
|
||||
:disabled colors/neutral-90}}
|
||||
:dark-grey {:icon-color colors/white
|
||||
:icon-secondary-color colors/neutral-40
|
||||
:label-color colors/white
|
||||
:background-color {:default colors/neutral-70
|
||||
:pressed colors/neutral-60
|
||||
:disabled colors/neutral-70}}
|
||||
:outline {:icon-color colors/neutral-40
|
||||
:icon-secondary-color colors/neutral-40
|
||||
:label-color colors/white
|
||||
:border-color {:default colors/neutral-70
|
||||
:pressed colors/neutral-60
|
||||
:disabled colors/neutral-70}}
|
||||
:ghost {:icon-color colors/neutral-40
|
||||
:icon-secondary-color colors/neutral-40
|
||||
:label-color colors/white
|
||||
:background-color {:pressed colors/neutral-80}}
|
||||
:danger {:icon-color colors/white
|
||||
:icon-secondary-color colors/white-opa-70
|
||||
:label-color colors/white
|
||||
:background-color {:default colors/danger-60
|
||||
:pressed colors/danger-50
|
||||
:disabled colors/danger-60}}
|
||||
:positive {:icon-color colors/white
|
||||
:icon-secondary-color colors/white-opa-70
|
||||
:label-color colors/white
|
||||
:background-color {:default colors/success-60
|
||||
:pressed colors/success-50
|
||||
:disabled colors/success-60-opa-30}}
|
||||
:photo-bg {:icon-color colors/white
|
||||
:icon-secondary-color colors/neutral-30
|
||||
:label-color colors/white
|
||||
:background-color {:default colors/neutral-80-opa-40
|
||||
:pressed colors/neutral-80-opa-50
|
||||
:disabled colors/neutral-80-opa-40}}
|
||||
:blur-bg {:icon-color colors/white
|
||||
:icon-secondary-color colors/white-opa-70
|
||||
:label-color colors/white
|
||||
:background-color {:default colors/white-opa-5
|
||||
:pressed colors/white-opa-10
|
||||
:disabled colors/white-opa-5}}
|
||||
:blurred {:icon-color colors/white
|
||||
:icon-secondary-color colors/white
|
||||
:icon-background-color {:default colors/neutral-80
|
||||
:blurred colors/white-opa-10}
|
||||
:label-color colors/white
|
||||
:background-color {:default colors/neutral-90
|
||||
:pressed colors/neutral-90
|
||||
:disabled colors/neutral-90-opa-10-blur}
|
||||
:blur-overlay-color colors/neutral-80-opa-40
|
||||
:blur-type :dark}
|
||||
:blur-bg-outline {:icon-color colors/white
|
||||
:icon-secondary-color colors/white-opa-40
|
||||
:label-color colors/white
|
||||
:border-color {:default colors/white-opa-10
|
||||
:pressed colors/white-opa-20
|
||||
:disabled colors/white-opa-5}}
|
||||
:shell {:icon-color colors/white
|
||||
:label-color colors/white
|
||||
:background-color {:default colors/neutral-95}}}})
|
||||
|
||||
(defn shape-style-container
|
||||
[type icon size]
|
||||
{:height size
|
||||
:border-radius (if (and icon (#{:primary :secondary :danger} type))
|
||||
24
|
||||
(case size
|
||||
56 12
|
||||
40 12
|
||||
32 10
|
||||
24 8))})
|
||||
|
||||
(defn style-container
|
||||
[{:keys [type size disabled background-color border-color icon above width before after blur-active?]}]
|
||||
(merge {:height size
|
||||
:align-items :center
|
||||
:justify-content :center
|
||||
:flex-direction (if above :column :row)
|
||||
:padding-horizontal (when-not (or icon before after)
|
||||
(case size
|
||||
56 16
|
||||
40 16
|
||||
32 12
|
||||
24 8))
|
||||
:padding-left (when-not (or icon before)
|
||||
(case size
|
||||
56 16
|
||||
40 16
|
||||
32 12
|
||||
24 8))
|
||||
:padding-right (when-not (or icon after)
|
||||
(case size
|
||||
56 16
|
||||
40 16
|
||||
32 12
|
||||
24 8))
|
||||
:padding-top (when-not (or icon before after)
|
||||
(case size
|
||||
56 0
|
||||
40 9
|
||||
32 5
|
||||
24 3))
|
||||
:padding-bottom (when-not (or icon before after)
|
||||
(case size
|
||||
56 0
|
||||
40 9
|
||||
32 5
|
||||
24 4))
|
||||
:overflow :hidden}
|
||||
(when (or (and (= type :blurred) (not blur-active?))
|
||||
(not= type :blurred))
|
||||
{:background-color background-color})
|
||||
(shape-style-container type icon size)
|
||||
(when width
|
||||
{:width width})
|
||||
(when icon
|
||||
{:width size})
|
||||
(when border-color
|
||||
{:border-color border-color
|
||||
:border-width 1})
|
||||
(when disabled
|
||||
{:opacity 0.3})))
|
||||
@@ -1,138 +0,0 @@
|
||||
(ns quo2.components.dropdowns.old-button-view
|
||||
(:require [quo2.components.icon :as quo2.icons]
|
||||
[quo2.components.markdown.text :as text]
|
||||
[quo2.theme :as theme]
|
||||
[react-native.core :as rn]
|
||||
[react-native.blur :as blur]
|
||||
[reagent.core :as reagent]
|
||||
[quo2.components.dropdowns.old-button-style :as style]))
|
||||
|
||||
(defn- button-internal
|
||||
"with label
|
||||
[button opts \"label\"]
|
||||
opts
|
||||
{:type :primary/:secondary/:grey/:dark-grey/:outline/:ghost/
|
||||
:danger/:photo-bg/:blur-bg/:blur-bg-outline/:shell/:community
|
||||
:size 40 [default] /32/24
|
||||
:icon true/false
|
||||
:community-color '#FFFFFF'
|
||||
:community-text-color '#000000'
|
||||
:before :icon-keyword
|
||||
:after :icon-keyword}
|
||||
|
||||
only icon
|
||||
[button {:icon true} :i/close-circle]"
|
||||
[_ _]
|
||||
(let [pressed-in (reagent/atom false)]
|
||||
(fn
|
||||
[{:keys [on-press disabled type size before after above icon-secondary-no-color
|
||||
width customization-color theme override-background-color pressed
|
||||
on-long-press accessibility-label icon icon-no-color style inner-style test-ID
|
||||
blur-active? override-before-margins override-after-margins icon-size icon-container-size
|
||||
icon-container-rounded?]
|
||||
:or {type :primary
|
||||
size 40
|
||||
customization-color :primary
|
||||
blur-active? true}}
|
||||
children]
|
||||
(let [{:keys [icon-color icon-secondary-color background-color label-color border-color blur-type
|
||||
blur-overlay-color icon-background-color]}
|
||||
(get-in (style/themes customization-color)
|
||||
[theme type])
|
||||
state (cond disabled :disabled
|
||||
(or @pressed-in pressed) :pressed
|
||||
:else :default)
|
||||
blur-state (if blur-active? :blurred :default)
|
||||
icon-size (or icon-size (when (= 24 size) 12))
|
||||
icon-secondary-color (or icon-secondary-color icon-color)]
|
||||
[rn/touchable-without-feedback
|
||||
(merge {:test-ID test-ID
|
||||
:disabled disabled
|
||||
:accessibility-label accessibility-label
|
||||
:on-press-in #(reset! pressed-in true)
|
||||
:on-press-out #(reset! pressed-in nil)}
|
||||
(when on-press
|
||||
{:on-press on-press})
|
||||
(when on-long-press
|
||||
{:on-long-press on-long-press}))
|
||||
[rn/view
|
||||
{:style (merge
|
||||
(style/shape-style-container type icon size)
|
||||
{:width width}
|
||||
style)}
|
||||
[rn/view
|
||||
{:style (merge
|
||||
(style/style-container {:type type
|
||||
:size size
|
||||
:disabled disabled
|
||||
:background-color
|
||||
(or override-background-color (get background-color state))
|
||||
:border-color
|
||||
(get border-color state)
|
||||
:icon icon
|
||||
:above above
|
||||
:width width
|
||||
:before before
|
||||
:after after
|
||||
:blur-active? blur-active?})
|
||||
(when (= state :pressed) {:opacity 0.9})
|
||||
inner-style)}
|
||||
(when (and (= type :blurred)
|
||||
blur-active?)
|
||||
[blur/view
|
||||
{:blur-radius 20
|
||||
:blur-type blur-type
|
||||
:overlay-color blur-overlay-color
|
||||
:style style/blur-view}])
|
||||
(when above
|
||||
[rn/view
|
||||
[quo2.icons/icon above
|
||||
{:container-style {:margin-bottom 2}
|
||||
:color icon-secondary-color
|
||||
:size icon-size}]])
|
||||
(when before
|
||||
[rn/view
|
||||
{:style (style/before-icon-style
|
||||
{:override-margins override-before-margins
|
||||
:size size
|
||||
:icon-container-size icon-container-size
|
||||
:icon-background-color (get icon-background-color blur-state)
|
||||
:icon-container-rounded? icon-container-rounded?
|
||||
:icon-size icon-size})}
|
||||
[quo2.icons/icon before
|
||||
{:color icon-secondary-color
|
||||
:size icon-size}]])
|
||||
[rn/view
|
||||
(cond
|
||||
(or icon icon-no-color)
|
||||
[quo2.icons/icon children
|
||||
{:color icon-color
|
||||
:no-color icon-no-color
|
||||
:size icon-size}]
|
||||
|
||||
(string? children)
|
||||
[text/text
|
||||
{:size (when (#{56 24} size) :paragraph-2)
|
||||
:weight :medium
|
||||
:number-of-lines 1
|
||||
:style {:color label-color}}
|
||||
|
||||
children]
|
||||
|
||||
(vector? children)
|
||||
children)]
|
||||
(when after
|
||||
[rn/view
|
||||
{:style (style/after-icon-style
|
||||
{:override-margins override-after-margins
|
||||
:size size
|
||||
:icon-container-size icon-container-size
|
||||
:icon-background-color (get icon-background-color blur-state)
|
||||
:icon-container-rounded? icon-container-rounded?
|
||||
:icon-size icon-size})}
|
||||
[quo2.icons/icon after
|
||||
{:no-color icon-secondary-no-color
|
||||
:color icon-secondary-color
|
||||
:size icon-size}]])]]]))))
|
||||
|
||||
(def button (theme/with-theme button-internal))
|
||||
@@ -24,3 +24,7 @@
|
||||
{:color colors/white}))
|
||||
|
||||
(def button-container {:margin-top 20})
|
||||
|
||||
(defn upper-button-color
|
||||
[customization-color]
|
||||
(colors/custom-color-by-theme customization-color 50 60))
|
||||
|
||||
@@ -33,10 +33,10 @@
|
||||
upper-button-on-press :on-press} upper-button]
|
||||
[rn/view {:style styles/button-container}
|
||||
[button/button
|
||||
{:type :primary
|
||||
:size 32
|
||||
:customization-color customization-color
|
||||
:on-press upper-button-on-press}
|
||||
{:type :primary
|
||||
:size 32
|
||||
:override-background-color (styles/upper-button-color customization-color)
|
||||
:on-press upper-button-on-press}
|
||||
upper-button-text]
|
||||
(when-let [{lower-button-text :text
|
||||
lower-button-on-press :on-press} lower-button]
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
[quo2.components.icons.icons :as icons]
|
||||
[quo2.components.icons.svg :as icons.svg]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[quo2.theme :as quo.theme]
|
||||
[react-native.core :as rn]))
|
||||
|
||||
(defn- valid-color?
|
||||
@@ -13,10 +12,11 @@
|
||||
(not (string/blank? color)))))
|
||||
|
||||
(defn memo-icon-fn
|
||||
[{:keys [color color-2 no-color
|
||||
container-style size accessibility-label theme]
|
||||
[icon-name
|
||||
{:keys [color color-2 no-color
|
||||
container-style size accessibility-label]
|
||||
:or {accessibility-label :icon}}
|
||||
icon-name]
|
||||
_]
|
||||
(let [size (or size 20)]
|
||||
^{:key icon-name}
|
||||
(if-let [svg-icon (icons.svg/get-icon icon-name size)]
|
||||
@@ -34,15 +34,15 @@
|
||||
(when (not no-color)
|
||||
{:tint-color (if (and (string? color) (not (string/blank? color)))
|
||||
color
|
||||
(colors/theme-colors colors/neutral-100 colors/white theme))})
|
||||
(colors/theme-colors colors/neutral-100 colors/white))})
|
||||
|
||||
container-style)
|
||||
:accessibility-label accessibility-label
|
||||
:source (icons/icon-source (str (name icon-name) size))}])))
|
||||
|
||||
(def ^:private themed-icon (memoize (quo.theme/with-theme memo-icon-fn)))
|
||||
(def themed-icon (memoize memo-icon-fn))
|
||||
|
||||
(defn icon
|
||||
([icon-name] (icon icon-name nil))
|
||||
([icon-name params]
|
||||
(themed-icon params icon-name)))
|
||||
(themed-icon icon-name params (colors/dark?))))
|
||||
|
||||
@@ -35,5 +35,4 @@
|
||||
(get-icons 16)
|
||||
(get-icons 20)
|
||||
(get-icons 24)
|
||||
(get-icons 32)
|
||||
(get-icons 48)))
|
||||
(get-icons 32)))
|
||||
|
||||
@@ -3,62 +3,62 @@
|
||||
[quo2.foundations.colors :as colors]))
|
||||
|
||||
(defn variants-colors
|
||||
[blur? theme]
|
||||
[blur? override-theme]
|
||||
(if blur?
|
||||
{:label (colors/theme-colors colors/neutral-80-opa-40 colors/white-opa-40 theme)
|
||||
:icon (colors/theme-colors colors/neutral-80-opa-70 colors/white-opa-70 theme)
|
||||
:button-border (colors/theme-colors colors/neutral-80-opa-30 colors/white-opa-10 theme)
|
||||
:password-icon (colors/theme-colors colors/neutral-100 colors/white-opa-70 theme)
|
||||
:clear-icon (colors/theme-colors colors/neutral-80-opa-30 colors/white-opa-10 theme)
|
||||
{:label (colors/theme-colors colors/neutral-80-opa-40 colors/white-opa-40 override-theme)
|
||||
:icon (colors/theme-colors colors/neutral-80-opa-70 colors/white-opa-70 override-theme)
|
||||
:button-border (colors/theme-colors colors/neutral-80-opa-30 colors/white-opa-10 override-theme)
|
||||
:password-icon (colors/theme-colors colors/neutral-100 colors/white-opa-70 override-theme)
|
||||
:clear-icon (colors/theme-colors colors/neutral-80-opa-30 colors/white-opa-10 override-theme)
|
||||
:cursor (colors/theme-colors (colors/custom-color :blue 50)
|
||||
colors/white
|
||||
theme)}
|
||||
{:label (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)
|
||||
:icon (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)
|
||||
:button-border (colors/theme-colors colors/neutral-30 colors/neutral-70 theme)
|
||||
:clear-icon (colors/theme-colors colors/neutral-40 colors/neutral-60 theme)
|
||||
:password-icon (colors/theme-colors colors/neutral-50 colors/white theme)
|
||||
override-theme)}
|
||||
{:label (colors/theme-colors colors/neutral-50 colors/neutral-40 override-theme)
|
||||
:icon (colors/theme-colors colors/neutral-50 colors/neutral-40 override-theme)
|
||||
:button-border (colors/theme-colors colors/neutral-30 colors/neutral-70 override-theme)
|
||||
:clear-icon (colors/theme-colors colors/neutral-40 colors/neutral-60 override-theme)
|
||||
:password-icon (colors/theme-colors colors/neutral-50 colors/white override-theme)
|
||||
:cursor (colors/theme-colors (colors/custom-color :blue 50)
|
||||
(colors/custom-color :blue 60)
|
||||
theme)}))
|
||||
override-theme)}))
|
||||
|
||||
(defn status-colors
|
||||
[status blur? theme]
|
||||
[status blur? override-theme]
|
||||
(if blur?
|
||||
(case status
|
||||
:focus
|
||||
{:border-color (colors/theme-colors colors/neutral-80-opa-20 colors/white-opa-40 theme)
|
||||
:placeholder (colors/theme-colors colors/neutral-80-opa-20 colors/white-opa-20 theme)
|
||||
:text (colors/theme-colors colors/neutral-100 colors/white theme)}
|
||||
{:border-color (colors/theme-colors colors/neutral-80-opa-20 colors/white-opa-40 override-theme)
|
||||
:placeholder (colors/theme-colors colors/neutral-80-opa-20 colors/white-opa-20 override-theme)
|
||||
:text (colors/theme-colors colors/neutral-100 colors/white override-theme)}
|
||||
:error
|
||||
{:border-color (colors/theme-colors colors/danger-opa-40 colors/danger-opa-40 theme)
|
||||
:placeholder (colors/theme-colors colors/neutral-80-opa-40 colors/white-opa-40 theme)
|
||||
:text (colors/theme-colors colors/neutral-100 colors/white theme)}
|
||||
{:border-color (colors/theme-colors colors/danger-opa-40 colors/danger-opa-40 override-theme)
|
||||
:placeholder (colors/theme-colors colors/neutral-80-opa-40 colors/white-opa-40 override-theme)
|
||||
:text (colors/theme-colors colors/neutral-100 colors/white override-theme)}
|
||||
:disabled
|
||||
{:border-color (colors/theme-colors colors/neutral-80-opa-10 colors/white-opa-10 theme)
|
||||
:placeholder (colors/theme-colors colors/neutral-80-opa-30 colors/white-opa-20 theme)
|
||||
:text (colors/theme-colors colors/neutral-80-opa-30 colors/white-opa-20 theme)}
|
||||
{:border-color (colors/theme-colors colors/neutral-80-opa-10 colors/white-opa-10 override-theme)
|
||||
:placeholder (colors/theme-colors colors/neutral-80-opa-30 colors/white-opa-20 override-theme)
|
||||
:text (colors/theme-colors colors/neutral-80-opa-30 colors/white-opa-20 override-theme)}
|
||||
;; :default
|
||||
{:border-color (colors/theme-colors colors/neutral-80-opa-10 colors/white-opa-10 theme)
|
||||
:placeholder (colors/theme-colors colors/neutral-80-opa-40 colors/white-opa-40 theme)
|
||||
:text (colors/theme-colors colors/neutral-100 colors/white theme)})
|
||||
{:border-color (colors/theme-colors colors/neutral-80-opa-10 colors/white-opa-10 override-theme)
|
||||
:placeholder (colors/theme-colors colors/neutral-80-opa-40 colors/white-opa-40 override-theme)
|
||||
:text (colors/theme-colors colors/neutral-100 colors/white override-theme)})
|
||||
(case status
|
||||
:focus
|
||||
{:border-color (colors/theme-colors colors/neutral-40 colors/neutral-60 theme)
|
||||
:placeholder (colors/theme-colors colors/neutral-30 colors/neutral-60 theme)
|
||||
:text (colors/theme-colors colors/neutral-100 colors/white theme)}
|
||||
{:border-color (colors/theme-colors colors/neutral-40 colors/neutral-60 override-theme)
|
||||
:placeholder (colors/theme-colors colors/neutral-30 colors/neutral-60 override-theme)
|
||||
:text (colors/theme-colors colors/neutral-100 colors/white override-theme)}
|
||||
:error
|
||||
{:border-color (colors/theme-colors colors/danger-opa-40 colors/danger-opa-40 theme)
|
||||
:placeholder (colors/theme-colors colors/neutral-40 colors/white-opa-40 theme)
|
||||
:text (colors/theme-colors colors/neutral-100 colors/white theme)}
|
||||
{:border-color (colors/theme-colors colors/danger-opa-40 colors/danger-opa-40 override-theme)
|
||||
:placeholder (colors/theme-colors colors/neutral-40 colors/white-opa-40 override-theme)
|
||||
:text (colors/theme-colors colors/neutral-100 colors/white override-theme)}
|
||||
:disabled
|
||||
{:border-color (colors/theme-colors colors/neutral-20 colors/neutral-80 theme)
|
||||
:placeholder (colors/theme-colors colors/neutral-40 colors/neutral-40 theme)
|
||||
:text (colors/theme-colors colors/neutral-40 colors/neutral-40 theme)}
|
||||
{:border-color (colors/theme-colors colors/neutral-20 colors/neutral-80 override-theme)
|
||||
:placeholder (colors/theme-colors colors/neutral-40 colors/neutral-40 override-theme)
|
||||
:text (colors/theme-colors colors/neutral-40 colors/neutral-40 override-theme)}
|
||||
;; :default
|
||||
{:border-color (colors/theme-colors colors/neutral-20 colors/neutral-80 theme)
|
||||
:placeholder (colors/theme-colors colors/neutral-40 colors/neutral-50 theme)
|
||||
:text (colors/theme-colors colors/neutral-100 colors/white theme)})))
|
||||
{:border-color (colors/theme-colors colors/neutral-20 colors/neutral-80 override-theme)
|
||||
:placeholder (colors/theme-colors colors/neutral-40 colors/neutral-50 override-theme)
|
||||
:text (colors/theme-colors colors/neutral-100 colors/white override-theme)})))
|
||||
|
||||
(defn input-container
|
||||
[colors-by-status small? disabled?]
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
[quo2.components.markdown.text :as text]
|
||||
[react-native.core :as rn]
|
||||
[reagent.core :as reagent]
|
||||
[quo2.theme :as quo.theme]))
|
||||
[quo2.theme :as theme]))
|
||||
|
||||
(defn- label-&-counter
|
||||
[{:keys [label current-chars char-limit variant-colors]}]
|
||||
@@ -54,7 +54,7 @@
|
||||
|
||||
(def ^:private custom-props
|
||||
"Custom properties that must be removed from properties map passed to InputText."
|
||||
[:type :blur? :theme :error? :right-icon :left-icon :disabled? :small? :button
|
||||
[:type :blur? :override-theme :error? :right-icon :left-icon :disabled? :small? :button
|
||||
:label :char-limit :on-char-limit-reach :icon-name :multiline? :on-focus :on-blur])
|
||||
|
||||
(defn- base-input
|
||||
@@ -74,15 +74,15 @@
|
||||
(reset! char-count amount-chars)
|
||||
(when (>= amount-chars char-limit)
|
||||
(on-char-limit-reach amount-chars))))]
|
||||
(fn [{:keys [blur? theme error? right-icon left-icon disabled? small? button
|
||||
(fn [{:keys [blur? override-theme error? right-icon left-icon disabled? small? button
|
||||
label char-limit multiline? clearable? on-focus on-blur]
|
||||
:as props}]
|
||||
(let [status-kw (cond
|
||||
disabled? :disabled
|
||||
error? :error
|
||||
:else @status)
|
||||
colors-by-status (style/status-colors status-kw blur? theme)
|
||||
variant-colors (style/variants-colors blur? theme)
|
||||
colors-by-status (style/status-colors status-kw blur? override-theme)
|
||||
variant-colors (style/variants-colors blur? override-theme)
|
||||
clean-props (apply dissoc props custom-props)]
|
||||
[:<>
|
||||
(when (or label char-limit)
|
||||
@@ -101,7 +101,7 @@
|
||||
(cond-> {:style (style/input colors-by-status small? @multiple-lines?)
|
||||
:accessibility-label :input
|
||||
:placeholder-text-color (:placeholder colors-by-status)
|
||||
:keyboard-appearance (quo.theme/theme-value :light :dark theme)
|
||||
:keyboard-appearance (theme/theme-value :light :dark override-theme)
|
||||
:cursor-color (:cursor variant-colors)
|
||||
:editable (not disabled?)
|
||||
:on-focus (fn []
|
||||
@@ -148,11 +148,11 @@
|
||||
:icon-name (if @password-shown? :i/hide :i/reveal)
|
||||
:on-press #(swap! password-shown? not)})])))
|
||||
|
||||
(defn input-internal
|
||||
(defn input
|
||||
"This input supports the following properties:
|
||||
- :type - Can be `:text`(default) or `:password`.
|
||||
- :blur? - Boolean to set the blur color variant.
|
||||
- :theme - Can be `light` or `:dark`.
|
||||
- :override-theme - Can be `light` or `:dark`.
|
||||
- :small? - Boolean to specify if this input is rendered in its small version.
|
||||
- :multiline? - Boolean to specify if this input support multiple lines.
|
||||
- :icon-name - The name of an icon to display at the left of the input.
|
||||
@@ -188,5 +188,3 @@
|
||||
(if (= type :password)
|
||||
[password-input base-props]
|
||||
[base-input base-props])))
|
||||
|
||||
(def input (quo.theme/with-theme input-internal))
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
[quo2.components.avatars.user-avatar.view :as user-avatar]
|
||||
[quo2.components.inputs.profile-input.style :as style]
|
||||
[quo2.components.inputs.title-input.view :as title-input]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[react-native.core :as rn]
|
||||
[react-native.hole-view :as hole-view]))
|
||||
|
||||
@@ -34,16 +35,16 @@
|
||||
:status-indicator? false
|
||||
:size :medium)]]
|
||||
[buttons/button
|
||||
{:accessibility-label :select-profile-picture-button
|
||||
:type :grey
|
||||
:background :blur
|
||||
:on-press on-press
|
||||
:icon-size 20
|
||||
:width 24
|
||||
:size 24
|
||||
:icon :i/camera
|
||||
:style style/button
|
||||
:inner-style style/button-inner} :i/camera]]
|
||||
{:accessibility-label :select-profile-picture-button
|
||||
:type :grey
|
||||
:override-background-color (colors/alpha colors/white 0.05)
|
||||
:on-press on-press
|
||||
:icon-size 20
|
||||
:width 24
|
||||
:size 24
|
||||
:icon :i/camera
|
||||
:style style/button
|
||||
:inner-style style/button-inner} :i/camera]]
|
||||
[rn/view {:style style/input-container}
|
||||
[title-input/title-input
|
||||
(merge title-input-props
|
||||
|
||||
@@ -17,29 +17,29 @@
|
||||
:text-align-vertical :top))
|
||||
|
||||
(defn placeholder-color
|
||||
[input-state theme blur?]
|
||||
[input-state override-theme blur?]
|
||||
(cond
|
||||
(and (= input-state :focused) blur?)
|
||||
(colors/theme-colors colors/neutral-80-opa-20 colors/white-opa-20 theme)
|
||||
(colors/theme-colors colors/neutral-80-opa-20 colors/white-opa-20 override-theme)
|
||||
|
||||
(= input-state :focused) ; Not blur
|
||||
(colors/theme-colors colors/neutral-30 colors/neutral-60 theme)
|
||||
(colors/theme-colors colors/neutral-30 colors/neutral-60 override-theme)
|
||||
|
||||
blur? ; :default & blur
|
||||
(colors/theme-colors colors/neutral-80-opa-40 colors/white-opa-30 theme)
|
||||
(colors/theme-colors colors/neutral-80-opa-40 colors/white-opa-30 override-theme)
|
||||
|
||||
:else ; :default & not blur
|
||||
(colors/theme-colors colors/neutral-40 colors/neutral-50 theme)))
|
||||
(colors/theme-colors colors/neutral-40 colors/neutral-50 override-theme)))
|
||||
|
||||
(defn cursor-color
|
||||
[customization-color theme]
|
||||
[customization-color override-theme]
|
||||
(colors/theme-colors (colors/custom-color customization-color 50)
|
||||
(colors/custom-color customization-color 60)
|
||||
theme))
|
||||
override-theme))
|
||||
|
||||
(defn error-word
|
||||
[theme]
|
||||
[]
|
||||
{:height 22
|
||||
:padding-horizontal 20
|
||||
:background-color colors/danger-50-opa-10
|
||||
:color (colors/theme-colors colors/danger-50 colors/danger-60 theme)})
|
||||
:color (colors/theme-colors colors/danger-50 colors/danger-60)})
|
||||
|
||||
@@ -3,19 +3,19 @@
|
||||
[quo2.components.inputs.recovery-phrase.style :as style]
|
||||
[react-native.core :as rn]
|
||||
[reagent.core :as reagent]
|
||||
[quo2.theme :as quo.theme]))
|
||||
[quo2.theme :as theme]))
|
||||
|
||||
(def ^:private custom-props
|
||||
[:customization-color :theme :blur? :cursor-color :multiline :on-focus :on-blur
|
||||
[:customization-color :override-theme :blur? :cursor-color :multiline :on-focus :on-blur
|
||||
:placeholder-text-color :mark-errors? :error-pred :word-limit])
|
||||
|
||||
(defn- error-word
|
||||
[text theme]
|
||||
[rn/text {:style (style/error-word theme)}
|
||||
[text]
|
||||
[rn/text {:style (style/error-word)}
|
||||
text])
|
||||
|
||||
(defn- mark-error-words
|
||||
[{:keys [pred-last-word pred-previous-words text word-limit theme]}]
|
||||
[pred-last-word pred-previous-words text word-limit]
|
||||
(let [last-index (dec (count (string/split text #"\s+")))
|
||||
words (map #(apply str %)
|
||||
(partition-by #(= " " %) text))]
|
||||
@@ -31,18 +31,18 @@
|
||||
:always (update :result
|
||||
conj
|
||||
(if invalid-word?
|
||||
[error-word word theme]
|
||||
[error-word word]
|
||||
word)))))
|
||||
{:result [:<>]
|
||||
:idx 0})
|
||||
:result)))
|
||||
|
||||
(defn recovery-phrase-input-internal
|
||||
(defn recovery-phrase-input
|
||||
[_ _]
|
||||
(let [state (reagent/atom :default)
|
||||
set-focused #(reset! state :focused)
|
||||
set-default #(reset! state :default)]
|
||||
(fn [{:keys [customization-color theme blur? on-focus on-blur mark-errors?
|
||||
(fn [{:keys [customization-color override-theme blur? on-focus on-blur mark-errors?
|
||||
error-pred-current-word error-pred-written-words word-limit]
|
||||
:or {customization-color :blue
|
||||
word-limit ##Inf
|
||||
@@ -55,9 +55,9 @@
|
||||
[rn/text-input
|
||||
(merge {:accessibility-label :recovery-phrase-input
|
||||
:style (style/input)
|
||||
:placeholder-text-color (style/placeholder-color @state theme blur?)
|
||||
:cursor-color (style/cursor-color customization-color theme)
|
||||
:keyboard-appearance (quo.theme/theme-value :light :dark theme)
|
||||
:placeholder-text-color (style/placeholder-color @state override-theme blur?)
|
||||
:cursor-color (style/cursor-color customization-color override-theme)
|
||||
:keyboard-appearance (theme/theme-value :light :dark override-theme)
|
||||
:multiline true
|
||||
:on-focus (fn []
|
||||
(set-focused)
|
||||
@@ -67,11 +67,5 @@
|
||||
(when on-blur (on-blur)))}
|
||||
extra-props)
|
||||
(if mark-errors?
|
||||
(mark-error-words {:pred-last-word error-pred-current-word
|
||||
:pred-previous-words error-pred-written-words
|
||||
:text text
|
||||
:word-limit word-limit
|
||||
:theme theme})
|
||||
(mark-error-words error-pred-current-word error-pred-written-words text word-limit)
|
||||
text)]]))))
|
||||
|
||||
(def recovery-phrase-input (quo.theme/with-theme recovery-phrase-input-internal))
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
[quo2.foundations.colors :as colors]
|
||||
[react-native.core :as rn]
|
||||
[react-native.fast-image :as fast-image]
|
||||
[react-native.hole-view :as hole-view]
|
||||
[quo2.theme :as quo.theme]))
|
||||
[react-native.hole-view :as hole-view]))
|
||||
|
||||
(def params
|
||||
{32 {:border-radius {:circular 16 :rounded 10}
|
||||
@@ -62,13 +61,13 @@
|
||||
[avatar item type size border-radius]]))
|
||||
|
||||
(defn get-overflow-color
|
||||
[transparent? transparent-color light-color dark-color theme]
|
||||
[transparent? transparent-color light-color dark-color override-theme]
|
||||
(if transparent?
|
||||
transparent-color
|
||||
(colors/theme-colors light-color dark-color theme)))
|
||||
(colors/theme-colors light-color dark-color override-theme)))
|
||||
|
||||
(defn overflow-label
|
||||
[{:keys [label size transparent? border-radius margin-left theme more-than-99-label]}]
|
||||
[label size transparent? border-radius margin-left override-theme more-than-99-label]
|
||||
[rn/view
|
||||
{:style {:width size
|
||||
:height size
|
||||
@@ -81,7 +80,7 @@
|
||||
colors/white-opa-10
|
||||
colors/neutral-20
|
||||
colors/neutral-70
|
||||
theme)}}
|
||||
override-theme)}}
|
||||
(if (= size 16)
|
||||
[quo2.icons/icon :i/more
|
||||
{:size 12
|
||||
@@ -90,7 +89,7 @@
|
||||
colors/white-opa-70
|
||||
colors/neutral-50
|
||||
colors/neutral-40
|
||||
theme)}]
|
||||
override-theme)}]
|
||||
[quo2.text/text
|
||||
{:size (if (= size 32) :paragraph-2 :label)
|
||||
:weight :medium
|
||||
@@ -99,7 +98,7 @@
|
||||
colors/white-opa-70
|
||||
colors/neutral-60
|
||||
colors/neutral-40
|
||||
theme)
|
||||
override-theme)
|
||||
:margin-left -2}}
|
||||
;; If overflow label is below 100, show label as +label (ex. +30), else just show 99+
|
||||
(if (< label 100)
|
||||
@@ -112,7 +111,7 @@
|
||||
(:account :collectible :photo) :rounded
|
||||
:circular))
|
||||
|
||||
(defn- preview-list-internal
|
||||
(defn preview-list
|
||||
"[preview-list opts items]
|
||||
opts
|
||||
{:type :user/:community/:account/:token/:collectible/:dapp
|
||||
@@ -121,7 +120,7 @@
|
||||
:transparent? overflow-label transparent?}
|
||||
items preview list items (only 4 items is required for preview)
|
||||
"
|
||||
[{:keys [type size list-size transparent? theme more-than-99-label]} items]
|
||||
[{:keys [type size list-size transparent? override-theme more-than-99-label]} items]
|
||||
(let [items-arr (into [] items)
|
||||
list-size (or list-size (count items))
|
||||
margin-left (get-in params [size :margin-left])
|
||||
@@ -136,13 +135,5 @@
|
||||
[list-item index type size (get items-arr index) list-size
|
||||
margin-left hole-size hole-radius hole-x hole-y border-radius])
|
||||
(when (> list-size 4)
|
||||
[overflow-label
|
||||
{:label (- list-size 3)
|
||||
:size size
|
||||
:transparent? transparent?
|
||||
:border-radius border-radius
|
||||
:margin-left margin-left
|
||||
:theme theme
|
||||
:more-than-99-label more-than-99-label}])]))
|
||||
|
||||
(def preview-list (quo.theme/with-theme preview-list-internal))
|
||||
[overflow-label (- list-size 3) size transparent? border-radius margin-left override-theme
|
||||
more-than-99-label])]))
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
(ns quo2.components.markdown.text-component-spec
|
||||
(ns quo2.components.markdown.--tests--.text-component-spec
|
||||
(:require ["@testing-library/react-native" :as rtl]
|
||||
[quo2.components.markdown.text :as text]
|
||||
[reagent.core :as reagent]))
|
||||
@@ -1,12 +1,12 @@
|
||||
(ns quo2.components.markdown.text
|
||||
(:require [quo2.foundations.colors :as colors]
|
||||
[quo2.foundations.typography :as typography]
|
||||
[quo2.theme :as quo.theme]
|
||||
[quo2.theme :as theme]
|
||||
[react-native.core :as rn]
|
||||
[reagent.core :as reagent]))
|
||||
|
||||
(defn text-style
|
||||
[{:keys [size align weight style theme]}]
|
||||
[{:keys [size align weight style]}]
|
||||
(merge (case (or weight :regular)
|
||||
:regular typography/font-regular
|
||||
:medium typography/font-medium
|
||||
@@ -25,23 +25,14 @@
|
||||
{:text-align (or align :auto)}
|
||||
(if (:color style)
|
||||
style
|
||||
(assoc style
|
||||
:color
|
||||
(if (= (or theme (quo.theme/get-theme)) :dark) colors/white colors/neutral-100)))))
|
||||
|
||||
(defn- text-view-internal
|
||||
[props & children]
|
||||
(let [style (text-style props)]
|
||||
(into [rn/text
|
||||
(merge {:style style}
|
||||
(dissoc props :style :size :align :weight :color :theme))]
|
||||
children)))
|
||||
|
||||
(def ^:private text-view (quo.theme/with-theme text-view-internal))
|
||||
(assoc style :color (if (= (theme/get-theme) :dark) colors/white colors/neutral-100)))))
|
||||
|
||||
(defn text
|
||||
[]
|
||||
(let [this (reagent/current-component)
|
||||
props (reagent/props this)
|
||||
children (reagent/children this)]
|
||||
(into [text-view props] children)))
|
||||
(let [this (reagent/current-component)
|
||||
props (reagent/props this)
|
||||
style (text-style props)]
|
||||
(into [rn/text
|
||||
(merge {:style style}
|
||||
(dissoc props :style :size :align :weight :color))]
|
||||
(reagent/children this))))
|
||||
|
||||
@@ -82,12 +82,11 @@
|
||||
:border-radius 50}])
|
||||
|
||||
(defn timestamp
|
||||
[s]
|
||||
[str]
|
||||
[text/text
|
||||
{:size :label
|
||||
:style {:text-transform :none
|
||||
:color (get-color :time)}}
|
||||
s])
|
||||
:color (get-color :time)}} str])
|
||||
|
||||
(defn info-button
|
||||
[on-press]
|
||||
|
||||
@@ -25,12 +25,11 @@
|
||||
(def message-body
|
||||
{:color colors/white})
|
||||
|
||||
(defn message-container
|
||||
[attachment]
|
||||
(def message-container
|
||||
{:border-radius 12
|
||||
:margin-top 12
|
||||
:padding-horizontal 12
|
||||
:padding-vertical (if (#{:photo :gif} attachment) 12 8)
|
||||
:padding-vertical 8
|
||||
:background-color colors/white-opa-5})
|
||||
|
||||
(def footer-container
|
||||
|
||||
@@ -74,8 +74,8 @@
|
||||
context))))
|
||||
|
||||
(defn- activity-message
|
||||
[{:keys [title body title-number-of-lines body-number-of-lines attachment]}]
|
||||
[rn/view {:style (style/message-container attachment)}
|
||||
[{:keys [title body title-number-of-lines body-number-of-lines]}]
|
||||
[rn/view {:style style/message-container}
|
||||
(when title
|
||||
[text/text
|
||||
{:size :paragraph-2
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
(ns quo2.components.notifications.activity-logs-photos.style)
|
||||
|
||||
(def photos-container
|
||||
{:flex 1
|
||||
:height 40
|
||||
:flex-direction :row})
|
||||
|
||||
(defn photo
|
||||
[index]
|
||||
{:width 40
|
||||
:height 40
|
||||
:border-radius 10
|
||||
:margin-left (if (= index 0) 0 8)})
|
||||
@@ -1,14 +0,0 @@
|
||||
(ns quo2.components.notifications.activity-logs-photos.view
|
||||
(:require [react-native.core :as rn]
|
||||
[quo2.components.notifications.activity-logs-photos.style :as style]))
|
||||
|
||||
(defn view
|
||||
[{:keys [photos]}]
|
||||
[rn/view {:style style/photos-container}
|
||||
(map-indexed
|
||||
(fn [index photo]
|
||||
^{:key index}
|
||||
[rn/image
|
||||
{:source photo
|
||||
:style (style/photo index)}])
|
||||
photos)])
|
||||
@@ -1,7 +1,7 @@
|
||||
(ns quo2.components.notifications.count-down-circle
|
||||
(:require [goog.string :as gstring]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[quo2.theme :as quo.theme]
|
||||
[quo2.theme :as theme]
|
||||
[react-native.core :as rn]
|
||||
[react-native.svg :as svg]
|
||||
[reagent.core :as reagent]))
|
||||
@@ -48,8 +48,8 @@
|
||||
{:color {:dark colors/neutral-80-opa-40
|
||||
:light colors/white-opa-40}})
|
||||
|
||||
(defn- circle-timer-internal
|
||||
[{:keys [color duration size stroke-width trail-color rotation initial-remaining-time theme]}]
|
||||
(defn circle-timer
|
||||
[{:keys [color duration size stroke-width trail-color rotation initial-remaining-time]}]
|
||||
(let [rotation (or rotation :clockwise)
|
||||
duration (or duration 4)
|
||||
stroke-width (or stroke-width 1)
|
||||
@@ -98,10 +98,8 @@
|
||||
[svg/path
|
||||
{:d path
|
||||
:fill :none
|
||||
:stroke (or color (get-in themes [:color theme]))
|
||||
:stroke (or color (get-in themes [:color (theme/get-theme)]))
|
||||
:stroke-linecap :square
|
||||
:stroke-width stroke-width
|
||||
:stroke-dasharray path-length
|
||||
:stroke-dashoffset (linear-ease @display-time 0 path-length duration)}])]])})))
|
||||
|
||||
(def circle-timer (quo.theme/with-theme circle-timer-internal))
|
||||
|
||||
@@ -3,27 +3,22 @@
|
||||
[quo2.foundations.typography :as typography]
|
||||
[react-native.core :as rn]))
|
||||
|
||||
(defn- counter-style
|
||||
[customization-color overwritten-styles]
|
||||
(merge {:width 16
|
||||
:height 16
|
||||
:position :absolute
|
||||
:right 22
|
||||
:border-radius 6
|
||||
:justify-content :center
|
||||
:align-items :center
|
||||
:background-color (colors/custom-color-by-theme customization-color 50 60)}
|
||||
overwritten-styles))
|
||||
|
||||
(defn info-count
|
||||
([amount]
|
||||
(info-count {} amount))
|
||||
([{:keys [customization-color style]
|
||||
:or {customization-color :blue}
|
||||
:as props}
|
||||
amount]
|
||||
(when (pos? amount)
|
||||
[rn/view (assoc props :style (counter-style customization-color style))
|
||||
([props amount]
|
||||
(when (> amount 0)
|
||||
[rn/view
|
||||
(merge props
|
||||
{:style (merge {:width 16
|
||||
:height 16
|
||||
:position :absolute
|
||||
:right 22
|
||||
:border-radius 6
|
||||
:justify-content :center
|
||||
:align-items :center
|
||||
:background-color (colors/theme-colors colors/primary-50 colors/primary-60)}
|
||||
(:style props))})
|
||||
[rn/text
|
||||
{:style (merge typography/font-medium
|
||||
typography/label
|
||||
|
||||
@@ -3,12 +3,10 @@
|
||||
[quo2.foundations.colors :as colors]
|
||||
[quo2.foundations.shadows :as shadows]))
|
||||
|
||||
(defn box-container
|
||||
[theme]
|
||||
(merge (shadows/get 1 theme)
|
||||
{:margin-horizontal 12
|
||||
:border-radius 12
|
||||
:overflow :hidden}))
|
||||
(def box-container
|
||||
{:margin-horizontal 12
|
||||
:border-radius 12
|
||||
:overflow :hidden})
|
||||
|
||||
(def blur-container
|
||||
{:height "100%"
|
||||
@@ -21,33 +19,35 @@
|
||||
|
||||
(defn content-container
|
||||
[theme]
|
||||
{:background-color (colors/theme-colors colors/neutral-80-opa-70 colors/white-opa-70 theme)
|
||||
:flex-direction :row
|
||||
:justify-content :space-between
|
||||
:padding-vertical 8
|
||||
:padding-left 10
|
||||
:padding-right 8
|
||||
:border-radius 12})
|
||||
(merge
|
||||
(shadows/get 1 theme)
|
||||
{:background-color (colors/theme-colors colors/neutral-80-opa-70 colors/white-opa-70 theme)
|
||||
:flex-direction :row
|
||||
:justify-content :space-between
|
||||
:padding-vertical 8
|
||||
:padding-left 10
|
||||
:padding-right 8
|
||||
:border-radius 12}))
|
||||
|
||||
(defn title
|
||||
[theme]
|
||||
{:color (colors/theme-colors colors/white colors/neutral-100 theme)})
|
||||
[override-theme]
|
||||
{:color (colors/theme-colors colors/white colors/neutral-100 override-theme)})
|
||||
|
||||
(defn text
|
||||
[theme]
|
||||
{:color (colors/theme-colors colors/white colors/neutral-100 theme)})
|
||||
[override-theme]
|
||||
{:color (colors/theme-colors colors/white colors/neutral-100 override-theme)})
|
||||
|
||||
(defn icon
|
||||
[theme]
|
||||
{:color (colors/theme-colors colors/white colors/neutral-100 theme)
|
||||
[override-theme]
|
||||
{:color (colors/theme-colors colors/white colors/neutral-100 override-theme)
|
||||
:container-style {:width 20 :height 20}})
|
||||
|
||||
(def left-side-container {:padding 2})
|
||||
(def right-side-container {:padding 4 :flex 1})
|
||||
|
||||
(defn action-container
|
||||
[theme]
|
||||
{:background-color (colors/theme-colors colors/white-opa-5 colors/neutral-80-opa-5 theme)
|
||||
[override-theme]
|
||||
{:background-color (colors/theme-colors colors/white-opa-5 colors/neutral-80-opa-5 override-theme)
|
||||
:flex-direction :row
|
||||
:padding-vertical 3
|
||||
:padding-horizontal 8
|
||||
|
||||
@@ -4,40 +4,33 @@
|
||||
[quo2.components.markdown.text :as text]
|
||||
[quo2.components.notifications.count-down-circle :as count-down-circle]
|
||||
[quo2.components.notifications.toast.style :as style]
|
||||
[quo2.theme :as quo.theme]
|
||||
[quo2.theme :as theme]
|
||||
[react-native.blur :as blur]
|
||||
[react-native.core :as rn]
|
||||
[utils.i18n :as i18n]))
|
||||
|
||||
(defn toast-action-container
|
||||
[{:keys [on-press style theme]} & children]
|
||||
[{:keys [on-press style]} & children]
|
||||
[rn/touchable-highlight
|
||||
{:on-press on-press
|
||||
:underlay-color :transparent}
|
||||
[into
|
||||
[rn/view
|
||||
{:style (merge (style/action-container theme) style)}]
|
||||
{:style (merge (style/action-container (theme/get-theme)) style)}]
|
||||
children]])
|
||||
|
||||
(defn toast-undo-action-internal
|
||||
[{:keys [undo-duration undo-on-press theme]}]
|
||||
[toast-action-container
|
||||
{:on-press undo-on-press
|
||||
:accessibility-label :toast-undo-action
|
||||
:theme theme}
|
||||
(defn toast-undo-action
|
||||
[duration on-press override-theme]
|
||||
[toast-action-container {:on-press on-press :accessibility-label :toast-undo-action}
|
||||
[rn/view {:style {:margin-right 5}}
|
||||
[count-down-circle/circle-timer {:duration undo-duration}]]
|
||||
[count-down-circle/circle-timer {:duration duration}]]
|
||||
[text/text
|
||||
{:size :paragraph-2
|
||||
:weight :medium
|
||||
:style (style/text theme)}
|
||||
{:size :paragraph-2 :weight :medium :style (style/text override-theme)}
|
||||
[i18n/label :t/undo]]])
|
||||
|
||||
(def ^:private toast-undo-action (quo.theme/with-theme toast-undo-action-internal))
|
||||
|
||||
(defn- toast-container-internal
|
||||
[{:keys [left title text right container-style theme]}]
|
||||
[rn/view {:style (merge (style/box-container theme) container-style)}
|
||||
(defn- toast-container
|
||||
[{:keys [left title text right container-style override-theme]}]
|
||||
[rn/view {:style (merge style/box-container container-style)}
|
||||
[blur/view
|
||||
{:style style/blur-container
|
||||
:blur-amount 13
|
||||
@@ -45,7 +38,7 @@
|
||||
:blur-type :transparent
|
||||
:overlay-color :transparent}]
|
||||
|
||||
[rn/view {:style (style/content-container theme)}
|
||||
[rn/view {:style (style/content-container override-theme)}
|
||||
[rn/view {:style style/left-side-container}
|
||||
left]
|
||||
[rn/view {:style style/right-side-container}
|
||||
@@ -53,39 +46,34 @@
|
||||
[text/text
|
||||
{:size :paragraph-1
|
||||
:weight :semi-bold
|
||||
:style (style/title theme)
|
||||
:style (style/title override-theme)
|
||||
:accessibility-label :toast-title}
|
||||
title])
|
||||
(when text
|
||||
[text/text
|
||||
{:size :paragraph-2
|
||||
:weight :medium
|
||||
:style (style/text theme)
|
||||
:style (style/text override-theme)
|
||||
:accessibility-label :toast-content}
|
||||
text])]
|
||||
right]])
|
||||
|
||||
(def ^:private toast-container (quo.theme/with-theme toast-container-internal))
|
||||
|
||||
(defn toast
|
||||
[{:keys [icon icon-color title text action undo-duration undo-on-press container-style
|
||||
theme user]}]
|
||||
(let [context-theme (or theme (quo.theme/get-theme))]
|
||||
[quo.theme/provider {:theme context-theme}
|
||||
[toast-container
|
||||
{:left (cond icon
|
||||
[icon/icon icon
|
||||
(cond-> (style/icon context-theme)
|
||||
icon-color
|
||||
(assoc :color icon-color))]
|
||||
override-theme user]}]
|
||||
[toast-container
|
||||
{:left (cond icon
|
||||
[icon/icon icon
|
||||
(cond-> (style/icon override-theme)
|
||||
icon-color
|
||||
(assoc :color icon-color))]
|
||||
|
||||
user
|
||||
[user-avatar/user-avatar user])
|
||||
:title title
|
||||
:text text
|
||||
:right (if undo-duration
|
||||
[toast-undo-action
|
||||
{:undo-duration undo-duration
|
||||
:undo-on-press undo-on-press}]
|
||||
action)
|
||||
:container-style container-style}]]))
|
||||
user
|
||||
[user-avatar/user-avatar user])
|
||||
:title title
|
||||
:text text
|
||||
:right (if undo-duration
|
||||
[toast-undo-action undo-duration undo-on-press override-theme]
|
||||
action)
|
||||
:container-style container-style
|
||||
:override-theme override-theme}])
|
||||
|
||||
@@ -73,8 +73,7 @@
|
||||
(when show-options-button?
|
||||
[button/button
|
||||
{:size 32
|
||||
:type :grey
|
||||
:background :blur
|
||||
:type :blur-bg
|
||||
:icon true
|
||||
:style style/option-button
|
||||
:on-press on-options-press
|
||||
|
||||
+3
-1
@@ -1,4 +1,4 @@
|
||||
(ns quo2.components.record-audio.record-audio.component-spec
|
||||
(ns quo2.components.record-audio.record-audio.--tests--.record-audio-component-spec
|
||||
(:require [quo2.components.record-audio.record-audio.view :as record-audio]
|
||||
[react-native.audio-toolkit :as audio]
|
||||
[test-helpers.component :as h]
|
||||
@@ -252,3 +252,5 @@
|
||||
(h/advance-timers-by-time 250)
|
||||
(-> (js/expect event)
|
||||
(.toHaveBeenCalledTimes 1)))))))
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
(ns quo2.components.record-audio.soundtrack.component-spec
|
||||
(ns quo2.components.record-audio.soundtrack.--tests--.soundtrack-component-spec
|
||||
(:require [quo2.components.record-audio.soundtrack.view :as soundtrack]
|
||||
[test-helpers.component :as h]
|
||||
[reagent.core :as reagent]
|
||||
@@ -10,8 +10,8 @@
|
||||
:padding 6})
|
||||
|
||||
(defn container-border-color
|
||||
[pressed? blur? theme]
|
||||
(let [dark? (= :dark theme)]
|
||||
[pressed? blur? override-theme]
|
||||
(let [dark? (= :dark override-theme)]
|
||||
(cond
|
||||
(and (not pressed?) (not dark?) (not blur?))
|
||||
colors/neutral-20
|
||||
@@ -35,24 +35,26 @@
|
||||
nil)))
|
||||
|
||||
(defn container-background-color
|
||||
[pressed? theme]
|
||||
[pressed? override-theme]
|
||||
(when pressed?
|
||||
(colors/theme-colors colors/primary-50 colors/primary-60 theme)))
|
||||
(if (= :dark override-theme)
|
||||
colors/primary-60
|
||||
colors/primary-50)))
|
||||
|
||||
(defn container-outer
|
||||
[pressed? theme]
|
||||
[pressed? override-theme]
|
||||
(merge container-default
|
||||
{:background-color (container-background-color pressed? theme)}))
|
||||
{:background-color (container-background-color pressed? override-theme)}))
|
||||
|
||||
(defn container-inner
|
||||
[pressed? blur? theme]
|
||||
[pressed? blur? override-theme]
|
||||
(merge container-default
|
||||
{:border-width 1
|
||||
:border-color (container-border-color pressed? blur? theme)}))
|
||||
:border-color (container-border-color pressed? blur? override-theme)}))
|
||||
|
||||
(defn icon-color
|
||||
[pressed? theme]
|
||||
[pressed? override-theme]
|
||||
(if (and (not pressed?)
|
||||
(= :light theme))
|
||||
(= :light override-theme))
|
||||
colors/neutral-100
|
||||
colors/white))
|
||||
|
||||
@@ -1,24 +1,23 @@
|
||||
(ns quo2.components.selectors.filter.view
|
||||
(:require [quo2.components.icon :as icon]
|
||||
[quo2.components.selectors.filter.style :as style]
|
||||
[quo2.theme :as quo.theme]
|
||||
[quo2.theme :as theme]
|
||||
[react-native.core :as rn]
|
||||
[reagent.core :as reagent]))
|
||||
|
||||
(defn view-internal
|
||||
(defn view
|
||||
[initial-props]
|
||||
(let [pressed? (reagent/atom (:pressed? initial-props))]
|
||||
(fn [{:keys [blur? theme on-press-out]}]
|
||||
(fn [{:keys [blur? override-theme on-press-out]
|
||||
:or {override-theme (theme/get-theme)}}]
|
||||
[rn/touchable-without-feedback
|
||||
{:accessibility-label :selector-filter
|
||||
:on-press-out (fn []
|
||||
(swap! pressed? not)
|
||||
(when on-press-out
|
||||
(on-press-out @pressed?)))}
|
||||
[rn/view {:style (style/container-outer @pressed? theme)}
|
||||
[rn/view {:style (style/container-inner @pressed? blur? theme)}
|
||||
[rn/view {:style (style/container-outer @pressed? override-theme)}
|
||||
[rn/view {:style (style/container-inner @pressed? blur? override-theme)}
|
||||
[icon/icon :i/unread
|
||||
{:color (style/icon-color @pressed? theme)
|
||||
{:color (style/icon-color @pressed? override-theme)
|
||||
:size 20}]]]])))
|
||||
|
||||
(def view (quo.theme/with-theme view-internal))
|
||||
|
||||
@@ -1,53 +1,20 @@
|
||||
(ns quo2.components.settings.category.component-spec
|
||||
(:require
|
||||
[quo2.components.settings.category.view :as category]
|
||||
[test-helpers.component :as h]))
|
||||
(:require [test-helpers.component :as h]
|
||||
[quo2.components.settings.category.view :as category]))
|
||||
|
||||
(h/describe "Settings Category tests"
|
||||
(h/describe "category tests"
|
||||
(h/test "category label renders"
|
||||
(h/render [category/category
|
||||
{:list-type :settings
|
||||
:label "Label"
|
||||
:data [{:title "Item 1"
|
||||
:left-icon :i/browser
|
||||
:chevron? true}]}])
|
||||
(h/is-truthy (h/get-by-text "Label")))
|
||||
{:label "label"
|
||||
:data [{:title "Item 1"
|
||||
:left-icon :i/browser
|
||||
:chevron? true}]}])
|
||||
(h/is-truthy (h/get-by-text "label")))
|
||||
|
||||
(h/test "category item renders"
|
||||
(h/render [category/category
|
||||
{:list-type :settings
|
||||
:label "Label"
|
||||
:data [{:title "Item 1"
|
||||
:left-icon :i/browser
|
||||
:chevron? true}]}])
|
||||
{:label "label"
|
||||
:data [{:title "Item 1"
|
||||
:left-icon :i/browser
|
||||
:chevron? true}]}])
|
||||
(h/is-truthy (h/get-by-text "Item 1"))))
|
||||
|
||||
|
||||
(h/describe "Reorder Category tests"
|
||||
(h/test "category label renders"
|
||||
(h/render [category/category
|
||||
{:list-type :reorder
|
||||
:label "Label"
|
||||
:data [{:title "Item 1"
|
||||
:right-icon :i/globe
|
||||
:chevron? true}]}])
|
||||
(h/is-truthy (h/get-by-text "Label")))
|
||||
|
||||
(h/test "category item renders"
|
||||
(h/render [category/category
|
||||
{:list-type :reorder
|
||||
:label "Label"
|
||||
:data [{:title "Item 1"
|
||||
:right-icon :i/globe
|
||||
:chevron? true}]}])
|
||||
(h/is-truthy (h/get-by-text "Item 1")))
|
||||
|
||||
(h/test "category item subtitle renders"
|
||||
(h/render [category/category
|
||||
{:list-type :reorder
|
||||
:label "Label"
|
||||
:data [{:title "Item 1"
|
||||
:subtitle "subtitle"
|
||||
:right-icon :i/globe
|
||||
:chevron? true}]}])
|
||||
(h/is-truthy (h/get-by-text "subtitle"))))
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
(ns quo2.components.settings.category.reorder.view
|
||||
(:require
|
||||
[quo2.components.markdown.text :as text]
|
||||
[quo2.components.settings.reorder-item.types :as types]
|
||||
[quo2.components.settings.reorder-item.view :as reorder-item]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[react-native.blur :as blur]
|
||||
[react-native.core :as rn]
|
||||
[quo2.components.settings.category.style :as style]
|
||||
[quo2.theme :as quo.theme]
|
||||
[react-native.draggable-flatlist :as draggable-flatlist]
|
||||
[reagent.core :as reagent]))
|
||||
|
||||
(defn on-drag-end-fn
|
||||
[data atom-data]
|
||||
(reset! atom-data data)
|
||||
(reagent/flush))
|
||||
|
||||
(defn- reorder-category-internal
|
||||
[{:keys [label data blur? theme]}]
|
||||
(reagent/with-let [atom-data (reagent/atom data)]
|
||||
[rn/view {:style style/container}
|
||||
(when blur?
|
||||
[rn/view (style/blur-container) [blur/view (style/blur-view)]])
|
||||
[text/text
|
||||
{:weight :medium
|
||||
:size :paragraph-2
|
||||
:style {:color (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)}}
|
||||
label]
|
||||
[draggable-flatlist/draggable-flatlist
|
||||
{:data @atom-data
|
||||
:key-fn (fn [item index] (str (:title item) index))
|
||||
:style style/reorder-items
|
||||
:render-fn (fn [item _ _ _ _ drag] [reorder-item/reorder-item item types/item
|
||||
{:blur? blur? :drag drag}])
|
||||
:on-drag-end-fn (fn [_ _ data]
|
||||
(on-drag-end-fn data atom-data))
|
||||
:separator [rn/view
|
||||
{:style (style/reorder-separator blur? theme)}]}]]))
|
||||
|
||||
(def reorder-category (quo.theme/with-theme reorder-category-internal))
|
||||
@@ -1,27 +0,0 @@
|
||||
(ns quo2.components.settings.category.settings.view
|
||||
(:require
|
||||
[quo2.components.markdown.text :as text]
|
||||
[quo2.components.settings.settings-list.view :as settings-list]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[react-native.blur :as blur]
|
||||
[react-native.core :as rn]
|
||||
[quo2.components.settings.category.style :as style]
|
||||
[quo2.theme :as quo.theme]))
|
||||
|
||||
(defn- category-internal
|
||||
[{:keys [label data blur? theme]}]
|
||||
[rn/view {:style style/container}
|
||||
(when blur?
|
||||
[rn/view (style/blur-container) [blur/view (style/blur-view)]])
|
||||
[text/text
|
||||
{:weight :medium
|
||||
:size :paragraph-2
|
||||
:style {:color (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)}}
|
||||
label]
|
||||
[rn/flat-list
|
||||
{:data data
|
||||
:style (style/settings-items theme blur?)
|
||||
:render-fn (fn [item] [settings-list/settings-list item])
|
||||
:separator [rn/view {:style (style/settings-separator theme blur?)}]}]])
|
||||
|
||||
(def settings-category (quo.theme/with-theme category-internal))
|
||||
@@ -8,7 +8,7 @@
|
||||
:padding-top 12
|
||||
:padding-bottom 8})
|
||||
|
||||
(defn settings-items
|
||||
(defn items
|
||||
[theme blur?]
|
||||
{:margin-top 12
|
||||
:border-radius 16
|
||||
@@ -20,23 +20,13 @@
|
||||
colors/white-opa-5
|
||||
(colors/theme-colors colors/neutral-10 colors/neutral-80 theme))})
|
||||
|
||||
(def reorder-items
|
||||
{:margin-top 12})
|
||||
|
||||
(defn settings-separator
|
||||
(defn separator
|
||||
[theme blur?]
|
||||
{:height 1
|
||||
:background-color (if blur?
|
||||
colors/white-opa-5
|
||||
(colors/theme-colors colors/neutral-10 colors/neutral-80 theme))})
|
||||
|
||||
(defn reorder-separator
|
||||
[blur? theme]
|
||||
{:height 4
|
||||
:background-color (if blur?
|
||||
:transparent
|
||||
(colors/theme-colors colors/neutral-5 colors/neutral-95 theme))})
|
||||
|
||||
(defn blur-container
|
||||
[]
|
||||
{:position :absolute
|
||||
|
||||
@@ -1,9 +1,27 @@
|
||||
(ns quo2.components.settings.category.view
|
||||
(:require [quo2.components.settings.category.settings.view :as settings]
|
||||
[quo2.components.settings.category.reorder.view :as reorder]))
|
||||
(:require
|
||||
[quo2.components.markdown.text :as text]
|
||||
[quo2.components.settings.settings-list.view :as settings-list]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[react-native.blur :as blur]
|
||||
[react-native.core :as rn]
|
||||
[quo2.components.settings.category.style :as style]
|
||||
[quo2.theme :as quo.theme]))
|
||||
|
||||
(defn category
|
||||
[{:keys [list-type] :as props}]
|
||||
(if (= list-type :settings)
|
||||
[settings/settings-category props]
|
||||
[reorder/reorder-category props]))
|
||||
(defn- category-internal
|
||||
[{:keys [label data blur? theme]}]
|
||||
[rn/view {:style style/container}
|
||||
(when blur?
|
||||
[rn/view (style/blur-container) [blur/view (style/blur-view)]])
|
||||
[text/text
|
||||
{:weight :medium
|
||||
:size :paragraph-2
|
||||
:style {:color (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)}}
|
||||
label]
|
||||
[rn/flat-list
|
||||
{:data data
|
||||
:style (style/items theme blur?)
|
||||
:render-fn (fn [item] [settings-list/settings-list item])
|
||||
:separator [rn/view {:style (style/separator theme blur?)}]}]])
|
||||
|
||||
(def category (quo.theme/with-theme category-internal))
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
(ns quo2.components.settings.reorder-item.items.item
|
||||
(:require
|
||||
[quo2.theme :as quo.theme]
|
||||
[react-native.core :as rn]
|
||||
[quo2.components.settings.reorder-item.style :as style]
|
||||
[quo2.components.markdown.text :as text]
|
||||
[quo2.components.icon :as icon]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[react-native.fast-image :as fast-image]))
|
||||
(:require [react-native.core :as rn]
|
||||
[quo2.components.settings.reorder-item.style :as style]
|
||||
[quo2.components.markdown.text :as text]
|
||||
[quo2.components.icon :as icon]
|
||||
[quo2.foundations.colors :as colors]))
|
||||
|
||||
(defn- view-internal
|
||||
(defn view
|
||||
[{:keys
|
||||
[title
|
||||
subtitle
|
||||
@@ -16,14 +13,10 @@
|
||||
image-size
|
||||
right-text
|
||||
right-icon
|
||||
on-press
|
||||
theme]}
|
||||
blur?
|
||||
drag]
|
||||
on-press]}]
|
||||
[rn/touchable-opacity
|
||||
{:on-press on-press
|
||||
:on-long-press drag
|
||||
:style (merge (style/item-container blur?) (when subtitle style/item-container-extended))}
|
||||
{:on-press on-press
|
||||
:style (merge (style/item-container) (when subtitle style/item-container-extended))}
|
||||
[icon/icon :main-icons/drag
|
||||
{:color (colors/theme-colors
|
||||
colors/neutral-50
|
||||
@@ -32,25 +25,23 @@
|
||||
{:style style/body-container}
|
||||
[rn/view
|
||||
{:style style/image-container}
|
||||
[fast-image/fast-image
|
||||
[rn/image
|
||||
{:source image
|
||||
:style (style/image image-size)}]]
|
||||
[rn/view
|
||||
{:style style/text-container}
|
||||
[rn/view
|
||||
[text/text
|
||||
{:weight :medium}
|
||||
{:style style/item-text
|
||||
:weight :medium}
|
||||
title]
|
||||
(when subtitle
|
||||
[text/text
|
||||
{:style style/item-subtitle
|
||||
:size :paragraph-2}
|
||||
{:style style/item-subtitle
|
||||
:weight :regular}
|
||||
subtitle])]
|
||||
(when right-text
|
||||
[text/text {:style style/right-text} right-text])
|
||||
(when right-icon
|
||||
[rn/view {:style style/right-icon-container} [icon/icon right-icon (style/right-icon)]])]]
|
||||
[icon/icon :tiny-icons/chevron-right (style/chevron theme)]])
|
||||
|
||||
|
||||
(def view (quo.theme/with-theme view-internal))
|
||||
[icon/icon :tiny-icons/chevron-right (style/chevron)]])
|
||||
|
||||
@@ -2,21 +2,19 @@
|
||||
(:require [quo2.foundations.colors :as colors]))
|
||||
|
||||
(defn item-container
|
||||
[blur?]
|
||||
[]
|
||||
{:flex-direction :row
|
||||
:align-items :center
|
||||
:border-radius 16
|
||||
:padding-horizontal 12
|
||||
:padding-vertical 12
|
||||
:height 48
|
||||
:background-color (if blur?
|
||||
colors/white-opa-5
|
||||
(colors/theme-colors
|
||||
colors/white
|
||||
colors/neutral-90))})
|
||||
:padding-horizontal 10
|
||||
:border-radius 14
|
||||
:margin-bottom 23
|
||||
:height 45
|
||||
:background-color (colors/theme-colors
|
||||
colors/white
|
||||
colors/neutral-90)})
|
||||
|
||||
(def item-container-extended
|
||||
{:height 56})
|
||||
{:height 52})
|
||||
|
||||
(def body-container
|
||||
{:flex 1
|
||||
@@ -33,17 +31,20 @@
|
||||
{:width size
|
||||
:height size})
|
||||
|
||||
(def item-text
|
||||
{:font-size 14})
|
||||
|
||||
(defn chevron
|
||||
[theme]
|
||||
[]
|
||||
{:color (colors/theme-colors
|
||||
colors/neutral-50
|
||||
colors/neutral-40
|
||||
theme)
|
||||
colors/neutral-40)
|
||||
:height 14
|
||||
:width 14})
|
||||
|
||||
(def item-subtitle
|
||||
{:color colors/neutral-50})
|
||||
{:color colors/neutral-50
|
||||
:font-size 13})
|
||||
|
||||
(def right-text
|
||||
{:font-size 15
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
[quo2.components.settings.reorder-item.types :as types]))
|
||||
|
||||
(defn reorder-item
|
||||
[item type {:keys [blur? drag]}]
|
||||
[item type]
|
||||
(case type
|
||||
types/item [item/view item blur? drag]
|
||||
types/item [item/view item]
|
||||
types/placeholder [placeholder/view item]
|
||||
types/skeleton [skeleton/view]
|
||||
types/tab [tab/view item]
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
(ns quo2.components.tabs.segmented-tab
|
||||
(:require [quo2.components.tabs.tab.view :as tab]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[quo2.theme :as theme]
|
||||
[react-native.core :as rn]
|
||||
[reagent.core :as reagent]
|
||||
[quo2.theme :as quo.theme]))
|
||||
[reagent.core :as reagent]))
|
||||
|
||||
(def themes-for-blur
|
||||
{:light {:background-color colors/neutral-80-opa-5}
|
||||
@@ -13,17 +13,17 @@
|
||||
{:light {:background-color colors/neutral-10}
|
||||
:dark {:background-color colors/neutral-90}})
|
||||
|
||||
(defn- segmented-control-internal
|
||||
(defn segmented-control
|
||||
[{:keys [default-active on-change]}]
|
||||
(let [active-tab-id (reagent/atom default-active)]
|
||||
(fn [{:keys [data size theme blur? container-style item-container-style
|
||||
(fn [{:keys [data size override-theme blur? container-style item-container-style
|
||||
active-item-container-style]}]
|
||||
(let [active-id @active-tab-id]
|
||||
[rn/view
|
||||
(merge
|
||||
{:flex-direction :row
|
||||
:background-color (get-in (if blur? themes-for-blur themes)
|
||||
[theme :background-color])
|
||||
[(or override-theme (theme/get-theme)) :background-color])
|
||||
:border-radius (case size
|
||||
32 10
|
||||
28 8
|
||||
@@ -42,6 +42,7 @@
|
||||
:item-container-style item-container-style
|
||||
:segmented? true
|
||||
:size size
|
||||
:override-theme override-theme
|
||||
:blur? blur?
|
||||
:active (= id active-id)
|
||||
:on-press (fn [tab-id]
|
||||
@@ -49,5 +50,3 @@
|
||||
(when on-change
|
||||
(on-change tab-id)))}
|
||||
label]])]))))
|
||||
|
||||
(def segmented-control (quo.theme/with-theme segmented-control-internal))
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user