Skip to content

Commit 450cbcc

Browse files
authored
Merge branch 'develop' into share-community-qr-17993
2 parents fedaa36 + 5fdaf00 commit 450cbcc

File tree

150 files changed

+2691
-1131
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+2691
-1131
lines changed

Makefile

+8-3
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export KEYSTORE_PATH ?= $(HOME)/.gradle/status-im.keystore
4444
# Our custom config is located in nix/nix.conf
4545
export NIX_USER_CONF_FILES = $(PWD)/nix/nix.conf
4646
# Location of symlinks to derivations that should not be garbage collected
47-
export _NIX_GCROOTS = /nix/var/nix/gcroots/per-user/$(USER)/status-mobile
47+
export _NIX_GCROOTS = ./.nix-gcroots
4848
# Defines which variables will be kept for Nix pure shell, use semicolon as divider
4949
export _NIX_KEEP ?= TMPDIR,BUILD_ENV,\
5050
BUILD_TYPE,BUILD_NUMBER,COMMIT_HASH,\
@@ -373,15 +373,20 @@ test-watch-for-repl: ##@test Watch all Clojure tests and support REPL connection
373373
"until [ -f $$SHADOW_OUTPUT_TO ] ; do sleep 1 ; done ; node --require ./test-resources/override.js $$SHADOW_OUTPUT_TO --repl"
374374

375375
test-unit: export SHADOW_OUTPUT_TO := target/unit_test/test.js
376-
test-unit: export SHADOW_NS_REGEXP := ^(?!status-im\.integration-test).*-test$$
376+
test-unit: export SHADOW_NS_REGEXP := ^(?!tests\.integration-test)(?!tests-im\.contract-test).*-test$$
377377
test-unit: ##@test Run unit tests
378378
test-unit: _test-clojure
379379

380380
test-integration: export SHADOW_OUTPUT_TO := target/integration_test/test.js
381-
test-integration: export SHADOW_NS_REGEXP := ^status-im\.integration-test.*$$
381+
test-integration: export SHADOW_NS_REGEXP := ^tests\.integration-test.*$$
382382
test-integration: ##@test Run integration tests
383383
test-integration: _test-clojure
384384

385+
test-contract: export SHADOW_OUTPUT_TO := target/contract_test/test.js
386+
test-contract: export SHADOW_NS_REGEXP := ^tests\.contract-test.*$$
387+
test-contract: ##@test Run contract tests
388+
test-contract: _test-clojure
389+
385390
android-test: jsbundle
386391
android-test: export TARGET := android
387392
android-test:

ci/Jenkinsfile.android

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ library '[email protected]'
55
def isPRBuild = utils.isPRBuild()
66

