Compare commits

..
Author SHA1 Message Date
Omar Basem 85d9909084 updates 2023-07-04 11:27:11 +04:00
Omar Basem 21ce4aabd8 updates 2023-07-04 11:24:34 +04:00
Omar Basem b9247cb517 updates 2023-07-04 11:15:32 +04:00
Omar Basem 24b8349b95 updates 2023-07-04 11:01:03 +04:00
Omar Basem e9adebc3fb updates 2023-07-04 10:47:31 +04:00
Omar Basem 531e63e2ea updates 2023-07-04 10:33:25 +04:00
Omar Basem 47b5470a91 updates 2023-07-04 10:23:21 +04:00
Omar Basem 3b0a7911e3 updates 2023-07-04 09:45:02 +04:00
Omar Basem bf7d36b899 updates 2023-07-04 09:19:57 +04:00
Omar Basem b9ba4fdf42 updates 2023-07-04 09:10:29 +04:00
Omar Basem b16c45f2fc updates 2023-07-04 08:56:57 +04:00
Omar Basem 0255eb051e fix 2023-07-03 18:59:25 +04:00
Omar Basem 1fd1d0ee79 feat: lightbox text 2023-07-03 17:21:01 +04:00
Omar Basem 2cc844111c feat: lightbox text 2023-07-03 16:08:41 +04:00
Omar Basem 75926edb81 feat: lightbox text 2023-07-03 11:22:44 +04:00
Anton Iakimov a6e6716311 ci: add shebang to jenkinsfiles 2023-07-02 09:11:54 +02:00
Anton Iakimov 07d037f2e1 nix: downgrade watchman to 4.9.0
watchman was upgraded significantly during the last #14944 (4.9.0 (Aug 16, 2017) to 2023.01.30.00 - 6 years between):
status-im/nixpkgs@4e9c02b

Probably causing developers to have "too many files open" issue #16341

