Compare commits

..
28 Commits
Author SHA1 Message Date
ibrkhalil 757d731eed Show community members if a member permission doesn't exist 2024-05-11 10:31:56 +03:00
ibrkhalil 7b536451ef Fix component tests 2024-05-11 07:25:42 +03:00
ibrkhalil 13febab085 Rebase 2024-05-11 07:25:42 +03:00
ibrkhalil 7a3652c8eb Less confusion 2024-05-11 07:25:41 +03:00
ibrkhalil 925bf82621 Chus idea, hide count by default until community data is in app-db if the data doesn't exist 2024-05-11 07:25:41 +03:00
ibrkhalil d1c36e32c7 clean 2024-05-11 07:25:40 +03:00
ibrkhalil 248354e868 Directory changes and following guidelines 2024-05-11 07:25:39 +03:00
ibrkhalil d2fc803f47 grammar 2024-05-11 07:25:39 +03:00
ibrkhalil 641523f011 Update case information 2024-05-11 07:25:38 +03:00
ibrkhalil af993cc227 Update KNOWN_ISSUES.md 2024-05-11 07:25:38 +03:00
Ibrahem Khalil 3c36577e26 clean 2024-05-11 07:25:37 +03:00
Ibrahem Khalil 9bc9998b49 clean 2024-05-11 07:25:37 +03:00
Ibrahem Khalil aa1ce42079 clean 2024-05-11 07:25:36 +03:00
Ibrahem Khalil cabe377938 clean 2024-05-11 07:25:36 +03:00
Ibrahem Khalil 5e5989ffa7 Hide member count on token-gated community link preview 2024-05-11 07:25:35 +03:00
Icaro Motta 22392464e0 Don't preload user & dev.user namespaces (#19985)
Reverts the preloading mechanism from PR
https://github.com/status-im/status-mobile/pull/19927, which introduced a
problem I couldn't find any satisfactory solution. The namespaces user and
dev.user were being preloaded by shadow-cljs, but the problem is that preloading
will fail if those namespaces don't exist in your file system.

I couldn't find any solution to conditionally preload namespaces via shadow-cljs
and ClojureScript unfortunately doesn't support conditional requires like
Clojure.