77
pipeline {
8-
agent { label 'linux && x86_64 && nix-2.14' }
8+
agent { label 'linux && x86_64 && nix-2.19' }
99

1010
options {
1111
timestamps()

ci/Jenkinsfile.ios

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ library '[email protected]'
55
def isPRBuild = utils.isPRBuild()
66

77
pipeline {
8-
agent { label 'macos && arm64 && nix-2.14 && xcode-15.1' }
8+
agent { label 'macos && arm64 && nix-2.19 && xcode-15.1' }
99

1010
parameters {
1111
string(

ci/Jenkinsfile.tests

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ library '[email protected]'
55
def isPRBuild = utils.isPRBuild()
66

77
pipeline {
8-
agent { label 'linux && x86_64 && nix-2.14' }
8+
agent { label 'linux && x86_64 && nix-2.19' }
99

1010
options {
1111
timestamps()

nix/DETAILS.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,10 @@ Would fail.
8484

8585
# Garbage Collection
8686

87-
The `make nix-gc` target calls `nix-store --gc` and normally would remove almost everything, but to prevent that we place symlinks to protected derivations in `/nix/var/nix/gcroots` subfolder. Specifically:
87+
The `make nix-gc` target calls `nix-store --gc` and normally would remove almost everything, but to prevent that we place symlinks to protected derivations in `.nix-gcroots` folder. Specifically:
8888
```sh
89-
_NIX_GCROOTS="${_NIX_GCROOTS:-/nix/var/nix/gcroots/per-user/${USER}/status-mobile}"
89+
_NIX_GCROOTS="${_NIX_GCROOTS:-${GIT_ROOT}/.nix-gcroots}
9090
```
91+
These symlinks in turn will be symlinked from `/nix/var/nix/gcroots/auto` through use of `nix-store --add-gcroots`.
92+
9193
Whenever `nix/scripts/build.sh` or `nix/scripts/shell.sh` are called they update symlinks named after given targets in that folder. This in combination with `keep-outputs = true` set in `nix/nix.conf` prevents garbage collection from removing too much.

nix/scripts/gcroots.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
set -Ee
44

5-
_NIX_GCROOTS="${_NIX_GCROOTS:-/nix/var/nix/gcroots/per-user/${USER}/status-mobile}"
6-
75
GIT_ROOT=$(cd "${BASH_SOURCE%/*}" && git rev-parse --show-toplevel)
86
source "${GIT_ROOT}/nix/scripts/source.sh"
97
source "${GIT_ROOT}/scripts/colors.sh"
108

9+
_NIX_GCROOTS="${_NIX_GCROOTS:-${GIT_ROOT}/.nix-gcroots}"
10+
1111
TARGET="${1}"
1212
shift
1313
if [[ -z "${TARGET}" ]]; then

nix/scripts/version.sh

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#!/usr/bin/env bash
2-
# WARNING: Versions 2.14, 2.15, 2.16 have an issue creating gcroots:
3-
# https://github.com/NixOS/nix/issues/8564
4-
export NIX_VERSION="2.13.4"
5-
export NIX_PACKAGE="nixVersions.nix_2_13"
2+
export NIX_VERSION="2.19.3"
3+
export NIX_PACKAGE="nixVersions.nix_2_19"
64
export NIX_INSTALL_URL="https://nixos.org/releases/nix/nix-${NIX_VERSION}/install"
7-
export NIX_INSTALL_SHA256="a9908cc48f5886b4f22172bdd2f9657873276fd295e78c6ed97fb308c6d284d0"
5+
export NIX_INSTALL_SHA256="73d47b0ab783fddca1b2d44a03d52a74c97c28a1fc8ff5a29419079302ef9c3d"
86
export NIX_INSTALL_PATH="/tmp/nix-install-${NIX_VERSION}"
695 Bytes
Loading
1.02 KB
Loading
1.05 KB
Loading
1.69 KB
Loading
1.01 KB
Loading
1.59 KB
Loading
181 Bytes
Loading
217 Bytes
Loading

shadow-cljs.edn

-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@
176176
;; option setupFilesAfterEnv.
177177
test-helpers.component-tests-preload
178178
status-im.setup.schema-preload
179-
180179
quo.core-spec
181180
status-im.core-spec]
182181
:ns-regexp "component-spec$"

src/quo/components/buttons/button/properties.cljs

+33-25
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,19 @@
44

55
(def backgrounds #{:photo :blur})
66

7-
(defn custom-color-type
7+
;; Note: We hardcode the :light theme for the background-color and apply an overlay when necessary, such
8+
;; as for dark themes and pressed states. This approach is taken because, for communities, we only have
9+
;; one color available, which is the light theme version.
10+
;; For more information, see the related issue: https://github.com/status-im/status-mobile/issues/16396
11+
(defn- custom-color-type
812
[customization-color icon-only?]
9-
{:icon-color colors/white-opa-70
10-
:label-color colors/white
11-
:background-color (colors/custom-color customization-color 50)
12-
:border-radius (when icon-only? 24)})
13+
{:icon-color colors/white-opa-70
14+
:label-color colors/white
15+
:background-color (colors/resolve-color customization-color :light)
16+
:border-radius (when icon-only? 24)
17+
:overlay-customization-color customization-color})
1318

14-
(defn grey-photo
19+
(defn- grey-photo
1520
[theme pressed?]
1621
{:icon-color (colors/theme-colors colors/neutral-80-opa-40 colors/white-opa-70 theme)
1722
:label-color (colors/theme-colors colors/neutral-100 colors/white theme)
@@ -24,23 +29,23 @@
2429
theme))
2530
:blur-type (if (= theme :light) :light :dark)})
2631

27-
(defn grey-blur
32+
(defn- grey-blur
2833
[theme pressed?]
2934
{:icon-color (colors/theme-colors colors/neutral-80-opa-40 colors/white-opa-70 theme)
3035
:label-color (colors/theme-colors colors/neutral-100 colors/white theme)
3136
:background-color (if pressed?
3237
(colors/theme-colors colors/neutral-80-opa-10 colors/white-opa-10 theme)
3338
(colors/theme-colors colors/neutral-80-opa-5 colors/white-opa-5 theme))})
3439

35-
(defn outline-blur
40+
(defn- outline-blur
3641
[theme pressed?]
3742
{:icon-color (colors/theme-colors colors/neutral-80-opa-40 colors/white-opa-40 theme)
3843
:label-color (colors/theme-colors colors/neutral-100 colors/white theme)
3944
:border-color (if pressed?
4045
(colors/theme-colors colors/neutral-80-opa-20 colors/white-opa-20 theme)
4146
(colors/theme-colors colors/neutral-80-opa-10 colors/white-opa-10 theme))})
4247

43-
(defn grey
48+
(defn- grey
4449
[theme pressed?]
4550
{:icon-color (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)
4651
:label-color (colors/theme-colors colors/neutral-100 colors/white theme)
@@ -50,45 +55,48 @@
5055
colors/neutral-90
5156
theme))})
5257

53-
(defn dark-grey
58+
(defn- dark-grey
5459
[theme pressed?]
5560
{:icon-color (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)
5661
:label-color (colors/theme-colors colors/neutral-100 colors/white theme)
5762
:background-color (if pressed?
5863
(colors/theme-colors colors/neutral-30 colors/neutral-60 theme)
5964
(colors/theme-colors colors/neutral-20 colors/neutral-90 theme))})
6065

61-
(defn outline
66+
(defn- outline
6267
[theme pressed?]
6368
{:icon-color (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)
6469
:label-color (colors/theme-colors colors/neutral-100 colors/white theme)
6570
:border-color (if pressed?
6671
(colors/theme-colors colors/neutral-40 colors/neutral-60 theme)
6772
(colors/theme-colors colors/neutral-30 colors/neutral-70 theme))})
6873

69-
(defn ghost
74+
(defn- ghost
7075
[theme pressed?]
7176
{:icon-color (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)
7277
:label-color (colors/theme-colors colors/neutral-100 colors/white theme)
7378
:background-color (when pressed?
7479
(colors/theme-colors colors/neutral-10 colors/neutral-80 theme))})
7580

76-
(defn black
81+
(defn- black
7782
[pressed?]
7883
{:label-color colors/white
7984
:background-color (if pressed? colors/neutral-80 colors/neutral-95)})
8085

8186
(defn get-values
8287
[{:keys [customization-color theme type background pressed? icon-only?]}]
83-
(cond
84-
(= type :primary) (custom-color-type customization-color icon-only?)
85-
(= type :positive) (custom-color-type customization-color icon-only?)
86-
(= type :danger) (custom-color-type customization-color icon-only?)
87-
(and (= :photo background) (= type :grey)) (grey-photo theme pressed?)
88-
(and (= :blur background) (= type :grey)) (grey-blur theme pressed?)
89-
(and (= :blur background) (= type :outline)) (outline-blur theme pressed?)
90-
(= type :grey) (grey theme pressed?)
91-
(= type :dark-grey) (dark-grey theme pressed?)
92-
(= type :outline) (outline theme pressed?)
93-
(= type :ghost) (ghost theme pressed?)
94-
(= type :black) (black pressed?)))
88+
(let [customization-color (get {:primary customization-color
89+
:positive :success
90+
:danger :danger}
91+
type)]
92+
(cond
93+
(contains? #{:primary :positive :danger} type) (custom-color-type customization-color
94+
icon-only?)
95+
(and (= :photo background) (= type :grey)) (grey-photo theme pressed?)
96+
(and (= :blur background) (= type :grey)) (grey-blur theme pressed?)
97+
(and (= :blur background) (= type :outline)) (outline-blur theme pressed?)
98+
(= type :grey) (grey theme pressed?)
99+
(= type :dark-grey) (dark-grey theme pressed?)
100+
(= type :outline) (outline theme pressed?)
101+
(= type :ghost) (ghost theme pressed?)
102+
(= type :black) (black pressed?))))

src/quo/components/buttons/button/view.cljs

+4-7
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,10 @@
3737
pressed? on-press-in on-press-out allow-multiple-presses?]
3838
:or {type :primary
3939
size 40
40-
customization-color (cond (= type :primary) :blue
41-
(= type :positive) :success
42-
(= type :danger) :danger
43-
:else nil)}}
40+
customization-color (if (= type :primary) :blue nil)}}
4441
children]
4542
(let [{:keys [icon-color background-color label-color border-color blur-type
46-
blur-overlay-color border-radius]}
43+
blur-overlay-color border-radius overlay-customization-color]}
4744
(button-properties/get-values {:customization-color customization-color
4845
:background background
4946
:type type
@@ -79,9 +76,9 @@
7976
:icon-left icon-left
8077
:icon-right icon-right})
8178
inner-style)}
82-
(when customization-color
79+
(when overlay-customization-color
8380
[customization-colors/overlay
84-
{:customization-color customization-color
81+
{:customization-color overlay-customization-color
8582
:theme theme
8683
:pressed? (if pressed? pressed? @pressed-state?)}])
8784
(when (= background :photo)

src/quo/components/colors/color_picker/view.cljs

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
(when (and @ref (>= index 0))
3636
(some-> ^js @ref
3737
(.scrollToIndex #js
38-
{:animated true
38+
{:animated false
3939
:index index
4040
:viewPosition 0.5})))))
4141
50)))

src/quo/components/drawers/bottom_actions/component_spec.cljs

+42-16
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,60 @@
33
[quo.components.drawers.bottom-actions.view :as bottom-actions]
44
[test-helpers.component :as h]))
55