This PR is an attempt to fix the issue by downgrading the watchman

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2023-07-02 08:46:28 +02:00
Andrea Maria Piana 36a72f2d63 Set nameserver on login 2023-07-01 08:39:12 +01:00
Jamie Caprani 4c0a8d9f6d chore: use with theme for step component (#16399) 2023-06-30 09:02:46 -07:00
Brian Sztamfater 2d860c363a feat: allow navigation inside different stacks (#16419)
Signed-off-by: Brian Sztamfater <brian@status.im>
2023-06-30 11:48:35 -03:00
Icaro Motta 186ac482ee Comment time bomb test out (#16452) 2023-06-30 12:47:24 +00:00
Andrea Maria Piana f015eb929a [Fixes: #16203] Fix delete for me replies images
https://github.com/status-im/status-go/compare/09c5223d...b058ab41
2023-06-30 11:14:49 +01:00
35 changed files with 486 additions and 143 deletions
+1
View File
@@ -1,3 +1,4 @@
#!/usr/bin/env groovy
library 'status-jenkins-lib@v1.7.9'
/* Options section can't access functions in objects. */
+1
View File
@@ -1,3 +1,4 @@
#!/usr/bin/env groovy
library 'status-jenkins-lib@v1.7.9'
pipeline {
+1
View File
@@ -1,3 +1,4 @@
#!/usr/bin/env groovy
library 'status-jenkins-lib@v1.7.9'
/* Options section can't access functions in objects. */
+1
View File
@@ -1,3 +1,4 @@
#!/usr/bin/env groovy
library 'status-jenkins-lib@v1.7.9'
/* Options section can't access functions in objects. */
+1
View File
@@ -1,3 +1,4 @@
#!/usr/bin/env groovy
library 'status-jenkins-lib@v1.7.9'
pipeline {
+1
View File
@@ -1,3 +1,4 @@
#!/usr/bin/env groovy
library 'status-jenkins-lib@v1.7.9'
pipeline {
+1
View File
@@ -1,3 +1,4 @@
#!/usr/bin/env groovy
library 'status-jenkins-lib@v1.7.9'
pipeline {
+1
View File
@@ -1,3 +1,4 @@
#!/usr/bin/env groovy
library 'status-jenkins-lib@v1.7.9'
pipeline {
+1
View File
@@ -1,3 +1,4 @@
#!/usr/bin/env groovy
library 'status-jenkins-lib@v1.7.9'
pipeline {
+1
View File
@@ -1,3 +1,4 @@
#!/usr/bin/env groovy
library 'status-jenkins-lib@v1.7.9'
pipeline {
+1
View File
@@ -1,3 +1,4 @@
#!/usr/bin/env groovy
/**
* This job runs daily and executes `pod repo update` on MacOS
* This is done to avoid issues with out of date repo causing errors like:
+1
View File
@@ -1,3 +1,4 @@
#!/usr/bin/env groovy
library 'status-jenkins-lib@v1.7.9'
pipeline {
+6
View File
@@ -49,6 +49,12 @@ in {
doCheck = false;
});
# Downgrade watchman in attempt to fix "too many files open issue"
watchman = callPackage ./pkgs/watchman {
inherit (super.darwin.apple_sdk.frameworks) CoreServices;
autoconf = super.buildPackages.autoconf269;
};
# Package version adjustments
gradle = super.gradle_7;
nodejs = super.nodejs-18_x;
+23
View File
@@ -0,0 +1,23 @@
# Issue
`watchman` was upgraded significantly during the last nixpkgs upgrade (`4.9.0` (Aug 16, 2017) to `2023.01.30.00` - 6 years between):
- https://github.com/status-im/status-mobile/pull/14944
- https://github.com/status-im/nixpkgs/commit/4e9c02bcc709fe1737a746add0e8e0109133d808
Probably causing developers to have "too many files open" issue:
https://github.com/status-im/status-mobile/issues/16341
```
Error: A non-recoverable condition has triggered. Watchman needs your help!
The triggering condition was at timestamp=1687286390: opendir(/Users/javid/Projects/status-mobile/node_modules/metro-core/node_modules/jest-regex-util/build) -> Too many open files
All requests will continue to fail with this message until you resolve
the underlying problem. You will find more information on fixing this at
https://facebook.github.io/watchman/docs/troubleshooting.html#poison-opendir
```
# Fix
This is an attempt to fix the issue by downgrading the watchman
# Upgrade
When upgrading in the future, please read the comments:
https://github.com/status-im/status-mobile/issues/16341
+48
View File
@@ -0,0 +1,48 @@
{ stdenv, lib, config, fetchFromGitHub, autoconf, automake, pcre
, libtool, pkg-config, openssl
, confFile ? config.watchman.confFile or null
, withApple ? stdenv.isDarwin, CoreServices
}:
stdenv.mkDerivation rec {
pname = "watchman";
version = "4.9.0";
src = fetchFromGitHub {
owner = "facebook";
repo = "watchman";
rev = "v${version}";
sha256 = "0fdaj5pmicm6j17d5q7px800m5rmam1a400x3hv1iiifnmhgnkal";
};
nativeBuildInputs = [ autoconf automake pkg-config libtool ];
buildInputs = [ pcre openssl ]
#++ lib.optionals withApple [ CoreServices ];
++ lib.optionals stdenv.isDarwin [ CoreServices ];
configureFlags = [
"--enable-lenient"
"--enable-conffile=${if confFile == null then "no" else confFile}"
"--with-pcre=yes"
# For security considerations re: --disable-statedir, see:
# https://github.com/facebook/watchman/issues/178
"--disable-statedir"
];
prePatch = ''
patchShebangs .
'';
preConfigure = ''
./autogen.sh
'';
meta = with lib; {
description = "Watches files and takes action when they change";
homepage = "https://facebook.github.io/watchman";
maintainers = with maintainers; [ cstrahan ];
platforms = with platforms; linux ++ darwin;
license = licenses.asl20;
};
}
+7
View File
@@ -6,3 +6,10 @@ export function infoLayout(input, isTop) {
return isTop ? input.value : -input.value;
});
}
export function textSheet(input, isHeight) {
return useDerivedValue(function () {
'worklet';
return isHeight ? input.value : -input.value;
});
}
+7 -7
View File
@@ -9,23 +9,23 @@
:height 20})
(defn neutral-border-color
[in-blur-view? override-theme]
[in-blur-view? theme]
(if in-blur-view?
(colors/theme-colors colors/neutral-80-opa-5 colors/white-opa-10 override-theme)
(colors/theme-colors colors/neutral-20 colors/neutral-80 override-theme)))
(colors/theme-colors colors/neutral-80-opa-5 colors/white-opa-10 theme)
(colors/theme-colors colors/neutral-20 colors/neutral-80 theme)))
(def active-background-color (colors/custom-color :blue 50 10))
(def complete-background-color (colors/custom-color :blue 50))
(defn container
[size type in-blur-view? override-theme]
[size type in-blur-view? theme]
(cond-> container-base
(#{1 2} size) (assoc :width 20)
(= size 3) (assoc :width 28)
(= type :neutral)
(assoc :border-width 1
:border-color (neutral-border-color in-blur-view? override-theme))
:border-color (neutral-border-color in-blur-view? theme))
(= type :active)
(assoc :background-color active-background-color)
@@ -35,7 +35,7 @@
(defn text-color
([type] (text-color type nil))
([type override-theme]
([type theme]
(case type
(:neutral :active) (colors/theme-colors colors/neutral-100-opa-100 colors/white override-theme)
(:neutral :active) (colors/theme-colors colors/neutral-100-opa-100 colors/white theme)
:complete colors/white)))
+7 -4
View File
@@ -2,11 +2,12 @@
(:require
[quo2.components.counter.step.style :as style]
[quo2.components.markdown.text :as text]
[quo2.theme :as theme]
[react-native.core :as rn]
[utils.number]))
(defn step
[{:keys [type accessibility-label override-theme in-blur-view?]} value]
(defn themed-step
[{:keys [type accessibility-label theme in-blur-view?]} value]
(let [type (or type :neutral)
value (utils.number/parse-int value)
label (str value)
@@ -14,8 +15,10 @@
[rn/view
{:accessible true
:accessibility-label (or accessibility-label :step-counter)
:style (style/container size type in-blur-view? override-theme)}
:style (style/container size type in-blur-view? theme)}
[text/text
{:weight :medium
:size :label
:style {:color (style/text-color type override-theme)}} label]]))
:style {:color (style/text-color type theme)}} label]]))
(def step (theme/with-theme themed-step))
+2
View File
@@ -88,6 +88,8 @@
(def neutral-100-opa-5 (alpha neutral-100 0.05))
(def neutral-100-opa-10 (alpha neutral-100 0.1))
(def neutral-100-opa-30 (alpha neutral-100 0.3))
(def neutral-100-opa-50 (alpha neutral-100 0.5))
(def neutral-100-opa-60 (alpha neutral-100 0.6))
(def neutral-100-opa-70 (alpha neutral-100 0.7))
(def neutral-100-opa-80 (alpha neutral-100 0.8))
+4
View File
@@ -33,6 +33,10 @@
[comp]
(.showOverlay Navigation (clj->js comp)))
(defn pop-to
[comp]
(.popTo Navigation (clj->js comp)))
(defn pop-to-root
[tab]
(.popToRoot Navigation (clj->js tab)))
@@ -61,6 +61,7 @@
(fn [[key-uid _ hashed-password]]
(native-module/login-account {:keyUid key-uid
:password hashed-password
:wakuV2Nameserver "1.1.1.1"
:openseaAPIKey config/opensea-api-key
:poktToken config/POKT_TOKEN
@@ -1,13 +1,16 @@
(ns status-im2.contexts.chat.lightbox.bottom-view
(:require
[quo2.foundations.colors :as colors]
[react-native.core :as rn]
[react-native.gesture :as gesture]
[react-native.platform :as platform]
[react-native.reanimated :as reanimated]
[status-im2.contexts.chat.lightbox.style :as style]
[utils.re-frame :as rf]
[status-im2.contexts.chat.lightbox.animations :as anim]
[status-im2.contexts.chat.lightbox.constants :as c]
[status-im2.contexts.chat.messages.content.text.view :as message-view]))
[status-im2.contexts.chat.messages.content.text.view :as message-view]
[status-im2.contexts.chat.lightbox.text-sheet.view :as text-sheet]))
(defn get-small-item-layout
[_ index]
@@ -48,20 +51,16 @@
[item index _ render-data]
[:f> f-small-image item index _ render-data])
(defn bottom-view
[messages index scroll-index insets animations derived item-width props]
(let [{:keys [chat-id content]} (first messages)
padding-horizontal (- (/ item-width 2) (/ c/focused-image-size 2))]
[messages index scroll-index insets animations derived item-width props state]
(let [padding-horizontal (- (/ item-width 2) (/ c/focused-image-size 2))]
[reanimated/linear-gradient
{:colors [:black :transparent]
{:colors [colors/neutral-100-opa-100 colors/neutral-100-opa-50]
:start {:x 0 :y 1}
:end {:x 0 :y 0}
:style (style/gradient-container insets animations derived)}
(when c/image-description-in-lightbox?
[message-view/render-parsed-text
{:content content
:chat-id chat-id
:style-override style/text-style}])
[text-sheet/view messages animations state]
[rn/flat-list
{:ref #(reset! (:small-list-ref props) %)
:key-fn :message-id
@@ -75,4 +74,10 @@
:get-item-layout get-small-item-layout
:separator [rn/view {:style {:width 8}}]
:initial-scroll-index index
:content-container-style (style/content-container padding-horizontal)}]]))
:content-container-style (style/content-container padding-horizontal)}]
[rn/view
{:style {:height (:bottom insets)
:position :absolute
:bottom 0
:left 0
:right 0}}]]))
@@ -66,6 +66,7 @@
{:transform [{:translateY bottom-layout}]
:opacity opacity}
{:position :absolute
:overflow :visible
:bottom 0
:padding-bottom (:bottom insets)
:z-index 3}))
@@ -77,8 +78,15 @@
:align-items :center
:justify-content :center})
(def text-style
{:color colors/white
:align-self :center
:margin-horizontal 20
:margin-vertical 12})
(defn background
[{:keys [overlay-opacity]} {:keys [overlay-z-index]}]
(reanimated/apply-animations-to-style
{:opacity overlay-opacity}
{:background-color colors/neutral-100-opa-70
:position :absolute
:top 0
:bottom 0
:z-index @overlay-z-index
:left 0
:right 0}))
@@ -0,0 +1,32 @@
(ns status-im2.contexts.chat.lightbox.text-sheet.style
(:require [quo2.foundations.colors :as colors]
[react-native.reanimated :as reanimated]))
(def text-style
{:color colors/white
:align-self :center
:margin-horizontal 20
:margin-vertical 12
:flex-grow 1})
(def bar-container
{:height 20
:left 0
:right 0
:top 0
:z-index 1
:justify-content :center
:align-items :center})
(defn bar
[]
{:width 32
:height 4
:border-radius 100
:background-color colors/white-opa-40
:border-width 0.5
:border-color colors/neutral-100})
@@ -0,0 +1,127 @@
(ns status-im2.contexts.chat.lightbox.text-sheet.view
(:require
[quo2.foundations.colors :as colors]
[react-native.core :as rn]
[react-native.gesture :as gesture]
[react-native.linear-gradient :as linear-gradient]
[react-native.platform :as platform]
[react-native.reanimated :as reanimated]
[react-native.safe-area :as safe-area]
[reagent.core :as reagent]
[status-im2.contexts.chat.lightbox.constants :as c]
[oops.core :as oops]
[status-im2.contexts.chat.lightbox.text-sheet.style :as style]
[status-im2.contexts.chat.messages.content.text.view :as message-view]
[utils.worklets.lightbox :as worklet]))
(defn drag-gesture
[derived-value saved-top expanded-height max-height opacity gradient-opacity overlay-z-index expanded?]
(-> (gesture/gesture-pan)
(gesture/enabled true)
(gesture/max-pointers 1)
(gesture/on-start (fn []
(reset! overlay-z-index 1)
(reanimated/animate gradient-opacity 0)))
(gesture/on-update
(fn [e]
(let [new-value (+ (reanimated/get-shared-value saved-top) (oops/oget e "translationY"))
progress (/ (- new-value) max-height)]
(reanimated/set-shared-value opacity progress)
(reanimated/set-shared-value derived-value (max (min (- new-value) expanded-height) c/small-list-height)))))
(gesture/on-end (fn [e]
(if (or (> (- (reanimated/get-shared-value derived-value))
(reanimated/get-shared-value saved-top))
(= (reanimated/get-shared-value derived-value) c/small-list-height))
(do
(reanimated/animate derived-value c/small-list-height)
(reanimated/animate opacity 0)
(reanimated/set-shared-value saved-top (- c/small-list-height))
(reset! expanded? false)
(js/setTimeout #(reset! overlay-z-index 0) 300))
(reanimated/set-shared-value saved-top (- (reanimated/get-shared-value derived-value))))
(when (= (reanimated/get-shared-value derived-value) expanded-height)
(reset! expanded? true))))))
(defn bar
[]
[rn/view {:style style/bar-container}
[rn/view {:style (style/bar)}]])
(defn text-sheet
[messages text-height expanded? opacity overlay-z-index]
(let [{:keys [chat-id content]} (first messages)
insets (safe-area/get-insets)
window-height (:height (rn/get-window))
max-height (- window-height
c/small-list-height
c/top-view-height
(:bottom insets)
(when platform/ios? (:top insets)))
text-padding 24
expanded-height (min max-height (+ 20 @text-height text-padding))
derived-value (reanimated/use-shared-value c/small-list-height)
height (worklet/text-sheet derived-value true)
top (worklet/text-sheet derived-value false)
saved-top (reanimated/use-shared-value (- c/small-list-height))
gradient-opacity (reanimated/use-shared-value 0)]
[gesture/gesture-detector
{:gesture (drag-gesture derived-value saved-top expanded-height max-height opacity gradient-opacity overlay-z-index expanded?)}
[reanimated/touchable-opacity
{:active-opacity 1
:on-press (fn []
(reanimated/animate derived-value expanded-height)
(reanimated/animate opacity 1)
(reanimated/set-shared-value saved-top (- expanded-height))
(reset! overlay-z-index 1)
(reset! expanded? true))
:style (reanimated/apply-animations-to-style
{:height height
:top top}
{:position :absolute
:left 0
:right 0})}
(when (> @text-height 44)
[bar])
[reanimated/linear-gradient
{:colors [colors/neutral-100-opa-0 colors/neutral-100]
:start {:x 0 :y 1}
:end {:x 0 :y 0}
:style (reanimated/apply-animations-to-style
{:opacity gradient-opacity}
{:position :absolute
:left 0
:right 0
:top (- (+ c/top-view-height (:top insets)))
:height (+ c/top-view-height (:top insets) 20 12 44)
:z-index 1})}]
[linear-gradient/linear-gradient
{:colors [colors/neutral-100-opa-50 colors/neutral-100-opa-0]
:start {:x 0 :y 1}
:end {:x 0 :y 0}
:style {:position :absolute
:left 0
:right 0
:height 28
:bottom 0
:z-index 1}}]
[gesture/scroll-view
{:scroll-enabled true
:scroll-event-throttle 16
:on-scroll (fn [e]
(if (and (> (oops/oget e "nativeEvent.contentOffset.y") 0) @expanded?)
(reanimated/animate gradient-opacity 1)
(reanimated/animate gradient-opacity 0)))
:style {:height (- max-height 20)}}
[message-view/render-parsed-text
{:content content
:chat-id chat-id
:style-override style/text-style
:on-layout (fn [event]
(reset! text-height (oops/oget event "nativeEvent.layout.height")))}]]]]))
(defn view
[messages {:keys [overlay-opacity]} {:keys [overlay-z-index]}]
(let [text-height (reagent/atom 0)
expanded? (reagent/atom false)]
[:f> text-sheet messages text-height expanded? overlay-opacity overlay-z-index]))
@@ -43,8 +43,9 @@
(anim/animate top-view-bg colors/neutral-100-opa-0)))))
(defn drawer
[content]
(let [uri (http/replace-port (:image content)
[messages index]
(let [{:keys [content]} (nth messages @index)
uri (http/replace-port (:image content)
(rf/sub [:mediaserver/port]))]
[quo/action-drawer
[[{:icon :i/save
@@ -61,17 +62,22 @@
:container-style {:bottom (when platform/android? 20)}
:text (i18n/label :t/photo-saved)}])))}]]]))
(defn share-image
[messages index]
(let [{:keys [content]} (nth messages @index)
uri (http/replace-port (:image content)
(rf/sub [:mediaserver/port]))]
(images/share-image uri)))
(defn top-view
[messages insets index animations derived landscape? screen-width]
(let [{:keys [from timestamp content]} (nth @messages @index)
(let [{:keys [from timestamp]} (first messages)
display-name (first (rf/sub [:contacts/contact-two-names-by-identity
from]))
bg-color (if landscape?
colors/neutral-100-opa-70
colors/neutral-100-opa-0)
{:keys [background-color opacity]} animations
uri (http/replace-port (:image content)
(rf/sub [:mediaserver/port]))]
{:keys [background-color opacity overlay-opacity]} animations]
[reanimated/view
{:style
(style/top-view-container (:top insets) screen-width bg-color landscape? animations derived)}
@@ -87,6 +93,7 @@
{:on-press (fn []
(anim/animate background-color :transparent)
(anim/animate opacity 0)
(anim/animate overlay-opacity 0)
(rf/dispatch (if platform/ios?
[:chat.ui/exit-lightbox-signal @index]
[:navigate-back])))
@@ -100,15 +107,15 @@
[quo/text
{:weight :medium
:size :paragraph-2
:style {:color colors/neutral-40}} (datetime/to-short-str timestamp)]]]
:style {:color colors/neutral-40}} (when timestamp (datetime/to-short-str timestamp))]]]
[rn/view {:style style/top-right-buttons}
[rn/touchable-opacity
{:active-opacity 1
:on-press #(images/share-image uri)
:on-press #(share-image messages index)
:style (merge style/close-container {:margin-right 12})}
[quo/icon :share {:size 20 :color colors/white}]]
[rn/touchable-opacity
{:active-opacity 1
:on-press #(rf/dispatch [:show-bottom-sheet {:content (fn [] [drawer content])}])
:on-press #(rf/dispatch [:show-bottom-sheet {:content (fn [] [drawer messages index])}])
:style style/close-container}
[quo/icon :options {:size 20 :color colors/white}]]]]))
@@ -31,8 +31,9 @@
(fn []
(reagent/next-tick (fn []
(when @flat-list-ref
(.scrollToIndex ^js @flat-list-ref
#js {:animated false :index index}))))
(.scrollToOffset ^js @flat-list-ref
#js {:animated false
:offset (* (+ (:width (rn/get-window)) constants/separator-width) index)}))))
(swap! timers assoc
:mount-animation
(js/setTimeout (fn []
@@ -125,7 +126,9 @@
{:flat-list-ref (atom nil)
:small-list-ref (atom nil)
:scroll-index-lock? (atom true)
:timers (atom {})})
:timers (atom {})
:viewability-config (atom {:view-area-coverage-percent-threshold 50
:wait-for-interaction true})})
(defn init-state
[messages index]
@@ -135,13 +138,15 @@
{:data (reagent/atom (if (number? index) [(nth messages index)] []))
:scroll-index (reagent/atom index)
:transparent? (reagent/atom false)
:set-full-height? (reagent/atom false)})
:set-full-height? (reagent/atom false)
:overlay-z-index (reagent/atom 0)})
(defn init-animations
[]
{:background-color (anim/use-val colors/neutral-100-opa-0)
:border (anim/use-val (if platform/ios? 0 12))
:opacity (anim/use-val 0)
:overlay-opacity (anim/use-val 0)
:rotate (anim/use-val "0deg")
:layout (anim/use-val -10)
:top-view-y (anim/use-val 0)
@@ -43,7 +43,8 @@
[rn/view {:style {:width constants/separator-width}}]])
(defn lightbox-content
[props {:keys [data transparent? scroll-index set-full-height?]} animations derived messages index
[props {:keys [data transparent? scroll-index set-full-height?] :as state} animations derived messages
index
callback]
(let [insets (safe-area/get-insets)
window (rn/get-window)
@@ -66,7 +67,7 @@
{:style (reanimated/apply-animations-to-style {:background-color (:background-color animations)}
{:height screen-height})}
(when-not @transparent?
[:f> top-view/top-view data insets scroll-index animations derived landscape?
[:f> top-view/top-view messages insets scroll-index animations derived landscape?
screen-width])
[gesture/gesture-detector
{:gesture (utils/drag-gesture animations (and landscape? platform/ios?) set-full-height?)}
@@ -75,6 +76,7 @@
{:transform [{:translateY (:pan-y animations)}
{:translateX (:pan-x animations)}]}
{})}
[reanimated/view {:style (style/background animations state)}]
[gesture/flat-list
{:ref #(reset! (:flat-list-ref props) %)
:key-fn :message-id
@@ -95,24 +97,23 @@
:inverted inverted?
:paging-enabled true
:get-item-layout (fn [_ index] (get-item-layout _ index item-width))
:viewability-config {:view-area-coverage-percent-threshold 50
:wait-for-interaction true}
:viewability-config @(:viewability-config props)
:shows-vertical-scroll-indicator false
:shows-horizontal-scroll-indicator false
:on-viewable-items-changed callback}]]]
(when (and (not @transparent?) (not landscape?))
[:f> bottom-view/bottom-view messages index scroll-index insets animations derived
item-width props])]))
item-width props state])]))
(defn- f-lightbox
[{:keys [messages index]}]
(let [props (utils/init-props)
state (utils/init-state messages index)]
state (utils/init-state messages index)
callback (rn/use-callback
#(on-viewable-items-changed % props state))]
(fn [{:keys [messages index]}]
(let [animations (utils/init-animations)
derived (utils/init-derived-animations animations)
callback (fn [e]
(on-viewable-items-changed e props state))]
derived (utils/init-derived-animations animations)]
(anim/animate (:background-color animations) colors/neutral-100)
(reset! (:data state) messages)
(when platform/ios? ; issue: https://github.com/wix/react-native-navigation/issues/7726
@@ -2,6 +2,7 @@
(:require
[quo2.core :as quo]
[quo2.foundations.colors :as colors]
[oops.core :as oops]
[react-native.core :as rn]
[status-im2.contexts.chat.messages.content.link-preview.view :as link-preview]
[status-im2.contexts.chat.messages.content.text.style :as style]
@@ -139,9 +140,11 @@
(conj parsed-text {:type :edited-block :children [edited-tag]}))))
(defn render-parsed-text
[{:keys [content chat-id edited-at style-override]}]
[{:keys [content chat-id edited-at style-override on-layout]}]
^{:key (:parsed-text content)}
[rn/view {:style style-override}
[rn/view
{:style style-override
:on-layout on-layout}
(reduce (fn [acc e]
(render-block acc e chat-id style-override))
[:<>]
@@ -138,7 +138,7 @@
[quo/text {:size :paragraph-2} (i18n/label :t/forgot-your-password-info-description)]
[rn/view {:style style/forget-password-step-container}
[quo/step {:in-blur-view? true :override-theme :dark} 1]
[quo/step {:in-blur-view? true} 1]
[rn/view
{:style style/forget-password-step-content}
[quo/text {:size :paragraph-2 :weight :semi-bold}
@@ -146,7 +146,7 @@
[quo/text {:size :paragraph-2} (i18n/label :t/forgot-your-password-info-remove-app-description)]]]
[rn/view {:style style/forget-password-step-container}
[quo/step {:in-blur-view? true :override-theme :dark} 2]
[quo/step {:in-blur-view? true} 2]
[rn/view
{:style style/forget-password-step-content}
[quo/text {:size :paragraph-2 :weight :semi-bold}
@@ -155,7 +155,7 @@
(i18n/label :t/forgot-your-password-info-reinstall-app-description)]]]
[rn/view {:style style/forget-password-step-container}
[quo/step {:in-blur-view? true :override-theme :dark} 3]
[quo/step {:in-blur-view? true} 3]
[rn/view
{:style style/forget-password-step-content}
[rn/view
@@ -167,7 +167,7 @@
(i18n/label :t/forgot-your-password-info-signup-with-key-description)]]]
[rn/view {:style style/forget-password-step-container}
[quo/step {:in-blur-view? true :override-theme :dark} 4]
[quo/step {:in-blur-view? true} 4]
[rn/view
{:style style/forget-password-step-content}
[quo/text {:size :paragraph-2 :weight :semi-bold}
+36 -11
View File
@@ -54,9 +54,10 @@
(reset! state/pushed-screen-id view-id)))))
(defn dissmissModal
[]
(reset! state/dissmissing true)
(navigation/dismiss-modal (name (last @state/modals))))
([] (dissmissModal nil))
([comp-id]
(reset! state/dissmissing true)
(navigation/dismiss-modal (name (or comp-id (last @state/modals))))))
(defn dismiss-all-modals
[]
@@ -95,8 +96,24 @@
(options/merge-top-bar (options/topbar-options) options)
{:topBar {:visible false}}))}})))
;; NAVIGATE-TO-WITHIN-STACK
(defn navigate-to-within-stack
[[comp comp-id]]
(let [{:keys [options]} (get views/screens comp)]
(navigation/push
(name comp-id)
{:component {:id comp
:name comp
:options (merge (options/statusbar-and-navbar)
options
(if (:topBar options)
(options/merge-top-bar (options/topbar-options) options)
{:topBar {:visible false}}))}})))
(re-frame/reg-fx :navigate-to navigate)
(re-frame/reg-fx :navigate-to-within-stack navigate-to-within-stack)
(re-frame/reg-fx :navigate-replace-fx
(fn [view-id]
(navigation/pop (name @state/root-id))
@@ -108,6 +125,14 @@
(dissmissModal)
(navigation/pop (name @state/root-id)))))
(re-frame/reg-fx :navigate-back-within-stack
(fn [comp-id]
(navigation/pop (name comp-id))))
(re-frame/reg-fx :navigate-back-to
(fn [comp-id]
(navigation/pop-to (name comp-id))))
(defn pop-to-root
[root-id]
(navigation/pop-to-root root-id)
@@ -126,14 +151,14 @@
(reset! state/curr-modal true)
(swap! state/modals conj comp)
(navigation/show-modal
{:component
{:name comp
:id comp
:options (merge (options/default-root)
(options/statusbar-and-navbar)
options
(when sheet?
options/sheet-options))}})))))
{:stack {:children [{:component
{:name comp
:id comp
:options (merge (options/default-root)
(options/statusbar-and-navbar)
options
(when sheet?
options/sheet-options))}}]}})))))
(re-frame/reg-fx :open-modal-fx open-modal)
+20
View File
@@ -21,6 +21,11 @@
:dispatch-n [[:hide-bottom-sheet]]}
(shell.events/shell-navigate-to go-to-view-id screen-params nil nil)))
(rf/defn navigate-to-within-stack
{:events [:navigate-to-within-stack]}
[_ comp-id]
{:navigate-to-within-stack comp-id})
(rf/defn open-modal
{:events [:open-modal]}
[{:keys [db]} comp screen-params]
@@ -29,11 +34,26 @@
:dispatch [:hide-bottom-sheet]
:open-modal-fx comp})
(rf/defn dismiss-modal
{:events [:dismiss-modal]}
[_ comp-id]
{:dismiss-modal comp-id})
(rf/defn navigate-back
{:events [:navigate-back]}
[cofx]
(shell.events/shell-navigate-back cofx))
(rf/defn navigate-back-within-stack
{:events [:navigate-back-within-stack]}
[_ comp-id]
{:navigate-back-within-stack comp-id})
(rf/defn navigate-back-to
{:events [:navigate-back-to]}
[_ comp-id]
{:navigate-back-to comp-id})
(rf/defn pop-to-root
{:events [:pop-to-root]}
[{:keys [db]} tab]
+74 -74
View File
@@ -1,9 +1,7 @@
(ns utils.datetime-test
(:require [cljs-time.coerce :as time-coerce]
[cljs-time.core :as t]
[cljs-time.format :as t.format]
[cljs.test :refer-macros [deftest testing is are]]
[clojure.string :as string]
[cljs.test :refer-macros [deftest testing is]]
[utils.datetime :as datetime]
[utils.i18n-goog :as i18n-goog]))
@@ -192,74 +190,76 @@
#'utils.datetime/medium-date-time-format)]
(is (= (datetime/day-relative epoch) "01 gen 1970, 12:00:00 AM")))))
(deftest format-mute-till-test
(let [remove-msecs #(string/replace % #"\.\w*Z" "Z")
time-str-to-obj #(t.format/parse (remove-msecs (time-coerce/to-string %)))
curr-time (t/now)
custom-HH-MM-formatter (t.format/formatter "HH:mm")
custom-DD-formatter (t.format/formatter "DD")
get-hh-mm #(t.format/unparse custom-HH-MM-formatter %)
get-day #(t.format/unparse custom-DD-formatter %)
get-week-day #(->> %
t/day-of-week
(get datetime/int->weekday))
mock-today (t.format/unparse (t.format/formatters :date-time-no-ms) curr-time)
in-n-days #(-> (time-str-to-obj mock-today)
(t/plus (t/days %)))
in-n-minutes #(-> (time-str-to-obj mock-today)
(t/plus (t/minutes %)))
in-n-hours #(-> (time-str-to-obj mock-today)
(t/plus (t/hours %)))
mock-tomorrow (in-n-days 1)
mock-in-two-days (in-n-days 2)
mock-in-three-days (in-n-days 3)
mock-in-four-days (in-n-days 4)
mock-in-five-days (in-n-days 5)
mock-in-six-days (in-n-days 6)
mock-in-15-minutes (in-n-minutes 15)
mock-in-1-hour (in-n-hours 1)
mock-in-8-hour (in-n-hours 8)
get-month-day-int #(int (get-day %))
today? (fn [mocked curr-time]
(=
(t.format/unparse (t.format/formatter "MM:DD") mocked)
(t.format/unparse (t.format/formatter "MM:DD") curr-time)))
tomorrow? (fn [mocked curr-time]
(some #(= %
(-
(int (get-month-day-int mocked))
(int (get-month-day-int curr-time))))
[1 30 29 27]))
form-full-date #(str (get-hh-mm %)
" " (string/capitalize (get-week-day %))
" " (get-month-day-int %)
" " (string/capitalize (get datetime/months (t/month %))))
today-date #(str (get-hh-mm %) " today")
tomorrow-date #(str (get-hh-mm %) " tomorrow")
write-date #(cond (today? % curr-time) (today-date %)
(tomorrow? % curr-time) (tomorrow-date %)
:else (form-full-date %))
will-unmute-in-1-hour (remove-msecs (time-coerce/to-string mock-in-1-hour))
will-unmute-in-8-hours (remove-msecs (time-coerce/to-string mock-in-8-hour))
will-unmute-in-15-mins (remove-msecs (time-coerce/to-string mock-in-15-minutes))
will-unmute-in-two-days (remove-msecs (time-coerce/to-string mock-in-two-days))
will-unmute-tomorrow (remove-msecs (time-coerce/to-string mock-tomorrow))
will-unmute-in-three-days (remove-msecs (time-coerce/to-string mock-in-three-days))
will-unmute-in-four-days (remove-msecs (time-coerce/to-string mock-in-four-days))
will-unmute-in-five-days (remove-msecs (time-coerce/to-string mock-in-five-days))
will-unmute-in-six-days (remove-msecs (time-coerce/to-string mock-in-six-days))]
(testing "Mute for minutes and hours"
(are [arg expected] (= (datetime/format-mute-till arg) expected)
will-unmute-in-15-mins (write-date mock-in-15-minutes)
will-unmute-in-1-hour (write-date mock-in-1-hour)
will-unmute-in-8-hours (write-date mock-in-8-hour)))
(testing "Weekdays"
(are [arg expected] (= (datetime/format-mute-till arg) expected)
will-unmute-tomorrow (write-date mock-tomorrow)
will-unmute-in-two-days (write-date mock-in-two-days)
will-unmute-in-three-days (write-date mock-in-three-days)
will-unmute-in-four-days (write-date mock-in-four-days)
will-unmute-in-five-days (write-date mock-in-five-days)
will-unmute-in-six-days (write-date mock-in-six-days)))
(testing "Until the user turns it back on"
(is (= "you turn it back on" (datetime/format-mute-till datetime/go-default-time))))))
;; TODO(@ibrkhalil): This test sometimes fail in the CI. Make the test agnostic
;; of the current time and timezone.
#_(deftest format-mute-till-test
(let [remove-msecs #(string/replace % #"\.\w*Z" "Z")
time-str-to-obj #(t.format/parse (remove-msecs (time-coerce/to-string %)))
curr-time (t/now)
custom-HH-MM-formatter (t.format/formatter "HH:mm")
custom-DD-formatter (t.format/formatter "DD")
get-hh-mm #(t.format/unparse custom-HH-MM-formatter %)
get-day #(t.format/unparse custom-DD-formatter %)
get-week-day #(->> %
t/day-of-week
(get datetime/int->weekday))
mock-today (t.format/unparse (t.format/formatters :date-time-no-ms) curr-time)
in-n-days #(-> (time-str-to-obj mock-today)
(t/plus (t/days %)))
in-n-minutes #(-> (time-str-to-obj mock-today)
(t/plus (t/minutes %)))
in-n-hours #(-> (time-str-to-obj mock-today)
(t/plus (t/hours %)))
mock-tomorrow (in-n-days 1)
mock-in-two-days (in-n-days 2)
mock-in-three-days (in-n-days 3)
mock-in-four-days (in-n-days 4)
mock-in-five-days (in-n-days 5)
mock-in-six-days (in-n-days 6)
mock-in-15-minutes (in-n-minutes 15)
mock-in-1-hour (in-n-hours 1)
mock-in-8-hour (in-n-hours 8)
get-month-day-int #(int (get-day %))
today? (fn [mocked curr-time]
(=
(t.format/unparse (t.format/formatter "MM:DD") mocked)
(t.format/unparse (t.format/formatter "MM:DD") curr-time)))
tomorrow? (fn [mocked curr-time]
(some #(= %
(-
(int (get-month-day-int mocked))
(int (get-month-day-int curr-time))))
[1 30 29 27]))
form-full-date #(str (get-hh-mm %)
" " (string/capitalize (get-week-day %))
" " (get-month-day-int %)
" " (string/capitalize (get datetime/months (t/month %))))
today-date #(str (get-hh-mm %) " today")
tomorrow-date #(str (get-hh-mm %) " tomorrow")
write-date #(cond (today? % curr-time) (today-date %)
(tomorrow? % curr-time) (tomorrow-date %)
:else (form-full-date %))
will-unmute-in-1-hour (remove-msecs (time-coerce/to-string mock-in-1-hour))
will-unmute-in-8-hours (remove-msecs (time-coerce/to-string mock-in-8-hour))
will-unmute-in-15-mins (remove-msecs (time-coerce/to-string mock-in-15-minutes))
will-unmute-in-two-days (remove-msecs (time-coerce/to-string mock-in-two-days))
will-unmute-tomorrow (remove-msecs (time-coerce/to-string mock-tomorrow))
will-unmute-in-three-days (remove-msecs (time-coerce/to-string mock-in-three-days))
will-unmute-in-four-days (remove-msecs (time-coerce/to-string mock-in-four-days))
will-unmute-in-five-days (remove-msecs (time-coerce/to-string mock-in-five-days))
will-unmute-in-six-days (remove-msecs (time-coerce/to-string mock-in-six-days))]
(testing "Mute for minutes and hours"
(are [arg expected] (= (datetime/format-mute-till arg) expected)
will-unmute-in-15-mins (write-date mock-in-15-minutes)
will-unmute-in-1-hour (write-date mock-in-1-hour)
will-unmute-in-8-hours (write-date mock-in-8-hour)))
(testing "Weekdays"
(are [arg expected] (= (datetime/format-mute-till arg) expected)
will-unmute-tomorrow (write-date mock-tomorrow)
will-unmute-in-two-days (write-date mock-in-two-days)
will-unmute-in-three-days (write-date mock-in-three-days)
will-unmute-in-four-days (write-date mock-in-four-days)
will-unmute-in-five-days (write-date mock-in-five-days)
will-unmute-in-six-days (write-date mock-in-six-days)))
(testing "Until the user turns it back on"
(is (= "you turn it back on" (datetime/format-mute-till datetime/go-default-time))))))
+4
View File
@@ -5,3 +5,7 @@
(defn info-layout
[input top?]
(.infoLayout ^js layout-worklets input top?))
(defn text-sheet
[input height?]
(.textSheet ^js layout-worklets input height?))
+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.160.1",
"commit-sha1": "a04e21013d27fb8c8f3466e17fd459d7d4e3cda5",
"src-sha256": "1b29ma6lp6ixdb281jbw02pqbvh8xclcmsjs2s972pwgrfsl08zq"
"version": "v0.160.2",
"commit-sha1": "b058ab41da726ba1b985f64d1d749089f7687279",
"src-sha256": "12hfl9x88igrw9k0461casni3znh22431dpx158qqm45mymmgc7i"
}