Skip to content

Commit

Permalink
Merge branch 'develop' into jc/remove-legacy-wallet
Browse files Browse the repository at this point in the history
  • Loading branch information
J-Son89 authored Feb 13, 2024
2 parents 60fb189 + c5df51d commit 936af92
Show file tree
Hide file tree
Showing 67 changed files with 1,234 additions and 459 deletions.
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export KEYSTORE_PATH ?= $(HOME)/.gradle/status-im.keystore
# Our custom config is located in nix/nix.conf
export NIX_USER_CONF_FILES = $(PWD)/nix/nix.conf
# Location of symlinks to derivations that should not be garbage collected
export _NIX_GCROOTS = /nix/var/nix/gcroots/per-user/$(USER)/status-mobile
export _NIX_GCROOTS = ./.nix-gcroots
# Defines which variables will be kept for Nix pure shell, use semicolon as divider
export _NIX_KEEP ?= TMPDIR,BUILD_ENV,\
BUILD_TYPE,BUILD_NUMBER,COMMIT_HASH,\
Expand Down Expand Up @@ -373,15 +373,20 @@ test-watch-for-repl: ##@test Watch all Clojure tests and support REPL connection
"until [ -f $$SHADOW_OUTPUT_TO ] ; do sleep 1 ; done ; node --require ./test-resources/override.js $$SHADOW_OUTPUT_TO --repl"

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

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

test-contract: export SHADOW_OUTPUT_TO := target/contract_test/test.js
test-contract: export SHADOW_NS_REGEXP := ^tests\.contract-test.*$$
test-contract: ##@test Run contract tests
test-contract: _test-clojure

android-test: jsbundle
android-test: export TARGET := android
android-test:
Expand Down
2 changes: 1 addition & 1 deletion ci/Jenkinsfile.android
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ library 'status-jenkins-lib@v1.8.5'
def isPRBuild = utils.isPRBuild()