6+
(defn- render
7+
[component]
8+
(h/render-with-theme-provider component :light))
9+
610
(h/describe "bottom actions tests"
711
(h/test "default render with no description and single action button"
8-
(h/render [bottom-actions/view {:button-one-label "Request to join"}])
12+
(render [bottom-actions/view {:actions :one-action :button-one-label "Request to join"}])
913
(h/is-truthy (h/get-by-text "Request to join")))
1014

11-
(h/test "render with description"
12-
(h/render [bottom-actions/view {:description "Sample description"}])
13-
(h/is-truthy (h/get-by-text "Sample description")))
15+
(h/test "render with description & 1 action"
16+
(render [bottom-actions/view
17+
{:description :bottom
18+
:description-text "Sample description"
19+
:actions :one-action
20+
:button-one-label "Request to join"}])
21+
(h/is-truthy (h/get-by-text "Sample description"))
22+
(h/is-truthy (h/get-by-text "Request to join")))
1423

1524
(h/test "render with 2 actions"
1625
(let [button-one "Button One"
1726
button-two "Button Two"]
18-
(h/render [bottom-actions/view
19-
{:actions :2-actions
20-
:button-one-label button-one
21-
:button-one-props {:icon-left :i/arrow-left}
22-
:button-two-label button-two}])
27+
(render [bottom-actions/view
28+
{:actions :two-actions
29+
:button-one-label button-one
30+
:button-one-props {:icon-left :i/arrow-left}
31+
:button-two-label button-two}])
2332
(h/is-truthy (h/get-by-text button-one))
2433
(h/is-truthy (h/get-by-label-text :icon))
2534
(h/is-truthy (h/get-by-text button-two))))
2635

2736
(h/test "render disabled button"
28-
(h/render [bottom-actions/view
29-
{:description "Sample description"
30-
:button-one-props {:disabled? true}
31-
:button-one-label "button"}])
37+
(render [bottom-actions/view
38+
{:description :bottom
39+
:actions :one-action
40+
:description-text "Sample description"
41+
:button-one-props {:disabled? true}
42+
:button-one-label "button"}])
3243
(h/is-disabled (h/get-by-label-text :button-one)))
3344

34-
(h/test "sane defaults"
35-
(h/render [bottom-actions/view {}])
36-
(h/is-truthy (h/get-by-label-text :button-one))))
45+
(h/test "render with error & 1 action"
46+
(render [bottom-actions/view
47+
{:description :top-error
48+
:error-message "Sample error"
49+
:actions :one-action
50+
:button-one-label "Request to join"}])
51+
(h/is-truthy (h/get-by-text "Sample error"))
52+
(h/is-truthy (h/get-by-text "Request to join")))
53+
54+
(h/test "render with top description & 1 action"
55+
(render [bottom-actions/view
56+
{:description :top
57+
:role :admin
58+
:actions :one-action
59+
:button-one-label "Request to join"}])
60+
(h/is-truthy (h/get-by-text "Eligible to join as"))
61+
(h/is-truthy (h/get-by-text "Admin"))
62+
(h/is-truthy (h/get-by-text "Request to join"))))

0 commit comments

Comments
 (0)