Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
301b2bc6f7 | ||
|
|
d039864dca | ||
|
|
a4f1f23d3c | ||
|
|
fe20fa4e99 | ||
|
|
5c30fd847a | ||
|
|
64de325678 | ||
|
|
489557c1a3 | ||
|
|
439fdfa12c | ||
|
|
f695dbf115 | ||
|
|
7c45b1e075 | ||
|
|
64453716b0 | ||
|
|
56d135f1f8 | ||
|
|
a7178a4950 | ||
|
|
3cd302b271 | ||
|
|
1e797273b6 | ||
|
|
8ff67bf344 | ||
|
|
3fee21c73a | ||
|
|
f9f328107d | ||
|
|
04dee8be45 | ||
|
|
52f7fc59ee | ||
|
|
b5202b4d28 | ||
|
|
210cf64ce0 | ||
|
|
ed270b2162 | ||
|
|
d412fa3c63 | ||
|
|
b7f675aa5c | ||
|
|
bfa23c182f | ||
|
|
6b721265af | ||
|
|
589a581298 | ||
|
|
0546a87e9a | ||
|
|
e5ce7fed3a | ||
|
|
58d5c3d7a5 | ||
|
|
6ccea1ddb2 | ||
|
|
a9a17aaae8 | ||
|
|
6d69c278cd | ||
|
|
c7e230d070 | ||
|
|
d309aa366d | ||
|
|
f124ca4252 | ||
|
|
1385e27cf4 | ||
|
|
f82d28c6c9 | ||
|
|
a2856cf1c3 | ||
|
|
e6a7c420a2 | ||
|
|
671aa67002 | ||
|
|
dbc8df251a | ||
|
|
279993b658 | ||
|
|
0c1a18b444 | ||
|
|
73e9f67dbd | ||
|
|
86c5505c94 | ||
|
|
c1dcd7a764 | ||
|
|
17ebedd6b8 | ||
|
|
2e2d15adfb | ||
|
|
1d1d586223 | ||
|
|
88dd5e04bb | ||
|
|
8f8c8dede2 | ||
|
|
2e0643fabe | ||
|
|
ec4046e543 | ||
|
|
4a44161163 | ||
|
|
b9353b1ccd | ||
|
|
5ceb7c2215 | ||
|
|
2043e9353b | ||
|
|
7153e4da48 | ||
|
|
c7cba5b4d3 | ||
|
|
45df308dd0 | ||
|
|
a74c934936 |
@@ -95,7 +95,6 @@ react-native.fs/unlink
|
|||||||
react-native.fs/file-exists?
|
react-native.fs/file-exists?
|
||||||
status-im.ui.components.colors/white
|
status-im.ui.components.colors/white
|
||||||
status-im.ui.components.colors/black
|
status-im.ui.components.colors/black
|
||||||
status-im.transport.core-test/messages
|
|
||||||
status-im.ui.components.core/animated-header
|
status-im.ui.components.core/animated-header
|
||||||
status-im.ui.components.core/safe-area-provider
|
status-im.ui.components.core/safe-area-provider
|
||||||
status-im.ui.components.core/safe-area-consumer
|
status-im.ui.components.core/safe-area-consumer
|
||||||
|
|||||||
@@ -16,10 +16,18 @@
|
|||||||
:clj-kondo-config {:level :error}
|
:clj-kondo-config {:level :error}
|
||||||
:cond-else {:level :error}
|
:cond-else {:level :error}
|
||||||
:consistent-alias {:level :error
|
:consistent-alias {:level :error
|
||||||
:aliases {clojure.string string
|
:aliases {clojure.set set
|
||||||
clojure.set set
|
clojure.string string
|
||||||
clojure.walk walk
|
clojure.walk walk
|
||||||
taoensso.timbre log}}
|
malli.core malli
|
||||||
|
malli.dev.pretty malli.pretty
|
||||||
|
malli.dev.virhe malli.virhe
|
||||||
|
malli.error malli.error
|
||||||
|
malli.generator malli.generator
|
||||||
|
malli.transform malli.transform
|
||||||
|
malli.util malli.util
|
||||||
|
schema.core schema
|
||||||
|
taoensso.timbre log}}
|
||||||
:deprecated-namespace {:level :warning}
|
:deprecated-namespace {:level :warning}
|
||||||
:docstring-blank {:level :error}
|
:docstring-blank {:level :error}
|
||||||
:equals-true {:level :error}
|
:equals-true {:level :error}
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
{:lint-as {malli.experimental/defn schema.core/defn}
|
||||||
|
:linters {:unresolved-symbol {:exclude [(malli.core/=>)]}}}
|
||||||
@@ -32,10 +32,12 @@
|
|||||||
"letsubs" :binding
|
"letsubs" :binding
|
||||||
"with-let" "let"
|
"with-let" "let"
|
||||||
"reg-event-fx" :arg1-pair
|
"reg-event-fx" :arg1-pair
|
||||||
|
"reg-fx" :arg1-pair
|
||||||
"testing" :arg1-body
|
"testing" :arg1-body
|
||||||
"deftest-sub" :arg1-body
|
"deftest-sub" :arg1-body
|
||||||
"wait-for" :arg1-body
|
"wait-for" :arg1-body
|
||||||
"with-deps-check" :arg1-body
|
"with-deps-check" :arg1-body
|
||||||
|
"schema/=>" :arg1-body
|
||||||
"->" [:noarg1-body
|
"->" [:noarg1-body
|
||||||
{:list {:constant-pair? false :force-nl? false}
|
{:list {:constant-pair? false :force-nl? false}
|
||||||
:next-inner-restore [[:list :constant-pair?]]}]
|
:next-inner-restore [[:list :constant-pair?]]}]
|
||||||
|
|||||||
@@ -311,13 +311,14 @@ endef
|
|||||||
lint: export TARGET := clojure
|
lint: export TARGET := clojure
|
||||||
lint: export CLJ_LINTER_PRINT_WARNINGS ?= false
|
lint: export CLJ_LINTER_PRINT_WARNINGS ?= false
|
||||||
lint: ##@test Run code style checks
|
lint: ##@test Run code style checks
|
||||||
@sh scripts/lint-re-frame-in-quo-components.sh && \
|
@sh scripts/lint/re-frame-in-quo-components.sh && \
|
||||||
sh scripts/lint-direct-require-component-outside-quo.sh && \
|
sh scripts/lint/direct-require-component-outside-quo.sh && \
|
||||||
|
sh scripts/lint/require-i18n-resource-first.sh && \
|
||||||
clj-kondo --config .clj-kondo/config.edn --cache false --fail-level error --lint src $(if $(filter $(CLJ_LINTER_PRINT_WARNINGS),true),,| grep -v ': warning: ') && \
|
clj-kondo --config .clj-kondo/config.edn --cache false --fail-level error --lint src $(if $(filter $(CLJ_LINTER_PRINT_WARNINGS),true),,| grep -v ': warning: ') && \
|
||||||
ALL_CLOJURE_FILES=$(call find_all_clojure_files) && \
|
ALL_CLOJURE_FILES=$(call find_all_clojure_files) && \
|
||||||
scripts/lint_translations.clj && \
|
scripts/lint/translations.clj && \
|
||||||
zprint '{:search-config? true}' -sfc $$ALL_CLOJURE_FILES && \
|
zprint '{:search-config? true}' -sfc $$ALL_CLOJURE_FILES && \
|
||||||
sh scripts/lint-trailing-newline.sh && \
|
sh scripts/lint/trailing-newline.sh && \
|
||||||
node_modules/.bin/prettier --write .
|
node_modules/.bin/prettier --write .
|
||||||
|
|
||||||
# NOTE: We run the linter twice because of https://github.com/kkinnear/zprint/issues/271
|
# NOTE: We run the linter twice because of https://github.com/kkinnear/zprint/issues/271
|
||||||
@@ -327,7 +328,7 @@ lint-fix: ##@test Run code style checks and fix issues
|
|||||||
zprint '{:search-config? true}' -sw $$ALL_CLOJURE_FILES && \
|
zprint '{:search-config? true}' -sw $$ALL_CLOJURE_FILES && \
|
||||||
zprint '{:search-config? true}' -sw $$ALL_CLOJURE_FILES && \
|
zprint '{:search-config? true}' -sw $$ALL_CLOJURE_FILES && \
|
||||||
clojure-lsp --ns-exclude-regex ".*/src/status_im2/core\.cljs$$" clean-ns && \
|
clojure-lsp --ns-exclude-regex ".*/src/status_im2/core\.cljs$$" clean-ns && \
|
||||||
sh scripts/lint-trailing-newline.sh --fix && \
|
sh scripts/lint/trailing-newline.sh --fix && \
|
||||||
node_modules/.bin/prettier --write .
|
node_modules/.bin/prettier --write .
|
||||||
|
|
||||||
shadow-server: export TARGET := clojure
|
shadow-server: export TARGET := clojure
|
||||||
|
|||||||
@@ -27,18 +27,23 @@ class StatusOkHttpClientFactory implements OkHttpClientFactory {
|
|||||||
X509Certificate cert = null;
|
X509Certificate cert = null;
|
||||||
HandshakeCertificates clientCertificates;
|
HandshakeCertificates clientCertificates;
|
||||||
String certPem = "";
|
String certPem = "";
|
||||||
|
// Get TLS PEM certificate from status-go
|
||||||
|
try {
|
||||||
|
// induce half second sleep because sometimes a cert is not immediately available
|
||||||
|
// TODO : remove sleep if App no longer crashes on Android 10 devices with
|
||||||
|
// java.lang.RuntimeException: Could not invoke WebSocketModule.connect
|
||||||
|
Thread.sleep(500);
|
||||||
|
certPem = getCertificatePem();
|
||||||
|
} catch(Exception e) {
|
||||||
|
Log.e(TAG, "Could not getImageTLSCert",e);
|
||||||
|
}
|
||||||
|
|
||||||
// Get TLS PEM certificate from status-go
|
if (certPem.isEmpty()) {
|
||||||
try {
|
Log.e(TAG, "Certificate is empty, cannot create OkHttpClient without a valid certificate");
|
||||||
// induce half second sleep because sometimes a cert is not immediately available
|
return null;
|
||||||
// TODO : remove sleep if App no longer crashes on Android 10 devices with
|
}
|
||||||
// java.lang.RuntimeException: Could not invoke WebSocketModule.connect
|
|
||||||
Thread.sleep(500);
|
// Convert PEM certificate string to X509Certificate object
|
||||||
certPem = StatusPackage.getImageTLSCert();
|
|
||||||
} catch(Exception e) {
|
|
||||||
Log.e(TAG, "Could not getImageTLSCert",e);
|
|
||||||
}
|
|
||||||
// Convert PEM certificate string to X509Certificate object
|
|
||||||
try {
|
try {
|
||||||
// induce half second sleep because sometimes a cert is not immediately available
|
// induce half second sleep because sometimes a cert is not immediately available
|
||||||
// TODO : remove sleep if App no longer crashes on Android 10 devices
|
// TODO : remove sleep if App no longer crashes on Android 10 devices
|
||||||
@@ -74,4 +79,17 @@ class StatusOkHttpClientFactory implements OkHttpClientFactory {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private String getCertificatePem() {
|
||||||
|
try {
|
||||||
|
String certPem = StatusPackage.getImageTLSCert();
|
||||||
|
if (certPem == null || certPem.trim().isEmpty()) {
|
||||||
|
Log.e(TAG, "Certificate PEM string is null or empty");
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return certPem;
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.e(TAG, "Could not getImageTLSCert", e);
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,7 +77,6 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Upload') {
|
stage('Upload') {
|
||||||
when { expression { !utils.isReleaseBuild() } }
|
|
||||||
steps { script {
|
steps { script {
|
||||||
env.DIAWI_URL = ios.uploadToDiawi()
|
env.DIAWI_URL = ios.uploadToDiawi()
|
||||||
env.PKG_URL = env.DIAWI_URL
|
env.PKG_URL = env.DIAWI_URL
|
||||||
|
|||||||
@@ -716,7 +716,7 @@ src
|
|||||||
|
|
||||||
- `src/js`: Raw Javascript files, e.g. React Native Reanimated worklets.
|
- `src/js`: Raw Javascript files, e.g. React Native Reanimated worklets.
|
||||||
- `src/mocks`: Plumbing configuration to be able to run tests.
|
- `src/mocks`: Plumbing configuration to be able to run tests.
|
||||||
- `src/quo/`: The component library for Status Mobile.
|
- `src/quo/`: The component library for Status Mobile. [Read more...](../src/quo/README.md)
|
||||||
- `src/react_native/`: Contains only low-level constructs to help React Native
|
- `src/react_native/`: Contains only low-level constructs to help React Native
|
||||||
work in tandem with Clojure(Script).
|
work in tandem with Clojure(Script).
|
||||||
- `src/status_im2/`: Directory where we try to be as strict as possible about
|
- `src/status_im2/`: Directory where we try to be as strict as possible about
|
||||||
|
|||||||
@@ -45,11 +45,20 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"path": "borkdude/edamame/1.1.17/edamame-1.1.17",
|
"path": "borkdude/dynaload/0.3.5/dynaload-0.3.5",
|
||||||
"host": "https://repo.clojars.org",
|
"host": "https://repo.clojars.org",
|
||||||
"jar": {
|
"jar": {
|
||||||
"sha1": "9087f7abf0104e0354d7db7fc4576608eac558f4",
|
"sha1": "accd696ba364b850b4d92e38f5a34d0e828a0ad1",
|
||||||
"sha256": "1n1872i240lakn4pzsag4grf7bv7lcsipmqllxd9m4k1zp3dgla1"
|
"sha256": "0k62m1f29xfh3cp67w7kcvkp5aj35simi8kf95ycvkmgp76w11q8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"path": "borkdude/edamame/1.3.23/edamame-1.3.23",
|
||||||
|
"host": "https://repo.clojars.org",
|
||||||
|
"jar": {
|
||||||
|
"sha1": "254d023e97ed438f0f44532b5a06d928d031ede4",
|
||||||
|
"sha256": "0l7mxza2nimslhg0qh6jp7gmb8sd6l89fk5d1zvzq2xskscq2vly"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -81,20 +90,20 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"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",
|
"host": "https://repo.clojars.org",
|
||||||
"jar": {
|
"jar": {
|
||||||
"sha1": "45f6034b26a14138e74145b7a4059628c0fedcd1",
|
"sha1": "5ae0efd9377a5e60c084bdaf4a2ce094f759ce23",
|
||||||
"sha256": "1dy1l6y8cb8xiqq97a4lf8giyiicq4wfl4s2lxn5fb6614cjxqx2"
|
"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",
|
"host": "https://repo.clojars.org",
|
||||||
"jar": {
|
"jar": {
|
||||||
"sha1": "ecfd5c286a85db3f059e75c37fca5722d9e26f79",
|
"sha1": "0a02a3e2ecd7a126ab60d8a44793342f20ced79b",
|
||||||
"sha256": "1ps9yf3cxmlm447hqkidjb5xry90n0wl3jk0jn28fagq31lzylkl"
|
"sha256": "142vl5np33akcrnn6pksi0rjfsmmi528villxsj6cwcndvybiw4m"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -539,6 +548,24 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"path": "metosin/malli/0.13.0/malli-0.13.0",
|
||||||
|
"host": "https://repo.clojars.org",
|
||||||
|
"jar": {
|
||||||
|
"sha1": "286c52d26a3a9d613b5f692971bd19c581cdc4b0",
|
||||||
|
"sha256": "0vaq9d6cln5j4ww302fwlgg7m647cf2j16gs2i1p1d4klbn4jddz"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"path": "mvxcvi/arrangement/2.1.0/arrangement-2.1.0",
|
||||||
|
"host": "https://repo.clojars.org",
|
||||||
|
"jar": {
|
||||||
|
"sha1": "1bc8f3bba7a28de85f319b7d464aa8d955f44918",
|
||||||
|
"sha256": "1j1rkwrs4wm8zk9v7ilgpnyav5sipdd2bmb83sazh392blw52wpk"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"path": "net/cgrand/macrovich/0.2.1/macrovich-0.2.1",
|
"path": "net/cgrand/macrovich/0.2.1/macrovich-0.2.1",
|
||||||
"host": "https://repo.clojars.org",
|
"host": "https://repo.clojars.org",
|
||||||
@@ -728,6 +755,15 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"path": "org/clojure/test.check/1.1.1/test.check-1.1.1",
|
||||||
|
"host": "https://repo1.maven.org/maven2",
|
||||||
|
"jar": {
|
||||||
|
"sha1": "f33d988fd57bc9c11af1952db81c10f319c91416",
|
||||||
|
"sha256": "0y2hpkj7zl4yrpsl35ifpdaja5c72b8fpjcnmdgmld9c7cb1hlcl"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"path": "org/clojure/tools.analyzer/1.1.0/tools.analyzer-1.1.0",
|
"path": "org/clojure/tools.analyzer/1.1.0/tools.analyzer-1.1.0",
|
||||||
"host": "https://repo1.maven.org/maven2",
|
"host": "https://repo1.maven.org/maven2",
|
||||||
@@ -909,11 +945,11 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"path": "refactor-nrepl/refactor-nrepl/3.6.0/refactor-nrepl-3.6.0",
|
"path": "refactor-nrepl/refactor-nrepl/2.5.0/refactor-nrepl-2.5.0",
|
||||||
"host": "https://repo.clojars.org",
|
"host": "https://repo.clojars.org",
|
||||||
"jar": {
|
"jar": {
|
||||||
"sha1": "2b3bb82da53b5db9c2b2aa298417816b81d0ed97",
|
"sha1": "6bc3441afc94f7ca024e41a864ca75e05df7e207",
|
||||||
"sha256": "1ysqabmlnghki6x0636zngxza2d83c85276wp9ma9wk183mkv52a"
|
"sha256": "0w8hax99y98l53mixxzx2ja0vcnhjv8dnsaz1zj3vqk775ns5w6i"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -3,12 +3,13 @@ babashka/fs/0.2.16/fs-0.2.16.jar
|
|||||||
bidi/bidi/2.1.6/bidi-2.1.6.jar
|
bidi/bidi/2.1.6/bidi-2.1.6.jar
|
||||||
binaryage/env-config/0.2.2/env-config-0.2.2.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.2/oops-0.7.2.jar
|
||||||
borkdude/edamame/1.1.17/edamame-1.1.17.jar
|
borkdude/dynaload/0.3.5/dynaload-0.3.5.jar
|
||||||
|
borkdude/edamame/1.3.23/edamame-1.3.23.jar
|
||||||
borkdude/sci.impl.reflector/0.0.1/sci.impl.reflector-0.0.1.jar
|
borkdude/sci.impl.reflector/0.0.1/sci.impl.reflector-0.0.1.jar
|
||||||
camel-snake-kebab/camel-snake-kebab/0.4.3/camel-snake-kebab-0.4.3.jar
|
camel-snake-kebab/camel-snake-kebab/0.4.3/camel-snake-kebab-0.4.3.jar
|
||||||
cheshire/cheshire/5.11.0/cheshire-5.11.0.jar
|
cheshire/cheshire/5.11.0/cheshire-5.11.0.jar
|
||||||
cider/cider-nrepl/0.29.0/cider-nrepl-0.29.0.jar
|
cider/cider-nrepl/0.25.3/cider-nrepl-0.25.3.jar
|
||||||
cider/piggieback/0.5.2/piggieback-0.5.2.jar
|
cider/piggieback/0.4.1/piggieback-0.4.1.jar
|
||||||
clj-kondo/clj-kondo/2023.09.07/clj-kondo-2023.09.07.jar
|
clj-kondo/clj-kondo/2023.09.07/clj-kondo-2023.09.07.jar
|
||||||
cljs-bean/cljs-bean/1.9.0/cljs-bean-1.9.0.jar
|
cljs-bean/cljs-bean/1.9.0/cljs-bean-1.9.0.jar
|
||||||
clout/clout/2.1.2/clout-2.1.2.jar
|
clout/clout/2.1.2/clout-2.1.2.jar
|
||||||
@@ -58,6 +59,8 @@ javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar
|
|||||||
javax/servlet/servlet-api/2.5/servlet-api-2.5.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
|
javax/xml/bind/jaxb-api/2.3.0/jaxb-api-2.3.0.jar
|
||||||
medley/medley/0.8.2/medley-0.8.2.jar
|
medley/medley/0.8.2/medley-0.8.2.jar
|
||||||
|
metosin/malli/0.13.0/malli-0.13.0.jar
|
||||||
|
mvxcvi/arrangement/2.1.0/arrangement-2.1.0.jar
|
||||||
net/cgrand/macrovich/0.2.1/macrovich-0.2.1.jar
|
net/cgrand/macrovich/0.2.1/macrovich-0.2.1.jar
|
||||||
net/java/dev/jna/jna/5.12.1/jna-5.12.1.jar
|
net/java/dev/jna/jna/5.12.1/jna-5.12.1.jar
|
||||||
nrepl/bencode/1.1.0/bencode-1.1.0.jar
|
nrepl/bencode/1.1.0/bencode-1.1.0.jar
|
||||||
@@ -79,6 +82,7 @@ org/clojure/data.priority-map/1.1.0/data.priority-map-1.1.0.jar
|
|||||||
org/clojure/google-closure-library/0.0-20230227-c7c0a541/google-closure-library-0.0-20230227-c7c0a541.jar
|
org/clojure/google-closure-library/0.0-20230227-c7c0a541/google-closure-library-0.0-20230227-c7c0a541.jar
|
||||||
org/clojure/google-closure-library-third-party/0.0-20230227-c7c0a541/google-closure-library-third-party-0.0-20230227-c7c0a541.jar
|
org/clojure/google-closure-library-third-party/0.0-20230227-c7c0a541/google-closure-library-third-party-0.0-20230227-c7c0a541.jar
|
||||||
org/clojure/spec.alpha/0.3.218/spec.alpha-0.3.218.jar
|
org/clojure/spec.alpha/0.3.218/spec.alpha-0.3.218.jar
|
||||||
|
org/clojure/test.check/1.1.1/test.check-1.1.1.jar
|
||||||
org/clojure/tools.analyzer/1.1.0/tools.analyzer-1.1.0.jar
|
org/clojure/tools.analyzer/1.1.0/tools.analyzer-1.1.0.jar
|
||||||
org/clojure/tools.analyzer.jvm/1.2.2/tools.analyzer.jvm-1.2.2.jar
|
org/clojure/tools.analyzer.jvm/1.2.2/tools.analyzer.jvm-1.2.2.jar
|
||||||
org/clojure/tools.cli/1.0.206/tools.cli-1.0.206.jar
|
org/clojure/tools.cli/1.0.206/tools.cli-1.0.206.jar
|
||||||
@@ -99,7 +103,7 @@ 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
|
prismatic/schema/1.1.7/schema-1.1.7.jar
|
||||||
reagent/reagent/1.2.0/reagent-1.2.0.jar
|
reagent/reagent/1.2.0/reagent-1.2.0.jar
|
||||||
re-com/re-com/2.8.0/re-com-2.8.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
|
refactor-nrepl/refactor-nrepl/2.5.0/refactor-nrepl-2.5.0.jar
|
||||||
re-frame/re-frame/1.3.0/re-frame-1.3.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-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
|
re-frisk/sente/1.15.0/sente-1.15.0.jar
|
||||||
|
|||||||
@@ -67,9 +67,12 @@ stdenv.mkDerivation {
|
|||||||
'';
|
'';
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
# Assemble CLASSPATH from available clojure dependencies.
|
# Assemble CLASSPATH from available clojure dependencies.
|
||||||
# We append 'src' so it can find the local sources.
|
# We prepend 'src' so it can find the local sources and prioritize
|
||||||
export CLASS_PATH="$(find ${deps.clojure} \
|
# our own namespaces over dependencies, given that indirect dependencies
|
||||||
-iname '*.jar' | tr '\n' ':')src"
|
# can also cause naming conflicts (e.g. prismatic/schema already uses
|
||||||
|
# namespace schema.core).
|
||||||
|
export CLASS_PATH="src:$(find ${deps.clojure} \
|
||||||
|
-iname '*.jar' | tr '\n' ':')"
|
||||||
|
|
||||||
# target must be one of the builds defined in shadow-cljs.edn
|
# target must be one of the builds defined in shadow-cljs.edn
|
||||||
java -cp "$CLASS_PATH" clojure.main \
|
java -cp "$CLASS_PATH" clojure.main \
|
||||||
|
|||||||
@@ -94,7 +94,7 @@
|
|||||||
"process": "0.11.10",
|
"process": "0.11.10",
|
||||||
"react-test-renderer": "18.0.0",
|
"react-test-renderer": "18.0.0",
|
||||||
"rn-snoopy": "git+https://github.com/status-im/rn-snoopy.git#refs/tags/v2.0.2-status",
|
"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.26.2"
|
||||||
},
|
},
|
||||||
"binary": {
|
"binary": {
|
||||||
"module_name": "status_nodejs_addon",
|
"module_name": "status_nodejs_addon",
|
||||||
|
|||||||
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 9.6 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 8.7 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 8.7 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 61 KiB |
|
After Width: | Height: | Size: 114 KiB |
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 75 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 30 KiB |
@@ -0,0 +1,10 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
if rg --quiet --multiline '^\(ns.*\n^\s*\(:require\n(^\s*(;|#_).*\n)*(^\s*\[status-im2\.setup\.i18n-resources\W)' src/status_im2/core.cljs; then
|
||||||
|
exit 0
|
||||||
|
elif [ $? -eq 1 ]; then
|
||||||
|
echo "status-im2.setup.i18n-resources must be loaded first (be the first one in ns :require form) in status-im2.core"
|
||||||
|
echo "For more info, check the comment here https://github.com/status-im/status-mobile/pull/17618#discussion_r1361275489"
|
||||||
|
else
|
||||||
|
exit $?
|
||||||
|
fi
|
||||||
@@ -9,11 +9,13 @@
|
|||||||
[cljs-bean "1.9.0"]
|
[cljs-bean "1.9.0"]
|
||||||
[com.cognitect/transit-cljs "0.8.280"]
|
[com.cognitect/transit-cljs "0.8.280"]
|
||||||
[camel-snake-kebab "0.4.3"]
|
[camel-snake-kebab "0.4.3"]
|
||||||
|
[metosin/malli "0.13.0"]
|
||||||
|
|
||||||
;; Dev dependencies
|
;; Dev dependencies
|
||||||
[refactor-nrepl "2.5.0"]
|
[refactor-nrepl "3.9.1"]
|
||||||
[cider/cider-nrepl "0.25.3"]
|
[cider/cider-nrepl "0.31.0"]
|
||||||
[cider/piggieback "0.4.1"]
|
[cider/piggieback "0.4.1"]
|
||||||
|
[org.slf4j/slf4j-nop "2.0.9"]
|
||||||
[re-frisk-remote "1.6.0"]
|
[re-frisk-remote "1.6.0"]
|
||||||
|
|
||||||
;; Use the same version specified in the Nix dependency.
|
;; Use the same version specified in the Nix dependency.
|
||||||
@@ -50,6 +52,7 @@
|
|||||||
:after-load-async status-im2.setup.hot-reload/reload
|
:after-load-async status-im2.setup.hot-reload/reload
|
||||||
:build-notify status-im2.setup.hot-reload/build-notify
|
:build-notify status-im2.setup.hot-reload/build-notify
|
||||||
:preloads [re-frisk-remote.preload
|
:preloads [re-frisk-remote.preload
|
||||||
|
status-im2.setup.schema-preload
|
||||||
;; In order to use component test helpers in the REPL we
|
;; In order to use component test helpers in the REPL we
|
||||||
;; need to preload namespaces that are not normally required
|
;; need to preload namespaces that are not normally required
|
||||||
;; by production code, such as
|
;; by production code, such as
|
||||||
@@ -71,6 +74,10 @@
|
|||||||
:warnings {:fn-deprecated false}
|
:warnings {:fn-deprecated false}
|
||||||
:closure-defines {re-frame.trace/trace-enabled? true}
|
:closure-defines {re-frame.trace/trace-enabled? true}
|
||||||
:source-map false
|
:source-map false
|
||||||
|
;; This seems to be necessary while using the REPL,
|
||||||
|
;; otherwise sometimes you'll get weird errors when
|
||||||
|
;; instrumenting functions.
|
||||||
|
:static-fns false
|
||||||
:infer-externs true}
|
:infer-externs true}
|
||||||
;; if you want to use a real device, set your local ip
|
;; if you want to use a real device, set your local ip
|
||||||
;; in the SHADOW_HOST env variable to make sure that
|
;; in the SHADOW_HOST env variable to make sure that
|
||||||
@@ -104,13 +111,15 @@
|
|||||||
:output-dir "target/test"
|
:output-dir "target/test"
|
||||||
:optimizations :simple
|
:optimizations :simple
|
||||||
:target :node-test
|
:target :node-test
|
||||||
|
:dev {:devtools {:preloads [status-im2.setup.schema-preload]}}
|
||||||
;; Uncomment line below to `make test-watch` a specific file
|
;; Uncomment line below to `make test-watch` a specific file
|
||||||
;; :ns-regexp "status-im2.subs.messages-test$"
|
;; :ns-regexp "status-im2.subs.messages-test$"
|
||||||
:main status-im.test-runner/main
|
:main status-im.test-runner/main
|
||||||
;; set :ui-driven to true to let shadow-cljs inject node-repl
|
;; set :ui-driven to true to let shadow-cljs inject node-repl
|
||||||
:ui-driven true
|
:ui-driven true
|
||||||
:closure-defines
|
:closure-defines
|
||||||
{status-im2.config/POKT_TOKEN #shadow/env "POKT_TOKEN"
|
{schema.core/throw-on-error? true
|
||||||
|
status-im2.config/POKT_TOKEN #shadow/env "POKT_TOKEN"
|
||||||
status-im2.config/INFURA_TOKEN #shadow/env "INFURA_TOKEN"
|
status-im2.config/INFURA_TOKEN #shadow/env "INFURA_TOKEN"
|
||||||
status-im2.config/OPENSEA_API_KEY #shadow/env "OPENSEA_API_KEY"
|
status-im2.config/OPENSEA_API_KEY #shadow/env "OPENSEA_API_KEY"
|
||||||
status-im2.config/ALCHEMY_ARBITRUM_GOERLI_TOKEN #shadow/env "ALCHEMY_ARBITRUM_GOERLI_TOKEN"
|
status-im2.config/ALCHEMY_ARBITRUM_GOERLI_TOKEN #shadow/env "ALCHEMY_ARBITRUM_GOERLI_TOKEN"
|
||||||
@@ -139,9 +148,17 @@
|
|||||||
:compiler-options {:optimizations :simple
|
:compiler-options {:optimizations :simple
|
||||||
:source-map false}}
|
:source-map false}}
|
||||||
:component-test {:target :npm-module
|
:component-test {:target :npm-module
|
||||||
:entries [quo.core-spec status-im2.core-spec]
|
:entries [;; We need to tell shadow-cljs to compile
|
||||||
|
;; the preloads namespace because it will
|
||||||
|
;; be used directly by Jest in the option
|
||||||
|
;; setupFilesAfterEnv.
|
||||||
|
status-im2.setup.schema-preload
|
||||||
|
|
||||||
|
quo.core-spec
|
||||||
|
status-im2.core-spec]
|
||||||
:ns-regexp "component-spec$"
|
:ns-regexp "component-spec$"
|
||||||
:output-dir "component-spec"
|
:output-dir "component-spec"
|
||||||
|
:closure-defines {schema.core/throw-on-error? true}
|
||||||
:compiler-options {:warnings-as-errors false
|
:compiler-options {:warnings-as-errors false
|
||||||
:static-fns false
|
:static-fns false
|
||||||
:infer-externs true}}}}
|
:infer-externs true}}}}
|
||||||
|
|||||||
@@ -49,6 +49,7 @@
|
|||||||
:Text {}
|
:Text {}
|
||||||
:StatusBar {}
|
:StatusBar {}
|
||||||
:ScrollView {}
|
:ScrollView {}
|
||||||
|
:SafeAreaView {}
|
||||||
:KeyboardAvoidingView {}
|
:KeyboardAvoidingView {}
|
||||||
:TextInput {}
|
:TextInput {}
|
||||||
:Image {}
|
:Image {}
|
||||||
|
|||||||
@@ -116,6 +116,17 @@ rendered. We use [React Native Testing Library](https://callstack.github.io/reac
|
|||||||
There are dozens of examples in the repository, so use them as a reference. A
|
There are dozens of examples in the repository, so use them as a reference. A
|
||||||
good and complete example is [quo.components.avatars.user-avatar.component-spec](/src/quo/components/avatars/user_avatar/component_spec.cljs)
|
good and complete example is [quo.components.avatars.user-avatar.component-spec](/src/quo/components/avatars/user_avatar/component_spec.cljs)
|
||||||
|
|
||||||
|
### No-props test
|
||||||
|
|
||||||
|
When writing tests for the component that has props, please add one test that covers situation when props aren't passed. Because even if component not showing anything meaningful without props, it shouldn't crash.
|
||||||
|
|
||||||
|
```clojure
|
||||||
|
(h/describe "Transaction Progress"
|
||||||
|
(h/test "component renders without props"
|
||||||
|
(h/render [quo/transaction-progress {}])
|
||||||
|
(h/is-truthy (h/get-by-label-text :transaction-progress)))
|
||||||
|
```
|
||||||
|
|
||||||
## Do not couple the library with re-frame
|
## Do not couple the library with re-frame
|
||||||
|
|
||||||
Don't use re-frame inside this library (e.g. dispatch & subscribe). If a
|
Don't use re-frame inside this library (e.g. dispatch & subscribe). If a
|
||||||
|
|||||||
@@ -30,6 +30,6 @@
|
|||||||
{:accessibility-label :account-emoji
|
{:accessibility-label :account-emoji
|
||||||
:adjusts-font-size-to-fit true
|
:adjusts-font-size-to-fit true
|
||||||
:style {:font-size emoji-size}}
|
:style {:font-size emoji-size}}
|
||||||
(string/trim emoji)]]))
|
(when emoji (string/trim emoji))]]))
|
||||||
|
|
||||||
(def view (quo.theme/with-theme view-internal))
|
(def view (quo.theme/with-theme view-internal))
|
||||||
|
|||||||
@@ -67,7 +67,7 @@
|
|||||||
[rn/text
|
[rn/text
|
||||||
{:style (style/emoji-size size)
|
{:style (style/emoji-size size)
|
||||||
:accessibility-label :emoji}
|
:accessibility-label :emoji}
|
||||||
(string/trim emoji)])
|
(when emoji (string/trim emoji))])
|
||||||
[lock locked? size theme]])
|
[lock locked? size theme]])
|
||||||
|
|
||||||
(def view (quo.theme/with-theme view-internal))
|
(def view (quo.theme/with-theme view-internal))
|
||||||
|
|||||||
@@ -2,26 +2,30 @@
|
|||||||
(:require [quo.foundations.colors :as colors]))
|
(:require [quo.foundations.colors :as colors]))
|
||||||
|
|
||||||
(defn- circle-color
|
(defn- circle-color
|
||||||
[customization-color]
|
[customization-color neutral? theme]
|
||||||
(colors/custom-color customization-color 50 20))
|
(if neutral?
|
||||||
|
(colors/theme-colors colors/neutral-80-opa-5 colors/white-opa-5 theme)
|
||||||
|
(colors/custom-color customization-color 50 20)))
|
||||||
|
|
||||||
(defn- text-color
|
(defn- text-color
|
||||||
[customization-color theme]
|
[customization-color neutral? theme]
|
||||||
(colors/theme-colors
|
(if neutral?
|
||||||
(colors/custom-color customization-color 50)
|
(colors/theme-colors colors/neutral-80-opa-70 colors/white-opa-70 theme)
|
||||||
(colors/custom-color customization-color 60)
|
(colors/theme-colors
|
||||||
theme))
|
(colors/custom-color customization-color 50)
|
||||||
|
(colors/custom-color customization-color 60)
|
||||||
|
theme)))
|
||||||
|
|
||||||
(defn container
|
(defn container
|
||||||
[circle-size customization-color]
|
[circle-size customization-color neutral? theme]
|
||||||
{:width circle-size
|
{:width circle-size
|
||||||
:height circle-size
|
:height circle-size
|
||||||
:border-radius circle-size
|
:border-radius circle-size
|
||||||
:text-align :center
|
:text-align :center
|
||||||
:justify-content :center
|
:justify-content :center
|
||||||
:align-items :center
|
:align-items :center
|
||||||
:background-color (circle-color customization-color)})
|
:background-color (circle-color customization-color neutral? theme)})
|
||||||
|
|
||||||
(defn text
|
(defn text
|
||||||
[customization-color theme]
|
[customization-color neutral? theme]
|
||||||
{:color (text-color customization-color theme)})
|
{:color (text-color customization-color neutral? theme)})
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
(ns quo.components.avatars.wallet-user-avatar.view
|
(ns quo.components.avatars.wallet-user-avatar.view
|
||||||
(:require [quo.components.avatars.wallet-user-avatar.style :as style]
|
(:require [clojure.string :as string]
|
||||||
|
[quo.components.avatars.wallet-user-avatar.style :as style]
|
||||||
[quo.components.markdown.text :as text]
|
[quo.components.markdown.text :as text]
|
||||||
[quo.theme :as quo.theme]
|
[quo.theme :as quo.theme]
|
||||||
[react-native.core :as rn]
|
[react-native.core :as rn]
|
||||||
@@ -40,18 +41,21 @@
|
|||||||
:customization-color - keyword (default: nil) - color of the avatar
|
:customization-color - keyword (default: nil) - color of the avatar
|
||||||
:size - keyword (default: last element of properties object) - size of the
|
:size - keyword (default: last element of properties object) - size of the
|
||||||
avatar
|
avatar
|
||||||
:monospace? - boolean (default: false) - use monospace font"
|
:monospace? - boolean (default: false) - use monospace font
|
||||||
[{:keys [full-name customization-color size theme monospace?]
|
:lowercase? - boolean (default: false) - lowercase text
|
||||||
|
:neutral? - boolean (default: false) - use neutral colors variant"
|
||||||
|
[{:keys [full-name customization-color size theme monospace? lowercase? neutral?]
|
||||||
:or {size biggest-possible}}]
|
:or {size biggest-possible}}]
|
||||||
(let [circle-size (:size (size properties))
|
(let [circle-size (:size (size properties))
|
||||||
small? (check-if-size-small size)]
|
small? (check-if-size-small size)
|
||||||
|
initials (utils.string/get-initials full-name (if small? 1 2))]
|
||||||
[rn/view
|
[rn/view
|
||||||
{:style (style/container circle-size customization-color)}
|
{:style (style/container circle-size customization-color neutral? theme)}
|
||||||
[text/text
|
[text/text
|
||||||
{:accessibility-label :wallet-user-avatar
|
{:accessibility-label :wallet-user-avatar
|
||||||
:size (:font-size (size properties))
|
:size (:font-size (size properties))
|
||||||
:weight (if monospace? :monospace (:font-weight (size properties)))
|
:weight (if monospace? :monospace (:font-weight (size properties)))
|
||||||
:style (style/text customization-color theme)}
|
:style (style/text customization-color neutral? theme)}
|
||||||
(utils.string/get-initials full-name (if small? 1 2))]]))
|
(if (and initials lowercase?) (string/lower-case initials) initials)]]))
|
||||||
|
|
||||||
(def wallet-user-avatar (quo.theme/with-theme view-internal))
|
(def wallet-user-avatar (quo.theme/with-theme view-internal))
|
||||||
|
|||||||
@@ -3,18 +3,22 @@
|
|||||||
[quo.components.counter.step.view :as step]
|
[quo.components.counter.step.view :as step]
|
||||||
[test-helpers.component :as h]))
|
[test-helpers.component :as h]))
|
||||||
|
|
||||||
|
(defn render
|
||||||
|
[component]
|
||||||
|
(h/render-with-theme-provider component :dark))
|
||||||
|
|
||||||
(h/describe "step component"
|
(h/describe "step component"
|
||||||
(h/test "default render of step component"
|
(h/test "default render of step component"
|
||||||
(h/render [step/view {} nil])
|
(render [step/view {} nil])
|
||||||
(-> (h/expect (h/query-by-label-text :step-counter))
|
(-> (h/expect (h/query-by-label-text :step-counter))
|
||||||
(h/is-truthy)))
|
(h/is-truthy)))
|
||||||
|
|
||||||
(h/test "renders step with a string value"
|
(h/test "renders step with a string value"
|
||||||
(h/render [step/view {} "1"])
|
(render [step/view {} "1"])
|
||||||
(-> (h/expect (h/get-by-text "1"))
|
(-> (h/expect (h/get-by-text "1"))
|
||||||
(h/is-truthy)))
|
(h/is-truthy)))
|
||||||
|
|
||||||
(h/test "renders step with an integer value"
|
(h/test "renders step with an integer value"
|
||||||
(h/render [step/view {} 1])
|
(render [step/view {} 1])
|
||||||
(-> (h/expect (h/get-by-text "1"))
|
(-> (h/expect (h/get-by-text "1"))
|
||||||
(h/is-truthy))))
|
(h/is-truthy))))
|
||||||
|
|||||||
@@ -2,10 +2,24 @@
|
|||||||
(:require
|
(:require
|
||||||
[quo.components.counter.step.style :as style]
|
[quo.components.counter.step.style :as style]
|
||||||
[quo.components.markdown.text :as text]
|
[quo.components.markdown.text :as text]
|
||||||
[quo.theme :as theme]
|
quo.theme
|
||||||
[react-native.core :as rn]
|
[react-native.core :as rn]
|
||||||
|
[schema.core :as schema]
|
||||||
[utils.number]))
|
[utils.number]))
|
||||||
|
|
||||||
|
(def ?schema
|
||||||
|
[:=>
|
||||||
|
[:catn
|
||||||
|
[:props
|
||||||
|
[:map {:closed true}
|
||||||
|
[:accessibility-label {:optional true} [:maybe :keyword]]
|
||||||
|
[:customization-color {:optional true} [:maybe :schema.common/customization-color]]
|
||||||
|
[:in-blur-view? {:optional true} [:maybe :boolean]]
|
||||||
|
[:theme :schema.common/theme]
|
||||||
|
[:type {:optional true} [:enum :active :complete :neutral]]]]
|
||||||
|
[:value [:maybe [:or :string :int]]]]
|
||||||
|
:any])
|
||||||
|
|
||||||
(defn- view-internal
|
(defn- view-internal
|
||||||
[{:keys [type accessibility-label theme in-blur-view? customization-color]} value]
|
[{:keys [type accessibility-label theme in-blur-view? customization-color]} value]
|
||||||
(let [type (or type :neutral)
|
(let [type (or type :neutral)
|
||||||
@@ -23,6 +37,9 @@
|
|||||||
[text/text
|
[text/text
|
||||||
{:weight :medium
|
{:weight :medium
|
||||||
:size :label
|
:size :label
|
||||||
:style {:color (style/text-color type theme)}} label]]))
|
:style {:color (style/text-color type theme)}}
|
||||||
|
label]]))
|
||||||
|
|
||||||
(def view (theme/with-theme view-internal))
|
(def view
|
||||||
|
(quo.theme/with-theme
|
||||||
|
(schema/instrument #'view-internal ?schema)))
|
||||||
|
|||||||
@@ -0,0 +1,56 @@
|
|||||||
|
(ns quo.components.dropdowns.dropdown-input.component-spec
|
||||||
|
(:require
|
||||||
|
[quo.components.dropdowns.dropdown-input.view :as dropdown-input]
|
||||||
|
[test-helpers.component :as h]))
|
||||||
|
|
||||||
|
(h/describe "Dropdown Input"
|
||||||
|
|
||||||
|
(h/test "default render"
|
||||||
|
(let [header-label "Label"
|
||||||
|
label "Dropdown"]
|
||||||
|
(h/render [dropdown-input/view
|
||||||
|
{:label? true
|
||||||
|
:header-label
|
||||||
|
header-label} label])
|
||||||
|
(h/is-truthy (h/get-by-label-text :dropdown))
|
||||||
|
(h/is-truthy (h/get-by-text header-label))
|
||||||
|
(h/is-truthy (h/get-by-text label))))
|
||||||
|
|
||||||
|
(h/test "render with icon"
|
||||||
|
(let [label "Dropdown"]
|
||||||
|
(h/render [dropdown-input/view
|
||||||
|
{:icon? true
|
||||||
|
:icon-name
|
||||||
|
:i/wallet
|
||||||
|
:label? true}
|
||||||
|
label])
|
||||||
|
(h/is-truthy (h/get-by-label-text :dropdown))
|
||||||
|
(h/is-truthy (h/get-by-label-text :left-icon))
|
||||||
|
(h/is-truthy (h/get-by-text label))))
|
||||||
|
|
||||||
|
(h/test "render in active state"
|
||||||
|
(let [label "Dropdown"]
|
||||||
|
(h/render [dropdown-input/view
|
||||||
|
{:state :active
|
||||||
|
:label?
|
||||||
|
true} label])
|
||||||
|
(h/is-truthy (h/get-by-label-text :dropdown))
|
||||||
|
(h/is-truthy (h/get-by-label-text :right-icon "Expecting active state icon"))))
|
||||||
|
|
||||||
|
(h/test "render in disabled state"
|
||||||
|
(let [label "Dropdown"]
|
||||||
|
(h/render [dropdown-input/view
|
||||||
|
{:state :disabled
|
||||||
|
:label? true} label])
|
||||||
|
(h/is-truthy (h/get-by-label-text :dropdown))
|
||||||
|
(h/is-disabled (h/get-by-text label "Dropdown should be disabled in disabled state"))))
|
||||||
|
|
||||||
|
(h/test "on-press"
|
||||||
|
(let [event (h/mock-fn)
|
||||||
|
label "Dropdown"]
|
||||||
|
(h/render [dropdown-input/view
|
||||||
|
{:on-press event
|
||||||
|
:label?
|
||||||
|
true} label])
|
||||||
|
(h/fire-event :press (h/get-by-text label))
|
||||||
|
(h/was-called event))))
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
(ns quo.components.dropdowns.dropdown-input.properties
|
||||||
|
(:require
|
||||||
|
[quo.foundations.colors :as colors]))
|
||||||
|
|
||||||
|
(def icon-size 20)
|
||||||
|
|
||||||
|
(defn- grey-blur
|
||||||
|
[theme active?]
|
||||||
|
{:left-icon-color (colors/theme-colors colors/neutral-80-opa-40 colors/white-opa-70 theme)
|
||||||
|
:right-icon-color (colors/theme-colors colors/neutral-80-opa-10 colors/white-opa-10 theme)
|
||||||
|
:right-icon-color-2 (colors/theme-colors colors/neutral-100 colors/white theme)
|
||||||
|
:label-color (colors/theme-colors colors/neutral-100 colors/white theme)
|
||||||
|
:border-color (if active?
|
||||||
|
(colors/theme-colors colors/neutral-80-opa-20
|
||||||
|
colors/white-opa-40
|
||||||
|
theme)
|
||||||
|
(colors/theme-colors colors/neutral-80-opa-10
|
||||||
|
colors/white-opa-10
|
||||||
|
theme))})
|
||||||
|
|
||||||
|
(defn- outline
|
||||||
|
[theme active?]
|
||||||
|
{:left-icon-color (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)
|
||||||
|
:right-icon-color (colors/theme-colors colors/neutral-20 colors/neutral-80 theme)
|
||||||
|
:right-icon-color-2 (colors/theme-colors colors/neutral-100 colors/white theme)
|
||||||
|
:label-color (colors/theme-colors colors/neutral-100 colors/white theme)
|
||||||
|
:border-color (if active?
|
||||||
|
(colors/theme-colors colors/neutral-40 colors/neutral-60 theme)
|
||||||
|
(colors/theme-colors colors/neutral-30 colors/neutral-70 theme))})
|
||||||
|
|
||||||
|
(defn- grey
|
||||||
|
[theme active?]
|
||||||
|
{:left-icon-color (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)
|
||||||
|
:right-icon-color (colors/theme-colors colors/neutral-20 colors/neutral-80 theme)
|
||||||
|
:right-icon-color-2 (colors/theme-colors colors/neutral-100 colors/white theme)
|
||||||
|
:label-color (colors/theme-colors colors/neutral-100 colors/white theme)
|
||||||
|
:border-color (if active?
|
||||||
|
(colors/theme-colors colors/neutral-40 colors/neutral-60 theme)
|
||||||
|
(colors/theme-colors colors/neutral-20
|
||||||
|
colors/neutral-60
|
||||||
|
theme))})
|
||||||
|
|
||||||
|
(defn get-colors
|
||||||
|
[{:keys [theme state blur?]}]
|
||||||
|
(let [active? (= state :active)]
|
||||||
|
(cond
|
||||||
|
blur? (grey-blur theme active?)
|
||||||
|
(= theme :dark) (outline theme active?)
|
||||||
|
(= theme :light) (grey theme active?))))
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
(ns quo.components.dropdowns.dropdown-input.style
|
||||||
|
(:require
|
||||||
|
[quo.foundations.colors :as colors]))
|
||||||
|
|
||||||
|
(def gap 8)
|
||||||
|
|
||||||
|
(def blur-view
|
||||||
|
{:position :absolute
|
||||||
|
:top 0
|
||||||
|
:left 0
|
||||||
|
:right 0
|
||||||
|
:bottom 0})
|
||||||
|
|
||||||
|
(def left-icon
|
||||||
|
{:margin-right gap})
|
||||||
|
|
||||||
|
(defn right-icon
|
||||||
|
[theme]
|
||||||
|
{:color (colors/theme-colors colors/neutral-100 colors/white theme)
|
||||||
|
:margin-right gap})
|
||||||
|
|
||||||
|
(defn header-label
|
||||||
|
[theme blur?]
|
||||||
|
{:color (if blur?
|
||||||
|
(colors/theme-colors colors/neutral-80-opa-40
|
||||||
|
colors/white-opa-70
|
||||||
|
theme)
|
||||||
|
(colors/theme-colors colors/neutral-50
|
||||||
|
colors/neutral-40
|
||||||
|
theme))
|
||||||
|
:margin-bottom gap})
|
||||||
|
|
||||||
|
(def root-container
|
||||||
|
{:width "100%"
|
||||||
|
:height 40})
|
||||||
|
|
||||||
|
(defn container
|
||||||
|
[{:keys [background-color border-color]}
|
||||||
|
{:keys [icon? state]}]
|
||||||
|
(cond-> {:align-items :center
|
||||||
|
:justify-content :space-between
|
||||||
|
:flex-direction :row
|
||||||
|
:padding-vertical 9
|
||||||
|
:padding-left 16
|
||||||
|
:padding-right 12
|
||||||
|
:overflow :hidden
|
||||||
|
:background-color background-color
|
||||||
|
:border-radius 12}
|
||||||
|
|
||||||
|
icon?
|
||||||
|
(assoc :padding-left 12)
|
||||||
|
|
||||||
|
border-color
|
||||||
|
(assoc :border-color border-color
|
||||||
|
:border-width 1)
|
||||||
|
|
||||||
|
(= state :disabled)
|
||||||
|
(assoc :opacity 0.3)))
|
||||||
|
|
||||||
|
(def right-half-container
|
||||||
|
{:flex-direction :row
|
||||||
|
:align-items :center})
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
(ns quo.components.dropdowns.dropdown-input.view
|
||||||
|
(:require
|
||||||
|
[quo.components.dropdowns.dropdown-input.properties :as properties]
|
||||||
|
[quo.components.dropdowns.dropdown-input.style :as style]
|
||||||
|
[quo.components.icon :as icon]
|
||||||
|
[quo.components.markdown.text :as text]
|
||||||
|
[quo.theme :as theme]
|
||||||
|
[react-native.core :as rn]))
|
||||||
|
|
||||||
|
(defn- view-internal
|
||||||
|
[{:keys [state theme on-press icon?
|
||||||
|
label? blur?
|
||||||
|
accessibility-label header-label]
|
||||||
|
:or {state :default
|
||||||
|
icon? true
|
||||||
|
label? true
|
||||||
|
blur? false
|
||||||
|
header-label "Label"}
|
||||||
|
:as props}
|
||||||
|
label]
|
||||||
|
(let [{:keys [left-icon-color right-icon-color right-icon-color-2]
|
||||||
|
:as colors} (properties/get-colors props)
|
||||||
|
right-icon (if (= state :active) :i/pullup :i/dropdown)]
|
||||||
|
[rn/view
|
||||||
|
{:style style/root-container}
|
||||||
|
(when label?
|
||||||
|
[text/text
|
||||||
|
{:size :paragraph-2
|
||||||
|
:weight :medium
|
||||||
|
:align :left
|
||||||
|
:style (style/header-label theme blur?)} header-label])
|
||||||
|
[rn/pressable
|
||||||
|
{:accessibility-label (or accessibility-label :dropdown)
|
||||||
|
:disabled (= state :disabled)
|
||||||
|
:on-press on-press
|
||||||
|
:style (style/container colors props)}
|
||||||
|
[rn/view
|
||||||
|
{:style style/right-half-container}
|
||||||
|
(when icon?
|
||||||
|
[icon/icon
|
||||||
|
:i/placeholder
|
||||||
|
{:accessibility-label :left-icon
|
||||||
|
:color left-icon-color
|
||||||
|
:size properties/icon-size
|
||||||
|
:container-style style/left-icon}])
|
||||||
|
[text/text
|
||||||
|
{:size :paragraph-1
|
||||||
|
:weight :regular
|
||||||
|
:number-of-lines 1
|
||||||
|
:style (style/right-icon theme)}
|
||||||
|
label]]
|
||||||
|
[icon/icon
|
||||||
|
right-icon
|
||||||
|
{:size properties/icon-size
|
||||||
|
:accessibility-label :right-icon
|
||||||
|
:color right-icon-color
|
||||||
|
:color-2 right-icon-color-2}]]]))
|
||||||
|
|
||||||
|
(def view
|
||||||
|
"Props:
|
||||||
|
- state: :default (default) | :active | :disabled
|
||||||
|
- label: string
|
||||||
|
- header-label: string
|
||||||
|
- icon?: boolean
|
||||||
|
- label?: boolean
|
||||||
|
- blur?: boolean
|
||||||
|
- on-press: function"
|
||||||
|
(theme/with-theme view-internal))
|
||||||
@@ -19,3 +19,7 @@
|
|||||||
:background-color colors/danger-50
|
:background-color colors/danger-50
|
||||||
:align-items :center
|
:align-items :center
|
||||||
:justify-content :center})
|
:justify-content :center})
|
||||||
|
|
||||||
|
(def empty-state
|
||||||
|
{:width 375
|
||||||
|
:height 116})
|
||||||
|
|||||||
@@ -2,11 +2,12 @@
|
|||||||
(:require
|
(:require
|
||||||
[quo.components.graph.utils :as utils]
|
[quo.components.graph.utils :as utils]
|
||||||
[quo.components.graph.wallet-graph.style :as style]
|
[quo.components.graph.wallet-graph.style :as style]
|
||||||
[quo.components.markdown.text :as text]
|
|
||||||
[quo.foundations.colors :as colors]
|
[quo.foundations.colors :as colors]
|
||||||
|
[quo.foundations.resources :as resources]
|
||||||
[quo.theme :as quo.theme]
|
[quo.theme :as quo.theme]
|
||||||
[react-native.charts :as charts]
|
[react-native.charts :as charts]
|
||||||
[react-native.core :as rn]
|
[react-native.core :as rn]
|
||||||
|
[react-native.fast-image :as fast-image]
|
||||||
[react-native.linear-gradient :as linear-gradient]))
|
[react-native.linear-gradient :as linear-gradient]))
|
||||||
|
|
||||||
(defn- time-frame->max-data-points
|
(defn- time-frame->max-data-points
|
||||||
@@ -42,11 +43,10 @@
|
|||||||
gradient-colors [(colors/alpha line-color 0.1) (colors/alpha line-color 0)]
|
gradient-colors [(colors/alpha line-color 0.1) (colors/alpha line-color 0)]
|
||||||
fill-color (colors/theme-colors colors/white colors/neutral-95)]
|
fill-color (colors/theme-colors colors/white colors/neutral-95)]
|
||||||
(if (= time-frame :empty)
|
(if (= time-frame :empty)
|
||||||
[rn/view
|
[fast-image/fast-image
|
||||||
{:accessibility-label :illustration
|
{:style style/empty-state
|
||||||
:style style/illustration}
|
:source (resources/get-themed-image :no-funds theme)
|
||||||
[text/text {:style {:color colors/white}}
|
:accessibility-label :illustration}]
|
||||||
"Illustration here"]]
|
|
||||||
[rn/view
|
[rn/view
|
||||||
[linear-gradient/linear-gradient
|
[linear-gradient/linear-gradient
|
||||||
{:colors gradient-colors
|
{:colors gradient-colors
|
||||||
|
|||||||
@@ -3,22 +3,18 @@
|
|||||||
[quo.components.icon :as quo.icons]
|
[quo.components.icon :as quo.icons]
|
||||||
[quo.components.markdown.text :as text]
|
[quo.components.markdown.text :as text]
|
||||||
[quo.foundations.colors :as colors]
|
[quo.foundations.colors :as colors]
|
||||||
[quo.theme :as theme]
|
[quo.theme :as quo.theme]
|
||||||
[react-native.core :as rn]))
|
[react-native.core :as rn]))
|
||||||
|
|
||||||
(def themes
|
|
||||||
{:light {:default colors/neutral-50
|
|
||||||
:success colors/success-50
|
|
||||||
:error colors/danger-50}
|
|
||||||
:dark {:default colors/neutral-40
|
|
||||||
:success colors/success-60
|
|
||||||
:error colors/danger-60}})
|
|
||||||
|
|
||||||
(defn get-color
|
(defn get-color
|
||||||
[k]
|
[k theme]
|
||||||
(get-in themes [(theme/get-theme) k]))
|
(case k
|
||||||
|
:success (colors/resolve-color :success theme)
|
||||||
|
:error (colors/resolve-color :danger theme)
|
||||||
|
:warning (colors/resolve-color :warning theme)
|
||||||
|
(colors/theme-colors colors/neutral-50 colors/neutral-40 theme)))
|
||||||
|
|
||||||
(defn info-message
|
(defn view-internal
|
||||||
"[info-message opts \"message\"]
|
"[info-message opts \"message\"]
|
||||||
opts
|
opts
|
||||||
{:type :default/:success/:error
|
{:type :default/:success/:error
|
||||||
@@ -27,11 +23,11 @@
|
|||||||
:text-color colors/white ;; text color override
|
:text-color colors/white ;; text color override
|
||||||
:icon-color colors/white ;; icon color override
|
:icon-color colors/white ;; icon color override
|
||||||
:no-icon-color? false ;; disable tint color for icon"
|
:no-icon-color? false ;; disable tint color for icon"
|
||||||
[{:keys [type size icon text-color icon-color no-icon-color? style]} message]
|
[{:keys [type size theme icon text-color icon-color no-icon-color? style accessibility-label]} message]
|
||||||
(let [weight (if (= size :default) :regular :medium)
|
(let [weight (if (= size :default) :regular :medium)
|
||||||
icon-size (if (= size :default) 16 12)
|
icon-size (if (= size :default) 16 12)
|
||||||
size (if (= size :default) :paragraph-2 :label)
|
size (if (= size :default) :paragraph-2 :label)
|
||||||
text-color (or text-color (get-color type))
|
text-color (or text-color (get-color type theme))
|
||||||
icon-color (or icon-color text-color)]
|
icon-color (or icon-color text-color)]
|
||||||
[rn/view
|
[rn/view
|
||||||
{:style (merge {:flex-direction :row
|
{:style (merge {:flex-direction :row
|
||||||
@@ -42,7 +38,10 @@
|
|||||||
:no-color no-icon-color?
|
:no-color no-icon-color?
|
||||||
:size icon-size}]
|
:size icon-size}]
|
||||||
[text/text
|
[text/text
|
||||||
{:size size
|
{:accessibility-label accessibility-label
|
||||||
:weight weight
|
:size size
|
||||||
:style {:color text-color
|
:weight weight
|
||||||
:margin-horizontal 4}} message]]))
|
:style {:color text-color
|
||||||
|
:margin-horizontal 4}} message]]))
|
||||||
|
|
||||||
|
(def info-message (quo.theme/with-theme view-internal))
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
(ns quo.components.ios.drawer-bar.style
|
||||||
|
(:require
|
||||||
|
[quo.foundations.colors :as colors]
|
||||||
|
[quo.theme :as theme]))
|
||||||
|
|
||||||
|
(def handle-container
|
||||||
|
{:padding-vertical 8
|
||||||
|
:height 20
|
||||||
|
:align-items :center})
|
||||||
|
|
||||||
|
(defn handle
|
||||||
|
[{:keys [theme]}]
|
||||||
|
{:width 32
|
||||||
|
:height 4
|
||||||
|
:background-color (colors/theme-colors colors/neutral-100 colors/white theme)
|
||||||
|
:opacity (theme/theme-value 0.05 0.1 theme)
|
||||||
|
:border-radius 100})
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
(ns quo.components.ios.drawer-bar.view
|
||||||
|
(:require
|
||||||
|
[quo.components.ios.drawer-bar.style :as style]
|
||||||
|
[quo.theme :as quo.theme]
|
||||||
|
[react-native.core :as rn]))
|
||||||
|
|
||||||
|
(defn- view-internal
|
||||||
|
[props]
|
||||||
|
[rn/view {:style style/handle-container}
|
||||||
|
[rn/view {:style (style/handle props)}]])
|
||||||
|
|
||||||
|
(def view (quo.theme/with-theme view-internal))
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
(h/render [account/view])
|
(h/render [account/view])
|
||||||
(h/fire-event :on-press-in (h/get-by-label-text :container))
|
(h/fire-event :on-press-in (h/get-by-label-text :container))
|
||||||
(h/wait-for #(h/has-style (h/query-by-label-text :container)
|
(h/wait-for #(h/has-style (h/query-by-label-text :container)
|
||||||
{:backgroundColor (colors/custom-color :blue 50 5)})))
|
{:backgroundColor (colors/resolve-color :blue :light 5)})))
|
||||||
|
|
||||||
(h/test "on-press-in changes state to :pressed with blur? enabled"
|
(h/test "on-press-in changes state to :pressed with blur? enabled"
|
||||||
(h/render [account/view {:blur? true}])
|
(h/render [account/view {:blur? true}])
|
||||||
@@ -21,31 +21,26 @@
|
|||||||
(h/wait-for #(h/has-style (h/query-by-label-text :container)
|
(h/wait-for #(h/has-style (h/query-by-label-text :container)
|
||||||
{:backgroundColor colors/white-opa-5})))
|
{:backgroundColor colors/white-opa-5})))
|
||||||
|
|
||||||
(h/test "on-press-out changes state to :active"
|
(h/test "render with state :active"
|
||||||
(h/render [account/view])
|
(h/render [account/view {:state :active}])
|
||||||
(h/fire-event :on-press-in (h/get-by-label-text :container))
|
(h/has-style (h/query-by-label-text :container)
|
||||||
(h/fire-event :on-press-out (h/get-by-label-text :container))
|
{:backgroundColor (colors/resolve-color :blue :light 10)}))
|
||||||
(h/wait-for #(h/has-style (h/query-by-label-text :container)
|
|
||||||
{:backgroundColor (colors/custom-color :blue 50 10)})))
|
|
||||||
|
|
||||||
(h/test "on-press-out changes state to :active with blur? enabled"
|
(h/test "render with state :active and blur? enabled"
|
||||||
(h/render [account/view {:blur? true}])
|
(h/render [account/view
|
||||||
(h/fire-event :on-press-in (h/get-by-label-text :container))
|
{:blur? true
|
||||||
(h/fire-event :on-press-out (h/get-by-label-text :container))
|
:state :active}])
|
||||||
(h/wait-for #(h/has-style (h/query-by-label-text :container)
|
(h/has-style (h/query-by-label-text :container)
|
||||||
{:backgroundColor colors/white-opa-10})))
|
{:backgroundColor colors/white-opa-10}))
|
||||||
|
|
||||||
(h/test "on-press-out changes state to :selected"
|
(h/test "render with state :selected"
|
||||||
(h/render [account/view {:selectable? true}])
|
(h/render [account/view {:state :selected}])
|
||||||
(h/fire-event :on-press-in (h/get-by-label-text :container))
|
(h/is-truthy (h/query-by-label-text :check-icon)))
|
||||||
(h/fire-event :on-press-out (h/get-by-label-text :container))
|
|
||||||
(h/wait-for #(h/is-truthy (h/query-by-label-text :check-icon))))
|
|
||||||
|
|
||||||
(h/test "on-press-out calls on-press"
|
(h/test "calls on-press"
|
||||||
(let [on-press (h/mock-fn)]
|
(let [on-press (h/mock-fn)]
|
||||||
(h/render [account/view {:on-press on-press}])
|
(h/render [account/view {:on-press on-press}])
|
||||||
(h/fire-event :on-press-in (h/get-by-label-text :container))
|
(h/fire-event :on-press (h/get-by-label-text :container))
|
||||||
(h/fire-event :on-press-out (h/get-by-label-text :container))
|
|
||||||
(h/was-called on-press)))
|
(h/was-called on-press)))
|
||||||
|
|
||||||
(h/test "renders token props if type :tag"
|
(h/test "renders token props if type :tag"
|
||||||
|
|||||||
@@ -3,12 +3,12 @@
|
|||||||
[quo.foundations.colors :as colors]))
|
[quo.foundations.colors :as colors]))
|
||||||
|
|
||||||
(defn- background-color
|
(defn- background-color
|
||||||
[{:keys [state blur? customization-color]}]
|
[{:keys [state pressed? blur? customization-color]}]
|
||||||
(cond (or (= state :pressed) (= state :selected))
|
(cond (or pressed? (= state :selected))
|
||||||
(if blur? colors/white-opa-5 (colors/custom-color customization-color 50 5))
|
(if blur? colors/white-opa-5 (colors/resolve-color customization-color :light 5))
|
||||||
(= state :active)
|
(= state :active)
|
||||||
(if blur? colors/white-opa-10 (colors/custom-color customization-color 50 10))
|
(if blur? colors/white-opa-10 (colors/resolve-color customization-color :light 10))
|
||||||
(and (= state :pressed) blur?) colors/white-opa-10
|
(and pressed? blur?) colors/white-opa-10
|
||||||
:else :transparent))
|
:else :transparent))
|
||||||
|
|
||||||
(defn container
|
(defn container
|
||||||
|
|||||||
@@ -94,62 +94,42 @@
|
|||||||
[icon/icon :i/check
|
[icon/icon :i/check
|
||||||
{:color (if blur?
|
{:color (if blur?
|
||||||
colors/white
|
colors/white
|
||||||
(colors/theme-colors (colors/custom-color customization-color 50)
|
(colors/resolve-color customization-color theme))}]])
|
||||||
(colors/custom-color customization-color 60)
|
|
||||||
theme))}]])
|
|
||||||
|
|
||||||
(defn- f-internal-view
|
|
||||||
[]
|
|
||||||
(let [state (reagent/atom :default)
|
|
||||||
active-or-selected? (atom false)
|
|
||||||
timer (atom nil)
|
|
||||||
on-press-in (fn []
|
|
||||||
(when-not (= @state :selected)
|
|
||||||
(reset! timer (js/setTimeout #(reset! state :pressed) 100))))]
|
|
||||||
(fn [{:keys [type selectable? blur? customization-color on-press]
|
|
||||||
:or {customization-color :blue
|
|
||||||
type :default
|
|
||||||
blur? false}
|
|
||||||
:as props}]
|
|
||||||
(let [on-press-out (fn []
|
|
||||||
(let [new-state (if @active-or-selected?
|
|
||||||
:default
|
|
||||||
(if (and (= type :default) selectable?)
|
|
||||||
:selected
|
|
||||||
:active))]
|
|
||||||
(when @timer (js/clearTimeout @timer))
|
|
||||||
(reset! timer nil)
|
|
||||||
(reset! active-or-selected? (or (= new-state :active)
|
|
||||||
(= new-state :selected)))
|
|
||||||
(reset! state new-state)
|
|
||||||
(when on-press
|
|
||||||
(on-press))))]
|
|
||||||
(rn/use-effect
|
|
||||||
#(cond (and selectable? (= type :default) (= @state :active)) (reset! state :selected)
|
|
||||||
(and (not selectable?) (= type :default) (= @state :selected)) (reset! state :active))
|
|
||||||
[selectable?])
|
|
||||||
[rn/pressable
|
|
||||||
{:style (style/container
|
|
||||||
{:state @state :blur? blur? :customization-color customization-color})
|
|
||||||
:on-press-in on-press-in
|
|
||||||
:on-press-out on-press-out
|
|
||||||
:accessibility-label :container}
|
|
||||||
[account-view props]
|
|
||||||
[rn/view {:style (when (= type :tag) style/token-tag-container)}
|
|
||||||
(when (or (= type :balance-neutral)
|
|
||||||
(= type :balance-negative)
|
|
||||||
(= type :balance-positive))
|
|
||||||
[balance-view props])
|
|
||||||
(when (= type :tag)
|
|
||||||
[token-tag props])
|
|
||||||
(when (= type :action)
|
|
||||||
[options-button props])
|
|
||||||
(when (and (= type :default)
|
|
||||||
(= @state :selected))
|
|
||||||
[check-icon props])]]))))
|
|
||||||
|
|
||||||
(defn- internal-view
|
(defn- internal-view
|
||||||
[props]
|
[_]
|
||||||
[:f> f-internal-view props])
|
(let [pressed? (reagent/atom false)
|
||||||
|
on-press-in #(reset! pressed? true)
|
||||||
|
on-press-out #(reset! pressed? false)]
|
||||||
|
(fn [{:keys [type state blur? customization-color on-press]
|
||||||
|
:or {customization-color :blue
|
||||||
|
type :default
|
||||||
|
state :default
|
||||||
|
blur? false}
|
||||||
|
:as props}]
|
||||||
|
[rn/pressable
|
||||||
|
{:style (style/container
|
||||||
|
{:state state
|
||||||
|
:blur? blur?
|
||||||
|
:customization-color customization-color
|
||||||
|
:pressed? @pressed?})
|
||||||
|
:on-press-in on-press-in
|
||||||
|
:on-press on-press
|
||||||
|
:on-press-out on-press-out
|
||||||
|
:accessibility-label :container}
|
||||||
|
[account-view props]
|
||||||
|
[rn/view {:style (when (= type :tag) style/token-tag-container)}
|
||||||
|
(cond
|
||||||
|
(#{:balance-neutral :balance-negative :balance-positive} type)
|
||||||
|
[balance-view props]
|
||||||
|
|
||||||
|
(= type :tag)
|
||||||
|
[token-tag props]
|
||||||
|
|
||||||
|
(= type :action)
|
||||||
|
[options-button props]
|
||||||
|
|
||||||
|
(and (= type :default) (= state :selected))
|
||||||
|
[check-icon props])]])))
|
||||||
|
|
||||||
(def view (quo.theme/with-theme internal-view))
|
(def view (quo.theme/with-theme internal-view))
|
||||||
|
|||||||
@@ -13,11 +13,11 @@
|
|||||||
[{:keys [theme address networks blur?]}]
|
[{:keys [theme address networks blur?]}]
|
||||||
[rn/view {:style style/left-container}
|
[rn/view {:style style/left-container}
|
||||||
[wallet-user-avatar/wallet-user-avatar
|
[wallet-user-avatar/wallet-user-avatar
|
||||||
{:size :medium
|
{:size :size-32
|
||||||
:f-name "0"
|
:full-name "0 x"
|
||||||
:l-name "x"
|
|
||||||
:monospace? true
|
:monospace? true
|
||||||
:uppercase? false}]
|
:lowercase? true
|
||||||
|
:neutral? true}]
|
||||||
[rn/view {:style style/account-container}
|
[rn/view {:style style/account-container}
|
||||||
[text/text {:size :paragraph-1}
|
[text/text {:size :paragraph-1}
|
||||||
(map (fn [network]
|
(map (fn [network]
|
||||||
@@ -25,8 +25,8 @@
|
|||||||
[text/text
|
[text/text
|
||||||
{:size :paragraph-1
|
{:size :paragraph-1
|
||||||
:weight :semi-bold
|
:weight :semi-bold
|
||||||
:style {:color (colors/resolve-color network theme)}}
|
:style {:color (colors/resolve-color (:network-name network) theme)}}
|
||||||
(str (subs (name network) 0 3) ":")])
|
(str (:short-name network) ":")])
|
||||||
networks)
|
networks)
|
||||||
[text/text
|
[text/text
|
||||||
{:size :paragraph-1
|
{:size :paragraph-1
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
(ns quo.components.list-items.saved-address.view
|
(ns quo.components.list-items.saved-address.view
|
||||||
(:require
|
(:require
|
||||||
[clojure.string :as string]
|
|
||||||
[quo.components.avatars.wallet-user-avatar.view :as wallet-user-avatar]
|
[quo.components.avatars.wallet-user-avatar.view :as wallet-user-avatar]
|
||||||
[quo.components.icon :as icon]
|
[quo.components.icon :as icon]
|
||||||
[quo.components.list-items.saved-address.style :as style]
|
[quo.components.list-items.saved-address.style :as style]
|
||||||
@@ -13,27 +12,23 @@
|
|||||||
|
|
||||||
(defn- left-container
|
(defn- left-container
|
||||||
[{:keys [blur? theme name ens address customization-color]}]
|
[{:keys [blur? theme name ens address customization-color]}]
|
||||||
(let [names (remove string/blank? (string/split name " "))
|
[rn/view {:style style/left-container}
|
||||||
first-name (if (> (count names) 0) (first names) "")
|
[wallet-user-avatar/wallet-user-avatar
|
||||||
last-name (if (> (count names) 1) (last names) "")]
|
{:size :size-32
|
||||||
[rn/view {:style style/left-container}
|
:full-name name
|
||||||
[wallet-user-avatar/wallet-user-avatar
|
:customization-color customization-color}]
|
||||||
{:size :medium
|
[rn/view {:style style/account-container}
|
||||||
:f-name first-name
|
[text/text
|
||||||
:l-name last-name
|
{:weight :semi-bold
|
||||||
:customization-color customization-color}]
|
:size :paragraph-1
|
||||||
[rn/view {:style style/account-container}
|
:style style/name-text}
|
||||||
[text/text
|
name]
|
||||||
{:weight :semi-bold
|
[text/text {:size :paragraph-2}
|
||||||
:size :paragraph-1
|
[text/text
|
||||||
:style style/name-text}
|
{:size :paragraph-2
|
||||||
name]
|
:weight :monospace
|
||||||
[text/text {:size :paragraph-2}
|
:style (style/account-address blur? theme)}
|
||||||
[text/text
|
(or ens (address/get-shortened-key address))]]]])
|
||||||
{:size :paragraph-2
|
|
||||||
:weight :monospace
|
|
||||||
:style (style/account-address blur? theme)}
|
|
||||||
(or ens (address/get-shortened-key address))]]]]))
|
|
||||||
|
|
||||||
(defn- internal-view
|
(defn- internal-view
|
||||||
[]
|
[]
|
||||||
|
|||||||
@@ -26,21 +26,25 @@
|
|||||||
|
|
||||||
(def info
|
(def info
|
||||||
{:flex-direction :row
|
{:flex-direction :row
|
||||||
:align-items :center})
|
:align-items :center
|
||||||
|
:width "70%"})
|
||||||
|
|
||||||
(def token-info
|
(def token-info
|
||||||
{:height 40})
|
{:height 40
|
||||||
|
:flex 1})
|
||||||
|
|
||||||
(def token-image
|
(def token-image
|
||||||
{:width 32
|
{:width 32
|
||||||
:height 32
|
:height 32
|
||||||
:border-width 1
|
:border-width 1
|
||||||
:border-radius 16
|
:border-radius 16
|
||||||
:border-color colors/neutral-80-opa-5
|
:border-color colors/neutral-80-opa-5
|
||||||
:margin-right 8})
|
:margin-right 8
|
||||||
|
:background-color colors/neutral-80-opa-5})
|
||||||
|
|
||||||
(def values-container
|
(def values-container
|
||||||
{:align-items :flex-end})
|
{:align-items :flex-end
|
||||||
|
:max-width "30%"})
|
||||||
|
|
||||||
(defn fiat-value
|
(defn fiat-value
|
||||||
[theme]
|
[theme]
|
||||||
|
|||||||
@@ -15,11 +15,14 @@
|
|||||||
{:source (or (:source token) token)
|
{:source (or (:source token) token)
|
||||||
:style style/token-image}]
|
:style style/token-image}]
|
||||||
[rn/view {:style style/token-info}
|
[rn/view {:style style/token-info}
|
||||||
[text/text {:weight :semi-bold} label]
|
[text/text
|
||||||
|
{:weight :semi-bold
|
||||||
|
:number-of-lines 1}
|
||||||
|
(if-not (empty? label) label "-")]
|
||||||
[preview-list/view
|
[preview-list/view
|
||||||
{:type :network
|
{:type :network
|
||||||
:size :size-14
|
:size :size-14
|
||||||
:number 3}
|
:number (count networks)}
|
||||||
networks]]])
|
networks]]])
|
||||||
|
|
||||||
(defn- values
|
(defn- values
|
||||||
@@ -30,12 +33,14 @@
|
|||||||
:accessibility-label :check-icon}]
|
:accessibility-label :check-icon}]
|
||||||
[rn/view {:style style/values-container}
|
[rn/view {:style style/values-container}
|
||||||
[text/text
|
[text/text
|
||||||
{:weight :medium
|
{:weight :medium
|
||||||
:size :paragraph-2}
|
:size :paragraph-2
|
||||||
|
:number-of-lines 1}
|
||||||
token-value]
|
token-value]
|
||||||
[text/text
|
[text/text
|
||||||
{:style (style/fiat-value theme)
|
{:style (style/fiat-value theme)
|
||||||
:size :paragraph-2}
|
:size :paragraph-2
|
||||||
|
:number-of-lines 1}
|
||||||
fiat-value]]))
|
fiat-value]]))
|
||||||
|
|
||||||
(defn- view-internal
|
(defn- view-internal
|
||||||
|
|||||||
@@ -22,9 +22,10 @@
|
|||||||
(h/is-truthy (h/get-by-text "test description")))
|
(h/is-truthy (h/get-by-text "test description")))
|
||||||
|
|
||||||
(h/test "renders step component when step-number is valid and type is step"
|
(h/test "renders step component when step-number is valid and type is step"
|
||||||
(h/render [list/view
|
(h/render-with-theme-provider [list/view
|
||||||
{:type :step
|
{:type :step
|
||||||
:step-number 1}])
|
:step-number 1}]
|
||||||
|
:dark)
|
||||||
(h/is-truthy (h/get-by-label-text :step-counter)))
|
(h/is-truthy (h/get-by-label-text :step-counter)))
|
||||||
|
|
||||||
(h/test "renders decription with a context tag component and description after the tag"
|
(h/test "renders decription with a context tag component and description after the tag"
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
:blur? false
|
:blur? false
|
||||||
:type :digit} 1])
|
:type :digit} 1])
|
||||||
(h/is-truthy (h/query-by-label-text :text-label))
|
(h/is-truthy (h/query-by-label-text :text-label))
|
||||||
(h/fire-event :press (h/query-by-label-text :keyboard-key))
|
(h/fire-event :press (h/query-by-label-text :keyboard-key-1))
|
||||||
(h/was-called on-press)))
|
(h/was-called on-press)))
|
||||||
|
|
||||||
(h/test "Is not pressable when disabled is true"
|
(h/test "Is not pressable when disabled is true"
|
||||||
@@ -47,5 +47,5 @@
|
|||||||
:blur? false
|
:blur? false
|
||||||
:type :digit} 1])
|
:type :digit} 1])
|
||||||
(h/is-truthy (h/query-by-label-text :text-label))
|
(h/is-truthy (h/query-by-label-text :text-label))
|
||||||
(h/fire-event :press (h/query-by-label-text :keyboard-key))
|
(h/fire-event :press (h/query-by-label-text :keyboard-key-1))
|
||||||
(h/was-not-called on-press))))
|
(h/was-not-called on-press))))
|
||||||
|
|||||||
@@ -7,6 +7,11 @@
|
|||||||
[react-native.core :as rn]
|
[react-native.core :as rn]
|
||||||
[reagent.core :as reagent]))
|
[reagent.core :as reagent]))
|
||||||
|
|
||||||
|
(defn- label->accessibility-label
|
||||||
|
[label]
|
||||||
|
(let [label-name (if (keyword? label) (name label) label)]
|
||||||
|
(keyword (str "keyboard-key-" label-name))))
|
||||||
|
|
||||||
(defn- view-internal
|
(defn- view-internal
|
||||||
[]
|
[]
|
||||||
(let [pressed? (reagent/atom false)]
|
(let [pressed? (reagent/atom false)]
|
||||||
@@ -14,9 +19,11 @@
|
|||||||
(let [label-color (style/get-label-color disabled? theme blur?)
|
(let [label-color (style/get-label-color disabled? theme blur?)
|
||||||
background-color (style/toggle-background-color @pressed? blur? theme)]
|
background-color (style/toggle-background-color @pressed? blur? theme)]
|
||||||
[rn/pressable
|
[rn/pressable
|
||||||
{:accessibility-label :keyboard-key
|
{:accessibility-label (label->accessibility-label label)
|
||||||
:disabled (or disabled? (not label))
|
:disabled (or disabled? (not label))
|
||||||
:on-press (fn [] (on-press label))
|
:on-press (fn []
|
||||||
|
(when on-press
|
||||||
|
(on-press label)))
|
||||||
:on-press-in #(reset! pressed? true)
|
:on-press-in #(reset! pressed? true)
|
||||||
:on-press-out #(reset! pressed? false)
|
:on-press-out #(reset! pressed? false)
|
||||||
:style (style/container background-color)}
|
:style (style/container background-color)}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
(ns quo.components.numbered-keyboard.numbered-keyboard.style)
|
(ns quo.components.numbered-keyboard.numbered-keyboard.style)
|
||||||
|
|
||||||
(def container
|
(def container
|
||||||
{:flex 1
|
{:display :flex
|
||||||
:padding-top 8
|
:padding-top 8
|
||||||
:padding-horizontal 48})
|
:padding-horizontal 48})
|
||||||
|
|
||||||
|
|||||||
@@ -17,13 +17,17 @@
|
|||||||
|
|
||||||
(defn- view-internal
|
(defn- view-internal
|
||||||
[]
|
[]
|
||||||
(fn [{:keys [disabled? theme blur? left-action delete-key? on-press]}]
|
(fn [{:keys [disabled? theme blur? left-action delete-key? on-press on-delete
|
||||||
|
container-style]
|
||||||
|
:or {left-action :none}}]
|
||||||
[rn/view
|
[rn/view
|
||||||
{:style style/container}
|
{:style (merge style/container
|
||||||
|
container-style)}
|
||||||
(for [row-index (range 1 4)]
|
(for [row-index (range 1 4)]
|
||||||
^{:key row-index}
|
^{:key row-index}
|
||||||
[rn/view {:style style/row-container}
|
[rn/view {:style style/row-container}
|
||||||
(for [column-index (range 1 4)]
|
(for [column-index (range 1 4)]
|
||||||
|
^{:key (str row-index column-index)}
|
||||||
[keyboard-item
|
[keyboard-item
|
||||||
{:item (+ (* (dec row-index) 3) column-index)
|
{:item (+ (* (dec row-index) 3) column-index)
|
||||||
:type :digit
|
:type :digit
|
||||||
@@ -58,10 +62,10 @@
|
|||||||
:theme theme}]
|
:theme theme}]
|
||||||
(if delete-key?
|
(if delete-key?
|
||||||
[keyboard-item
|
[keyboard-item
|
||||||
{:item :i/delete
|
{:item :i/backspace
|
||||||
:type :key
|
:type :key
|
||||||
:disabled? disabled?
|
:disabled? disabled?
|
||||||
:on-press on-press
|
:on-press on-delete
|
||||||
:blur? blur?
|
:blur? blur?
|
||||||
:theme theme}]
|
:theme theme}]
|
||||||
[keyboard-item])]]))
|
[keyboard-item])]]))
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
(ns quo.components.overlay.style
|
||||||
|
(:require [quo.foundations.colors :as colors]))
|
||||||
|
|
||||||
|
(defn overlay-background
|
||||||
|
[type]
|
||||||
|
(let [background-color (case type
|
||||||
|
:shell colors/neutral-80-opa-80-blur
|
||||||
|
:drawer colors/neutral-100-opa-70-blur
|
||||||
|
nil)]
|
||||||
|
{:position :absolute
|
||||||
|
:top 0
|
||||||
|
:left 0
|
||||||
|
:right 0
|
||||||
|
:bottom 0
|
||||||
|
:background-color background-color}))
|
||||||
|
|
||||||
|
(def container
|
||||||
|
{:flex 1})
|
||||||
|
|
||||||
|
(def blur-container
|
||||||
|
{:flex 1
|
||||||
|
:background-color :transparent})
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
(ns quo.components.overlay.view
|
||||||
|
(:require
|
||||||
|
[quo.components.overlay.style :as style]
|
||||||
|
[react-native.blur :as blur]
|
||||||
|
[react-native.core :as rn]))
|
||||||
|
|
||||||
|
(defn view
|
||||||
|
[{:keys [type]} & children]
|
||||||
|
[rn/view {:style (style/overlay-background type)}
|
||||||
|
(if (= type :shell)
|
||||||
|
[blur/view
|
||||||
|
{:blur-amount 20
|
||||||
|
:blur-radius 25
|
||||||
|
:blur-type :transparent
|
||||||
|
:overlay-color :transparent
|
||||||
|
:style style/container}
|
||||||
|
[rn/view {:style style/blur-container}
|
||||||
|
children]]
|
||||||
|
[rn/view {:style style/container}
|
||||||
|
children])])
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
(ns quo.components.settings.data-item.component-spec
|
(ns quo.components.settings.data-item.component-spec
|
||||||
(:require
|
(:require
|
||||||
[quo.core :as quo]
|
[quo.core :as quo]
|
||||||
|
[quo.foundations.resources :as quo.resources]
|
||||||
[test-helpers.component :as h]))
|
[test-helpers.component :as h]))
|
||||||
|
|
||||||
(h/describe
|
(h/describe
|
||||||
@@ -9,14 +10,14 @@
|
|||||||
(h/render [quo/data-item
|
(h/render [quo/data-item
|
||||||
{:on-press (h/mock-fn)
|
{:on-press (h/mock-fn)
|
||||||
:blur? false
|
:blur? false
|
||||||
:description :account
|
|
||||||
:icon-right? false
|
:icon-right? false
|
||||||
:card? true
|
:card? true
|
||||||
:label :none
|
:label :none
|
||||||
:status :default
|
:status :default
|
||||||
:size :default
|
:size :default
|
||||||
:title "Label"
|
:title "Label"
|
||||||
:subtitle "Description"
|
:subtitle "Subtitle"
|
||||||
|
:subtitle-type :account
|
||||||
:icon :i/placeholder
|
:icon :i/placeholder
|
||||||
:emoji "🎮"
|
:emoji "🎮"
|
||||||
:customization-color :yellow}])
|
:customization-color :yellow}])
|
||||||
@@ -26,14 +27,14 @@
|
|||||||
(h/render [quo/data-item
|
(h/render [quo/data-item
|
||||||
{:on-press (h/mock-fn)
|
{:on-press (h/mock-fn)
|
||||||
:blur? false
|
:blur? false
|
||||||
:description :account
|
|
||||||
:icon-right? false
|
:icon-right? false
|
||||||
:card? false
|
:card? false
|
||||||
:label :none
|
:label :none
|
||||||
:status :default
|
:status :default
|
||||||
:size :default
|
:size :default
|
||||||
:title "Label"
|
:title "Label"
|
||||||
:subtitle "Description"
|
:subtitle "Subtitle"
|
||||||
|
:subtitle-type :account
|
||||||
:icon :i/placeholder
|
:icon :i/placeholder
|
||||||
:emoji "🎮"
|
:emoji "🎮"
|
||||||
:customization-color :yellow}])
|
:customization-color :yellow}])
|
||||||
@@ -44,14 +45,14 @@
|
|||||||
(h/render [quo/data-item
|
(h/render [quo/data-item
|
||||||
{:on-press (h/mock-fn)
|
{:on-press (h/mock-fn)
|
||||||
:blur? false
|
:blur? false
|
||||||
:description :account
|
|
||||||
:icon-right? false
|
:icon-right? false
|
||||||
:card? true
|
:card? true
|
||||||
:label :none
|
:label :none
|
||||||
:status :default
|
:status :default
|
||||||
:size :small
|
:size :small
|
||||||
:title "Label"
|
:title "Label"
|
||||||
:subtitle "Description"
|
:subtitle "Subtitle"
|
||||||
|
:subtitle-type :account
|
||||||
:icon :i/placeholder
|
:icon :i/placeholder
|
||||||
:emoji "🎮"
|
:emoji "🎮"
|
||||||
:customization-color :yellow}])
|
:customization-color :yellow}])
|
||||||
@@ -62,14 +63,14 @@
|
|||||||
(h/render [quo/data-item
|
(h/render [quo/data-item
|
||||||
{:on-press (h/mock-fn)
|
{:on-press (h/mock-fn)
|
||||||
:blur? false
|
:blur? false
|
||||||
:description :account
|
|
||||||
:icon-right? false
|
:icon-right? false
|
||||||
:card? true
|
:card? true
|
||||||
:label :none
|
:label :none
|
||||||
:status :default
|
:status :default
|
||||||
:size :default
|
:size :default
|
||||||
:title "Label"
|
:title "Label"
|
||||||
:subtitle "Description"
|
:subtitle "Subtitle"
|
||||||
|
:subtitle-type :account
|
||||||
:icon :i/placeholder
|
:icon :i/placeholder
|
||||||
:emoji "🎮"
|
:emoji "🎮"
|
||||||
:customization-color :yellow}])
|
:customization-color :yellow}])
|
||||||
@@ -80,31 +81,31 @@
|
|||||||
(h/render [quo/data-item
|
(h/render [quo/data-item
|
||||||
{:on-press (h/mock-fn)
|
{:on-press (h/mock-fn)
|
||||||
:blur? false
|
:blur? false
|
||||||
:description :account
|
|
||||||
:icon-right? false
|
:icon-right? false
|
||||||
:card? true
|
:card? true
|
||||||
:label :none
|
:label :none
|
||||||
:status :default
|
:status :default
|
||||||
:size :default
|
:size :default
|
||||||
:title "Label"
|
:title "Label"
|
||||||
:subtitle "Description"
|
:subtitle "Subtitle"
|
||||||
|
:subtitle-type :account
|
||||||
:icon :i/placeholder
|
:icon :i/placeholder
|
||||||
:emoji "🎮"
|
:emoji "🎮"
|
||||||
:customization-color :yellow}])
|
:customization-color :yellow}])
|
||||||
(h/is-truthy (h/get-by-text "Description")))
|
(h/is-truthy (h/get-by-text "Subtitle")))
|
||||||
|
|
||||||
(h/test "right icon is not visible when icon-right? is false"
|
(h/test "right icon is not visible when icon-right? is false"
|
||||||
(h/render [quo/data-item
|
(h/render [quo/data-item
|
||||||
{:on-press (h/mock-fn)
|
{:on-press (h/mock-fn)
|
||||||
:blur? false
|
:blur? false
|
||||||
:description :account
|
|
||||||
:icon-right? false
|
:icon-right? false
|
||||||
:card? true
|
:card? true
|
||||||
:label :none
|
:label :none
|
||||||
:status :default
|
:status :default
|
||||||
:size :default
|
:size :default
|
||||||
:title "Label"
|
:title "Label"
|
||||||
:subtitle "Description"
|
:subtitle "Subtitle"
|
||||||
|
:subtitle-type :account
|
||||||
:icon :i/placeholder
|
:icon :i/placeholder
|
||||||
:emoji "🎮"
|
:emoji "🎮"
|
||||||
:customization-color :yellow}])
|
:customization-color :yellow}])
|
||||||
@@ -114,7 +115,6 @@
|
|||||||
(h/render [quo/data-item
|
(h/render [quo/data-item
|
||||||
{:on-press (h/mock-fn)
|
{:on-press (h/mock-fn)
|
||||||
:blur? false
|
:blur? false
|
||||||
:description :account
|
|
||||||
:icon-right? true
|
:icon-right? true
|
||||||
:right-icon :i/chevron-right
|
:right-icon :i/chevron-right
|
||||||
:card? true
|
:card? true
|
||||||
@@ -122,17 +122,17 @@
|
|||||||
:status :default
|
:status :default
|
||||||
:size :default
|
:size :default
|
||||||
:title "Label"
|
:title "Label"
|
||||||
:subtitle "Description"
|
:subtitle "Subtitle"
|
||||||
|
:subtitle-type :account
|
||||||
:icon :i/placeholder
|
:icon :i/placeholder
|
||||||
:emoji "🎮"
|
:emoji "🎮"
|
||||||
:customization-color :yellow}])
|
:customization-color :yellow}])
|
||||||
(h/is-truthy (h/query-by-label-text :icon-right)))
|
(h/is-truthy (h/query-by-label-text :icon-right)))
|
||||||
|
|
||||||
(h/test "description icon is visible when description is icon"
|
(h/test "icon is visible when subtitle type is icon"
|
||||||
(h/render [quo/data-item
|
(h/render [quo/data-item
|
||||||
{:on-press (h/mock-fn)
|
{:on-press (h/mock-fn)
|
||||||
:blur? false
|
:blur? false
|
||||||
:description :icon
|
|
||||||
:icon-right? true
|
:icon-right? true
|
||||||
:right-icon :i/chevron-right
|
:right-icon :i/chevron-right
|
||||||
:card? true
|
:card? true
|
||||||
@@ -140,17 +140,17 @@
|
|||||||
:status :default
|
:status :default
|
||||||
:size :default
|
:size :default
|
||||||
:title "Label"
|
:title "Label"
|
||||||
:subtitle "Description"
|
:subtitle "Subtitle"
|
||||||
|
:subtitle-type :icon
|
||||||
:icon :i/placeholder
|
:icon :i/placeholder
|
||||||
:emoji "🎮"
|
:emoji "🎮"
|
||||||
:customization-color :yellow}])
|
:customization-color :yellow}])
|
||||||
(h/is-truthy (h/query-by-label-text :description-icon)))
|
(h/is-truthy (h/query-by-label-text :subtitle-type-icon)))
|
||||||
|
|
||||||
(h/test "description image is visible when description is network"
|
(h/test "image is visible when subtitle type is network"
|
||||||
(h/render [quo/data-item
|
(h/render [quo/data-item
|
||||||
{:on-press (h/mock-fn)
|
{:on-press (h/mock-fn)
|
||||||
:blur? false
|
:blur? false
|
||||||
:description :network
|
|
||||||
:icon-right? true
|
:icon-right? true
|
||||||
:right-icon :i/chevron-right
|
:right-icon :i/chevron-right
|
||||||
:card? true
|
:card? true
|
||||||
@@ -158,17 +158,18 @@
|
|||||||
:status :default
|
:status :default
|
||||||
:size :default
|
:size :default
|
||||||
:title "Label"
|
:title "Label"
|
||||||
:subtitle "Description"
|
:subtitle "Subtitle"
|
||||||
|
:subtitle-type :network
|
||||||
:icon :i/placeholder
|
:icon :i/placeholder
|
||||||
:emoji "🎮"
|
:emoji "🎮"
|
||||||
:customization-color :yellow}])
|
:customization-color :yellow
|
||||||
(h/is-truthy (h/query-by-label-text :description-image)))
|
:network-image (quo.resources/get-network :ethereum)}])
|
||||||
|
(h/is-truthy (h/query-by-label-text :subtitle-type-image)))
|
||||||
|
|
||||||
(h/test "description emoji is visible when description is account"
|
(h/test "emoji is visible when subtitle type is account"
|
||||||
(h/render [quo/data-item
|
(h/render [quo/data-item
|
||||||
{:on-press (h/mock-fn)
|
{:on-press (h/mock-fn)
|
||||||
:blur? false
|
:blur? false
|
||||||
:description :account
|
|
||||||
:icon-right? true
|
:icon-right? true
|
||||||
:right-icon :i/chevron-right
|
:right-icon :i/chevron-right
|
||||||
:card? true
|
:card? true
|
||||||
@@ -176,7 +177,8 @@
|
|||||||
:status :default
|
:status :default
|
||||||
:size :default
|
:size :default
|
||||||
:title "Label"
|
:title "Label"
|
||||||
:subtitle "Description"
|
:subtitle "Subtitle"
|
||||||
|
:subtitle-type :account
|
||||||
:icon :i/placeholder
|
:icon :i/placeholder
|
||||||
:emoji "🎮"
|
:emoji "🎮"
|
||||||
:customization-color :yellow}])
|
:customization-color :yellow}])
|
||||||
|
|||||||
@@ -37,8 +37,8 @@
|
|||||||
:align-items :center})
|
:align-items :center})
|
||||||
|
|
||||||
(defn subtitle-icon-container
|
(defn subtitle-icon-container
|
||||||
[description]
|
[subtitle-type]
|
||||||
{:margin-right (when (not= :default description) 4)
|
{:margin-right (when (not= :default subtitle-type) 4)
|
||||||
:justify-content :center})
|
:justify-content :center})
|
||||||
|
|
||||||
(defn title
|
(defn title
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
[quo.components.markdown.text :as text]
|
[quo.components.markdown.text :as text]
|
||||||
[quo.components.settings.data-item.style :as style]
|
[quo.components.settings.data-item.style :as style]
|
||||||
[quo.foundations.colors :as colors]
|
[quo.foundations.colors :as colors]
|
||||||
[quo.foundations.resources :as quo.resources]
|
|
||||||
[quo.theme :as quo.theme]
|
[quo.theme :as quo.theme]
|
||||||
[react-native.core :as rn]
|
[react-native.core :as rn]
|
||||||
[utils.i18n :as i18n]))
|
[utils.i18n :as i18n]))
|
||||||
@@ -17,13 +16,15 @@
|
|||||||
[rn/view {:style (style/loading-container size blur? theme)}])
|
[rn/view {:style (style/loading-container size blur? theme)}])
|
||||||
|
|
||||||
(defn- left-subtitle
|
(defn- left-subtitle
|
||||||
[{:keys [theme size description icon icon-color blur? subtitle customization-color emoji]}]
|
[{:keys [theme size subtitle-type icon icon-color blur? subtitle customization-color emoji
|
||||||
|
network-image]
|
||||||
|
:or {subtitle-type :default}}]
|
||||||
[rn/view {:style style/subtitle-container}
|
[rn/view {:style style/subtitle-container}
|
||||||
(when (not= :small size)
|
(when (not= :small size)
|
||||||
[rn/view {:style (style/subtitle-icon-container description)}
|
[rn/view {:style (style/subtitle-icon-container subtitle-type)}
|
||||||
(case description
|
(case subtitle-type
|
||||||
:icon [icons/icon icon
|
:icon [icons/icon icon
|
||||||
{:accessibility-label :description-icon
|
{:accessibility-label :subtitle-type-icon
|
||||||
:size 16
|
:size 16
|
||||||
:color icon-color}]
|
:color icon-color}]
|
||||||
:account [account-avatar/view
|
:account [account-avatar/view
|
||||||
@@ -32,8 +33,8 @@
|
|||||||
:emoji emoji
|
:emoji emoji
|
||||||
:type :default}]
|
:type :default}]
|
||||||
:network [rn/image
|
:network [rn/image
|
||||||
{:accessibility-label :description-image
|
{:accessibility-label :subtitle-type-image
|
||||||
:source (quo.resources/tokens :eth)
|
:source network-image
|
||||||
:style style/image}]
|
:style style/image}]
|
||||||
nil)])
|
nil)])
|
||||||
[text/text
|
[text/text
|
||||||
@@ -58,10 +59,9 @@
|
|||||||
(i18n/label :t/days)])])
|
(i18n/label :t/days)])])
|
||||||
|
|
||||||
(defn- left-side
|
(defn- left-side
|
||||||
"The description can either be given as a string `description` or a component `custom-subtitle`"
|
"The description can either be given as a string `subtitle-type` or a component `custom-subtitle`"
|
||||||
[{:keys [theme title status size blur? description custom-subtitle icon subtitle label icon-color
|
[{:keys [theme title status size blur? custom-subtitle icon subtitle subtitle-type label icon-color
|
||||||
customization-color
|
customization-color network-image emoji]
|
||||||
emoji]
|
|
||||||
:as props}]
|
:as props}]
|
||||||
[rn/view {:style style/left-side}
|
[rn/view {:style style/left-side}
|
||||||
[left-title
|
[left-title
|
||||||
@@ -79,13 +79,14 @@
|
|||||||
[left-subtitle
|
[left-subtitle
|
||||||
{:theme theme
|
{:theme theme
|
||||||
:size size
|
:size size
|
||||||
:description description
|
:subtitle-type subtitle-type
|
||||||
:icon icon
|
:icon icon
|
||||||
:icon-color icon-color
|
:icon-color icon-color
|
||||||
:blur? blur?
|
:blur? blur?
|
||||||
:subtitle subtitle
|
:subtitle subtitle
|
||||||
:customization-color customization-color
|
:customization-color customization-color
|
||||||
:emoji emoji}]))])
|
:emoji emoji
|
||||||
|
:network-image network-image}]))])
|
||||||
|
|
||||||
(defn- right-side
|
(defn- right-side
|
||||||
[{:keys [label icon-right? right-icon icon-color communities-list]}]
|
[{:keys [label icon-right? right-icon icon-color communities-list]}]
|
||||||
|
|||||||
@@ -17,30 +17,21 @@
|
|||||||
{:width size})))
|
{:width size})))
|
||||||
|
|
||||||
(defn base-tag
|
(defn base-tag
|
||||||
[_]
|
[{:keys [id size disabled? border-color border-width background-color on-press
|
||||||
(fn
|
accessibility-label type labelled?]
|
||||||
[{:keys [id
|
:or {size 32}}
|
||||||
size
|
children]
|
||||||
disabled?
|
[rn/touchable-without-feedback
|
||||||
border-color
|
(merge {:disabled disabled?
|
||||||
border-width
|
:accessibility-label accessibility-label}
|
||||||
background-color
|
(when on-press
|
||||||
on-press
|
{:on-press #(on-press id)}))
|
||||||
accessibility-label
|
[rn/view
|
||||||
type
|
{:style (merge (style-container size
|
||||||
labelled?]
|
disabled?
|
||||||
:or {size 32}} children]
|
border-color
|
||||||
[rn/touchable-without-feedback
|
border-width
|
||||||
(merge {:disabled disabled?
|
background-color
|
||||||
:accessibility-label accessibility-label}
|
labelled?
|
||||||
(when on-press
|
type))}
|
||||||
{:on-press #(on-press id)}))
|
children]])
|
||||||
[rn/view
|
|
||||||
{:style (merge (style-container size
|
|
||||||
disabled?
|
|
||||||
border-color
|
|
||||||
border-width
|
|
||||||
background-color
|
|
||||||
labelled?
|
|
||||||
type))}
|
|
||||||
children]]))
|
|
||||||
|
|||||||
@@ -0,0 +1,53 @@
|
|||||||
|
(ns quo.components.tags.summary-tag.component-spec
|
||||||
|
(:require
|
||||||
|
[quo.components.tags.summary-tag.view :as summary-tag]
|
||||||
|
[test-helpers.component :as h]))
|
||||||
|
|
||||||
|
(h/describe "Summary tag component tests"
|
||||||
|
(h/test "Basic render"
|
||||||
|
(h/render [summary-tag/view])
|
||||||
|
(h/is-truthy (h/query-by-label-text :container)))
|
||||||
|
|
||||||
|
(h/test "Account view render"
|
||||||
|
(h/render [summary-tag/view
|
||||||
|
{:type :account
|
||||||
|
:label "Alice's Account"
|
||||||
|
:customization-color "#ff0000"
|
||||||
|
:emoji "🎉"}])
|
||||||
|
(h/is-truthy (h/get-by-text "Alice's Account")))
|
||||||
|
|
||||||
|
(h/test "Network view render"
|
||||||
|
(h/render [summary-tag/view
|
||||||
|
{:type :network
|
||||||
|
:label "Ethereum Network"
|
||||||
|
:image-source "path/to/ethereum-logo.png"}])
|
||||||
|
(h/is-truthy (h/get-by-text "Ethereum Network")))
|
||||||
|
|
||||||
|
(h/test "Saved address view render"
|
||||||
|
(h/render [summary-tag/view
|
||||||
|
{:type :saved-address
|
||||||
|
:label "Charlie's Wallet"
|
||||||
|
:customization-color "#00ff00"}])
|
||||||
|
(h/is-truthy (h/get-by-text "Charlie's Wallet")))
|
||||||
|
|
||||||
|
(h/test "Collectible view render"
|
||||||
|
(h/render [summary-tag/view
|
||||||
|
{:type :collectible
|
||||||
|
:label "Rare Artifact"
|
||||||
|
:image-source "path/to/artifact-image.png"}])
|
||||||
|
(h/is-truthy (h/get-by-text "Rare Artifact")))
|
||||||
|
|
||||||
|
(h/test "User view render"
|
||||||
|
(h/render [summary-tag/view
|
||||||
|
{:type :user
|
||||||
|
:label "Bob Smith"
|
||||||
|
:image-source "path/to/profile-pic.png"
|
||||||
|
:customization-color "#0000ff"}])
|
||||||
|
(h/is-truthy (h/get-by-text "Bob Smith")))
|
||||||
|
|
||||||
|
(h/test "Token view render"
|
||||||
|
(h/render [summary-tag/view
|
||||||
|
{:type :token
|
||||||
|
:label "1,000 SNT"
|
||||||
|
:image-source "path/to/token-image.png"}])
|
||||||
|
(h/is-truthy (h/get-by-text "1,000 SNT"))))
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
(ns quo.components.tags.summary-tag.style
|
||||||
|
(:require
|
||||||
|
[quo.foundations.colors :as colors]))
|
||||||
|
|
||||||
|
(defn main
|
||||||
|
[{:keys [type theme customization-color]}]
|
||||||
|
{:justify-content :center
|
||||||
|
:align-items :center
|
||||||
|
:height 32
|
||||||
|
:padding-left 4
|
||||||
|
:padding-right 10
|
||||||
|
:flex-direction :row
|
||||||
|
:border-radius (if (#{:account :collectible} type) 10 16)
|
||||||
|
:background-color (colors/resolve-color customization-color theme 10)})
|
||||||
|
|
||||||
|
(defn label
|
||||||
|
[type theme]
|
||||||
|
{:color (colors/theme-colors colors/neutral-100 colors/white theme)
|
||||||
|
:margin-left (if (= type :address) 6 4)})
|
||||||
|
|
||||||
|
(def collectible-image
|
||||||
|
{:width 24
|
||||||
|
:height 24
|
||||||
|
:border-radius 10})
|
||||||
|
|
||||||
|
(def token-image
|
||||||
|
{:width 24
|
||||||
|
:height 24
|
||||||
|
:border-radius 12})
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
(ns quo.components.tags.summary-tag.view
|
||||||
|
(:require
|
||||||
|
[quo.components.avatars.account-avatar.view :as account-avatar]
|
||||||
|
[quo.components.avatars.user-avatar.view :as user-avatar]
|
||||||
|
[quo.components.avatars.wallet-user-avatar.view :as wallet-user-avatar]
|
||||||
|
[quo.components.markdown.text :as text]
|
||||||
|
[quo.components.tags.summary-tag.style :as style]
|
||||||
|
[quo.foundations.colors :as colors]
|
||||||
|
[quo.theme :as quo.theme]
|
||||||
|
[react-native.core :as rn]))
|
||||||
|
|
||||||
|
(defn- left-view
|
||||||
|
[{:keys [label type customization-color emoji image-source]}]
|
||||||
|
(case type
|
||||||
|
:account
|
||||||
|
[account-avatar/view
|
||||||
|
{:customization-color customization-color
|
||||||
|
:size 24
|
||||||
|
:emoji emoji
|
||||||
|
:type :default}]
|
||||||
|
:network
|
||||||
|
[rn/image
|
||||||
|
{:source image-source
|
||||||
|
:style style/token-image}]
|
||||||
|
:saved-address
|
||||||
|
[wallet-user-avatar/wallet-user-avatar
|
||||||
|
{:full-name label
|
||||||
|
:size :size-24
|
||||||
|
:customization-color customization-color}]
|
||||||
|
:collectible
|
||||||
|
[rn/image
|
||||||
|
{:source image-source
|
||||||
|
:style style/collectible-image}]
|
||||||
|
:user
|
||||||
|
[user-avatar/user-avatar
|
||||||
|
{:full-name label
|
||||||
|
:size :xs
|
||||||
|
:profile-picture image-source
|
||||||
|
:customization-color customization-color}]
|
||||||
|
:token
|
||||||
|
[rn/image
|
||||||
|
{:source image-source
|
||||||
|
:style style/token-image}]
|
||||||
|
nil))
|
||||||
|
|
||||||
|
(defn- view-internal
|
||||||
|
"Options:
|
||||||
|
- :label - string - tag label
|
||||||
|
- :customization-color - color - It will be passed down to components that
|
||||||
|
should vary based on a custom color.
|
||||||
|
- :type - :token / :user / :collectible / :saved-address / :network / :account
|
||||||
|
- :emoji - string - emoji used for displaying account avatar
|
||||||
|
- :image-source - resource - image to display on :network, :collectible :user and :token
|
||||||
|
- :theme - :light / :dark"
|
||||||
|
[{:keys [label customization-color type theme]
|
||||||
|
:as props
|
||||||
|
:or {customization-color colors/neutral-80-opa-5}}]
|
||||||
|
[rn/view
|
||||||
|
{:accessibility-label :container
|
||||||
|
:style (style/main (assoc props :customization-color customization-color))}
|
||||||
|
[left-view props]
|
||||||
|
[text/text
|
||||||
|
{:style (style/label type theme)
|
||||||
|
:weight :semi-bold
|
||||||
|
:size :heading-1} label]])
|
||||||
|
|
||||||
|
(def view (quo.theme/with-theme view-internal))
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
[quo.components.markdown.text :as text]
|
[quo.components.markdown.text :as text]
|
||||||
[quo.components.tags.base-tag :as base-tag]
|
[quo.components.tags.base-tag :as base-tag]
|
||||||
[quo.foundations.colors :as colors]
|
[quo.foundations.colors :as colors]
|
||||||
[quo.theme :as theme]
|
[quo.theme]
|
||||||
[react-native.core :as rn]))
|
[react-native.core :as rn]))
|
||||||
|
|
||||||
(def themes
|
(def themes
|
||||||
@@ -66,54 +66,45 @@
|
|||||||
text-color)
|
text-color)
|
||||||
label])])
|
label])])
|
||||||
|
|
||||||
(defn tag
|
(defn tag-internal
|
||||||
"opts
|
"opts
|
||||||
{:type :icon/:emoji/:label
|
{:type :icon/:emoji/:label
|
||||||
:label string
|
:label string
|
||||||
:size 32/24
|
:size 32/24
|
||||||
:on-press fn
|
:on-press fn
|
||||||
:blurred? true/false
|
:blurred? true/false
|
||||||
:resource icon/image
|
:resource icon/image
|
||||||
:labelled? true/false
|
:labelled? true/false
|
||||||
:disabled? true/false}
|
:disabled? true/false}
|
||||||
|
|
||||||
opts
|
opts
|
||||||
- `blurred` boolean: use to determine border color if the background is blurred
|
- `blurred` boolean: use to determine border color if the background is blurred
|
||||||
- `type` can be icon or emoji with or without a tag label
|
- `type` can be icon or emoji with or without a tag label
|
||||||
- `labelled` boolean: is true if tag has label else false"
|
- `labelled` boolean: is true if tag has label else false"
|
||||||
[_ _]
|
[{:keys [id on-press disabled? size active accessibility-label label resource type
|
||||||
(fn
|
labelled? blurred? icon-color theme]
|
||||||
[{:keys [id
|
:or {size 32}}]
|
||||||
on-press
|
(let [state (cond
|
||||||
disabled?
|
disabled? :disabled
|
||||||
size
|
active :active
|
||||||
active
|
:else :default)
|
||||||
accessibility-label
|
{:keys [border-color
|
||||||
label
|
blurred-border-color
|
||||||
resource
|
text-color]} (get-in themes [theme state])]
|
||||||
type
|
[rn/view {:style {:align-items :center}}
|
||||||
labelled?
|
[base-tag/base-tag
|
||||||
blurred?
|
{:id id
|
||||||
icon-color
|
:size size
|
||||||
override-theme]
|
:border-width 1
|
||||||
:or {size 32}}]
|
:border-color (if blurred?
|
||||||
(let [state (cond disabled? :disabled
|
blurred-border-color
|
||||||
active :active
|
border-color)
|
||||||
:else :default)
|
:on-press on-press
|
||||||
{:keys [border-color blurred-border-color text-color]}
|
:accessibility-label accessibility-label
|
||||||
(get-in themes [(or override-theme (theme/get-theme)) state])]
|
:disabled? disabled?
|
||||||
[rn/view {:style {:align-items :center}}
|
:type type
|
||||||
[base-tag/base-tag
|
:labelled? (if (= type :label) true labelled?)}
|
||||||
{:id id
|
[tag-resources size type resource icon-color label text-color labelled?]]]))
|
||||||
:size size
|
|
||||||
:border-width 1
|
(def tag (quo.theme/with-theme tag-internal))
|
||||||
:border-color (if blurred?
|
|
||||||
blurred-border-color
|
|
||||||
border-color)
|
|
||||||
:on-press on-press
|
|
||||||
:accessibility-label accessibility-label
|
|
||||||
:disabled? disabled?
|
|
||||||
:type type
|
|
||||||
:labelled? (if (= type :label) true labelled?)}
|
|
||||||
[tag-resources size type resource icon-color label text-color labelled?]]])))
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
(ns quo.components.text-combinations.channel-name.component-spec
|
||||||
|
(:require [quo.components.text-combinations.channel-name.view :as channel-name]
|
||||||
|
[test-helpers.component :as h]))
|
||||||
|
|
||||||
|
(h/describe "Channel name"
|
||||||
|
(h/test "Renders Default"
|
||||||
|
(h/render [channel-name/view {:channel-name "Test channel"}])
|
||||||
|
(h/is-truthy (h/get-by-text "# Test channel")))
|
||||||
|
|
||||||
|
(h/test "Renders unlocked icon"
|
||||||
|
(h/render [channel-name/view
|
||||||
|
{:channel-name "Test channel"
|
||||||
|
:unlocked? true}])
|
||||||
|
(h/is-truthy (h/get-by-label-text :channel-name-unlocked-icon)))
|
||||||
|
|
||||||
|
(h/test "Renders muted icon"
|
||||||
|
(h/render [channel-name/view
|
||||||
|
{:channel-name "Test channel"
|
||||||
|
:muted? true}])
|
||||||
|
(h/is-truthy (h/get-by-label-text :channel-name-muted-icon)))
|
||||||
|
|
||||||
|
(h/test "Renders muted and unlocked icon"
|
||||||
|
(h/render [channel-name/view
|
||||||
|
{:channel-name "Test channel"
|
||||||
|
:muted? true
|
||||||
|
:unlocked? true}])
|
||||||
|
(h/is-truthy (h/get-by-label-text :channel-name-unlocked-icon))
|
||||||
|
(h/is-truthy (h/get-by-label-text :channel-name-muted-icon))))
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
(ns quo.components.text-combinations.channel-name.style
|
||||||
|
(:require [quo.foundations.colors :as colors]))
|
||||||
|
|
||||||
|
(def container {:flex-direction :row})
|
||||||
|
|
||||||
|
(def icons-container
|
||||||
|
{:flex-direction :row
|
||||||
|
:padding-top 8
|
||||||
|
:padding-bottom 4
|
||||||
|
:margin-left 6})
|
||||||
|
|
||||||
|
(def icon {:width 20 :height 20})
|
||||||
|
|
||||||
|
(def icons-gap {:width 4})
|
||||||
|
|
||||||
|
(defn- blur-icon-color
|
||||||
|
[theme]
|
||||||
|
(colors/theme-colors colors/neutral-80-opa-40 colors/white-opa-40 theme))
|
||||||
|
|
||||||
|
(defn unlocked-icon-color
|
||||||
|
[theme blur?]
|
||||||
|
(if blur?
|
||||||
|
(blur-icon-color theme)
|
||||||
|
(colors/theme-colors colors/neutral-50 colors/neutral-40 theme)))
|
||||||
|
|
||||||
|
(defn muted-icon-color
|
||||||
|
[theme blur?]
|
||||||
|
(if blur?
|
||||||
|
(blur-icon-color theme)
|
||||||
|
(colors/theme-colors colors/neutral-40 colors/neutral-60 theme)))
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
(ns quo.components.text-combinations.channel-name.view
|
||||||
|
(:require [quo.components.icon :as icon]
|
||||||
|
[quo.components.markdown.text :as text]
|
||||||
|
[quo.components.text-combinations.channel-name.style :as style]
|
||||||
|
[quo.theme]
|
||||||
|
[react-native.core :as rn]))
|
||||||
|
|
||||||
|
(defn icons
|
||||||
|
[{:keys [theme unlocked? muted? blur?]}]
|
||||||
|
[rn/view {:style style/icons-container}
|
||||||
|
(when unlocked?
|
||||||
|
[rn/view
|
||||||
|
{:style style/icon
|
||||||
|
:accessibility-label :channel-name-unlocked-icon}
|
||||||
|
[icon/icon :i/unlocked
|
||||||
|
{:color (style/unlocked-icon-color theme blur?)
|
||||||
|
:size 20}]])
|
||||||
|
|
||||||
|
(when (and unlocked? muted?)
|
||||||
|
[rn/view {:style style/icons-gap}])
|
||||||
|
|
||||||
|
(when muted?
|
||||||
|
[rn/view
|
||||||
|
{:style style/icon
|
||||||
|
:accessibility-label :channel-name-muted-icon}
|
||||||
|
[icon/icon :i/muted
|
||||||
|
{:color (style/muted-icon-color theme blur?)
|
||||||
|
:size 20}]])])
|
||||||
|
|
||||||
|
(defn- view-internal
|
||||||
|
[{:keys [unlocked? muted? channel-name] :as props}]
|
||||||
|
[rn/view {:style style/container}
|
||||||
|
[text/text
|
||||||
|
{:size :heading-1
|
||||||
|
:weight :semi-bold}
|
||||||
|
(str "# " channel-name)]
|
||||||
|
(when (or unlocked? muted?)
|
||||||
|
[icons props])])
|
||||||
|
|
||||||
|
(def view (quo.theme/with-theme view-internal))
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
(ns quo.components.text-combinations.standard-title.component-spec
|
||||||
|
(:require [quo.components.text-combinations.standard-title.view :as standard-title]
|
||||||
|
[test-helpers.component :as h]))
|
||||||
|
|
||||||
|
(h/describe "Text combinations - Standard title"
|
||||||
|
(h/test "Default render"
|
||||||
|
(h/render [standard-title/view {:title "This is a title"}])
|
||||||
|
(h/is-truthy (h/get-by-text "This is a title")))
|
||||||
|
|
||||||
|
(h/test "Counter variant"
|
||||||
|
(h/render [standard-title/view
|
||||||
|
{:title "This is a title"
|
||||||
|
:right :counter
|
||||||
|
:counter-left 50
|
||||||
|
:counter-right 100}])
|
||||||
|
(h/is-truthy (h/get-by-text "50/100")))
|
||||||
|
|
||||||
|
(h/describe "Action variant"
|
||||||
|
(h/test "Default render"
|
||||||
|
(let [on-press-fn (h/mock-fn)]
|
||||||
|
(h/render [standard-title/view
|
||||||
|
{:title "This is a title"
|
||||||
|
:right :action
|
||||||
|
:on-press on-press-fn}])
|
||||||
|
(h/is-truthy (h/get-by-text "This is a title"))))
|
||||||
|
|
||||||
|
(h/test "Action fired"
|
||||||
|
(let [on-press-fn (h/mock-fn)]
|
||||||
|
(h/render [standard-title/view
|
||||||
|
{:title "This is a title"
|
||||||
|
:right :action
|
||||||
|
:on-press on-press-fn}])
|
||||||
|
|
||||||
|
(h/fire-event :on-press (h/get-by-label-text :standard-title-action))
|
||||||
|
(h/was-called-times on-press-fn 1))))
|
||||||
|
|
||||||
|
(h/describe "Tag variant"
|
||||||
|
(h/test "Default render"
|
||||||
|
(h/render [standard-title/view
|
||||||
|
{:title "This is a title"
|
||||||
|
:right :tag}])
|
||||||
|
(h/is-truthy (h/get-by-text "This is a title")))
|
||||||
|
|
||||||
|
(h/test "Tag callback fired"
|
||||||
|
(let [on-press-fn (h/mock-fn)]
|
||||||
|
(h/render [standard-title/view
|
||||||
|
{:title "This is a title"
|
||||||
|
:right :tag
|
||||||
|
:on-press on-press-fn}])
|
||||||
|
(h/fire-event :on-press (h/get-by-label-text :standard-title-tag))
|
||||||
|
(h/was-called-times on-press-fn 1)))))
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
(ns quo.components.text-combinations.standard-title.style
|
||||||
|
(:require [quo.foundations.colors :as colors]))
|
||||||
|
|
||||||
|
(def container
|
||||||
|
{:flex-direction :row
|
||||||
|
:justify-content :space-between})
|
||||||
|
|
||||||
|
(def right-container {:margin-left 20})
|
||||||
|
|
||||||
|
(def right-counter
|
||||||
|
{:padding-top 12
|
||||||
|
:padding-bottom 2})
|
||||||
|
|
||||||
|
(defn right-counter-text
|
||||||
|
[blur? theme]
|
||||||
|
{:color (if blur?
|
||||||
|
(colors/theme-colors colors/neutral-80-opa-40 colors/white-opa-40 theme)
|
||||||
|
(colors/theme-colors colors/neutral-40 colors/neutral-50 theme))})
|
||||||
|
|
||||||
|
(defn right-tag-icon-color
|
||||||
|
[blur? theme]
|
||||||
|
(if blur?
|
||||||
|
(colors/theme-colors colors/neutral-80-opa-70 colors/white-opa-70 theme)
|
||||||
|
(colors/theme-colors colors/neutral-50 colors/neutral-40 theme)))
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
(ns quo.components.text-combinations.standard-title.view
|
||||||
|
(:require [clojure.string :as string]
|
||||||
|
[quo.components.buttons.button.view :as button]
|
||||||
|
[quo.components.markdown.text :as text]
|
||||||
|
[quo.components.tags.tag :as tag]
|
||||||
|
[quo.components.text-combinations.standard-title.style :as style]
|
||||||
|
[quo.theme]
|
||||||
|
[react-native.core :as rn]
|
||||||
|
[utils.number]))
|
||||||
|
|
||||||
|
(defn- get-counter-number
|
||||||
|
[n]
|
||||||
|
(let [parsed-number (utils.number/parse-int n)]
|
||||||
|
(if (< n 10)
|
||||||
|
(str "0" parsed-number)
|
||||||
|
parsed-number)))
|
||||||
|
|
||||||
|
(defn- right-counter
|
||||||
|
[{:keys [blur? theme counter-left counter-right]}]
|
||||||
|
[rn/view {:style style/right-counter}
|
||||||
|
[text/text
|
||||||
|
{:size :paragraph-2
|
||||||
|
:weight :regular
|
||||||
|
:style (style/right-counter-text blur? theme)}
|
||||||
|
(str (get-counter-number counter-left)
|
||||||
|
"/"
|
||||||
|
(get-counter-number counter-right))]])
|
||||||
|
|
||||||
|
(defn- right-action
|
||||||
|
[{:keys [customization-color on-press icon]
|
||||||
|
:or {icon :i/placeholder}}]
|
||||||
|
[button/button
|
||||||
|
{:accessibility-label :standard-title-action
|
||||||
|
:size 32
|
||||||
|
:icon-only? true
|
||||||
|
:customization-color customization-color
|
||||||
|
:on-press on-press}
|
||||||
|
icon])
|
||||||
|
|
||||||
|
(defn- right-tag
|
||||||
|
[{:keys [theme blur? on-press icon label]
|
||||||
|
:or {icon :i/placeholder}}]
|
||||||
|
(let [labelled? (not (string/blank? label))]
|
||||||
|
[tag/tag
|
||||||
|
{:accessibility-label :standard-title-tag
|
||||||
|
:size 32
|
||||||
|
:type :icon
|
||||||
|
:resource icon
|
||||||
|
:on-press on-press
|
||||||
|
:labelled? labelled?
|
||||||
|
:label (when labelled? label)
|
||||||
|
:blurred? blur?
|
||||||
|
:icon-color (style/right-tag-icon-color blur? theme)}]))
|
||||||
|
|
||||||
|
(defn- view-internal
|
||||||
|
[{:keys [title right] :as props}]
|
||||||
|
[rn/view {:style style/container}
|
||||||
|
[text/text {:size :heading-1 :weight :semi-bold}
|
||||||
|
title]
|
||||||
|
(when right
|
||||||
|
[rn/view {:style style/right-container}
|
||||||
|
(case right
|
||||||
|
:counter [right-counter props]
|
||||||
|
:action [right-action props]
|
||||||
|
:tag [right-tag props]
|
||||||
|
nil)])])
|
||||||
|
|
||||||
|
(def view (quo.theme/with-theme view-internal))
|
||||||
@@ -9,3 +9,8 @@
|
|||||||
|
|
||||||
(def description-description-text
|
(def description-description-text
|
||||||
{:margin-top 8})
|
{:margin-top 8})
|
||||||
|
|
||||||
|
(def emoji-hash
|
||||||
|
{:margin-top 8
|
||||||
|
:letter-spacing 0.5
|
||||||
|
:line-height 20.5})
|
||||||
|
|||||||
@@ -27,7 +27,8 @@
|
|||||||
description-accessibility-label
|
description-accessibility-label
|
||||||
button-icon
|
button-icon
|
||||||
button-on-press
|
button-on-press
|
||||||
customization-color]}]
|
customization-color
|
||||||
|
emoji-hash]}]
|
||||||
[rn/view {:style container-style}
|
[rn/view {:style container-style}
|
||||||
[rn/view
|
[rn/view
|
||||||
{:style {:flex-direction :row
|
{:style {:flex-direction :row
|
||||||
@@ -55,6 +56,11 @@
|
|||||||
:weight :regular
|
:weight :regular
|
||||||
:size :paragraph-1
|
:size :paragraph-1
|
||||||
:style style/description-description-text}
|
:style style/description-description-text}
|
||||||
description])])
|
description])
|
||||||
|
(when emoji-hash
|
||||||
|
[text/text
|
||||||
|
{:number-of-lines 1
|
||||||
|
:style style/emoji-hash}
|
||||||
|
emoji-hash])])
|
||||||
|
|
||||||
(def view (theme/with-theme view-internal))
|
(def view (theme/with-theme view-internal))
|
||||||
|
|||||||
@@ -20,12 +20,13 @@
|
|||||||
(i18n/label :t/trip-accounts))])
|
(i18n/label :t/trip-accounts))])
|
||||||
|
|
||||||
(defn- row-icon
|
(defn- row-icon
|
||||||
[profile-picture type secondary-color]
|
[customization-color profile-picture type secondary-color]
|
||||||
(case type
|
(case type
|
||||||
:default-keypair [user-avatar/user-avatar
|
:default-keypair [user-avatar/user-avatar
|
||||||
{:size :xxs
|
{:size :xxs
|
||||||
:ring? false
|
:ring? false
|
||||||
:profile-picture profile-picture}]
|
:customization-color customization-color
|
||||||
|
:profile-picture profile-picture}]
|
||||||
:recovery-phrase [icons/icon
|
:recovery-phrase [icons/icon
|
||||||
:i/seed
|
:i/seed
|
||||||
{:accessibility-label :recovery-phrase-icon
|
{:accessibility-label :recovery-phrase-icon
|
||||||
@@ -41,10 +42,11 @@
|
|||||||
nil))
|
nil))
|
||||||
|
|
||||||
(defn- row-view
|
(defn- row-view
|
||||||
[{:keys [type theme secondary-color profile-picture title stored subtitle on-press]}]
|
[{:keys [type theme secondary-color customization-color profile-picture title stored subtitle
|
||||||
|
on-press]}]
|
||||||
[rn/view {:style (style/row-container type theme)}
|
[rn/view {:style (style/row-container type theme)}
|
||||||
[rn/view {:style style/icon-container}
|
[rn/view {:style style/icon-container}
|
||||||
[row-icon profile-picture type secondary-color]]
|
[row-icon customization-color profile-picture type secondary-color]]
|
||||||
[rn/view
|
[rn/view
|
||||||
{:style style/row-content-container}
|
{:style style/row-content-container}
|
||||||
[row-title type title]
|
[row-title type title]
|
||||||
@@ -68,18 +70,19 @@
|
|||||||
{:color secondary-color}]])])
|
{:color secondary-color}]])])
|
||||||
|
|
||||||
(defn- list-view
|
(defn- list-view
|
||||||
[{:keys [type stored profile-picture user-name theme secondary-color]}]
|
[{:keys [type stored customization-color profile-picture user-name theme secondary-color]}]
|
||||||
(let [stored-name (if (= :on-device stored)
|
(let [stored-name (if (= :on-device stored)
|
||||||
(i18n/label :t/on-device)
|
(i18n/label :t/on-device)
|
||||||
(i18n/label :t/on-keycard))]
|
(i18n/label :t/on-keycard))]
|
||||||
[row-view
|
[row-view
|
||||||
{:type type
|
{:type type
|
||||||
:stored stored
|
:stored stored
|
||||||
:profile-picture profile-picture
|
:customization-color customization-color
|
||||||
:title user-name
|
:profile-picture profile-picture
|
||||||
:subtitle stored-name
|
:title user-name
|
||||||
:theme theme
|
:subtitle stored-name
|
||||||
:secondary-color secondary-color}]))
|
:theme theme
|
||||||
|
:secondary-color secondary-color}]))
|
||||||
|
|
||||||
(defn- card-view
|
(defn- card-view
|
||||||
[theme derivation-path secondary-color on-press]
|
[theme derivation-path secondary-color on-press]
|
||||||
@@ -105,12 +108,13 @@
|
|||||||
|
|
||||||
(def view
|
(def view
|
||||||
"Create an account-origin UI component.
|
"Create an account-origin UI component.
|
||||||
| key | values |
|
| key | values |
|
||||||
| ------------------|------------------------------------------------|
|
| ----------------------|------------------------------------------------|
|
||||||
| :type | :default-keypair :recovery-phrase :private-key
|
| :type | :default-keypair :recovery-phrase :private-key
|
||||||
| :stored | :on-device :on-keycard
|
| :stored | :on-device :on-keycard
|
||||||
| :profile-picture | image source
|
| :profile-picture | image source
|
||||||
| :derivation-path | string
|
| :customization-color | profile color
|
||||||
| :user-name | string
|
| :derivation-path | string
|
||||||
| :on-press | function"
|
| :user-name | string
|
||||||
|
| :on-press | function"
|
||||||
(quo.theme/with-theme view-internal))
|
(quo.theme/with-theme view-internal))
|
||||||
|
|||||||
@@ -133,7 +133,7 @@
|
|||||||
| key | description |
|
| key | description |
|
||||||
| -------------|-------------|
|
| -------------|-------------|
|
||||||
| `:account-name` | A value representing the account name (default `nil`)
|
| `:account-name` | A value representing the account name (default `nil`)
|
||||||
| `:account` | A value that represents if the account is a `:watched-account` or a `:default` account. (default `nil`)
|
| `:account` | A value that represents if the account is a `:watched-address` or a `:default` account. (default `nil`)
|
||||||
| `:time-frame` | A value that represents the type of the timeframe, Can be from a preset of time frames. `[:1-week :1-month :3-months :1-year :custom]` (default `nil`) if custom is set, We expect a start time and if there's a space between two times that are in `time-frame-string` we'll split them with an arrow to the right icon
|
| `:time-frame` | A value that represents the type of the timeframe, Can be from a preset of time frames. `[:1-week :1-month :3-months :1-year :custom]` (default `nil`) if custom is set, We expect a start time and if there's a space between two times that are in `time-frame-string` we'll split them with an arrow to the right icon
|
||||||
| `:loading?` | A value that indicates that component is loading data. (default `nil`)
|
| `:loading?` | A value that indicates that component is loading data. (default `nil`)
|
||||||
| `:metrics` | A value that indicates if the account value have increased can be `:positive` or `:negative` (default `nil`)
|
| `:metrics` | A value that indicates if the account value have increased can be `:positive` or `:negative` (default `nil`)
|
||||||
|
|||||||
@@ -28,3 +28,9 @@
|
|||||||
{:flex-direction :row
|
{:flex-direction :row
|
||||||
:align-items :center
|
:align-items :center
|
||||||
:justify-content :space-between})
|
:justify-content :space-between})
|
||||||
|
|
||||||
|
(defn subtitle
|
||||||
|
[blur? theme]
|
||||||
|
{:color (if blur?
|
||||||
|
colors/white-opa-40
|
||||||
|
(colors/theme-colors colors/neutral-50 colors/neutral-40 theme))})
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
[quo.foundations.colors :as colors]
|
[quo.foundations.colors :as colors]
|
||||||
[quo.theme :as quo.theme]
|
[quo.theme :as quo.theme]
|
||||||
[react-native.core :as rn]
|
[react-native.core :as rn]
|
||||||
|
[react-native.platform :as platform]
|
||||||
[reagent.core :as reagent]
|
[reagent.core :as reagent]
|
||||||
[utils.i18n :as i18n]))
|
[utils.i18n :as i18n]))
|
||||||
|
|
||||||
@@ -19,11 +20,6 @@
|
|||||||
(let [first-name (first (string/split full-name #" "))]
|
(let [first-name (first (string/split full-name #" "))]
|
||||||
(i18n/label :t/keypair-title {:name first-name})))
|
(i18n/label :t/keypair-title {:name first-name})))
|
||||||
|
|
||||||
(defn details-string
|
|
||||||
[address stored]
|
|
||||||
(str (when address (str address " ∙ "))
|
|
||||||
(if (= stored :on-device) (i18n/label :t/on-device) (i18n/label :t/on-keycard))))
|
|
||||||
|
|
||||||
(defn avatar
|
(defn avatar
|
||||||
[{{:keys [full-name]} :details
|
[{{:keys [full-name]} :details
|
||||||
avatar-type :type
|
avatar-type :type
|
||||||
@@ -67,15 +63,21 @@
|
|||||||
[{:keys [details stored blur? theme]}]
|
[{:keys [details stored blur? theme]}]
|
||||||
(let [{:keys [address]} details]
|
(let [{:keys [address]} details]
|
||||||
[rn/view
|
[rn/view
|
||||||
{:style {:flex-direction :row
|
{:style {:flex-direction :row
|
||||||
:align-items :center}}
|
:align-items :center}
|
||||||
|
:accessibility-label :details}
|
||||||
[text/text
|
[text/text
|
||||||
{:size :paragraph-2
|
{:size :paragraph-2
|
||||||
:accessibility-label :details
|
:style (style/subtitle blur? theme)}
|
||||||
:style {:color (if blur?
|
address]
|
||||||
colors/white-opa-40
|
[text/text
|
||||||
(colors/theme-colors colors/neutral-50 colors/neutral-40 theme))}}
|
{:size :paragraph-2
|
||||||
(details-string address stored)]
|
:style (merge (style/subtitle blur? theme) {:bottom (if platform/ios? 2 -2)})}
|
||||||
|
" ∙ "]
|
||||||
|
[text/text
|
||||||
|
{:size :paragraph-2
|
||||||
|
:style (style/subtitle blur? theme)}
|
||||||
|
(if (= stored :on-device) (i18n/label :t/on-device) (i18n/label :t/on-keycard))]
|
||||||
(when (= stored :on-keycard)
|
(when (= stored :on-keycard)
|
||||||
[rn/view {:style {:margin-left 4}}
|
[rn/view {:style {:margin-left 4}}
|
||||||
[icon/icon :i/keycard-card
|
[icon/icon :i/keycard-card
|
||||||
|
|||||||
@@ -15,18 +15,26 @@
|
|||||||
|
|
||||||
(defn calc-value
|
(defn calc-value
|
||||||
[crypto? currency token value conversion]
|
[crypto? currency token value conversion]
|
||||||
(if crypto?
|
(let [num-value (if (string? value) (parse-double (or value "0")) value)]
|
||||||
(str (get common/currency-label currency) (.toFixed (* value conversion) 2))
|
(if crypto?
|
||||||
(str (.toFixed (/ value conversion) 2) " " (string/upper-case (clj->js token)))))
|
(str (get common/currency-label currency) (.toFixed (* num-value conversion) 2))
|
||||||
|
(str (.toFixed (/ num-value conversion) 2) " " (string/upper-case (or (clj->js token) ""))))))
|
||||||
|
|
||||||
(defn- view-internal
|
(defn- view-internal
|
||||||
[]
|
[{external-value :value}]
|
||||||
(let [width (:width (rn/get-window))
|
(let [width (:width (rn/get-window))
|
||||||
value (reagent/atom 0)
|
value (reagent/atom nil)
|
||||||
crypto? (reagent/atom true)
|
crypto? (reagent/atom true)
|
||||||
input-ref (atom nil)]
|
input-ref (atom nil)
|
||||||
(fn [{:keys [theme token currency conversion networks title customization-color]}]
|
controlled-input? (some? external-value)]
|
||||||
[rn/view {:style (style/main-container width)}
|
(fn [{:keys [theme token currency conversion networks title customization-color
|
||||||
|
on-change-text on-swap container-style show-keyboard?]
|
||||||
|
:or {show-keyboard? true}
|
||||||
|
external-value :value}]
|
||||||
|
[rn/view
|
||||||
|
{:style (merge
|
||||||
|
(style/main-container width)
|
||||||
|
container-style)}
|
||||||
[rn/view {:style style/amount-container}
|
[rn/view {:style style/amount-container}
|
||||||
[rn/pressable
|
[rn/pressable
|
||||||
{:on-press #(when @input-ref (.focus ^js @input-ref))
|
{:on-press #(when @input-ref (.focus ^js @input-ref))
|
||||||
@@ -37,27 +45,39 @@
|
|||||||
{:style style/token
|
{:style style/token
|
||||||
:source (resources/get-token token)}]
|
:source (resources/get-token token)}]
|
||||||
[rn/text-input
|
[rn/text-input
|
||||||
{:ref #(reset! input-ref %)
|
(cond-> {:auto-focus true
|
||||||
:placeholder "0"
|
:ref #(reset! input-ref %)
|
||||||
:placeholder-text-color (colors/theme-colors colors/neutral-40 colors/neutral-50 theme)
|
:placeholder "0"
|
||||||
:keyboard-type :numeric
|
:placeholder-text-color (colors/theme-colors colors/neutral-40
|
||||||
:max-length 12
|
colors/neutral-50
|
||||||
:default-value @value
|
theme)
|
||||||
:on-change-text #(reset! value %)
|
:keyboard-type :numeric
|
||||||
:style (style/text-input theme)
|
:max-length 12
|
||||||
:selection-color customization-color}]
|
:on-change-text (fn [v]
|
||||||
|
(when-not controlled-input?
|
||||||
|
(reset! value v))
|
||||||
|
(when on-change-text
|
||||||
|
(on-change-text v)))
|
||||||
|
:style (style/text-input theme)
|
||||||
|
:selection-color customization-color
|
||||||
|
:show-soft-input-on-focus show-keyboard?}
|
||||||
|
controlled-input? (assoc :value external-value)
|
||||||
|
(not controlled-input?) (assoc :default-value @value))]
|
||||||
[text/text
|
[text/text
|
||||||
{:size :paragraph-2
|
{:size :paragraph-2
|
||||||
:weight :semi-bold
|
:weight :semi-bold
|
||||||
:style {:color (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)
|
:style {:color (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)
|
||||||
:margin-right 8
|
:margin-right 8
|
||||||
:padding-bottom 2}}
|
:padding-bottom 2}}
|
||||||
(string/upper-case (clj->js (if @crypto? token currency)))]]
|
(string/upper-case (or (clj->js (if @crypto? token currency)) ""))]]
|
||||||
[button/button
|
[button/button
|
||||||
{:icon true
|
{:icon true
|
||||||
:icon-only? true
|
:icon-only? true
|
||||||
:size 32
|
:size 32
|
||||||
:on-press #(swap! crypto? not)
|
:on-press (fn []
|
||||||
|
(swap! crypto? not)
|
||||||
|
(when on-swap
|
||||||
|
(on-swap @crypto?)))
|
||||||
:type :outline
|
:type :outline
|
||||||
:accessibility-label :reorder}
|
:accessibility-label :reorder}
|
||||||
:i/reorder]]
|
:i/reorder]]
|
||||||
@@ -68,6 +88,6 @@
|
|||||||
{:size :paragraph-2
|
{:size :paragraph-2
|
||||||
:weight :medium
|
:weight :medium
|
||||||
:style {:color (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)}}
|
:style {:color (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)}}
|
||||||
(calc-value @crypto? currency token @value conversion)]]])))
|
(calc-value @crypto? currency token (or external-value @value) conversion)]]])))
|
||||||
|
|
||||||
(def view (quo.theme/with-theme view-internal))
|
(def view (quo.theme/with-theme view-internal))
|
||||||
|
|||||||
@@ -48,6 +48,7 @@
|
|||||||
quo.components.drawers.drawer-buttons.view
|
quo.components.drawers.drawer-buttons.view
|
||||||
quo.components.drawers.drawer-top.view
|
quo.components.drawers.drawer-top.view
|
||||||
quo.components.drawers.permission-context.view
|
quo.components.drawers.permission-context.view
|
||||||
|
quo.components.dropdowns.dropdown-input.view
|
||||||
quo.components.dropdowns.dropdown.view
|
quo.components.dropdowns.dropdown.view
|
||||||
quo.components.dropdowns.network-dropdown.view
|
quo.components.dropdowns.network-dropdown.view
|
||||||
quo.components.empty-state.empty-state.view
|
quo.components.empty-state.empty-state.view
|
||||||
@@ -65,6 +66,7 @@
|
|||||||
quo.components.inputs.recovery-phrase.view
|
quo.components.inputs.recovery-phrase.view
|
||||||
quo.components.inputs.search-input.view
|
quo.components.inputs.search-input.view
|
||||||
quo.components.inputs.title-input.view
|
quo.components.inputs.title-input.view
|
||||||
|
quo.components.ios.drawer-bar.view
|
||||||
quo.components.keycard.view
|
quo.components.keycard.view
|
||||||
quo.components.links.link-preview.view
|
quo.components.links.link-preview.view
|
||||||
quo.components.links.url-preview-list.view
|
quo.components.links.url-preview-list.view
|
||||||
@@ -100,6 +102,7 @@
|
|||||||
quo.components.numbered-keyboard.keyboard-key.view
|
quo.components.numbered-keyboard.keyboard-key.view
|
||||||
quo.components.numbered-keyboard.numbered-keyboard.view
|
quo.components.numbered-keyboard.numbered-keyboard.view
|
||||||
quo.components.onboarding.small-option-card.view
|
quo.components.onboarding.small-option-card.view
|
||||||
|
quo.components.overlay.view
|
||||||
quo.components.password.tips.view
|
quo.components.password.tips.view
|
||||||
quo.components.profile.collectible.view
|
quo.components.profile.collectible.view
|
||||||
quo.components.profile.profile-card.view
|
quo.components.profile.profile-card.view
|
||||||
@@ -131,10 +134,13 @@
|
|||||||
quo.components.tags.number-tag.view
|
quo.components.tags.number-tag.view
|
||||||
quo.components.tags.permission-tag
|
quo.components.tags.permission-tag
|
||||||
quo.components.tags.status-tags
|
quo.components.tags.status-tags
|
||||||
|
quo.components.tags.summary-tag.view
|
||||||
quo.components.tags.tag
|
quo.components.tags.tag
|
||||||
quo.components.tags.tags
|
quo.components.tags.tags
|
||||||
quo.components.tags.tiny-tag.view
|
quo.components.tags.tiny-tag.view
|
||||||
quo.components.tags.token-tag.view
|
quo.components.tags.token-tag.view
|
||||||
|
quo.components.text-combinations.channel-name.view
|
||||||
|
quo.components.text-combinations.standard-title.view
|
||||||
quo.components.text-combinations.view
|
quo.components.text-combinations.view
|
||||||
quo.components.wallet.account-card.view
|
quo.components.wallet.account-card.view
|
||||||
quo.components.wallet.account-origin.view
|
quo.components.wallet.account-origin.view
|
||||||
@@ -211,7 +217,7 @@
|
|||||||
|
|
||||||
;;;; Counter
|
;;;; Counter
|
||||||
(def counter quo.components.counter.counter.view/view)
|
(def counter quo.components.counter.counter.view/view)
|
||||||
(def step quo.components.counter.step.view/view)
|
(def step #'quo.components.counter.step.view/view)
|
||||||
|
|
||||||
;;;; Dividers
|
;;;; Dividers
|
||||||
(def divider-label quo.components.dividers.divider-label.view/view)
|
(def divider-label quo.components.dividers.divider-label.view/view)
|
||||||
@@ -230,6 +236,7 @@
|
|||||||
|
|
||||||
;;;; Dropdowns
|
;;;; Dropdowns
|
||||||
(def dropdown quo.components.dropdowns.dropdown.view/view)
|
(def dropdown quo.components.dropdowns.dropdown.view/view)
|
||||||
|
(def dropdown-input quo.components.dropdowns.dropdown-input.view/view)
|
||||||
(def network-dropdown quo.components.dropdowns.network-dropdown.view/view)
|
(def network-dropdown quo.components.dropdowns.network-dropdown.view/view)
|
||||||
|
|
||||||
;;;; Empty State
|
;;;; Empty State
|
||||||
@@ -262,6 +269,9 @@
|
|||||||
(def search-input quo.components.inputs.search-input.view/search-input)
|
(def search-input quo.components.inputs.search-input.view/search-input)
|
||||||
(def title-input quo.components.inputs.title-input.view/view)
|
(def title-input quo.components.inputs.title-input.view/view)
|
||||||
|
|
||||||
|
;;;; iOS
|
||||||
|
(def drawer-bar quo.components.ios.drawer-bar.view/view)
|
||||||
|
|
||||||
;;;; Numbered Keyboard
|
;;;; Numbered Keyboard
|
||||||
(def keyboard-key quo.components.numbered-keyboard.keyboard-key.view/view)
|
(def keyboard-key quo.components.numbered-keyboard.keyboard-key.view/view)
|
||||||
(def numbered-keyboard quo.components.numbered-keyboard.numbered-keyboard.view/view)
|
(def numbered-keyboard quo.components.numbered-keyboard.numbered-keyboard.view/view)
|
||||||
@@ -312,6 +322,9 @@
|
|||||||
(def notification quo.components.notifications.notification.view/notification)
|
(def notification quo.components.notifications.notification.view/notification)
|
||||||
(def toast quo.components.notifications.toast.view/toast)
|
(def toast quo.components.notifications.toast.view/toast)
|
||||||
|
|
||||||
|
;;;; Overlay
|
||||||
|
(def overlay quo.components.overlay.view/view)
|
||||||
|
|
||||||
;;;; Password
|
;;;; Password
|
||||||
(def tips quo.components.password.tips.view/view)
|
(def tips quo.components.password.tips.view/view)
|
||||||
|
|
||||||
@@ -360,12 +373,15 @@
|
|||||||
(def number-tag quo.components.tags.number-tag.view/view)
|
(def number-tag quo.components.tags.number-tag.view/view)
|
||||||
(def permission-tag quo.components.tags.permission-tag/tag)
|
(def permission-tag quo.components.tags.permission-tag/tag)
|
||||||
(def status-tag quo.components.tags.status-tags/status-tag)
|
(def status-tag quo.components.tags.status-tags/status-tag)
|
||||||
|
(def summary-tag quo.components.tags.summary-tag.view/view)
|
||||||
(def tag quo.components.tags.tag/tag)
|
(def tag quo.components.tags.tag/tag)
|
||||||
(def tags quo.components.tags.tags/tags)
|
(def tags quo.components.tags.tags/tags)
|
||||||
(def tiny-tag quo.components.tags.tiny-tag.view/view)
|
(def tiny-tag quo.components.tags.tiny-tag.view/view)
|
||||||
(def token-tag quo.components.tags.token-tag.view/view)
|
(def token-tag quo.components.tags.token-tag.view/view)
|
||||||
|
|
||||||
;;;; Text combinations
|
;;;; Text combinations
|
||||||
|
(def channel-name quo.components.text-combinations.channel-name.view/view)
|
||||||
|
(def standard-title quo.components.text-combinations.standard-title.view/view)
|
||||||
(def text-combinations quo.components.text-combinations.view/view)
|
(def text-combinations quo.components.text-combinations.view/view)
|
||||||
|
|
||||||
;;;; Wallet
|
;;;; Wallet
|
||||||
|
|||||||