pipeline {
agent { label 'linux && x86_64 && nix-2.14' }
agent { label 'linux && x86_64 && nix-2.19' }

options {
timestamps()
Expand Down
2 changes: 1 addition & 1 deletion ci/Jenkinsfile.ios
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ library 'status-jenkins-lib@v1.8.5'
def isPRBuild = utils.isPRBuild()

pipeline {
agent { label 'macos && arm64 && nix-2.14 && xcode-15.1' }
agent { label 'macos && arm64 && nix-2.19 && xcode-15.1' }

parameters {
string(
Expand Down
2 changes: 1 addition & 1 deletion ci/Jenkinsfile.tests
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ library 'status-jenkins-lib@v1.8.5'
def isPRBuild = utils.isPRBuild()

pipeline {
agent { label 'linux && x86_64 && nix-2.14' }
agent { label 'linux && x86_64 && nix-2.19' }

options {
timestamps()
Expand Down
6 changes: 4 additions & 2 deletions nix/DETAILS.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,10 @@ Would fail.

# Garbage Collection

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:
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:
```sh
_NIX_GCROOTS="${_NIX_GCROOTS:-/nix/var/nix/gcroots/per-user/${USER}/status-mobile}"
_NIX_GCROOTS="${_NIX_GCROOTS:-${GIT_ROOT}/.nix-gcroots}
```
These symlinks in turn will be symlinked from `/nix/var/nix/gcroots/auto` through use of `nix-store --add-gcroots`.
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.
4 changes: 2 additions & 2 deletions nix/scripts/gcroots.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

set -Ee

_NIX_GCROOTS="${_NIX_GCROOTS:-/nix/var/nix/gcroots/per-user/${USER}/status-mobile}"

GIT_ROOT=$(cd "${BASH_SOURCE%/*}" && git rev-parse --show-toplevel)
source "${GIT_ROOT}/nix/scripts/source.sh"
source "${GIT_ROOT}/scripts/colors.sh"

_NIX_GCROOTS="${_NIX_GCROOTS:-${GIT_ROOT}/.nix-gcroots}"

TARGET="${1}"
shift
if [[ -z "${TARGET}" ]]; then
Expand Down
8 changes: 3 additions & 5 deletions nix/scripts/version.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env bash
# WARNING: Versions 2.14, 2.15, 2.16 have an issue creating gcroots:
# https://github.com/NixOS/nix/issues/8564
export NIX_VERSION="2.13.4"
export NIX_PACKAGE="nixVersions.nix_2_13"
export NIX_VERSION="2.19.3"
export NIX_PACKAGE="nixVersions.nix_2_19"
export NIX_INSTALL_URL="https://nixos.org/releases/nix/nix-${NIX_VERSION}/install"
export NIX_INSTALL_SHA256="a9908cc48f5886b4f22172bdd2f9657873276fd295e78c6ed97fb308c6d284d0"
export NIX_INSTALL_SHA256="73d47b0ab783fddca1b2d44a03d52a74c97c28a1fc8ff5a29419079302ef9c3d"
export NIX_INSTALL_PATH="/tmp/nix-install-${NIX_VERSION}"
Binary file added resources/images/icons2/20x20/remove@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/icons2/20x20/remove@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion shadow-cljs.edn
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@
;; option setupFilesAfterEnv.
test-helpers.component-tests-preload
status-im.setup.schema-preload

quo.core-spec
status-im.core-spec]
:ns-regexp "component-spec$"
Expand Down
11 changes: 7 additions & 4 deletions src/quo/components/buttons/button/properties.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@

(def backgrounds #{:photo :blur})

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

Expand Down Expand Up @@ -87,8 +91,7 @@
type)]
(cond
(contains? #{:primary :positive :danger} type) (custom-color-type customization-color
icon-only?
theme)
icon-only?)
(and (= :photo background) (= type :grey)) (grey-photo theme pressed?)
(and (= :blur background) (= type :grey)) (grey-blur theme pressed?)
(and (= :blur background) (= type :outline)) (outline-blur theme pressed?)
Expand Down
105 changes: 48 additions & 57 deletions src/quo/components/drawers/bottom_actions/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
[quo.components.tags.context-tag.view :as context-tag]
[quo.foundations.colors :as colors]
[quo.theme :as quo.theme]
[react-native.blur :as blur]
[react-native.core :as rn]
[schema.core :as schema]
[utils.i18n :as i18n]))
Expand Down Expand Up @@ -41,65 +40,57 @@
(defn- view-internal
[{:keys [actions description description-text error-message role button-one-label button-two-label
blur? button-one-props button-two-props theme scroll? container-style]}]
[blur/view
{:blur-amount 20
:blur-type :transparent
:overlay-color (if blur?
colors/neutral-80-opa-1-blur
(colors/theme-colors colors/white-70-blur
colors/neutral-95-opa-70-blur
theme))}
[rn/view
{:style (merge (style/container scroll? blur? theme) container-style)}
(when (= description :top-error)
[rn/view {:style style/error-message}
[icon/icon
:i/alert
{:color (colors/theme-colors colors/danger-50 colors/danger-60 theme)
:size 16}]
[text/text
{:size :paragraph-2
:style {:color (colors/theme-colors colors/danger-50 colors/danger-60 theme)}}
error-message]])

(when (= description :top)
[rn/view
{:style style/description-top}
[text/text
{:size :paragraph-2
:style (style/description-top-text scroll? blur? theme)}
(i18n/label :t/eligible-to-join-as)]
[context-tag/view
{:type :icon
:size 24
:icon (role role-icon)
:blur? blur?
:context (i18n/label (keyword "t" role))}]])
[rn/view
{:style (merge (style/container scroll? blur? theme) container-style)}
(when (= description :top-error)
[rn/view {:style style/error-message}
[icon/icon
:i/alert
{:color (colors/theme-colors colors/danger-50 colors/danger-60 theme)
:size 16}]
[text/text
{:size :paragraph-2
:style {:color (colors/theme-colors colors/danger-50 colors/danger-60 theme)}}
error-message]])

[rn/view {:style style/buttons-container}
(when (= actions :two-actions)
[button/button
(merge
{:size 40
:background (when (or blur? scroll?) :blur)
:container-style style/button-container
:theme theme
:accessibility-label :button-two}
button-two-props)
button-two-label])
[button/button
(merge
{:size 40
:container-style style/button-container
:background (when (or blur? scroll?) :blur)
:theme theme
:accessibility-label :button-one}
button-one-props)
button-one-label]]
(when (= description :bottom)
(when (= description :top)
[rn/view
{:style style/description-top}
[text/text
{:size :paragraph-2
:style (style/description-bottom scroll? blur? theme)} description-text])]])
:style (style/description-top-text scroll? blur? theme)}
(i18n/label :t/eligible-to-join-as)]
[context-tag/view
{:type :icon
:size 24
:icon (role role-icon)
:blur? blur?
:context (i18n/label (keyword "t" role))}]])

[rn/view {:style style/buttons-container}
(when (= actions :two-actions)
[button/button
(merge
{:size 40
:background (when (or blur? scroll?) :blur)
:container-style style/button-container
:theme theme
:accessibility-label :button-two}
button-two-props)
button-two-label])
[button/button
(merge
{:size 40
:container-style style/button-container
:background (when (or blur? scroll?) :blur)
:theme theme
:accessibility-label :button-one}
button-one-props)
button-one-label]]
(when (= description :bottom)
[text/text
{:size :paragraph-2
:style (style/description-bottom scroll? blur? theme)} description-text])])