At least we got to keep the code to not lint them and the whole idea to start to
commit dev-only code inside src/dev/.
2024-05-10 15:42:04 -03:00
Icaro Motta 225e3b1c2f DX: Preload user and dev.user namespace (#19927)
Preload the user namespace (src/user.cljs and src/dev/user.cljs) for the mobile
target and for dev-only purposes. The files are git-ignored.

Just a reminder that you'll be responsible for making sure your user namespace
is correct. If it's broken in any way (e.g. calling non-existent code) the app
will crash at initialization (dev-only environment obviously).

Why? When the app initializes, it loads namespaces that were required at least
once. If you create a user namespace, it won't be automatically required for
you. And if you, like some Clojure devs, like to use the user namespace as
your safe heaven for experimentation and dev-only utilities, you'll need to
remember to evaluate the namespace at least once.

This is tedious and many times I forgot to do so and the app crashed because the
compiler didn't know where the symbols were coming from.
2024-05-10 13:17:26 -03:00
Icaro Motta 037e71bc03 Optimize opening of Settings screens (#19940)
This commit rewrites utils.re-frame/delay-render to use hooks. The new
implementation renders significantly better than what we have today, at least on
Android.

Why not hiccup instead of a function call to delay-render? The Settings screen
is rendered slightly faster if I use delay-render as a function call instead of
hiccup. My only guess is that this is just less work to be done by Reagent,
since the wrapper function is not creating a wrapper component with its own
lifecycle.

The full analysis can be found here, but it's copied for future reference:

--------------------------------------------------------------------------------
Based on my analysis of individual frames being rendered and having investigated
3 different scenarios:

1. Scenario 1: No delay whatsoever, i.e. not using `delay-render`.
2. Scenario 2: Using `delay-render` like in `develop`, that is, a form-2
   component with a local Reagent atom.
3. Scenario 3: Using `delay-render` as in this PR, using hooks.

All 3 scenarios open the Settings screen with all rendered views in the same
amount of time. In terms of raw performance, they are completely identical. The
absolute value doesn't matter, but in my recordings, on average, 10 frames of
video after the first press on the user's profile image.

So how can it be that on Android the new solution is visibly smoother? It's all
about latency and our brains are very picky about it.

Scenario 1 - Not using delay-render: the user notices a longer delay after
pressing on the profile image because all components in the Settings screen are
mounted in one go. This gives the impression to the user of being slower. In
slower Android devices, we've seen a user even press twice because the Settings
screen was taking longer to open. On newer Android devices this is not much of a
problem. There's another problem in `Scenario 1`, on Android, with too many
elements and/or too many heavy elements being mounted, the opening animation is
sometimes completely cut off or very clunky (a similar problem can happen while
opening the Activity Center).

Scenario 2 - Use delay-render with a form-2 component: The Settings items are
always rendered after the opening animation completes. Our brains perceive this
as a slight delay because we can see the empty gray background for 1-3 frames.
This is quite noticeable on my physical Android device, even with a prod build.

Scenario 3 - Use delay-render as a hook: the optimal solution from the user's
perspective, Settings items sometimes can be rendered before the animation
completes. I say sometimes because other times the items are rendered only 1
frame before or right when the animation completes, which would be almost the
same as Scenario 2.

What the hooks solution gave us is a little bit of the Scenario 1 and
Scenario 2 in one package, and because the Settings items can be sometimes
rendered before the opening animation completes, our brains see that as being
faster.

In future performance investigations, we might want to focus on manipulating
latency more aggressively to see where that leads us.
2024-05-10 12:43:08 -03:00
Siddarth Kumar cb9a620f40 fix: hack fix for contract tests on MacOS (#19965)
fixes #19802

Contract Tests are failing with missing symbols runtime error on `MacOS` after `golang` version was upgraded to 1.20
A simple hack fix such a case is to use `go 1.19` only to build the status-go library that is used specifically for these integration tests.
Its ugly but it works and unblocks devs from running tests locally.

- execute `make test-contract` on MacOS and it should not fail.

not needed since this impacts only the integration tests.

- macOS

status: ready
2024-05-10 17:58:49 +05:30
Icaro Motta a481a44c72 Fail fast during app initialization if an invalid schema is found (#19958)
Some devs reported invalid schemas in the develop branch during app
initialization. We knew this could happen when Malli was first
introduced, but we wanted to play safe in the beginning due to the
overall inexperience of the team with Malli.

This commit removes all guardrails on instrumented vars, i.e. during app
initialization the app will crash on any invalid schema. A reminder that
instrumentation only take effect when js/goog.DEBUG is true.
2024-05-10 09:12:31 -03:00
Siddarth Kumar a68b2f357d fix: node-pre-gyp warning (#19960)
## Summary

any `yarn` command calls `node-pre-gyp rebuild` which prints out this warning message :

```
make[1]: Entering directory '/Users/siddarthkumar/code/experiments/status-mobile/build'
  CXX(target) Release/obj.target/status_nodejs_addon/modules/react-native-status/nodejs/status.o
../modules/react-native-status/nodejs/status.cpp:1153:11: warning: ignoring return value of function
declared with 'warn_unused_result' attribute [-Wunused-result]
          func->Call(isolate->GetCurrentContext(), v8::Null(isolate), argc, argv);
          ^~~~ ~~~~~~~~~~~~~
1 warning generated.
```

This happens due to return value of `func->Call` here :
https://github.com/status-im/status-mobile/blob/52a6f5c17d3055a98a403505a354cde135b1966f/modules/react-native-status/nodejs/status.cpp#L1153
not being used.
Which is not a huge red flag but produces a warning which is not nice when looking at logs and can be sometimes misleading for other devs.

This commit fixes that warning by assigning return value of that function and checking if its empty or not.

## Testing notes
not needed since this impacts only the integration tests.

## Platforms
- macOS

status: ready
2024-05-10 17:06:45 +05:30
Sean Hagstrom 4f0a49f7bf Add screen for key-pairs and accounts inside wallet settings (#19912)
* chore: add "key pairs and accounts" label

* chore: feature flag wallet-settings

* tidy: extact navigate-back function into static defn

* wip: add initial keypairs and accounts list view to wallet settings

* tweak: wire-up initial action menu for key-pairs

* tidy: extract key-pair container styles into style namespace

* tweak: fix dark background for key-pair and account settings

* tidy: refactor on-press handler for key-pair options

* fix: move feature-flag usage to settings screen instead of settings items definition

* tidy: remove unneeded key props

* tidy: clean up de-structuring and passing of props

* tidy: use keep with when expressions instead of filter and map expressions

* tidy: rename the wallet-settings feature flag

* tweak: rename and add feature-flags for mobile wallet settings

* tweak: use scrollview for feature-flags and add spacing between feature-flag groups

* tweak: adjust the way feature-flags are displayed in groups

* tidy: remove unneeded prop

* tidy: use bottom-inset for padding key-pair and accounts list

* tidy: change `filterv` to `filter`

* tidy: use subscription for building account-props

* tidy: use subscription to build the entire keypair-account

* tweak: use key-pair type to determine default key-pair

* tidy: rename component to settings-category-view

* tidy: use assoc instead of merge

* tidy: extract function from subscription

* test: add tests for formatting key-pairs and accounts for wallet settings

* tweak: use `match?` instead of `=`

* tidy: use `swap!` without anonymous functions
2024-05-10 10:53:35 +01:00
Omar Basem c40853456b Fix: manage members gesture (#19949)
Fix: manage members gesture (#19949)
2024-05-10 09:16:57 +04:00
Icaro Motta 52a6f5c17d Upgrade clj-kondo to 2024.03.13 (#19930)
This PR upgrades clj-kondo (our Clojure linter) from v2023-09-07 to
v2024-03-13, so ~6 months of development updates.

You can check out the changes starting at
https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20231020.
Nothing terribly useful to us this time, but as usual, clj-kondo can catch
more problems and more reliably than before.
2024-05-09 12:04:31 -03:00
mmilad75 14aa9e1c20 Refresh control test (#19831) 2024-05-09 17:42:52 +03:30
mmilad75 2c5cc6cd08 'Send' button is shown for watch-only collectibles and can navigate to the 'send' flow #19743 (#19918) 2024-05-09 17:10:41 +03:30
Icaro Motta 8ad58bb364 Persist in-app feature flags (dev-only feature) (#19619)
This commit improves in-app feature flags to persist what is currently only
stored in a Reagent atom by using RN Async Storage
https://reactnative.dev/docs/asyncstorage. This should make them more convenient
to use, which is a good thing overall for developers.

Additionally, there's now a top-right button in screen Settings > Feature Flags
that will reset the flags to the initial values obtained from environment
variables.

These in-app feature flags are exclusively available in debug builds in
Settings > Feature Flags, and only visible when flag ENABLE_QUO_PREVIEW is
enabled. There's no impact whatsoever in prod builds. A reminder that they are
not meant to be used by users (yet).

It's worth noting that RN has deprecated Async Storage and now recommends other
community solutions, but for a dev-only feature, I think it's fine.
2024-05-09 09:42:38 -03:00
Icaro Motta ab191407ed Fix schema error after logout (#19933)
Detailed explanation:

The schema failure is due to utils.image-server/get-initials-avatar-uri being
called with a nil profile customization color right after the user confirms
logout.

Right after logging out, the subscription :profile/profile-with-image is
recomputed. One of its signal inputs is :profile/profile. Right after logout,
the output of sub :profile/profile is always nil (this is correct, nobody is
logged in). This means that the sub :profile/profile-with-image will try to
calculate the multiaccount URI by passing a nil profile. This is wasteful
computation and is also the cause of the schema for
utils.image-server/get-initials-avatar-uri to fail, because it expects the
profile's customization-color to be present.
2024-05-09 08:52:27 -03:00
41 changed files with 731 additions and 295 deletions
+7
View File
@@ -1,4 +1,5 @@
{:config-paths ["status-im"]
:output {:exclude-files ["src/user.cljs" "src/dev/user.cljs"]}
:lint-as {legacy.status-im.utils.views/defview clojure.core/defn
legacy.status-im.utils.views/letsubs clojure.core/let
reagent.core/with-let clojure.core/let
@@ -15,6 +16,8 @@
:case-symbol-test {:level :error}
:clj-kondo-config {:level :error}
:cond-else {:level :error}
:condition-always-true {:level :error}
:conflicting-alias {:level :error}
:consistent-alias {:level :error
:aliases {clojure.set set
clojure.string string
@@ -42,11 +45,13 @@
:missing-body-in-when {:level :error}
:missing-clause-in-try {:level :error}
:missing-else-branch {:level :error}
:multiple-async-in-deftest {:level :error}
:not-empty? {:level :error}
:plus-one {:level :error}
:redundant-do {:level :error}
:redundant-let {:level :error}
:refer-all {:level :error}
:shadowed-fn-param {:level :error}
:shadowed-var {:level :error
;; We temporarily use :include to define an
;; allowlist of core Clojure vars. In the
@@ -54,9 +59,11 @@
;; vars, we should be able to delete this
;; option and lint all vars.
:exclude [type name]}
:self-requiring-namespace {:level :error}
:single-operand-comparison {:level :error}
:syntax {:level :error}
:unbound-destructuring-default {:level :error}
:underscore-in-namespace {:level :error}
:uninitialized-var {:level :error}
:unknown-require-option {:level :error}
:unreachable-code {:level :error}
+2
View File
@@ -127,6 +127,8 @@ fastlane/README.md
# Clj
.cpcache/
src/user.cljs
src/dev/user.cljs
# emacs
.dir-locals.el
+13 -6
View File
@@ -1,5 +1,9 @@
// DO NOT EDIT: code is autogenerated by go2nodebinding from Go code.
// https://github.com/divan/go2nodebinding
// This code has pieces that were autogenerated but is now managed manually
// Here lies the node bindings used for integration tests
// These are basically C calls to exported status-go functions
// Along 1 additional Poll function to get signals to work
// function names registered here in init() are used in various places
// ref -> status-mobile/src/tests/test_utils.cljs
#include <node.h>
#include <string>
@@ -1147,10 +1151,13 @@ void _PollSignal(const FunctionCallbackInfo<Value>& args) {
v8::Local<v8::Function> func = v8::Local<v8::Function>::Cast(args[0]);
if (!q.empty()) {
const unsigned argc = 1;
v8::Local<v8::Value> argv[argc] =
{ v8::String::NewFromUtf8(isolate,q.front().c_str()).ToLocalChecked()};
func->Call(isolate->GetCurrentContext(), v8::Null(isolate), argc, argv);
v8::Local<v8::Value> argv[argc] = {v8::String::NewFromUtf8(isolate, q.front().c_str()).ToLocalChecked()};
v8::MaybeLocal<v8::Value> result = func->Call(isolate->GetCurrentContext(), v8::Null(isolate), argc, argv);
if (result.IsEmpty()) {
isolate->ThrowException(Exception::Error(
String::NewFromUtf8Literal(isolate, "Error calling the callback function")));
return;
}
q.pop();
}
}
+120 -102
View File
@@ -90,11 +90,20 @@
},
{
"path": "cider/cider-nrepl/0.31.0/cider-nrepl-0.31.0",
"path": "cider/cider-nrepl/0.44.0/cider-nrepl-0.44.0",
"host": "https://repo.clojars.org",
"jar": {
"sha1": "1f28a4a834a7a46cf24def971b1a705a6795c73a",
"sha256": "0h4pyzy8rzzh567khvimw2cs8jr640kqxgaxvbfx1s5yfp56fka2"
"sha1": "c3d3a729beaa728d0ee6a3678a48c880b6bc95f1",
"sha256": "0klcppvydxlx9ji376mvz40yv3s7awq6p9yd57wigpfy4m2yv0w6"
}
},
{
"path": "cider/orchard/0.21.0/orchard-0.21.0",
"host": "https://repo.clojars.org",
"jar": {
"sha1": "073617f16a132c7f20608d971244753d4e704129",
"sha256": "1n2afbyhw9x9kvfna4m4x6n6pwjiqsqcayql644bw2932i1isrkj"
}
},
@@ -108,11 +117,11 @@
},
{
"path": "clj-kondo/clj-kondo/2023.09.07/clj-kondo-2023.09.07",
"path": "clj-kondo/clj-kondo/2024.03.13/clj-kondo-2024.03.13",
"host": "https://repo.clojars.org",
"jar": {
"sha1": "9bf516b973a0b77d7dc5a3c6c84a884e3470e7b7",
"sha256": "1qkw5ryqdzy4wl3xbr0r72ikrch75z5vh1dny569y3jlc888gkv8"
"sha1": "adec398a95322f3a27baf0a92b658493335464d1",
"sha256": "0r97hsj7m3qc12xwyxx6m1a71gqp5aiy99imcf8r0nz2dnjmj0kz"
}
},
@@ -251,6 +260,15 @@
}
},
{
"path": "com/googlecode/json-simple/json-simple/1.1.1/json-simple-1.1.1",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "c9ad4a0850ab676c5c64461a05ca524cdfff59f1",
"sha256": "170rflxnqnah0265ik2aylmxkshyqbf2zas9bp2l32xqj9l6jsaf"
}
},
{
"path": "com/google/errorprone/error_prone_annotations/2.15.0/error_prone_annotations-2.15.0",
"host": "https://repo1.maven.org/maven2",
@@ -324,11 +342,38 @@
},
{
"path": "com/googlecode/json-simple/json-simple/1.1.1/json-simple-1.1.1",
"path": "commons-codec/commons-codec/1.15/commons-codec-1.15",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "c9ad4a0850ab676c5c64461a05ca524cdfff59f1",
"sha256": "170rflxnqnah0265ik2aylmxkshyqbf2zas9bp2l32xqj9l6jsaf"
"sha1": "49d94806b6e3dc933dacbd8acb0fdbab8ebd1e5d",
"sha256": "0qzd8v96j4x7jjcfpvvdh9ar1xhwxpxi2rh51nzhj0br7bbgdsdk"
}
},
{
"path": "commons-fileupload/commons-fileupload/1.4/commons-fileupload-1.4",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "f95188e3d372e20e7328706c37ef366e5d7859b0",
"sha256": "1xyyl54sfxsdcwxdyq6b0azmr31b4dwqns850jjkw9a9dwrh5v54"
}
},
{
"path": "commons-io/commons-io/2.11.0/commons-io-2.11.0",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "a2503f302b11ebde7ebc3df41daebe0e4eea3689",
"sha256": "020946yakki3qzc652arfndzi594drxanidz9bawbb6vhxnjy6wn"
}
},
{
"path": "compojure/compojure/1.5.2/compojure-1.5.2",
"host": "https://repo.clojars.org",
"jar": {
"sha1": "0b5258d0616ffc5f64c2b6d95f09de56d24df439",
"sha256": "1s2k05lwnlm9a66mxnsss437i9gp70dny8y2rlfkl090s6mdqsaf"
}
},
@@ -368,42 +413,6 @@
}
},
{
"path": "commons-codec/commons-codec/1.15/commons-codec-1.15",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "49d94806b6e3dc933dacbd8acb0fdbab8ebd1e5d",
"sha256": "0qzd8v96j4x7jjcfpvvdh9ar1xhwxpxi2rh51nzhj0br7bbgdsdk"
}
},
{
"path": "commons-fileupload/commons-fileupload/1.4/commons-fileupload-1.4",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "f95188e3d372e20e7328706c37ef366e5d7859b0",
"sha256": "1xyyl54sfxsdcwxdyq6b0azmr31b4dwqns850jjkw9a9dwrh5v54"
}
},
{
"path": "commons-io/commons-io/2.11.0/commons-io-2.11.0",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "a2503f302b11ebde7ebc3df41daebe0e4eea3689",
"sha256": "020946yakki3qzc652arfndzi594drxanidz9bawbb6vhxnjy6wn"
}
},
{
"path": "compojure/compojure/1.5.2/compojure-1.5.2",
"host": "https://repo.clojars.org",
"jar": {
"sha1": "0b5258d0616ffc5f64c2b6d95f09de56d24df439",
"sha256": "1s2k05lwnlm9a66mxnsss437i9gp70dny8y2rlfkl090s6mdqsaf"
}
},
{
"path": "crypto-equality/crypto-equality/1.0.1/crypto-equality-1.0.1",
"host": "https://repo.clojars.org",
@@ -575,6 +584,15 @@
}
},
{
"path": "mx/cider/logjam/0.1.1/logjam-0.1.1",
"host": "https://repo.clojars.org",
"jar": {
"sha1": "0e9a1c08d4e80e46be8ed8b8cb894bef5e56f39d",
"sha256": "1p6hnacyfjn365r0li639lf9fnqpgx1cs7jz7066cn566wjw46az"
}
},
{
"path": "net/cgrand/macrovich/0.2.1/macrovich-0.2.1",
"host": "https://repo.clojars.org",
@@ -603,11 +621,11 @@
},
{
"path": "nrepl/nrepl/0.9.0/nrepl-0.9.0",
"path": "nrepl/nrepl/1.1.0/nrepl-1.1.0",
"host": "https://repo.clojars.org",
"jar": {
"sha1": "49beada131959f08f9a20899affbd1b10c03a668",
"sha256": "1phak0479s27ffw9wzz7pi8cqqs6ipsm15dhgw9szxxcfhx529qa"
"sha1": "69f138d4a778c199e5d72446ca25998222ba0862",
"sha256": "0n29xczgwpqv98vz36sdic98mf07dmzhjawlxd63p2s2zafkp1ss"
}
},
@@ -620,15 +638,6 @@
}
},
{
"path": "org/apache/ant/ant-launcher/1.10.11/ant-launcher-1.10.11",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "ea0a0475fb6dfcdcf48b30410fd9d4f5c80df07e",
"sha256": "0mnj5v660qvmrsi1m6z0dnykw3df8f1213byzp45l2wqgbgk1dfs"
}
},
{
"path": "org/apache/ant/ant/1.10.11/ant-1.10.11",
"host": "https://repo1.maven.org/maven2",
@@ -638,6 +647,24 @@
}
},
{
"path": "org/apache/ant/ant-launcher/1.10.11/ant-launcher-1.10.11",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "ea0a0475fb6dfcdcf48b30410fd9d4f5c80df07e",
"sha256": "0mnj5v660qvmrsi1m6z0dnykw3df8f1213byzp45l2wqgbgk1dfs"
}
},
{
"path": "org/babashka/sci/0.8.41/sci-0.8.41",
"host": "https://repo.clojars.org",
"jar": {
"sha1": "e8d59dc588a1e1f0c62c21fb47c093eeed043f04",
"sha256": "1lhv283fs0bnqbj1jhfgyy2rv6hspnhdgsiklqy3rqxrqbnrww6w"
}
},
{
"path": "org/babashka/sci.impl.types/0.0.2/sci.impl.types-0.0.2",
"host": "https://repo.clojars.org",
@@ -647,15 +674,6 @@
}
},
{
"path": "org/babashka/sci/0.7.38/sci-0.7.38",
"host": "https://repo.clojars.org",
"jar": {
"sha1": "ef2d8c74065b9a7d685a11bff017676db308a923",
"sha256": "04pkxwcgkd1p4f4rszsr6pp18fl0vni1az47a390llrhyyrjcckn"
}
},
{
"path": "org/checkerframework/checker-qual/3.12.0/checker-qual-3.12.0",
"host": "https://repo1.maven.org/maven2",
@@ -746,15 +764,6 @@
}
},
{
"path": "org/clojure/google-closure-library-third-party/0.0-20230227-c7c0a541/google-closure-library-third-party-0.0-20230227-c7c0a541",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "f5ea82eb1309b81ada6a14371bb848323c65e38b",
"sha256": "0jk9v4bfrxvz6wq1s86msry2mf47nwcjfplnn41yabqc44g82hva"
}
},
{
"path": "org/clojure/google-closure-library/0.0-20230227-c7c0a541/google-closure-library-0.0-20230227-c7c0a541",
"host": "https://repo1.maven.org/maven2",
@@ -764,6 +773,15 @@
}
},
{
"path": "org/clojure/google-closure-library-third-party/0.0-20230227-c7c0a541/google-closure-library-third-party-0.0-20230227-c7c0a541",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "f5ea82eb1309b81ada6a14371bb848323c65e38b",
"sha256": "0jk9v4bfrxvz6wq1s86msry2mf47nwcjfplnn41yabqc44g82hva"
}
},
{
"path": "org/clojure/math.combinatorics/0.2.0/math.combinatorics-0.2.0",
"host": "https://repo1.maven.org/maven2",
@@ -791,15 +809,6 @@
}
},
{
"path": "org/clojure/tools.analyzer.jvm/1.2.2/tools.analyzer.jvm-1.2.2",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "449691b55d7d526258ce02c69b4699f2897c494d",
"sha256": "0phfs1z1scvdi00348zjh223xncmgrkmlrnbca4dh7lk701gy34i"
}
},
{
"path": "org/clojure/tools.analyzer/1.1.0/tools.analyzer-1.1.0",
"host": "https://repo1.maven.org/maven2",
@@ -809,6 +818,15 @@
}
},
{
"path": "org/clojure/tools.analyzer.jvm/1.2.2/tools.analyzer.jvm-1.2.2",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "449691b55d7d526258ce02c69b4699f2897c494d",
"sha256": "0phfs1z1scvdi00348zjh223xncmgrkmlrnbca4dh7lk701gy34i"
}
},
{
"path": "org/clojure/tools.cli/1.0.206/tools.cli-1.0.206",
"host": "https://repo1.maven.org/maven2",
@@ -962,6 +980,15 @@
}
},
{
"path": "reagent/reagent/1.2.0/reagent-1.2.0",
"host": "https://repo.clojars.org",
"jar": {
"sha1": "1b9a181b5c7ed3557768d2ea0c66f5616aef5e97",
"sha256": "0scvkzfqjs613z10rngh7427v3pxdqablf0fcl65pbpkzz16wgav"
}
},
{
"path": "re-com/re-com/2.8.0/re-com-2.8.0",
"host": "https://repo.clojars.org",
@@ -971,6 +998,15 @@
}
},
{
"path": "refactor-nrepl/refactor-nrepl/3.9.1/refactor-nrepl-3.9.1",
"host": "https://repo.clojars.org",
"jar": {
"sha1": "f949af92dd1d6fef59d7447bd0cb62118e34eca1",
"sha256": "0dml9yvjmji6xk2sk3cdmkvvnh13rw29szxxl363hap8yg28xcs1"
}
},
{
"path": "re-frame/re-frame/1.3.0/re-frame-1.3.0",
"host": "https://repo.clojars.org",
@@ -998,24 +1034,6 @@
}
},
{
"path": "reagent/reagent/1.2.0/reagent-1.2.0",
"host": "https://repo.clojars.org",
"jar": {
"sha1": "1b9a181b5c7ed3557768d2ea0c66f5616aef5e97",
"sha256": "0scvkzfqjs613z10rngh7427v3pxdqablf0fcl65pbpkzz16wgav"
}
},
{
"path": "refactor-nrepl/refactor-nrepl/3.9.1/refactor-nrepl-3.9.1",
"host": "https://repo.clojars.org",
"jar": {
"sha1": "f949af92dd1d6fef59d7447bd0cb62118e34eca1",
"sha256": "0dml9yvjmji6xk2sk3cdmkvvnh13rw29szxxl363hap8yg28xcs1"
}
},
{
"path": "ring-cors/ring-cors/0.1.8/ring-cors-0.1.8",
"host": "https://repo.clojars.org",
+16 -14
View File
@@ -8,9 +8,10 @@ borkdude/edamame/1.3.23/edamame-1.3.23.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
cheshire/cheshire/5.11.0/cheshire-5.11.0.jar
cider/cider-nrepl/0.31.0/cider-nrepl-0.31.0.jar
cider/cider-nrepl/0.44.0/cider-nrepl-0.44.0.jar
cider/orchard/0.21.0/orchard-0.21.0.jar
cider/piggieback/0.5.2/piggieback-0.5.2.jar
clj-kondo/clj-kondo/2023.09.07/clj-kondo-2023.09.07.jar
clj-kondo/clj-kondo/2024.03.13/clj-kondo-2024.03.13.jar
cljs-bean/cljs-bean/1.9.0/cljs-bean-1.9.0.jar
clout/clout/2.1.2/clout-2.1.2.jar
com/andrewmcveigh/cljs-time/0.5.2/cljs-time-0.5.2.jar
@@ -26,6 +27,7 @@ com/github/javaparser/javaparser-core/3.25.3/javaparser-core-3.25.3.jar
com/google/auto/value/auto-value-annotations/1.6/auto-value-annotations-1.6.jar
com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar
com/google/code/gson/gson/2.9.1/gson-2.9.1.jar
com/googlecode/json-simple/json-simple/1.1.1/json-simple-1.1.1.jar
com/google/errorprone/error_prone_annotations/2.15.0/error_prone_annotations-2.15.0.jar
com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar
com/google/guava/guava/31.0.1-jre/guava-31.0.1-jre.jar
@@ -34,15 +36,14 @@ com/google/j2objc/j2objc-annotations/1.3/j2objc-annotations-1.3.jar
com/google/javascript/closure-compiler-unshaded/v20230802/closure-compiler-unshaded-v20230802.jar
com/google/protobuf/protobuf-java/3.21.12/protobuf-java-3.21.12.jar
com/google/re2j/re2j/1.3/re2j-1.3.jar
com/googlecode/json-simple/json-simple/1.1.1/json-simple-1.1.1.jar
com/taoensso/encore/3.68.0/encore-3.68.0.jar
com/taoensso/timbre/6.3.1/timbre-6.3.1.jar
com/taoensso/truss/1.11.0/truss-1.11.0.jar
com/taoensso/tufte/2.6.3/tufte-2.6.3.jar
commons-codec/commons-codec/1.15/commons-codec-1.15.jar
commons-fileupload/commons-fileupload/1.4/commons-fileupload-1.4.jar
commons-io/commons-io/2.11.0/commons-io-2.11.0.jar
compojure/compojure/1.5.2/compojure-1.5.2.jar
com/taoensso/encore/3.68.0/encore-3.68.0.jar
com/taoensso/timbre/6.3.1/timbre-6.3.1.jar
com/taoensso/truss/1.11.0/truss-1.11.0.jar
com/taoensso/tufte/2.6.3/tufte-2.6.3.jar
crypto-equality/crypto-equality/1.0.1/crypto-equality-1.0.1.jar
crypto-random/crypto-random/1.2.1/crypto-random-1.2.1.jar
day8/re-frame/test/0.1.5/test-0.1.5.jar
@@ -62,15 +63,16 @@ javax/xml/bind/jaxb-api/2.3.0/jaxb-api-2.3.0.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
mx/cider/logjam/0.1.1/logjam-0.1.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
nrepl/bencode/1.1.0/bencode-1.1.0.jar
nrepl/nrepl/0.9.0/nrepl-0.9.0.jar
nrepl/nrepl/1.1.0/nrepl-1.1.0.jar
nubank/matcher-combinators/3.8.8/matcher-combinators-3.8.8.jar
org/apache/ant/ant-launcher/1.10.11/ant-launcher-1.10.11.jar
org/apache/ant/ant/1.10.11/ant-1.10.11.jar
org/apache/ant/ant-launcher/1.10.11/ant-launcher-1.10.11.jar
org/babashka/sci/0.8.41/sci-0.8.41.jar
org/babashka/sci.impl.types/0.0.2/sci.impl.types-0.0.2.jar
org/babashka/sci/0.7.38/sci-0.7.38.jar
org/checkerframework/checker-qual/3.12.0/checker-qual-3.12.0.jar
org/clojure/clojure/1.11.1/clojure-1.11.1.jar
org/clojure/clojurescript/1.11.60/clojurescript-1.11.60.jar
@@ -81,13 +83,13 @@ org/clojure/core.rrb-vector/0.1.2/core.rrb-vector-0.1.2.jar
org/clojure/core.specs.alpha/0.2.62/core.specs.alpha-0.2.62.jar
org/clojure/data.json/2.4.0/data.json-2.4.0.jar
org/clojure/data.priority-map/1.1.0/data.priority-map-1.1.0.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/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/math.combinatorics/0.2.0/math.combinatorics-0.2.0.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.jvm/1.2.2/tools.analyzer.jvm-1.2.2.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.cli/1.0.206/tools.cli-1.0.206.jar
org/clojure/tools.logging/1.1.0/tools.logging-1.1.0.jar
org/clojure/tools.macro/0.1.5/tools.macro-0.1.5.jar
@@ -105,12 +107,12 @@ org/slf4j/slf4j-nop/2.0.9/slf4j-nop-2.0.9.jar
org/wildfly/client/wildfly-client-config/1.0.1.Final/wildfly-client-config-1.0.1.Final.jar
org/wildfly/common/wildfly-common/1.5.4.Final/wildfly-common-1.5.4.Final.jar
prismatic/schema/1.1.7/schema-1.1.7.jar
reagent/reagent/1.2.0/reagent-1.2.0.jar
re-com/re-com/2.8.0/re-com-2.8.0.jar
refactor-nrepl/refactor-nrepl/3.9.1/refactor-nrepl-3.9.1.jar
re-frame/re-frame/1.3.0/re-frame-1.3.0.jar
re-frisk-remote/re-frisk-remote/1.6.0/re-frisk-remote-1.6.0.jar
re-frisk/sente/1.15.0/sente-1.15.0.jar
reagent/reagent/1.2.0/reagent-1.2.0.jar
refactor-nrepl/refactor-nrepl/3.9.1/refactor-nrepl-3.9.1.jar
ring-cors/ring-cors/0.1.8/ring-cors-0.1.8.jar
ring/ring-codec/1.2.0/ring-codec-1.2.0.jar
ring/ring-core/1.9.6/ring-core-1.9.6.jar
+6 -5
View File
@@ -1,8 +1,9 @@
{ buildGoPackage
# object with source attributes
, meta, source}:
buildGoPackage {
{ stdenv, meta, source, buildGo119Package, buildGo120Package }:
let
# https://github.com/status-im/status-mobile/issues/19802
# only for Darwin to fix Integration Tests failing with missing symbols on go 1.20
buildGoPackageIntegrationTest = if stdenv.isDarwin then buildGo119Package else buildGo120Package;
in buildGoPackageIntegrationTest {
pname = source.repo;
version = "${source.cleanVersion}-${source.shortRev}";
+1 -1
View File
@@ -21,7 +21,7 @@
[nubank/matcher-combinators "3.8.8"]
;; Use the same version specified in the Nix dependency.
[clj-kondo/clj-kondo "2023.09.07"]
[clj-kondo/clj-kondo "2024.03.13"]
;; Routing
[bidi "2.1.6"]
+23
View File
@@ -0,0 +1,23 @@
# The `dev/` directory
The `src/dev/` directory is a place where developers can commit non-production
and non-test code which can facilitate development in general. The code should,
ideally, be useful to more than one team member.
**Note**: As of today (2024-05-07), we don't have further guidelines or examples
about how mobile teams should use and maintain these dev-only namespaces. Before
opening a PR introducing new dev-only namespaces, consider sharing and
discussing with as many team members as you can.
### The `user` namespace
You may optionally create a `src/dev/user.cljs` and/or `src/user.cljs` file.
These files are git-ignored and are meant to be your own playground. Clojure
developers usually use such namespaces to create temporary utilities and
experiments that aren't necessarily useful to others. They are particularly
valuable for developers adept at the REPL-Driven Development workflow.
Be careful with `make clean` because it will delete all non-tracked git files.
If you rely on this file, you may prefer to create a symbolic link and store the
original `user.cljs` file outside the `status-mobile` repository. Then, after
`make clean`, you will need to recreate the symlink.
@@ -9,26 +9,31 @@
[schema.core :as schema]))
(defn- description-comp
[description members-count active-members-count]
[rn/view
[text/text
{:size :paragraph-2
:number-of-lines 3
:accessibility-label :description}
description]
[rn/view {:style style/stat-container}
[community-stat/view
{:value members-count
:icon :i/members
:accessibility-label :members-count
:style {:margin-right 12}
:text-size :paragraph-2}]
(when active-members-count
[community-stat/view
{:value active-members-count
:icon :i/active-members
:accessibility-label :active-members-count
:text-size :paragraph-2}])]])
[description members-count active-members-count show-members-count?]
(let [has-members? (pos? members-count)
has-active-members? (pos? active-members-count)]
[rn/view
[text/text
{:size :paragraph-2
:number-of-lines 3
:accessibility-label :description}
description]
(when show-members-count?
[rn/view
{:style style/stat-container}
(when has-members?
[community-stat/view
{:value members-count
:icon :i/members
:accessibility-label :members-count
:style {:margin-right 12}
:text-size :paragraph-2}])
(when has-active-members?
[community-stat/view
{:value active-members-count
:icon :i/active-members
:accessibility-label :active-members-count
:text-size :paragraph-2}])])]))
(defn- title-comp
[title]
@@ -74,7 +79,7 @@
(defn- view-internal
[{:keys [title description loading? icon banner members-count active-members-count
on-press size]}]
on-press size show-members-count?]}]
(let [theme (quo.theme/use-theme)]
[rn/pressable
{:style (style/container size theme)
@@ -88,7 +93,7 @@
[logo-comp icon])
[title-comp title]]
(when description
[description-comp description members-count active-members-count])
[description-comp description members-count active-members-count show-members-count?])
(when banner
[thumbnail-comp banner size])])]))
@@ -34,7 +34,8 @@
:members-count "20"
:loading? false
:active-members-count "15"
:type :community})
:type :community
:show-members-count? true})
(h/describe "Internal link card - Community"
(h/test "renders with most common props"
@@ -18,5 +18,6 @@
[:active-members-count {:optional true} [:maybe [:or :int :string]]]
[:customization-color {:optional true} [:maybe :schema.common/customization-color]]
[:emoji-hash {:optional true} [:maybe :string]]
[:size {:optional true} [:maybe :keyword]]]]]
[:size {:optional true} [:maybe :keyword]]
[:show-members-count? {:optional true} [:maybe :boolean]]]]]
:any])
@@ -12,8 +12,8 @@
[:lower-case? :boolean]
[:upper-case? :boolean]
[:numbers? :boolean]
[:symbols? :boolean]]
[:any]]])
[:symbols? :boolean]]]
:any])
(defn- view-internal
[{:keys [lower-case? upper-case? numbers? symbols?]}]
+9
View File
@@ -199,6 +199,15 @@
[handler deps]
(react/useMemo handler (get-js-deps deps)))
(defn delay-render
[content]
(let [[render? set-render] (use-state false)]
(use-mount
(fn []
(js/setTimeout #(set-render true) 0)))
(when render?
content)))
(def layout-animation (.-LayoutAnimation ^js react-native))
(def configure-next (.-configureNext ^js layout-animation))
+1 -1
View File
@@ -19,5 +19,5 @@
(catch js/Error e#
(taoensso.timbre/error "Failed to instrument function"
{:symbol ~sym :error e#})
~sym))
(throw e#)))
~sym))
+1 -1
View File
@@ -91,5 +91,5 @@
{:schema-id schema-id
:error e
:function f})
f))
(throw e)))
f)))
@@ -0,0 +1,10 @@
(ns status-im.common.refreshable-flat-list.view
(:require [react-native.core :as rn]
[reagent.core :as reagent]))
(defn view
[{:keys [refresh-control] :as props}]
[rn/flat-list
(merge {:refresh-control (reagent/as-element
refresh-control)}
(dissoc props :refresh-control))])
@@ -43,7 +43,7 @@
item]))))
(defn add-manage-members
[]
[{:keys [scroll-enabled? on-scroll]}]
(let [selected-participants (rf/sub [:group-chat/selected-participants])
deselected-members (rf/sub [:group-chat/deselected-members])
chat-id (rf/sub [:get-screen-params :group-add-manage-members])
@@ -62,6 +62,8 @@
(i18n/label :t/manage-members)]
[gesture/section-list
{:key-fn :title
:scroll-enabled @scroll-enabled?
:on-scroll on-scroll
:sticky-section-headers-enabled false
:sections (rf/sub [:contacts/grouped-by-first-letter])
:render-section-header-fn contact-list/contacts-section-header
@@ -15,14 +15,19 @@
community-icon :icon
community-banner :banner
community-name :display-name
members-count :members-count} community]
members-count :members-count
community-id :community-id} community
token-gated-not-a-member? (rf/sub
[:communities/token-gated-not-a-member?
community-id])]
^{:key url}
[quo/internal-link-card
{:type :community
:size :message
:description community-description
:members-count members-count
:title community-name
:banner (:url community-banner)
:icon (:url community-icon)
:on-press #(rf/dispatch [:universal-links/handle-url url])}])))])))
{:type :community
:size :message
:description community-description
:members-count members-count
:title community-name
:banner (:url community-banner)
:icon (:url community-icon)
:on-press #(rf/dispatch [:universal-links/handle-url url])
:show-members-count? token-gated-not-a-member?}])))])))
@@ -1,5 +1,6 @@
(ns status-im.contexts.preview.feature-flags.style)
(def container
{:flex 1
:margin-left 20})
{:flex 1
:margin-left 20
:margin-bottom 20})
@@ -15,25 +15,28 @@
:text-align :left
:title "Features Flags"
:icon-name :i/arrow-left
:on-press #(rf/dispatch [:navigate-back])}]
(doall
(for [context-name ff/feature-flags-categories
:let [context-flags (filter (fn [[k]]
(string/includes? (str k) context-name))
(ff/feature-flags))]]
^{:key (str context-name)}
[rn/view {:style style/container}
[quo/text
context-name]
(doall
(for [i (range (count context-flags))
:let [[flag] (nth context-flags i)]]
^{:key (str context-name flag i)}
[rn/view {:style {:flex-direction :row}}
[quo/selectors
{:type :toggle
:checked? (ff/enabled? flag)
:container-style {:margin-right 8}
:on-change #(ff/toggle flag)}]
[quo/text (second (string/split (name flag) "."))]]))]))])
:on-press #(rf/dispatch [:navigate-back])
:right-side [{:icon-name :i/rotate
:on-press #(ff/reset-flags)}]}]
[rn/scroll-view
(doall
(for [context-name ff/feature-flags-categories
:let [context-flags (filter (fn [[k]]
(= context-name
(first (string/split (str (name k)) "."))))
(ff/feature-flags))]]
^{:key (str context-name)}
[rn/view {:style style/container}
[quo/text
context-name]
(doall
(for [i (range (count context-flags))
:let [[flag] (nth context-flags i)]]
^{:key (str context-name flag i)}
[rn/view {:style {:flex-direction :row}}
[quo/selectors
{:type :toggle
:checked? (ff/enabled? flag)
:container-style {:margin-right 8}
:on-change #(ff/toggle flag)}]
[quo/text (second (string/split (name flag) "."))]]))]))]])
@@ -1,6 +1,7 @@
(ns status-im.contexts.profile.settings.list-items
(:require [status-im.common.not-implemented :as not-implemented]
[status-im.config :as config]
[status-im.feature-flags :as ff]
[utils.i18n :as i18n]
[utils.re-frame :as rf]))
@@ -34,12 +35,13 @@
:image :icon
:blur? true
:action :arrow}
{:title (i18n/label :t/wallet)
:on-press #(rf/dispatch [:open-modal :screen/settings.wallet])
:image-props :i/wallet
:image :icon
:blur? true
:action :arrow}
{:title (i18n/label :t/wallet)
:on-press #(rf/dispatch [:open-modal :screen/settings.wallet])
:image-props :i/wallet
:image :icon
:blur? true
:action :arrow
:feature-flag ::ff/settings.wallet-settings}
(when config/show-not-implemented-features?
{:title (i18n/label :t/dapps)
:on-press not-implemented/alert
@@ -9,18 +9,24 @@
[status-im.contexts.profile.settings.list-items :as settings.items]
[status-im.contexts.profile.settings.style :as style]
[status-im.contexts.profile.utils :as profile.utils]
[status-im.feature-flags :as ff]
[utils.debounce :as debounce]
[utils.i18n :as i18n]
[utils.re-frame :as rf]))
(defn- settings-item-view
(defn show-settings-item?
[{:keys [feature-flag]}]
(or (ff/enabled? feature-flag)
(nil? feature-flag)))
(defn- settings-category-view
[data]
[rf/delay-render
(rn/delay-render
[quo/category
{:list-type :settings
:container-style {:padding-bottom 12}
:blur? true
:data data}]])
:data (filter show-settings-item? data)}]))
(defn scroll-handler
[event scroll-y]
@@ -29,9 +35,9 @@
(defn- footer
[{:keys [bottom]} logout-press]
[rf/delay-render
(rn/delay-render
[rn/view {:style (style/footer-container bottom)}
[quo/logout-button {:on-press logout-press}]]])
[quo/logout-button {:on-press logout-press}]]))
(defn- get-item-layout
[_ index]
@@ -52,8 +58,7 @@
on-scroll (rn/use-callback #(scroll-handler % scroll-y))]
[quo/overlay {:type :shell}
[rn/view
{:key :header
:style (style/navigation-wrapper {:customization-color customization-color
{:style (style/navigation-wrapper {:customization-color customization-color
:inset (:top insets)
:theme theme})}
[quo/page-nav
@@ -72,11 +77,10 @@
{:options {:message (:universal-profile-url
profile)}}])}]}]]
[rn/flat-list
{:key :list
:header [settings.header/view {:scroll-y scroll-y}]
{:header [settings.header/view {:scroll-y scroll-y}]
:data (settings.items/items (boolean (:mnemonic profile)))
:shows-vertical-scroll-indicator false
:render-fn settings-item-view
:render-fn settings-category-view
:get-item-layout get-item-layout
:footer [footer insets logout-press]
:scroll-event-throttle 16
@@ -84,8 +88,7 @@
:bounces false
:over-scroll-mode :never}]
[quo/floating-shell-button
{:key :shell
:jump-to
{:jump-to
{:on-press #(rf/dispatch [:shell/navigate-to-jump-to])
:customization-color customization-color
:label (i18n/label :t/jump-to)}}
@@ -0,0 +1,6 @@
(ns status-im.contexts.settings.wallet.keypairs-and-accounts.actions.view
(:require [quo.core :as quo]))
(defn view
[props]
[quo/drawer-top props])
@@ -0,0 +1,18 @@
(ns status-im.contexts.settings.wallet.keypairs-and-accounts.style)
(def title-container
{:padding-horizontal 20
:margin-vertical 12})
(defn page-wrapper
[top-inset]
{:padding-top top-inset
:flex 1})
(defn list-container
[bottom-inset]
{:padding-bottom bottom-inset})
(def keypair-container-style
{:margin-horizontal 20
:margin-vertical 8})
@@ -0,0 +1,89 @@
(ns status-im.contexts.settings.wallet.keypairs-and-accounts.view
(:require [quo.core :as quo]
[quo.theme]
[react-native.core :as rn]
[react-native.safe-area :as safe-area]
[status-im.contexts.settings.wallet.keypairs-and-accounts.actions.view :as actions]
[status-im.contexts.settings.wallet.keypairs-and-accounts.style :as style]
[utils.address :as utils]
[utils.i18n :as i18n]
[utils.re-frame :as rf]))
(defn navigate-back
[]
(rf/dispatch [:navigate-back]))
(defn on-options-press
[{:keys [theme]
:as props}]
(rf/dispatch [:show-bottom-sheet
{:content (fn [] [actions/view props])
:theme theme}]))
(defn- keypair
[{keypair-type :type
:keys [accounts name]}
_ _
{:keys [profile-picture compressed-key customization-color]}]
(let [theme (quo.theme/use-theme)
default-keypair? (= keypair-type :profile)
shortened-key (when default-keypair?
(utils/get-shortened-compressed-key compressed-key))
on-press (rn/use-callback
(fn []
(on-options-press
(cond-> {:theme theme
:blur? true
:title name}
default-keypair?
(assoc :type :default-keypair
:description shortened-key
:customization-color customization-color
:profile-picture profile-picture)
(not default-keypair?)
(assoc :type :keypair
:icon-avatar :i/seed))))
[customization-color default-keypair? name
profile-picture shortened-key theme])]
[quo/keypair
{:blur? false
:status-indicator false
:stored :on-device
:action :options
:accounts accounts
:customization-color customization-color
:container-style style/keypair-container-style
:profile-picture (when default-keypair? profile-picture)
:type (if default-keypair? :default-keypair :other)
:on-options-press on-press
:details {:full-name name
:address shortened-key}}]))
(defn view
[]
(let [insets (safe-area/get-insets)
compressed-key (rf/sub [:profile/compressed-key])
profile-picture (rf/sub [:profile/image])
customization-color (rf/sub [:profile/customization-color])
quo-keypairs-accounts (rf/sub [:wallet/settings-keypairs-accounts])]
[quo/overlay
{:type :shell
:container-style (style/page-wrapper (:top insets))}
[quo/page-nav
{:key :header
:background :blur
:icon-name :i/arrow-left
:on-press navigate-back}]
[rn/view {:style style/title-container}
[quo/standard-title
{:title (i18n/label :t/keypairs-and-accounts)
:accessibility-label :keypairs-and-accounts-header
:customization-color customization-color}]]
[rn/view {:style {:flex 1}}
[rn/flat-list
{:data quo-keypairs-accounts
:render-fn keypair
:render-data {:profile-picture profile-picture
:compressed-key compressed-key
:customization-color customization-color}
:content-container-style (style/list-container (:bottom insets))}]]]))
@@ -1,8 +1,8 @@
(ns status-im.contexts.settings.wallet.wallet-options.view
(:require [quo.core :as quo]
[react-native.core :as rn]
[react-native.safe-area :as safe-area]
[status-im.contexts.settings.wallet.wallet-options.style :as style]
[status-im.feature-flags :as ff]
[utils.i18n :as i18n]
[utils.re-frame :as rf]))
@@ -10,9 +10,18 @@
[]
(rf/dispatch [:open-modal :screen/settings.saved-addresses]))
(defn open-keypairs-and-accounts-settings-modal
[]
(rf/dispatch [:open-modal :screen/settings.keypairs-and-accounts]))
(defn gen-basic-settings-options
[]
[{:title (i18n/label :t/saved-addresses)
[(when (ff/enabled? ::ff/settings.keypairs-and-accounts)
{:title (i18n/label :t/keypairs-and-accounts)
:blur? true
:on-press open-keypairs-and-accounts-settings-modal
:action :arrow})
{:title (i18n/label :t/saved-addresses)
:blur? true
:on-press open-saved-addresses-settings-modal
:action :arrow}])
@@ -26,11 +35,13 @@
:blur? true
:list-type :settings}])
(defn navigate-back
[]
(rf/dispatch [:navigate-back]))
(defn view
[]
(let [inset-top (safe-area/get-top)
navigate-back (rn/use-callback
#(rf/dispatch [:navigate-back]))]
(let [inset-top (safe-area/get-top)]
[quo/overlay
{:type :shell
:container-style (style/page-wrapper inset-top)}
@@ -28,15 +28,16 @@
collection-name]]])
(defn cta-buttons
[chain-id token-id contract-address]
[{:keys [chain-id token-id contract-address watch-only?]}]
(let [theme (quo.theme/use-theme)]
[rn/view {:style style/buttons-container}
[quo/button
{:container-style style/send-button
:type :outline
:size 40
:icon-left :i/send}
(i18n/label :t/send)]
(when-not watch-only?
[quo/button
{:container-style style/send-button
:type :outline
:size 40
:icon-left :i/send}
(i18n/label :t/send)])
[quo/button
{:container-style style/opensea-button
:type :outline
@@ -66,7 +67,7 @@
(let [theme (quo.theme/use-theme)
collectible (rf/sub [:wallet/last-collectible-details])
animation-shared-element-id (rf/sub [:animation-shared-element-id])
wallet-address (rf/sub [:wallet/current-viewing-account-address])
collectible-owner (rf/sub [:wallet/last-collectible-details-owner])
{:keys [id
preview-url
collection-data
@@ -90,7 +91,7 @@
:header collectible-name
:description collection-name}
total-owned (utils/total-owned-collectible (:ownership collectible)
wallet-address)]
(:address collectible-owner))]
(rn/use-unmount #(rf/dispatch [:wallet/clear-last-collectible-details]))
[scroll-page/scroll-page
{:navigate-back? true
@@ -128,7 +129,11 @@
{:name collectible-name
:image preview-uri}])}])}])))}]
[header collectible-name collection-name collection-image]
[cta-buttons chain-id token-id contract-address]
[cta-buttons
{:chain-id chain-id
:token-id token-id
:contract-address contract-address
:watch-only? (:watch-only? collectible-owner)}]
[quo/tabs
{:size 32
:style style/tabs
@@ -1,5 +1,6 @@
(ns status-im.contexts.wallet.home.style
(:require
[quo.foundations.colors :as colors]
[react-native.safe-area :as safe-area]))
(def tabs
@@ -22,3 +23,7 @@
[]
{:margin-top (+ (safe-area/get-top) 8)
:flex 1})
(defn header-container
[theme]
{:background-color (colors/theme-colors colors/white colors/neutral-95 theme)})
+54 -29
View File
@@ -1,8 +1,11 @@
(ns status-im.contexts.wallet.home.view
(:require
[quo.core :as quo]
[quo.foundations.colors :as colors]
[quo.theme]
[react-native.core :as rn]
[status-im.common.home.top-nav.view :as common.top-nav]
[status-im.common.refreshable-flat-list.view :as refreshable-flat-list]
[status-im.contexts.wallet.home.style :as style]
[status-im.contexts.wallet.home.tabs.view :as tabs]
[status-im.contexts.wallet.sheets.network-filter.view :as network-filter]
@@ -37,6 +40,27 @@
(when (ff/enabled? ::ff/wallet.home-activity)
{:id :activity :label (i18n/label :t/activity) :accessibility-label :activity-tab})])
(defn- render-cards
[cards ref]
[rn/flat-list
{:ref #(reset! ref %)
:style style/accounts-list
:content-container-style style/accounts-list-container
:data cards
:horizontal true
:separator [rn/view {:style style/separator}]
:render-fn (fn [item] [quo/account-card item])
:shows-horizontal-scroll-indicator false}])
(defn- render-tabs
[data on-change default-active]
[quo/tabs
{:style style/tabs
:size 32
:default-active default-active
:data data
:on-change #(on-change %)}])
(defn view
[]
(let [[selected-tab set-selected-tab] (rn/use-state (:id (first tabs-data)))
@@ -45,7 +69,9 @@
networks (rf/sub [:wallet/selected-network-details])
account-cards-data (rf/sub [:wallet/account-cards-data])
cards (conj account-cards-data (new-account-card-data))
{:keys [formatted-balance]} (rf/sub [:wallet/aggregated-token-values-and-balance])]
[init-loaded? set-init-loaded] (rn/use-state false)
{:keys [formatted-balance]} (rf/sub [:wallet/aggregated-token-values-and-balance])
theme (quo.theme/use-theme)]
(rn/use-effect (fn []
(when (and @account-list-ref (pos? (count cards)))
(.scrollToOffset ^js @account-list-ref
@@ -53,33 +79,32 @@
{:animated true
:offset 0})))
[(count cards)])
(rn/use-effect
#(when (and (boolean? tokens-loading?) (not tokens-loading?) (not init-loaded?))
(set-init-loaded true))
[tokens-loading?])
[rn/view {:style (style/home-container)}
[common.top-nav/view]
[rn/view
[quo/wallet-overview
{:state (if tokens-loading? :loading :default)
:time-frame :none
:metrics :none
:balance formatted-balance
:networks networks
:dropdown-on-press #(rf/dispatch [:show-bottom-sheet {:content network-filter/view}])}]]
(when (ff/enabled? ::ff/wallet.graph) [quo/wallet-graph {:time-frame :empty}])
[rn/flat-list
{:ref #(reset! account-list-ref %)
:style style/accounts-list
:content-container-style style/accounts-list-container
:data cards
:horizontal true
:separator [rn/view {:style style/separator}]
:render-fn (fn [item] [quo/account-card item])
:shows-horizontal-scroll-indicator false}]
[quo/tabs
{:style style/tabs
:size 32
:default-active selected-tab
:data tabs-data
:on-change (fn [tab]
(when (= :activity tab)
(rf/dispatch [:wallet/fetch-activities]))
(set-selected-tab tab))}]
[tabs/view {:selected-tab selected-tab}]]))
[refreshable-flat-list/view
{:refresh-control [rn/refresh-control
{:refreshing (and tokens-loading? init-loaded?)
:colors [colors/neutral-40]
:tint-color colors/neutral-40
:on-refresh #(rf/dispatch [:wallet/get-accounts])}]
:header [rn/view {:style (style/header-container theme)}
[quo/wallet-overview
{:state (if tokens-loading? :loading :default)
:time-frame :none
:metrics :none
:balance formatted-balance
:networks networks
:dropdown-on-press #(rf/dispatch [:show-bottom-sheet
{:content network-filter/view}])}]
(when (ff/enabled? ::ff/wallet.graph)
[quo/wallet-graph {:time-frame :empty}])
[render-cards cards account-list-ref]
[render-tabs tabs-data set-selected-tab selected-tab]]
:sticky-header-indices [0]
:data []
:render-fn #()
:footer [tabs/view {:selected-tab selected-tab}]}]]))
+4 -1
View File
@@ -21,10 +21,10 @@
[status-im.contexts.profile.push-notifications.events :as notifications]
[status-im.contexts.shell.jump-to.state :as shell.state]
[status-im.contexts.shell.jump-to.utils :as shell.utils]
[status-im.feature-flags :as ff]
[status-im.navigation.core :as navigation]
status-im.contexts.wallet.signals
status-im.events
status-im.navigation.core
[status-im.setup.dev :as dev]
[status-im.setup.global-error :as global-error]
[status-im.setup.interceptors :as interceptors]
@@ -63,6 +63,9 @@
(async-storage/get-item :selected-stack-id #(shell.utils/change-selected-stack-id % nil nil))
(async-storage/get-item :screen-height #(reset! shell.state/screen-height %))
(when config/quo-preview-enabled?
(ff/load-flags))
(dev/setup)
(log/info "hermesEnabled ->" (is-hermes))
+41 -14
View File
@@ -1,6 +1,7 @@
(ns status-im.feature-flags
(:require
[clojure.string :as string]
[react-native.async-storage :as async-storage]
[react-native.config :as config]
[reagent.core :as reagent]))
@@ -8,20 +9,25 @@
[k]
(= "1" (config/get-config k)))
(def ^:private initial-flags
{::community.edit-account-selection (enabled-in-env? :FLAG_EDIT_ACCOUNT_SELECTION_ENABLED)
::settings.wallet-settings (enabled-in-env? :FLAG_WALLET_SETTINGS_ENABLED)
::settings.keypairs-and-accounts (enabled-in-env?
:FLAG_WALLET_SETTINGS_KEYPAIRS_AND_ACCOUNTS_ENABLED)
::wallet.activities (enabled-in-env? :FLAG_WALLET_ACTIVITY_ENABLED)
::wallet.assets-modal-hide (enabled-in-env? :FLAG_ASSETS_MODAL_HIDE)
::wallet.assets-modal-manage-tokens (enabled-in-env? :FLAG_ASSETS_MODAL_MANAGE_TOKENS)
::wallet.bridge-token (enabled-in-env? :FLAG_BRIDGE_TOKEN_ENABLED)
::wallet.contacts (enabled-in-env? :FLAG_CONTACTS_ENABLED)
::wallet.edit-derivation-path (enabled-in-env? :FLAG_EDIT_DERIVATION_PATH)
::wallet.graph (enabled-in-env? :FLAG_GRAPH_ENABLED)
::wallet.import-private-key (enabled-in-env? :FLAG_IMPORT_PRIVATE_KEY_ENABLED)
::wallet.long-press-watch-only-asset (enabled-in-env? :FLAG_LONG_PRESS_WATCH_ONLY_ASSET_ENABLED)
::wallet.swap (enabled-in-env? :FLAG_SWAP_ENABLED)
::wallet.wallet-connect (enabled-in-env? :FLAG_WALLET_CONNECT_ENABLED)})
(defonce ^:private feature-flags-config
(reagent/atom
{::community.edit-account-selection (enabled-in-env? :FLAG_EDIT_ACCOUNT_SELECTION_ENABLED)
::wallet.activities (enabled-in-env? :FLAG_WALLET_ACTIVITY_ENABLED)
::wallet.assets-modal-hide (enabled-in-env? :FLAG_ASSETS_MODAL_HIDE)
::wallet.assets-modal-manage-tokens (enabled-in-env? :FLAG_ASSETS_MODAL_MANAGE_TOKENS)
::wallet.bridge-token (enabled-in-env? :FLAG_BRIDGE_TOKEN_ENABLED)
::wallet.contacts (enabled-in-env? :FLAG_CONTACTS_ENABLED)
::wallet.edit-derivation-path (enabled-in-env? :FLAG_EDIT_DERIVATION_PATH)
::wallet.graph (enabled-in-env? :FLAG_GRAPH_ENABLED)
::wallet.import-private-key (enabled-in-env? :FLAG_IMPORT_PRIVATE_KEY_ENABLED)
::wallet.long-press-watch-only-asset (enabled-in-env? :FLAG_LONG_PRESS_WATCH_ONLY_ASSET_ENABLED)
::wallet.swap (enabled-in-env? :FLAG_SWAP_ENABLED)
::wallet.wallet-connect (enabled-in-env? :FLAG_WALLET_CONNECT_ENABLED)}))
(reagent/atom initial-flags))
(defn feature-flags [] @feature-flags-config)
@@ -37,7 +43,28 @@
(defn toggle
[flag]
(swap! feature-flags-config update flag not))
(let [new-flags (update @feature-flags-config flag not)]
(async-storage/set-item!
:feature-flags
new-flags
(fn []
(reset! feature-flags-config new-flags)))))
(defn load-flags
[]
(async-storage/get-item
:feature-flags
(fn [flags]
(when flags
(reset! feature-flags-config flags)))))
(defn reset-flags
[]
(async-storage/set-item!
:feature-flags
initial-flags
(fn []
(reset! feature-flags-config initial-flags))))
(defn alert
[flag action]
+7
View File
@@ -57,6 +57,7 @@
[status-im.contexts.profile.settings.screens.password.change-password.view :as change-password]
[status-im.contexts.profile.settings.screens.password.view :as settings-password]
[status-im.contexts.profile.settings.view :as settings]
[status-im.contexts.settings.wallet.keypairs-and-accounts.view :as keypairs-and-accounts]
[status-im.contexts.settings.wallet.saved-addresses.view :as saved-addresses-settings]
[status-im.contexts.settings.wallet.wallet-options.view :as wallet-options]
[status-im.contexts.shell.activity-center.view :as activity-center]
@@ -501,6 +502,12 @@
:options options/transparent-modal-screen-options
:component saved-addresses-settings/view}
{:name :screen/settings.keypairs-and-accounts
:options (merge
options/transparent-modal-screen-options
options/dark-screen)
:component keypairs-and-accounts/view}
{:name :screen/settings-messages
:options options/transparent-modal-screen-options
:component settings.messages/view}
+7 -14
View File
@@ -90,19 +90,12 @@
manually call `setup!`, otherwise you won't see any changes. It is safe and
even expected you will call `setup!` multiple times in REPLs."
[]
(try
(schema.registry/init-global-registry)
(register-schemas)
(schema.registry/init-global-registry)
(register-schemas)
;; In theory not necessary, but sometimes in a REPL session the dev needs to
;; call unstrument! manually.
(malli.instrument/unstrument!)
;; In theory not necessary, but sometimes in a REPL session the dev needs to
;; call unstrument! manually.
(malli.instrument/unstrument!)
(malli.dev/start! {:report (schema/reporter)})
(log/debug "Schemas initialized.")
;; It is relatively easy to write invalid schemas, but we don't want to
;; block the app from initializing if such errors happen, at least not until
;; Malli matures in the project.
(catch js/Error e
(log/error "Failed to initialize schemas" {:error e}))))
(malli.dev/start! {:report (schema/reporter)})
(log/debug "Schemas initialized."))
+16
View File
@@ -427,3 +427,19 @@
(fn [[permissions] _]
(let [all-tokens (apply concat (map :tokens permissions))]
(boolean (some seq all-tokens)))))
(re-frame/reg-sub
:communities/token-gated-not-a-member?
(fn [[_ community-id]]
[(re-frame/subscribe [:communities/community community-id])])
(fn [{:keys [token-permissions joined] :as community}]
(let [token-permission-to-become-member-or-admin (->> token-permissions
(into {})
vals
(some (fn [{community-permission-type :type}]
(boolean
(constants/community-role-permissions
community-permission-type)))))]
(or joined
(and (not joined) (empty? token-permissions) (seq community))
(not token-permission-to-become-member-or-admin)))))
+6 -1
View File
@@ -279,7 +279,12 @@
:<- [:initials-avatar-font-file]
:<- [:theme]
(fn [[profile ens-names port font-file theme] [_ avatar-opts]]
(replace-multiaccount-image-uri profile ens-names port font-file avatar-opts theme)))
;; Right after logout, this subscription is recomputed, but the sub
;; `:profile/profile` output will always be nil. We skip any further
;; processing because it's wasteful and because it will trigger a schema
;; error.
(when profile
(replace-multiaccount-image-uri profile ens-names port font-file avatar-opts theme))))
(re-frame/reg-sub
:profile/image
+29
View File
@@ -1,6 +1,7 @@
(ns status-im.subs.wallet.wallet
(:require [clojure.string :as string]
[re-frame.core :as rf]
[status-im.constants :as constants]
[status-im.contexts.wallet.common.utils :as utils]
[status-im.contexts.wallet.common.utils.networks :as network-utils]
[status-im.subs.wallet.add-account.address-to-watch]
@@ -158,6 +159,34 @@
:goerli-enabled? goerli-enabled?})
selected-networks))))
(defn- format-settings-keypair-accounts
[accounts
{:keys [networks size]
:or {networks []
size 32}}]
(->> accounts
(keep (fn [{:keys [path customization-color emoji name address]}]
(when-not (string/starts-with? path constants/path-eip1581)
{:account-props {:customization-color customization-color
:size size
:emoji emoji
:type :default
:name name
:address address}
:networks networks
:state :default
:action :none})))))
(rf/reg-sub
:wallet/settings-keypairs-accounts
:<- [:wallet/keypairs]
(fn [keypairs [_ format-options]]
(->> keypairs
(map (fn [{:keys [accounts name type]}]
{:type (keyword type)
:name name
:accounts (format-settings-keypair-accounts accounts format-options)})))))
(rf/reg-sub
:wallet/derivation-path-state
:<- [:wallet/create-account]
+103
View File
@@ -554,6 +554,109 @@
(= keypairs
(rf/sub [sub-name])))))
(def chat-account
{:path "m/43'/60'/1581'/0'/0"
:emoji ""
:key-uid "abc"
:address "address-1"
:color-id ""
:wallet false
:name "My Profile"
:type "generated"
:chat true
:customization-color :blue
:hidden false
:removed false})
(def wallet-account
{:path "m/44'/60'/0'/0/0"
:emoji "🤡"
:key-uid "abc"
:address "address-2"
:wallet true
:name "My Account"
:type "generated"
:chat false
:customization-color :primary
:hidden false
:removed false})
(def keypairs-accounts
{:key-uid "abc"
:name "My Profile"
:type "profile"
:accounts []})
(h/deftest-sub :wallet/settings-keypairs-accounts
[sub-name]
(testing "returns formatted key-pairs and accounts"
(swap! rf-db/app-db
assoc-in
[:wallet :keypairs]
[(assoc keypairs-accounts
:accounts
[wallet-account])])
(let [{:keys [customization-color name address emoji]} wallet-account]
(is
(match? [{:name (:name keypairs-accounts)
:type (keyword (:type keypairs-accounts))
:accounts [{:account-props {:customization-color customization-color
:size 32
:emoji emoji
:type :default
:name name
:address address}
:networks []
:state :default
:action :none}]}]
(rf/sub [sub-name])))))
(testing "allows for passing account format options"
(swap! rf-db/app-db
assoc-in
[:wallet :keypairs]
[(assoc keypairs-accounts
:accounts
[wallet-account])])
(let [{:keys [customization-color
name
address
emoji]} wallet-account
network-options [{:network-name :ethereum :short-name "eth"}
{:network-name :optimism :short-name "opt"}
{:network-name :arbitrum :short-name "arb1"}]
size-option 20]
(is
(match? [{:name (:name keypairs-accounts)
:type (keyword (:type keypairs-accounts))
:accounts [{:account-props {:customization-color customization-color
:size size-option
:emoji emoji
:type :default
:name name
:address address}
:networks network-options
:state :default
:action :none}]}]
(rf/sub [sub-name
{:networks network-options
:size size-option}])))))
(testing "filters non-wallet accounts"
(swap! rf-db/app-db
assoc-in
[:wallet :keypairs]
[(assoc keypairs-accounts
:accounts
[chat-account])])
(is
(match? [{:name (:name keypairs-accounts)
:type (keyword (:type keypairs-accounts))
:accounts []}]
(rf/sub [sub-name])))))
(def local-suggestions ["a" "b"])
(h/deftest-sub :wallet/local-suggestions
-9
View File
@@ -4,7 +4,6 @@
[re-frame.core :as re-frame]
[re-frame.interceptor :as interceptor]
[re-frame.interop :as rf.interop]
[reagent.core :as reagent]
[taoensso.timbre :as log]
[utils.datetime :as datetime])
(:refer-clojure :exclude [merge reduce]))
@@ -80,14 +79,6 @@
(swap! handler-nesting-level dec)
res))
(defn delay-render
[_]
(let [render? (reagent/atom false)]
(js/setTimeout #(reset! render? true) 0)
(fn [content]
(when @render?
content))))
(def sub (comp deref re-frame/subscribe))
(def dispatch re-frame/dispatch)
+3 -3
View File
@@ -3,7 +3,7 @@
"_comment": "Instead use: scripts/update-status-go.sh <rev>",
"owner": "status-im",
"repo": "status-go",
"version": "v0.179.15",
"commit-sha1": "7ba78cd6e97ba1180e2cbab9ad8fc1e666b92a73",
"src-sha256": "0gafxkha9mcdnl91w1f786ax0z3yqgl55qblw9xazhm7lpm44vgj"
"version": "v0.179.13",
"commit-sha1": "f3f48654f54aebbb4949129f930fef648d8da8f9",
"src-sha256": "09gcr6fgx6v4qdp83w0n2ynnlvwjqid477jgpqjk57l5wfrv2raq"
}
+1 -1
View File
@@ -1,7 +1,7 @@
const WebSocket = require('ws');
const { NativeModules } = require('react-native');
require('@react-native-async-storage/async-storage/jest/async-storage-mock');
mockAsyncStorage = require('@react-native-async-storage/async-storage/jest/async-storage-mock');
require('react-native-gesture-handler/jestSetup');
require('react-native-reanimated/src/reanimated2/jestUtils').setUpTests();
+1
View File
@@ -2484,6 +2484,7 @@
"address-no-activity": "This address has no activity",
"scanning": "Scanning for activity...",
"keypairs": "Key pairs",
"keypairs-and-accounts": "Key pairs and accounts",
"keypairs-accounts-and-addresses": "Key pairs, accounts and addresses",
"keypairs-description": "Select key pair to derive your new account from",
"confirm-account-origin": "Confirm account origin",