From 60545a6608686af968a4dbdae7a1696611354c3e Mon Sep 17 00:00:00 2001 From: codemaster <39961806+codemaster115@users.noreply.github.com> Date: Wed, 21 Jun 2023 08:54:35 -0400 Subject: [PATCH] fix: activity center notifications swipe style (#16222) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: remove placeholder icons * fix: swipe action button style * lint fix * fix: swipe action button space * fix: lint * Fix for two separate sections with different colors shown on the chat screen (dark mode) (#16265) * Fix for two separate sections with different colors shown on the chat screen (dark mode) * lint-fix * temporary hide mutual update's messages (#16290) * chore: fix unit test for slide button (#16302) * nix: upgrade interpreter from 2.11.1 to 2.14.1 This is a mild upgrade that should not cause any controversy. You can read about changes here: - https://nixos.org/manual/nix/stable/release-notes/rl-2.12.html - https://nixos.org/manual/nix/stable/release-notes/rl-2.13.html - https://nixos.org/manual/nix/stable/release-notes/rl-2.14.html Relevant `infra-ci` change: - https://github.com/status-im/infra-ci/commit/e4e9796f The simplest way to upgrade to `2.14` your version locally is using: ```sh nix-channel --update nix-env -iA nixpkgs.nixVersions.nix_2_14 nixpkgs.cacert sudo systemctl daemon-reload sudo systemctl restart nix-daemon ``` For MacOS the instructions are a bit different: https://nixos.org/manual/nix/stable/installation/upgrading.html Keep in mind you should use `nixpkgs.nixVersions.nix_2_14` instead of just `nixpkgs.nix` to avoid getting newer than `2.14`. Signed-off-by: Jakub Sokołowski * nix: add upgrade script for Nix interpreter Now developers can upgrade to current Nix version using just: ```sh make nix-upgrade ``` For manual instructions see: https://nixos.org/manual/nix/stable/installation/upgrading.html Signed-off-by: Jakub Sokołowski * fix switcher cards position in ios (#16301) * Fix community tags and button spacing (#16292) Linked to https://github.com/status-im/status-mobile/issues/16119, fixes these issues: - Clipped community tags. They should extend to the edge of the screen. - Outdated information box message. Updated according suggestion in Figma https://www.figma.com/file/h9wo4GipgZURbqqr1vShFN/Communities-for-Mobile?type=design&node-id=7035-462899&t=wED97E4Mtv9v6OXf-0 - Add correct padding between community tags and the Request to join Community button. * Add decision about team structure & wallet team * [#16118] bottom nav tab notification color (#16236) * [#16066] bottom sheet height (#16285) * Update prettier config for the project. (#16303) * Update prettier config for the project. * Add prettier to make lint-fix. * fix: placeholder icons for join community, identity verification request * fix: lint * Make profile photos visible by default (#16095) * Fix incorrect channel option (#16314) * e2e: tests fixes * tests: fix type of shell used for linting Otherwise Node modules are not installed. Signed-off-by: Jakub Sokołowski * nix: upgrade nixpkgs to latest nixos-22.11 Notable upgrades: * Bash `5.1` to `5.2` * Git `2.37.3` to `2.40.1` * Curl `7.85.0` to `8.0.1` * OpenSSL `3.0.5` to `3.0.8` * Go `1.18.6` to `1.18.9` * NodeJS `18.9.1` to `18.16.0` * Java `1.8.0_322` to `11.0.11` * Ruby `3.1.2` to `3.1.4` * Python `2.7.18` to `3.10.11` * Clojure `1.11.1.1165` to `1.11.1.1273` * Clj-kondo `v2022.10.05` to `v2023.04.14` * Zprint `1.2.5` to `1.2.6` * Bundler `2.3.22` to `2.4.13` * Gradle `6.9.2` to `6.9.4` * Android Platform Tools `33.0.2` to `33.0.3` * Android SDK Tools to Android SDK Command-Line Tools Removals: * Zprint since the version in `nixpkgs` was newer than in overlay. * Xcode wrapper definition was removed since my fixes were merged: - https://github.com/NixOS/nixpkgs/pull/204278 - https://github.com/NixOS/nixpkgs/pull/228696 Signed-off-by: Jakub Sokołowski * ci: build generic status-go and all shells When discussing caching of `status-go` with Sid I noticed that the build we cache daily created from our nightly build is different from the build we create locally due to a single input. In a release CI host we can see the IPFS URL is that of Infura: ``` > find /nix/store -maxdepth 1 -name '*-status-go-*android' | tail -n1 /nix/store/2cc8ilhx5g3k2awbn4sla61n4cml2405-status-go-0.130.1-d2cce5e-android > RESULT=$(find /nix/store -maxdepth 1 -name '*-status-go-*android' | tail -n1) > nix show-derivation $RESULT | tr ' ' '\n' | grep IpfsGateway github.com/status-im/status-go/params.IpfsGatewayURL=https://status-im.infura-ipfs.io/ipfs/ ``` But for a local build the URL is the default, which is our own gateway: ``` > nix-build --no-out-link -A targets.status-go.mobile.android /nix/store/1p53m7a6y1kg3vcyd8d06scf3bsyn5rk-status-go-0.157.2-47711c4-android > RESULT=$(nix-build --no-out-link -A targets.status-go.mobile.android) > nix show-derivation $RESULT | tr ' ' '\n' | grep IpfsGateway github.com/status-im/status-go/params.IpfsGatewayURL=https://ipfs.status.im/ ``` This difference causes builds of `status-go` that get uploaded to our Nix cache to not match what developers locally would build, which results in a cache miss. This changes the Nix cache CI jobs to instead of building only dependencies (`buildInuts`) to simply build the generic versions of `status-go` without nightly specific inputs. Signed-off-by: Jakub Sokołowski * nix: fix applying nix.conf by using correct env var According to this line from the docs: >The system-wide configuration file sysconfdir/nix/nix.conf (i.e. /etc/nix/nix.conf), >or $NIX_CONF_DIR/nix.conf if NIX_CONF_DIR is set. Values loaded in this file are not >forwarded to the Nix daemon. The client assumes that the daemon has already loaded them. https://nixos.org/manual/nix/stable/command-ref/conf-file.html#description Our usage of `NIX_CONF_DIR` has been wrong for a while now. The correct way of applying this config is using `NIX_USER_CONF_FILES`. In addition the `extra-substituters` no longer exists in the docs. Use of `trusted-substituters` is necessary according to: >At least one of the following conditions must be met for Nix to use a substituter: > >- the substituter is in the trusted-substituters list >- the user calling Nix is in the trusted-users list https://nixos.org/manual/nix/stable/command-ref/conf-file.html#conf-substituters Signed-off-by: Jakub Sokołowski * Upgrade `react-native-camera-kit` library to resolve camera issues in Sign In screen (#16248) Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com> * Update prettier script. (#16324) * Update prettier script. * Add target and component-spec to prettierignore. --------- Signed-off-by: Jakub Sokołowski Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com> Co-authored-by: Alexander Co-authored-by: flexsurfer Co-authored-by: Jamie Caprani Co-authored-by: Jakub Sokołowski Co-authored-by: Parvesh Monu Co-authored-by: Icaro Motta Co-authored-by: Andrea Maria Piana Co-authored-by: Ulises Manuel Cárdenas <90291778+ulisesmac@users.noreply.github.com> Co-authored-by: Rahul Pratap Co-authored-by: Yevheniia Berdnyk Co-authored-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com> --- .../notifications/activity_log/style.cljs | 11 ++++---- .../notification/admin/view.cljs | 4 +-- .../notification/common/style.cljs | 2 +- .../notification/common/view.cljs | 28 ++++++++++++------- .../notification/contact_requests/view.cljs | 4 +-- .../contact_verification/view.cljs | 8 +++--- .../notification/membership/view.cljs | 4 +-- .../contexts/activity_center/style.cljs | 3 +- 8 files changed, 35 insertions(+), 29 deletions(-) diff --git a/src/quo2/components/notifications/activity_log/style.cljs b/src/quo2/components/notifications/activity_log/style.cljs index 4d184d8ced..05f562f8b0 100644 --- a/src/quo2/components/notifications/activity_log/style.cljs +++ b/src/quo2/components/notifications/activity_log/style.cljs @@ -2,12 +2,11 @@ (:require [quo2.foundations.colors :as colors])) (def container - {:flex-direction :row - :flex-grow 1 - :align-items :flex-start - :padding-top 8 - :padding-horizontal 12 - :padding-bottom 12}) + {:flex-direction :row + :flex-grow 1 + :align-items :flex-start + :padding-top 8 + :padding-bottom 12}) (def icon {:height 32 diff --git a/src/status_im2/contexts/activity_center/notification/admin/view.cljs b/src/status_im2/contexts/activity_center/notification/admin/view.cljs index d8332788df..3f868c0c7f 100644 --- a/src/status_im2/contexts/activity_center/notification/admin/view.cljs +++ b/src/status_im2/contexts/activity_center/notification/admin/view.cljs @@ -11,14 +11,14 @@ [{:keys [style]} _] [common/swipe-button-container {:style (common-style/swipe-success-container style) - :icon :i/placeholder + :icon :i/done :text (i18n/label :t/accept)}]) (defn- swipe-button-decline [{:keys [style]} _] [common/swipe-button-container {:style (common-style/swipe-danger-container style) - :icon :i/placeholder + :icon :i/decline :text (i18n/label :t/decline)}]) (defn- swipeable diff --git a/src/status_im2/contexts/activity_center/notification/common/style.cljs b/src/status_im2/contexts/activity_center/notification/common/style.cljs index b618b48220..7fbf242457 100644 --- a/src/status_im2/contexts/activity_center/notification/common/style.cljs +++ b/src/status_im2/contexts/activity_center/notification/common/style.cljs @@ -1,7 +1,7 @@ (ns status-im2.contexts.activity-center.notification.common.style (:require [quo2.foundations.colors :as colors])) -(def swipe-action-width 72) +(def swipe-action-width 80) (def swipe-button-border-radius 16) (def user-avatar-tag diff --git a/src/status_im2/contexts/activity_center/notification/common/view.cljs b/src/status_im2/contexts/activity_center/notification/common/view.cljs index a451f5ee3e..511f6f2b3a 100644 --- a/src/status_im2/contexts/activity_center/notification/common/view.cljs +++ b/src/status_im2/contexts/activity_center/notification/common/view.cljs @@ -35,13 +35,14 @@ interpolation-translate-x on-press swipe-button - swipeable-ref]}] + swipeable-ref + style]}] (fn [_ ^js drag-x] (let [{:keys [height] :as extra} (extra-fn) opacity (.interpolate drag-x interpolation-opacity) translate-x (.interpolate drag-x interpolation-translate-x)] [gesture/rect-button - {:style {:border-radius style/swipe-button-border-radius} + {:style (merge {:border-radius style/swipe-button-border-radius} style) :accessibility-label :notification-swipe-action-button :on-press (fn [] (when @swipeable-ref @@ -51,7 +52,8 @@ [swipe-button {:style {:opacity opacity :transform [{:translateX translate-x}] - :height height}} + :height height + :width style/swipe-action-width}} extra]]))) (defn- close-active-swipeable @@ -70,7 +72,10 @@ [rn/view {:style style/swipe-text-wrapper} [quo/icon icon {:color colors/white}] - [quo/text {:style style/swipe-text} + [quo/text + {:style style/swipe-text + :size :paragraph-2 + :weight :medium} text]]]) (defn swipe-button-read-or-unread @@ -114,10 +119,11 @@ (into [gesture/swipeable (merge - {:ref #(reset! swipeable-ref %) - :accessibility-label :notification-swipeable - :friction 2 - :on-swipeable-will-open (close-active-swipeable active-swipeable swipeable-ref)} + {:ref #(reset! swipeable-ref %) + :accessibility-label :notification-swipeable + :friction 2 + :on-swipeable-will-open (close-active-swipeable active-swipeable swipeable-ref) + :children-container-style {:padding-horizontal 20}} (when left-button {:overshoot-left false :left-threshold style/swipe-action-width @@ -129,7 +135,8 @@ style/left-swipe-translate-x-interpolation-js :on-press left-on-press :swipe-button left-button - :swipeable-ref swipeable-ref})}) + :swipeable-ref swipeable-ref + :style {:left 8}})}) (when right-button {:overshoot-right false :right-threshold style/swipe-action-width @@ -141,5 +148,6 @@ style/right-swipe-translate-x-interpolation-js :on-press right-on-press :swipe-button right-button - :swipeable-ref swipeable-ref})}))] + :swipeable-ref swipeable-ref + :style {:right -8}})}))] children)))) diff --git a/src/status_im2/contexts/activity_center/notification/contact_requests/view.cljs b/src/status_im2/contexts/activity_center/notification/contact_requests/view.cljs index 815ce6fe07..a418845276 100644 --- a/src/status_im2/contexts/activity_center/notification/contact_requests/view.cljs +++ b/src/status_im2/contexts/activity_center/notification/contact_requests/view.cljs @@ -13,14 +13,14 @@ [{:keys [style]} _] [common/swipe-button-container {:style (common-style/swipe-success-container style) - :icon :i/placeholder + :icon :i/done :text (i18n/label :t/accept)}]) (defn- swipe-button-decline [{:keys [style]} _] [common/swipe-button-container {:style (common-style/swipe-danger-container style) - :icon :i/placeholder + :icon :i/decline :text (i18n/label :t/decline)}]) (defn- swipeable diff --git a/src/status_im2/contexts/activity_center/notification/contact_verification/view.cljs b/src/status_im2/contexts/activity_center/notification/contact_verification/view.cljs index d4861fbc59..cfc8deba1d 100644 --- a/src/status_im2/contexts/activity_center/notification/contact_verification/view.cljs +++ b/src/status_im2/contexts/activity_center/notification/contact_verification/view.cljs @@ -12,28 +12,28 @@ [{:keys [style]} _] [common/swipe-button-container {:style (common-style/swipe-danger-container style) - :icon :i/placeholder + :icon :i/decline :text (i18n/label :t/decline)}]) (defn- swipe-button-reply [{:keys [style]} _] [common/swipe-button-container {:style (common-style/swipe-primary-container style) - :icon :i/placeholder + :icon :i/reply :text (i18n/label :t/message-reply)}]) (defn- swipe-button-untrustworthy [{:keys [style]} _] [common/swipe-button-container {:style (common-style/swipe-danger-container style) - :icon :i/placeholder + :icon :i/alert :text (i18n/label :t/untrustworthy)}]) (defn- swipe-button-trust [{:keys [style]} _] [common/swipe-button-container {:style (common-style/swipe-success-container style) - :icon :i/placeholder + :icon :i/done :text (i18n/label :t/accept)}]) (defn- context-tags diff --git a/src/status_im2/contexts/activity_center/notification/membership/view.cljs b/src/status_im2/contexts/activity_center/notification/membership/view.cljs index 13698aacf4..c1d31a2343 100644 --- a/src/status_im2/contexts/activity_center/notification/membership/view.cljs +++ b/src/status_im2/contexts/activity_center/notification/membership/view.cljs @@ -21,14 +21,14 @@ [{:keys [style]} _] [common/swipe-button-container {:style (common-style/swipe-success-container style) - :icon :i/placeholder + :icon :i/done :text (i18n/label :t/accept)}]) (defn- swipe-button-decline [{:keys [style]} _] [common/swipe-button-container {:style (common-style/swipe-danger-container style) - :icon :i/placeholder + :icon :i/decline :text (i18n/label :t/decline)}]) (defn- swipeable diff --git a/src/status_im2/contexts/activity_center/style.cljs b/src/status_im2/contexts/activity_center/style.cljs index 1e9de4a82c..c4a126bdff 100644 --- a/src/status_im2/contexts/activity_center/style.cljs +++ b/src/status_im2/contexts/activity_center/style.cljs @@ -16,8 +16,7 @@ (defn notification-container [index] - {:margin-top (if (zero? index) 0 4) - :padding-horizontal 8}) + {:margin-top (if (zero? index) 0 4)}) (def tabs {:padding-left screen-padding})