(def view
(quo.theme/with-theme
Expand Down
5 changes: 4 additions & 1 deletion src/quo/components/numbered_keyboard/keyboard_key/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
(defn- view-internal
[]
(let [pressed? (reagent/atom false)]
(fn [{:keys [disabled? theme blur? on-press type]} label]
(fn [{:keys [disabled? theme blur? on-press on-long-press type]} label]
(let [label-color (style/get-label-color disabled? theme blur?)
background-color (style/toggle-background-color @pressed? blur? theme)]
[rn/pressable
Expand All @@ -24,6 +24,9 @@
:on-press (fn []
(when on-press
(on-press label)))
:on-long-press (fn []
(when (fn? on-long-press)
(on-long-press label)))
:allow-multiple-presses? true
:on-press-in #(reset! pressed? true)
:on-press-out #(reset! pressed? false)
Expand Down
28 changes: 15 additions & 13 deletions src/quo/components/numbered_keyboard/numbered_keyboard/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,19 @@
[react-native.core :as rn]))

(defn keyboard-item
[{:keys [item type disabled? on-press blur? theme]}]
[{:keys [item type disabled? on-press on-long-press blur? theme]}]
[keyboard-key/view
{:disabled? disabled?
:on-press on-press
:blur? blur?
:theme theme
:type type}
{:disabled? disabled?
:on-press on-press
:on-long-press on-long-press
:blur? blur?
:theme theme
:type type}
item])

(defn- view-internal
[]
(fn [{:keys [disabled? theme blur? left-action delete-key? on-press on-delete
(fn [{:keys [disabled? theme blur? left-action delete-key? on-press on-delete on-long-press-delete
container-style]
:or {left-action :none}}]
[rn/view
Expand Down Expand Up @@ -62,12 +63,13 @@
:theme theme}]
(if delete-key?
[keyboard-item
{:item :i/backspace
:type :key
:disabled? disabled?
:on-press on-delete
:blur? blur?
:theme theme}]
{:item :i/backspace
:type :key
:disabled? disabled?
:on-press on-delete
:on-long-press on-long-press-delete
:blur? blur?
:theme theme}]
[keyboard-item])]]))

(def view (quo.theme/with-theme view-internal))
2 changes: 1 addition & 1 deletion src/quo/components/settings/data_item/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
{:accessibility-label :data-item
:disabled (not icon-right?)
:on-press on-press
:style (merge container-style (style/container size card? blur? theme))}
:style (merge (style/container size card? blur? theme) container-style)}
[left-side props]
(when (and (= :default status) (not= :small size))
[right-side
Expand Down
50 changes: 50 additions & 0 deletions src/quo/components/tags/collectible_tag/style.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
(ns quo.components.tags.collectible-tag.style
(:require
[quo.foundations.colors :as colors]))

(defn container
[size options blur? theme]
(let [hold? (= options :hold)]
(merge {:background-color (if blur?
(colors/theme-colors colors/neutral-80-opa-5 colors/white-opa-5 theme)
(colors/theme-colors colors/neutral-10 colors/neutral-90 theme))
:flex-direction :row
:align-items :center
:padding-left 2
:border-width (if hold? 1 0)
:border-radius 0
:border-color (colors/resolve-color :success theme)}
(condp = size
:size-24 {:height (if hold? 26 24)
:padding-right 10
:border-radius 8}
:size-32 {:height (if hold? 34 32)
:padding-right 12
:border-radius 10}))))

(defn options-icon
[size]
(assoc
(condp = size
:size-24 {:right -8
:top -8}
:size-32 {:right -6
:top -6})
:position
:absolute))

(defn collectible-img
[size]
(condp = size
:size-24 {:width 20
:height 20
:margin-right 6
:border-radius 6}
:size-32 {:width 28
:height 28
:margin-right 8
:border-radius 8}))

(defn label
[theme]
{:color (colors/theme-colors colors/neutral-100 colors/white theme)})
Loading

0 comments on commit 936af92

Please sign in to comment.