Compare commits

..
Author SHA1 Message Date
alwx 615810e7f4 Offsets for composer + dynamic height calculation 2023-07-28 12:45:44 +02:00
alwx 9a5b2859c8 Offsets for composer + dynamic height calculation 2023-07-28 12:39:11 +02:00
34 changed files with 285 additions and 398 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
name: MVPBug Report
about: MVPBug Report
title: ''
labels: 'E:Mobile Bugfixes MVP'
labels: E:MobileBugfixesMVP
assignees: ''
---
-55
View File
@@ -1,55 +0,0 @@
#!/bin/bash
if [ -z "$1" ]; then
echo "Please provide the full branch URL as an argument."
exit 1
fi
if [ -z "$2" ]; then
echo "Please provide the full pull request URL as second argument."
exit 1
fi
# Extract PR number from the URL
PR_URL="$2"
PR_NUMBER=$(echo "$PR_URL" | awk -F '/' '{print $NF}')
# Fetch PR Info
PR_TITLE=$(gh pr view "$PR_NUMBER" --json title -q '.title')
PR_DESCRIPTION=$(gh pr view "$PR_NUMBER" --json body -q '.body')
BRANCH_NAME=$(gh pr view "$PR_NUMBER" --json headRefName -q '.headRefName')
# Extracting the repo URL and branch name
FULL_URL="$1"
REPO_URL=$(echo "$FULL_URL" | awk -F "/tree/" '{print $1}')
REPO_NAME=$(basename "$REPO_URL")
NEW_REMOTE_URL="https://github.com/status-im/status-mobile"
# Clone the repo if not already cloned
if [ ! -d "$REPO_NAME" ]; then
git clone "$REPO_URL"
cd "$REPO_NAME" || exit
gh repo set-default "$REPO_URL"
else
cd "$REPO_NAME" || exit
gh repo set-default "$REPO_URL"
git fetch
fi
# Check if branch already exists
BRANCH_EXISTS=$(git show-ref refs/heads/"$BRANCH_NAME" 2>/dev/null)
if [ -z "$BRANCH_EXISTS" ]; then
# New Import
git checkout -b "$BRANCH_NAME" "origin/$BRANCH_NAME"
git remote add source "$REPO_URL"
git remote set-url origin $NEW_REMOTE_URL
git push -u origin "$BRANCH_NAME"
gh pr create --base develop --head "$BRANCH_NAME" --title "[IMPORTED] $PR_TITLE" --body "$PR_DESCRIPTION"
else
# Sync Existing Import
git checkout "$BRANCH_NAME"
git fetch source "$BRANCH_NAME"
git rebase source/"$BRANCH_NAME" # Rebase instead of merge
git push origin "$BRANCH_NAME" # Push updates to your imported branch
fi
@@ -15,7 +15,7 @@
:margin-bottom (+ (safe-area/get-bottom) 8)})
(defn title
[theme]
[shell?]
{:color (colors/theme-colors colors/neutral-100
colors/white
theme)})
(when shell? :dark))})
@@ -3,10 +3,9 @@
[quo2.components.drawers.documentation-drawers.style :as style]
[quo2.components.markdown.text :as text]
[react-native.core :as rn]
[react-native.gesture :as gesture]
[quo2.theme :as quo.theme]))
[react-native.gesture :as gesture]))
(defn- view-internal
(defn view
"Options
- `title` Title text
- `show-button?` Show button
@@ -16,7 +15,7 @@
- `shell?` use shell theme
`content` Content of the drawer
"
[{:keys [title show-button? on-press-button button-label button-icon theme shell?]} content]
[{:keys [title show-button? on-press-button button-label button-icon shell?]} content]
[gesture/scroll-view
{:style style/outer-container
:always-bounce-vertical false
@@ -25,18 +24,18 @@
[text/text
{:size :heading-2
:accessibility-label :documentation-drawer-title
:style (style/title theme)
:style (style/title shell?)
:weight :semi-bold}
title]
[rn/view {:style style/content :accessibility-label :documentation-drawer-content}
content]
(when show-button?
[button/button
{:size 24
:type (if shell? :blur-bg-outline :outline)
:on-press on-press-button
:accessibility-label :documentation-drawer-button
:after button-icon}
(cond-> {:size 24
:type (if shell? :blur-bg-outline :outline)
:on-press on-press-button
:accessibility-label :documentation-drawer-button
:after button-icon}
shell? (assoc :override-theme :dark))
button-label])]])
(def view (quo.theme/with-theme view-internal))
+38 -38
View File
@@ -3,62 +3,62 @@
[quo2.foundations.colors :as colors]))
(defn variants-colors
[blur? theme]
[blur? override-theme]
(if blur?
{:label (colors/theme-colors colors/neutral-80-opa-40 colors/white-opa-40 theme)
:icon (colors/theme-colors colors/neutral-80-opa-70 colors/white-opa-70 theme)
:button-border (colors/theme-colors colors/neutral-80-opa-30 colors/white-opa-10 theme)
:password-icon (colors/theme-colors colors/neutral-100 colors/white-opa-70 theme)
:clear-icon (colors/theme-colors colors/neutral-80-opa-30 colors/white-opa-10 theme)
{:label (colors/theme-colors colors/neutral-80-opa-40 colors/white-opa-40 override-theme)
:icon (colors/theme-colors colors/neutral-80-opa-70 colors/white-opa-70 override-theme)
:button-border (colors/theme-colors colors/neutral-80-opa-30 colors/white-opa-10 override-theme)
:password-icon (colors/theme-colors colors/neutral-100 colors/white-opa-70 override-theme)
:clear-icon (colors/theme-colors colors/neutral-80-opa-30 colors/white-opa-10 override-theme)
:cursor (colors/theme-colors (colors/custom-color :blue 50)
colors/white
theme)}
{:label (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)
:icon (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)
:button-border (colors/theme-colors colors/neutral-30 colors/neutral-70 theme)
:clear-icon (colors/theme-colors colors/neutral-40 colors/neutral-60 theme)
:password-icon (colors/theme-colors colors/neutral-50 colors/white theme)
override-theme)}
{:label (colors/theme-colors colors/neutral-50 colors/neutral-40 override-theme)
:icon (colors/theme-colors colors/neutral-50 colors/neutral-40 override-theme)
:button-border (colors/theme-colors colors/neutral-30 colors/neutral-70 override-theme)
:clear-icon (colors/theme-colors colors/neutral-40 colors/neutral-60 override-theme)
:password-icon (colors/theme-colors colors/neutral-50 colors/white override-theme)
:cursor (colors/theme-colors (colors/custom-color :blue 50)
(colors/custom-color :blue 60)
theme)}))
override-theme)}))
(defn status-colors
[status blur? theme]
[status blur? override-theme]
(if blur?
(case status
:focus
{:border-color (colors/theme-colors colors/neutral-80-opa-20 colors/white-opa-40 theme)
:placeholder (colors/theme-colors colors/neutral-80-opa-20 colors/white-opa-20 theme)
:text (colors/theme-colors colors/neutral-100 colors/white theme)}
{:border-color (colors/theme-colors colors/neutral-80-opa-20 colors/white-opa-40 override-theme)
:placeholder (colors/theme-colors colors/neutral-80-opa-20 colors/white-opa-20 override-theme)
:text (colors/theme-colors colors/neutral-100 colors/white override-theme)}
:error
{:border-color (colors/theme-colors colors/danger-opa-40 colors/danger-opa-40 theme)
:placeholder (colors/theme-colors colors/neutral-80-opa-40 colors/white-opa-40 theme)
:text (colors/theme-colors colors/neutral-100 colors/white theme)}
{:border-color (colors/theme-colors colors/danger-opa-40 colors/danger-opa-40 override-theme)
:placeholder (colors/theme-colors colors/neutral-80-opa-40 colors/white-opa-40 override-theme)
:text (colors/theme-colors colors/neutral-100 colors/white override-theme)}
:disabled
{:border-color (colors/theme-colors colors/neutral-80-opa-10 colors/white-opa-10 theme)
:placeholder (colors/theme-colors colors/neutral-80-opa-30 colors/white-opa-20 theme)
:text (colors/theme-colors colors/neutral-80-opa-30 colors/white-opa-20 theme)}
{:border-color (colors/theme-colors colors/neutral-80-opa-10 colors/white-opa-10 override-theme)
:placeholder (colors/theme-colors colors/neutral-80-opa-30 colors/white-opa-20 override-theme)
:text (colors/theme-colors colors/neutral-80-opa-30 colors/white-opa-20 override-theme)}
;; :default
{:border-color (colors/theme-colors colors/neutral-80-opa-10 colors/white-opa-10 theme)
:placeholder (colors/theme-colors colors/neutral-80-opa-40 colors/white-opa-40 theme)
:text (colors/theme-colors colors/neutral-100 colors/white theme)})
{:border-color (colors/theme-colors colors/neutral-80-opa-10 colors/white-opa-10 override-theme)
:placeholder (colors/theme-colors colors/neutral-80-opa-40 colors/white-opa-40 override-theme)
:text (colors/theme-colors colors/neutral-100 colors/white override-theme)})
(case status
:focus
{:border-color (colors/theme-colors colors/neutral-40 colors/neutral-60 theme)
:placeholder (colors/theme-colors colors/neutral-30 colors/neutral-60 theme)
:text (colors/theme-colors colors/neutral-100 colors/white theme)}
{:border-color (colors/theme-colors colors/neutral-40 colors/neutral-60 override-theme)
:placeholder (colors/theme-colors colors/neutral-30 colors/neutral-60 override-theme)
:text (colors/theme-colors colors/neutral-100 colors/white override-theme)}
:error
{:border-color (colors/theme-colors colors/danger-opa-40 colors/danger-opa-40 theme)
:placeholder (colors/theme-colors colors/neutral-40 colors/white-opa-40 theme)
:text (colors/theme-colors colors/neutral-100 colors/white theme)}
{:border-color (colors/theme-colors colors/danger-opa-40 colors/danger-opa-40 override-theme)
:placeholder (colors/theme-colors colors/neutral-40 colors/white-opa-40 override-theme)
:text (colors/theme-colors colors/neutral-100 colors/white override-theme)}
:disabled
{:border-color (colors/theme-colors colors/neutral-20 colors/neutral-80 theme)
:placeholder (colors/theme-colors colors/neutral-40 colors/neutral-40 theme)
:text (colors/theme-colors colors/neutral-40 colors/neutral-40 theme)}
{:border-color (colors/theme-colors colors/neutral-20 colors/neutral-80 override-theme)
:placeholder (colors/theme-colors colors/neutral-40 colors/neutral-40 override-theme)
:text (colors/theme-colors colors/neutral-40 colors/neutral-40 override-theme)}
;; :default
{:border-color (colors/theme-colors colors/neutral-20 colors/neutral-80 theme)
:placeholder (colors/theme-colors colors/neutral-40 colors/neutral-50 theme)
:text (colors/theme-colors colors/neutral-100 colors/white theme)})))
{:border-color (colors/theme-colors colors/neutral-20 colors/neutral-80 override-theme)
:placeholder (colors/theme-colors colors/neutral-40 colors/neutral-50 override-theme)
:text (colors/theme-colors colors/neutral-100 colors/white override-theme)})))
(defn input-container
[colors-by-status small? disabled?]
+8 -10
View File
@@ -5,7 +5,7 @@
[quo2.components.markdown.text :as text]
[react-native.core :as rn]
[reagent.core :as reagent]
[quo2.theme :as quo.theme]))
[quo2.theme :as theme]))
(defn- label-&-counter
[{:keys [label current-chars char-limit variant-colors]}]
@@ -54,7 +54,7 @@
(def ^:private custom-props
"Custom properties that must be removed from properties map passed to InputText."
[:type :blur? :theme :error? :right-icon :left-icon :disabled? :small? :button
[:type :blur? :override-theme :error? :right-icon :left-icon :disabled? :small? :button
:label :char-limit :on-char-limit-reach :icon-name :multiline? :on-focus :on-blur])
(defn- base-input
@@ -74,15 +74,15 @@
(reset! char-count amount-chars)
(when (>= amount-chars char-limit)
(on-char-limit-reach amount-chars))))]
(fn [{:keys [blur? theme error? right-icon left-icon disabled? small? button
(fn [{:keys [blur? override-theme error? right-icon left-icon disabled? small? button
label char-limit multiline? clearable? on-focus on-blur]
:as props}]
(let [status-kw (cond
disabled? :disabled
error? :error
:else @status)
colors-by-status (style/status-colors status-kw blur? theme)
variant-colors (style/variants-colors blur? theme)
colors-by-status (style/status-colors status-kw blur? override-theme)
variant-colors (style/variants-colors blur? override-theme)
clean-props (apply dissoc props custom-props)]
[:<>
(when (or label char-limit)
@@ -101,7 +101,7 @@
(cond-> {:style (style/input colors-by-status small? @multiple-lines?)
:accessibility-label :input
:placeholder-text-color (:placeholder colors-by-status)
:keyboard-appearance (quo.theme/theme-value :light :dark theme)
:keyboard-appearance (theme/theme-value :light :dark override-theme)
:cursor-color (:cursor variant-colors)
:editable (not disabled?)
:on-focus (fn []
@@ -148,11 +148,11 @@
:icon-name (if @password-shown? :i/hide :i/reveal)
:on-press #(swap! password-shown? not)})])))
(defn input-internal
(defn input
"This input supports the following properties:
- :type - Can be `:text`(default) or `:password`.
- :blur? - Boolean to set the blur color variant.
- :theme - Can be `light` or `:dark`.
- :override-theme - Can be `light` or `:dark`.
- :small? - Boolean to specify if this input is rendered in its small version.
- :multiline? - Boolean to specify if this input support multiple lines.
- :icon-name - The name of an icon to display at the left of the input.
@@ -188,5 +188,3 @@
(if (= type :password)
[password-input base-props]
[base-input base-props])))
(def input (quo.theme/with-theme input-internal))
@@ -17,29 +17,29 @@
:text-align-vertical :top))
(defn placeholder-color
[input-state theme blur?]
[input-state override-theme blur?]
(cond
(and (= input-state :focused) blur?)
(colors/theme-colors colors/neutral-80-opa-20 colors/white-opa-20 theme)
(colors/theme-colors colors/neutral-80-opa-20 colors/white-opa-20 override-theme)
(= input-state :focused) ; Not blur
(colors/theme-colors colors/neutral-30 colors/neutral-60 theme)
(colors/theme-colors colors/neutral-30 colors/neutral-60 override-theme)
blur? ; :default & blur
(colors/theme-colors colors/neutral-80-opa-40 colors/white-opa-30 theme)
(colors/theme-colors colors/neutral-80-opa-40 colors/white-opa-30 override-theme)
:else ; :default & not blur
(colors/theme-colors colors/neutral-40 colors/neutral-50 theme)))
(colors/theme-colors colors/neutral-40 colors/neutral-50 override-theme)))
(defn cursor-color
[customization-color theme]
[customization-color override-theme]
(colors/theme-colors (colors/custom-color customization-color 50)
(colors/custom-color customization-color 60)
theme))
override-theme))
(defn error-word
[theme]
[]
{:height 22
:padding-horizontal 20
:background-color colors/danger-50-opa-10
:color (colors/theme-colors colors/danger-50 colors/danger-60 theme)})
:color (colors/theme-colors colors/danger-50 colors/danger-60)})
@@ -3,19 +3,19 @@
[quo2.components.inputs.recovery-phrase.style :as style]
[react-native.core :as rn]
[reagent.core :as reagent]
[quo2.theme :as quo.theme]))
[quo2.theme :as theme]))
(def ^:private custom-props
[:customization-color :theme :blur? :cursor-color :multiline :on-focus :on-blur
[:customization-color :override-theme :blur? :cursor-color :multiline :on-focus :on-blur
:placeholder-text-color :mark-errors? :error-pred :word-limit])
(defn- error-word
[text theme]
[rn/text {:style (style/error-word theme)}
[text]
[rn/text {:style (style/error-word)}
text])
(defn- mark-error-words
[{:keys [pred-last-word pred-previous-words text word-limit theme]}]
[pred-last-word pred-previous-words text word-limit]
(let [last-index (dec (count (string/split text #"\s+")))
words (map #(apply str %)
(partition-by #(= " " %) text))]
@@ -31,18 +31,18 @@
:always (update :result
conj
(if invalid-word?
[error-word word theme]
[error-word word]
word)))))
{:result [:<>]
:idx 0})
:result)))
(defn recovery-phrase-input-internal
(defn recovery-phrase-input
[_ _]
(let [state (reagent/atom :default)
set-focused #(reset! state :focused)
set-default #(reset! state :default)]
(fn [{:keys [customization-color theme blur? on-focus on-blur mark-errors?
(fn [{:keys [customization-color override-theme blur? on-focus on-blur mark-errors?
error-pred-current-word error-pred-written-words word-limit]
:or {customization-color :blue
word-limit ##Inf
@@ -55,9 +55,9 @@
[rn/text-input
(merge {:accessibility-label :recovery-phrase-input
:style (style/input)
:placeholder-text-color (style/placeholder-color @state theme blur?)
:cursor-color (style/cursor-color customization-color theme)
:keyboard-appearance (quo.theme/theme-value :light :dark theme)
:placeholder-text-color (style/placeholder-color @state override-theme blur?)
:cursor-color (style/cursor-color customization-color override-theme)
:keyboard-appearance (theme/theme-value :light :dark override-theme)
:multiline true
:on-focus (fn []
(set-focused)
@@ -67,11 +67,5 @@
(when on-blur (on-blur)))}
extra-props)
(if mark-errors?
(mark-error-words {:pred-last-word error-pred-current-word
:pred-previous-words error-pred-written-words
:text text
:word-limit word-limit
:theme theme})
(mark-error-words error-pred-current-word error-pred-written-words text word-limit)
text)]]))))
(def recovery-phrase-input (quo.theme/with-theme recovery-phrase-input-internal))
@@ -5,8 +5,7 @@
[quo2.foundations.colors :as colors]
[react-native.core :as rn]
[react-native.fast-image :as fast-image]
[react-native.hole-view :as hole-view]
[quo2.theme :as quo.theme]))
[react-native.hole-view :as hole-view]))
(def params
{32 {:border-radius {:circular 16 :rounded 10}
@@ -62,13 +61,13 @@
[avatar item type size border-radius]]))
(defn get-overflow-color
[transparent? transparent-color light-color dark-color theme]
[transparent? transparent-color light-color dark-color override-theme]
(if transparent?
transparent-color
(colors/theme-colors light-color dark-color theme)))
(colors/theme-colors light-color dark-color override-theme)))
(defn overflow-label
[{:keys [label size transparent? border-radius margin-left theme more-than-99-label]}]
[label size transparent? border-radius margin-left override-theme more-than-99-label]
[rn/view
{:style {:width size
:height size
@@ -81,7 +80,7 @@
colors/white-opa-10
colors/neutral-20
colors/neutral-70
theme)}}
override-theme)}}
(if (= size 16)
[quo2.icons/icon :i/more
{:size 12
@@ -90,7 +89,7 @@
colors/white-opa-70
colors/neutral-50
colors/neutral-40
theme)}]
override-theme)}]
[quo2.text/text
{:size (if (= size 32) :paragraph-2 :label)
:weight :medium
@@ -99,7 +98,7 @@
colors/white-opa-70
colors/neutral-60
colors/neutral-40
theme)
override-theme)
:margin-left -2}}
;; If overflow label is below 100, show label as +label (ex. +30), else just show 99+
(if (< label 100)
@@ -112,7 +111,7 @@
(:account :collectible :photo) :rounded
:circular))
(defn- preview-list-internal
(defn preview-list
"[preview-list opts items]
opts
{:type :user/:community/:account/:token/:collectible/:dapp
@@ -121,7 +120,7 @@
:transparent? overflow-label transparent?}
items preview list items (only 4 items is required for preview)
"
[{:keys [type size list-size transparent? theme more-than-99-label]} items]
[{:keys [type size list-size transparent? override-theme more-than-99-label]} items]
(let [items-arr (into [] items)
list-size (or list-size (count items))
margin-left (get-in params [size :margin-left])
@@ -136,13 +135,5 @@
[list-item index type size (get items-arr index) list-size
margin-left hole-size hole-radius hole-x hole-y border-radius])
(when (> list-size 4)
[overflow-label
{:label (- list-size 3)
:size size
:transparent? transparent?
:border-radius border-radius
:margin-left margin-left
:theme theme
:more-than-99-label more-than-99-label}])]))
(def preview-list (quo.theme/with-theme preview-list-internal))
[overflow-label (- list-size 3) size transparent? border-radius margin-left override-theme
more-than-99-label])]))
+12 -10
View File
@@ -10,8 +10,8 @@
:padding 6})
(defn container-border-color
[pressed? blur? theme]
(let [dark? (= :dark theme)]
[pressed? blur? override-theme]
(let [dark? (= :dark override-theme)]
(cond
(and (not pressed?) (not dark?) (not blur?))
colors/neutral-20
@@ -35,24 +35,26 @@
nil)))
(defn container-background-color
[pressed? theme]
[pressed? override-theme]
(when pressed?
(colors/theme-colors colors/primary-50 colors/primary-60 theme)))
(if (= :dark override-theme)
colors/primary-60
colors/primary-50)))
(defn container-outer
[pressed? theme]
[pressed? override-theme]
(merge container-default
{:background-color (container-background-color pressed? theme)}))
{:background-color (container-background-color pressed? override-theme)}))
(defn container-inner
[pressed? blur? theme]
[pressed? blur? override-theme]
(merge container-default
{:border-width 1
:border-color (container-border-color pressed? blur? theme)}))
:border-color (container-border-color pressed? blur? override-theme)}))
(defn icon-color
[pressed? theme]
[pressed? override-theme]
(if (and (not pressed?)
(= :light theme))
(= :light override-theme))
colors/neutral-100
colors/white))
@@ -1,24 +1,23 @@
(ns quo2.components.selectors.filter.view
(:require [quo2.components.icon :as icon]
[quo2.components.selectors.filter.style :as style]
[quo2.theme :as quo.theme]
[quo2.theme :as theme]
[react-native.core :as rn]
[reagent.core :as reagent]))
(defn view-internal
(defn view
[initial-props]
(let [pressed? (reagent/atom (:pressed? initial-props))]
(fn [{:keys [blur? theme on-press-out]}]
(fn [{:keys [blur? override-theme on-press-out]
:or {override-theme (theme/get-theme)}}]
[rn/touchable-without-feedback
{:accessibility-label :selector-filter
:on-press-out (fn []
(swap! pressed? not)
(when on-press-out
(on-press-out @pressed?)))}
[rn/view {:style (style/container-outer @pressed? theme)}
[rn/view {:style (style/container-inner @pressed? blur? theme)}
[rn/view {:style (style/container-outer @pressed? override-theme)}
[rn/view {:style (style/container-inner @pressed? blur? override-theme)}
[icon/icon :i/unread
{:color (style/icon-color @pressed? theme)
{:color (style/icon-color @pressed? override-theme)
:size 20}]]]])))
(def view (quo.theme/with-theme view-internal))
+6 -7
View File
@@ -1,9 +1,9 @@
(ns quo2.components.tabs.segmented-tab
(:require [quo2.components.tabs.tab.view :as tab]
[quo2.foundations.colors :as colors]
[quo2.theme :as theme]
[react-native.core :as rn]
[reagent.core :as reagent]
[quo2.theme :as quo.theme]))
[reagent.core :as reagent]))
(def themes-for-blur
{:light {:background-color colors/neutral-80-opa-5}
@@ -13,17 +13,17 @@
{:light {:background-color colors/neutral-10}
:dark {:background-color colors/neutral-90}})
(defn- segmented-control-internal
(defn segmented-control
[{:keys [default-active on-change]}]
(let [active-tab-id (reagent/atom default-active)]
(fn [{:keys [data size theme blur? container-style item-container-style
(fn [{:keys [data size override-theme blur? container-style item-container-style
active-item-container-style]}]
(let [active-id @active-tab-id]
[rn/view
(merge
{:flex-direction :row
:background-color (get-in (if blur? themes-for-blur themes)
[theme :background-color])
[(or override-theme (theme/get-theme)) :background-color])
:border-radius (case size
32 10
28 8
@@ -42,6 +42,7 @@
:item-container-style item-container-style
:segmented? true
:size size
:override-theme override-theme
:blur? blur?
:active (= id active-id)
:on-press (fn [tab-id]
@@ -49,5 +50,3 @@
(when on-change
(on-change tab-id)))}
label]])]))))
(def segmented-control (quo.theme/with-theme segmented-control-internal))
+6 -8
View File
@@ -2,8 +2,8 @@
(:require [quo2.components.icon :as icon]
[quo2.components.markdown.text :as text]
[quo2.foundations.colors :as colors]
[react-native.core :as rn]
[quo2.theme :as quo.theme]))
[quo2.theme :as quo2.theme]
[react-native.core :as rn]))
(def default-container-style
{:border-radius 20
@@ -81,7 +81,7 @@
:border-color colors/danger-50-opa-20
:label label
;; The negative tag uses the same color for `dark` and `dark blur` variant
:text-color (colors/theme-colors colors/danger-50 colors/danger-60 theme)}])
:text-color (if (= theme :light) colors/danger-50 colors/danger-60)}])
(defn- pending
[size theme label blur? no-icon?]
@@ -104,8 +104,8 @@
colors/white-opa-70
(colors/theme-colors colors/neutral-50 colors/neutral-40 theme))}])
(defn- status-tag-internal
[{:keys [status size theme label blur? no-icon?]}]
(defn status-tag
[{:keys [status size override-theme label blur? no-icon?]}]
(when status
(when-let [status-component (case (:type status)
:positive positive
@@ -114,9 +114,7 @@
nil)]
[status-component
size
theme
(or override-theme (quo2.theme/get-theme))
label
blur?
no-icon?])))
(def status-tag (quo.theme/with-theme status-tag-internal))
+23 -33
View File
@@ -98,7 +98,30 @@
quo2.components.tags.token-tag
quo2.components.text-combinations.title.view))
(def icon quo2.components.icon/icon)
(def separator quo2.components.common.separator.view/separator)
(def header quo2.components.header/header)
(def dropdown quo2.components.dropdowns.dropdown/dropdown)
(def info-message quo2.components.info.info-message/info-message)
(def information-box quo2.components.info.information-box.view/view)
(def gap quo2.components.messages.gap/gap)
(def system-message quo2.components.messages.system-message/system-message)
(def reaction quo2.components.reactions.reaction/reaction)
(def add-reaction quo2.components.reactions.reaction/add-reaction)
(def user-avatar-tag quo2.components.tags.context-tag.view/user-avatar-tag)
(def context-tag quo2.components.tags.context-tag.view/context-tag)
(def group-avatar-tag quo2.components.tags.context-tag.view/group-avatar-tag)
(def audio-tag quo2.components.tags.context-tag.view/audio-tag)
(def community-tag quo2.components.tags.context-tag.view/community-tag)
(def disclaimer quo2.components.selectors.disclaimer.view/view)
(def checkbox quo2.components.selectors.selectors.view/checkbox)
(def filter quo2.components.selectors.filter.view/view)
(def author quo2.components.messages.author.view/author)
;;;; SELECTORS
(def reactions quo2.components.selectors.reactions.view/view)
;;;; AVATAR
(def account-avatar quo2.components.avatars.account-avatar/account-avatar)
@@ -161,22 +184,9 @@
(def drawer-buttons quo2.components.drawers.drawer-buttons.view/view)
(def permission-context quo2.components.drawers.permission-context.view/view)
;;;; DROPDOWNS
(def dropdown quo2.components.dropdowns.dropdown/dropdown)
;;;; EMPTY STATE
(def empty-state quo2.components.empty-state.empty-state.view/empty-state)
;;;; HEADER
(def header quo2.components.header/header)
;;;; ICON
(def icon quo2.components.icon/icon)
;;;; INFO
(def info-message quo2.components.info.info-message/info-message)
(def information-box quo2.components.info.information-box.view/view)
;;;; INPUTS
(def input quo2.components.inputs.input.view/input)
(def profile-input quo2.components.inputs.profile-input.view/profile-input)
@@ -203,10 +213,6 @@
(def markdown-list quo2.components.markdown.list.view/view)
(def text quo2.components.markdown.text/text)
;;;; MESSAGES
(def gap quo2.components.messages.gap/gap)
(def system-message quo2.components.messages.system-message/system-message)
;;;; NOTIFICATIONS
(def activity-log quo2.components.notifications.activity-log.view/view)
(def activity-logs-photos quo2.components.notifications.activity-logs-photos.view/view)
@@ -223,21 +229,10 @@
(def profile-card quo2.components.profile.profile-card.view/profile-card)
(def select-profile quo2.components.profile.select-profile.view/view)
;;;; REACTIONS
(def reaction quo2.components.reactions.reaction/reaction)
(def add-reaction quo2.components.reactions.reaction/add-reaction)
;;;; RECORD AUDIO
(def record-audio quo2.components.record-audio.record-audio.view/record-audio)
(def soundtrack quo2.components.record-audio.soundtrack.view/f-soundtrack)
;;;; SELECTORS
(def author quo2.components.messages.author.view/author)
(def disclaimer quo2.components.selectors.disclaimer.view/view)
(def filter quo2.components.selectors.filter.view/view)
(def reactions quo2.components.selectors.reactions.view/view)
(def checkbox quo2.components.selectors.selectors.view/checkbox)
;;;; SETTINGS
(def privacy-option quo2.components.settings.privacy-option/card)
(def account quo2.components.settings.accounts.view/account)
@@ -260,11 +255,6 @@
(def permission-tag quo2.components.tags.permission-tag/tag)
(def status-tag quo2.components.tags.status-tags/status-tag)
(def token-tag quo2.components.tags.token-tag/tag)
(def user-avatar-tag quo2.components.tags.context-tag.view/user-avatar-tag)
(def context-tag quo2.components.tags.context-tag.view/context-tag)
(def group-avatar-tag quo2.components.tags.context-tag.view/group-avatar-tag)
(def audio-tag quo2.components.tags.context-tag.view/audio-tag)
(def community-tag quo2.components.tags.context-tag.view/community-tag)
;;;; TITLE
(def title quo2.components.text-combinations.title.view/title)
@@ -35,16 +35,10 @@
(defn list-key-fn [{:keys [message-id value]}] (or message-id value))
(defn list-ref [ref] (reset! messages-list-ref ref))
(defn scroll-to-offset
[position]
(some-> ^js @messages-list-ref
(.scrollToOffset #js
{:offset position
:animated true})))
(defn scroll-to-bottom
[]
(scroll-to-offset (- 0 style/messages-list-bottom-offset)))
(some-> ^js @messages-list-ref
(.scrollToIndex #js {:index 0 :viewPosition 1})))
(defn on-scroll
[evt]
@@ -126,13 +120,13 @@
loading-indicator-page-loading-height)]])))
(defn list-header
[insets]
[insets composer-height]
[rn/view
{:background-color (colors/theme-colors colors/white colors/neutral-95)
:margin-bottom (- 0
(:top insets)
(when platform/ios? style/overscroll-cover-height))
:height (+ composer.constants/composer-default-height
:height (+ composer-height
(:bottom insets)
spacing-between-composer-and-content
(when platform/ios? style/overscroll-cover-height))}])
@@ -283,13 +277,14 @@
context (rf/sub [:chats/current-chat-message-list-view-context])
messages (rf/sub [:chats/raw-chat-messages-stream (:chat-id chat)])
recording? (rf/sub [:chats/recording?])
all-loaded? (rf/sub [:chats/all-loaded? (:chat-id chat)])]
all-loaded? (rf/sub [:chats/all-loaded? (:chat-id chat)])
composer-height (rf/sub [:chats/composer-height])]
[rn/view {:style {:flex 1}}
[rn/flat-list
{:key-fn list-key-fn
:ref list-ref
:header [:<>
[list-header insets]
[list-header insets composer-height]
(when (= (:chat-type chat) constants/private-group-chat-type)
[list-group-chat-header chat])]
:footer [list-footer
@@ -308,9 +303,9 @@
;; which is needed because by default the chat is scrolled to the
;; bottom
;; and no initial `on-scroll` event is getting triggered
(let [scroll-y-shared (reanimated/get-shared-value scroll-y)
(let [scroll-y-shared (reanimated/get-shared-value scroll-y)
content-height-shared (reanimated/get-shared-value
content-height)]
content-height)]
(when (or (= scroll-y-shared 0)
(> (Math/abs (- content-height-shared y))
min-message-height))
@@ -322,7 +317,7 @@
(reanimated/set-shared-value content-height y))))
:on-end-reached #(list-on-end-reached scroll-y)
:on-scroll-to-index-failed identity
:scroll-indicator-insets {:top (- composer.constants/composer-default-height 16)}
:scroll-indicator-insets {:top (- composer-height 12)}
:keyboard-dismiss-mode :interactive
:keyboard-should-persist-taps :always
:on-scroll-begin-drag rn/dismiss-keyboard!
@@ -334,13 +329,13 @@
(when on-scroll
(on-scroll event)))
:style (add-inverted-y-android
{:background-color (if all-loaded?
(colors/theme-colors
(colors/custom-color cover-bg-color 50 20)
(colors/custom-color cover-bg-color 50 40))
(colors/theme-colors
colors/white
colors/neutral-95))})
{:background-color (if all-loaded?
(colors/theme-colors
(colors/custom-color cover-bg-color 50 20)
(colors/custom-color cover-bg-color 50 40))
(colors/theme-colors
colors/white
colors/neutral-95))})
;;TODO(rasom) https://github.com/facebook/react-native/issues/30034
:inverted (when platform/ios? true)
:on-layout (fn [e]
@@ -351,8 +346,8 @@
(defn message-list-content-view
[props]
(let [chat-screen-loaded? (rf/sub [:shell/chat-screen-loaded?])
window-height (:height (rn/get-window))
content-height (- window-height composer.constants/composer-default-height)]
window-height (:height (rn/get-window))
content-height (- window-height composer.constants/composer-default-height)]
(if chat-screen-loaded?
[:f> f-messages-list-content props]
[rn/view {:style {:flex 1}}
@@ -362,20 +357,20 @@
(defn f-messages-list
[{:keys [chat cover-bg-color header-comp footer-comp]}]
(let [insets (safe-area/get-insets)
scroll-y (reanimated/use-shared-value 0)
content-height (reanimated/use-shared-value 0)
(let [insets (safe-area/get-insets)
scroll-y (reanimated/use-shared-value 0)
content-height (reanimated/use-shared-value 0)
{:keys [keyboard-height keyboard-shown]} (hooks/use-keyboard)]
(rn/use-effect
(fn []
(if keyboard-shown
(reanimated/set-shared-value scroll-y
(+ (reanimated/get-shared-value scroll-y)
keyboard-height))
(reanimated/set-shared-value scroll-y
(- (reanimated/get-shared-value scroll-y)
keyboard-height))))
[keyboard-shown keyboard-height])
(fn []
(if keyboard-shown
(reanimated/set-shared-value scroll-y
(+ (reanimated/get-shared-value scroll-y)
keyboard-height))
(reanimated/set-shared-value scroll-y
(- (reanimated/get-shared-value scroll-y)
keyboard-height))))
[keyboard-shown keyboard-height])
;; Note - Don't pass `behavior :height` to keyboard avoiding view,
;; It breaks composer - https://github.com/status-im/status-mobile/issues/16595
[rn/keyboard-avoiding-view
@@ -31,6 +31,7 @@
[quo/user-avatar
{:full-name name
:profile-picture profile-picture
:override-theme :dark
:size :medium
:status-indicator? false
:customization-color customization-color}]]
@@ -17,6 +17,13 @@
{:label "Blur:"
:key :blur?
:type :boolean}
{:label "Override Theme:"
:key :override-theme
:type :select
:options [{:key :dark
:value "Dark"}
{:key :light
:value "Light"}]}
{:label "Error:"
:key :error?
:type :boolean}
@@ -58,6 +65,7 @@
[]
(let [state (reagent/atom {:type :text
:blur false
:override-theme nil
:placeholder "Type something"
:error false
:icon-name false
@@ -77,10 +77,11 @@
"did something here."])
(def complex-user-action
(let [tag-props {:color :purple
:size :small
:style {:background-color colors/white-opa-10}
:text-style {:color colors/white}}]
(let [tag-props {:color :purple
:override-theme :dark
:size :small
:style {:background-color colors/white-opa-10}
:text-style {:color colors/white}}]
[[quo2/user-avatar-tag tag-props "Alice"]
"from"
[quo2/user-avatar-tag tag-props "Mainnet"]
@@ -11,12 +11,13 @@
[]
(let [unread-filter-enabled? (rf/sub [:activity-center/filter-status-unread-enabled?])]
[quo/filter
{:pressed? unread-filter-enabled?
:blur? true
:on-press-out #(rf/dispatch [:activity-center.notifications/fetch-first-page
{:filter-status (if unread-filter-enabled?
:all
:unread)}])}]))
{:pressed? unread-filter-enabled?
:blur? true
:override-theme :dark
:on-press-out #(rf/dispatch [:activity-center.notifications/fetch-first-page
{:filter-status (if unread-filter-enabled?
:all
:unread)}])}]))
(defn header
[]
@@ -10,6 +10,7 @@
(def tag-params
{:size :small
:override-theme :dark
:color colors/primary-50
:style style/user-avatar-tag
:text-style style/user-avatar-tag-text
@@ -19,10 +20,11 @@
[user-id]
(let [{:keys [primary-name] :as contact} (rf/sub [:contacts/contact-by-identity user-id])]
[quo/user-avatar-tag
{:color :purple
:size :small
:style style/user-avatar-tag
:text-style style/user-avatar-tag-text}
{:color :purple
:override-theme :dark
:size :small
:style style/user-avatar-tag
:text-style style/user-avatar-tag-text}
primary-name
(multiaccounts/displayed-photo contact)]))
@@ -38,13 +38,15 @@
shell.constants/community-card
(case (:type community-info)
:pending [quo/status-tag
{:status {:type :pending}
:label (i18n/label :t/pending)
:size :small}]
{:status {:type :pending}
:label (i18n/label :t/pending)
:size :small
:override-theme :dark}]
:kicked [quo/status-tag
{:status {:type :negative}
:size :small
:label (i18n/label :t/kicked)}]
{:status {:type :negative}
:size :small
:override-theme :dark
:label (i18n/label :t/kicked)}]
(:count :permission) [:<>] ;; Add components for these cases
nil)
@@ -67,8 +69,8 @@
[quo/preview-list
{:type :photo
:more-than-99-label (i18n/label :counter-99-plus)
:size 24}
data]
:size 24
:override-theme :dark} data]
constants/content-type-sticker
[fast-image/fast-image
@@ -260,11 +262,12 @@
[rn/view {:style style/avatar-container}
[avatar avatar-params type customization-color]])
[quo/button
{:size 24
:type :grey
:icon true
:on-press #(rf/dispatch [:shell/close-switcher-card id])
:style style/close-button}
{:size 24
:type :grey
:icon true
:on-press #(rf/dispatch [:shell/close-switcher-card id])
:override-theme :dark
:style style/close-button}
:i/close]]]))))
;; browser Card
@@ -21,6 +21,7 @@
:type :blur-bg
:size 32
:accessibility-label :close-shell-share-tab
:override-theme :dark
:style style/header-button
:on-press #(rf/dispatch [:navigate-back])}
:i/close]
@@ -83,6 +84,7 @@
:type :blur-bg
:size 32
:accessibility-label :link-to-profile
:override-theme :dark
:on-press #(list-selection/open-share {:message profile-url})}
:i/share]]]]
@@ -111,6 +113,7 @@
:type :blur-bg
:size 32
:accessibility-label :link-to-profile
:override-theme :dark
:style {:margin-right 12}
:on-press #(rf/dispatch [:share/copy-text-and-show-toast
{:text-to-copy emoji-hash-string
@@ -134,6 +137,7 @@
[quo/segmented-control
{:size 28
:blur? true
:override-theme :dark
:on-change #(reset! selected-tab %)
:default-active :profile
:data [{:id :profile
@@ -54,6 +54,7 @@
:type :blur-bg
:size 32
:accessibility-label :close-sign-in-by-syncing
:override-theme :dark
:on-press (fn []
(if (and animated? reset-animations-fn)
(reset-animations-fn)
@@ -69,6 +70,7 @@
:type :blur-bg
:size 32
:accessibility-label :find-sync-code
:override-theme :dark
:on-press #(rf/dispatch [:open-modal :find-sync-code])}
(i18n/label :t/find-sync-code)]]]
[reanimated/view
@@ -99,6 +101,7 @@
style/tabs-container)}
[quo/segmented-control
{:size 32
:override-theme :dark
:blur? true
:default-active @active-tab
:data [{:id 1 :label (i18n/label :t/scan-sync-qr-code)}
@@ -148,6 +151,7 @@
:type :primary
:size 32
:accessibility-label accessibility-label
:override-theme :dark
:customization-color :blue
:on-press on-press}
(i18n/label button-label)]]))
@@ -115,6 +115,7 @@
[quo/input
{:default-value @code
:type :password
:override-theme :dark
:default-shown? true
:editable false}]
[quo/button
@@ -26,17 +26,19 @@
:button-grey
[quo/button
{:type :grey
:size 24
:style style/button-grey}
{:type :grey
:override-theme :dark
:size 24
:style style/button-grey}
(i18n/label value)]
:button-grey-placeholder
[quo/button
{:type :grey
:size 24
:before :i/placeholder
:style style/button-grey-placeholder}
{:type :grey
:override-theme :dark
:size 24
:before :i/placeholder
:style style/button-grey-placeholder}
(i18n/label value)]
:context-tag
@@ -109,6 +111,7 @@
[rn/view {:style style/tabs-container}
[quo/segmented-control
{:size 28
:override-theme :dark
:blur? true
:default-active :mobile
:data platform-data
+4 -2
View File
@@ -88,11 +88,13 @@
:component add-new-contact/new-contact}
{:name :how-to-pair
:options (assoc options/dark-screen :sheet? true)
:options {:theme :dark
:sheet? true}
:component how-to-pair/view}
{:name :find-sync-code
:options (assoc options/dark-screen :sheet? true)
:options {:theme :dark
:sheet? true}
:component find-sync-code/view}
{:name :discover-communities
+2 -2
View File
@@ -145,9 +145,9 @@
:chats/composer-height
:<- [:chats/current-chat-input]
:<- [:chats/link-previews-unfurled]
(fn [[{:keys [input-content-height metadata]} link-previews]]
(fn [[{:keys [input-content-height metadata focused?]} link-previews]]
(let [{:keys [responding-to-message editing-message sending-image]} metadata]
(+ (max composer.constants/input-height input-content-height)
(+ composer.constants/input-height
(when responding-to-message
composer.constants/reply-container-height)
(when editing-message
@@ -1401,9 +1401,10 @@ class TestOneToOneChatMultipleSharedDevicesNewUi(MultipleSharedDeviceTestCase):
chat.long_press_element()
if self.home_1.mute_chat_button.text != transl["unmute-chat"]:
self.errors.append("Chat is not muted")
expected_text = "Muted until you turn it back on"
if not self.home_1.element_by_text(expected_text).is_element_displayed():
self.errors.append("Text '%s' is not shown for muted chat" %expected_text)
# ToDo: enable the next check when https://github.com/status-im/status-mobile/issues/16768 is fixed
# expected_text = "%s %s" % (transl["muted-until"], transl["until-you-turn-it-back-on"])
# if not self.home_1.element_by_text(expected_text).is_element_displayed():
# self.errors.append("Text '%s' is not shown for muted chat" %expected_text)
self.home_1.mute_chat_button.click()
unmuted_message = "after unmute"
@@ -558,10 +558,11 @@ class TestGroupChatMultipleDeviceMergedNewUI(MultipleSharedDeviceTestCase):
chat.long_press_element()
if self.homes[1].mute_chat_button.text != transl["unmute-chat"]:
self.errors.append("Chat is not muted")
# expected_text = "Muted until %s today" % device_time + 1
expected_text = "Muted until you turn it back on"
if not self.homes[1].element_by_text(expected_text).is_element_displayed():
self.errors.append("Text '%s' is not shown for muted chat" % expected_text)
# ToDo: enable the next check when https://github.com/status-im/status-mobile/issues/16768 is fixed
# # expected_text = "Muted until %s today" % device_time + 1
# expected_text = "%s %s" % (transl["muted-until"], transl["until-you-turn-it-back-on"])
# if not self.homes[1].element_by_text(expected_text).is_element_displayed():
# self.errors.append("Text '%s' is not shown for muted chat" % expected_text)
self.chats[1].just_fyi("Member 1 unmutes the chat")
# self.chats[1].just_fyi("Close app and change device time so chat will be unmuted by timer")
# self.homes[1].put_app_to_background()
@@ -349,22 +349,6 @@ class TestCommunityOneDeviceMerged(MultipleSharedDeviceTestCase):
self.errors.verify_no_errors()
@marks.testrail_id(702869)
def test_community_undo_delete_message(self):
if not self.channel.chat_message_input.is_element_displayed():
self.home.click_system_back_button_until_element_is_shown()
self.home.get_to_community_channel_from_home(self.community_name)
message_to_delete = "message to delete and undo"
self.channel.send_message(message_to_delete)
self.channel.delete_message_in_chat(message_to_delete)
self.channel.element_by_text("Undo").click()
try:
self.channel.chat_element_by_text(message_to_delete).wait_for_visibility_of_element()
except TimeoutException:
pytest.fail("Message was not restored by clicking 'Undo' button")
if self.channel.element_starts_with_text("Message deleted").is_element_displayed():
pytest.fail("Text about deleted message is shown in the chat")
@marks.testrail_id(703382)
def test_community_mute_community_and_channel(self):
self.home.jump_to_communities_home()
@@ -402,7 +386,7 @@ class TestCommunityOneDeviceMerged(MultipleSharedDeviceTestCase):
device_time = self.home.driver.device_time
current_time = datetime.datetime.strptime(device_time, "%Y-%m-%dT%H:%M:%S%z")
expected_time = current_time + datetime.timedelta(days=7)
expected_text = "Muted until %s" % expected_time.strftime('%H:%M %a %-d %b')
expected_text = "Muted until %s" % expected_time.strftime('%H:%M %a %d %b')
self.community_view.get_channel(self.channel_name).long_press_element()
if not self.home.element_by_text(expected_text).is_element_displayed():
self.errors.append("Text '%s' is not shown for a muted community channel" % expected_text)
@@ -418,17 +402,21 @@ class TestCommunityOneDeviceMerged(MultipleSharedDeviceTestCase):
self.errors.verify_no_errors()
@marks.testrail_id(703133)
@marks.xfail(reason="Restoring communities issue: 16787; "
"restoring contacts issue: 15500",
run=False)
def test_restore_multiaccount_with_waku_backup_remove_switch(self):
self.home.jump_to_communities_home()
profile = self.home.profile_button.click()
profile.logout()
self.home.just_fyi("Restore user with predefined communities and contacts")
self.sign_in.recover_access(passphrase=waku_user.seed, second_user=True)
self.home.just_fyi("Restore user with predefined communities and contacts")
self.home.just_fyi("Restore user with predefined communities, check communities")
self.home.communities_tab.click()
for key in ['admin_open', 'member_open', 'admin_closed', 'member_closed']:
if not self.home.element_by_text(waku_user.communities[key]).is_element_displayed(30):
self.errors.append("%s was not restored from waku-backup!!" % key)
# TODO: there is a bug when pending community sometimes restored as joined; needs investigation
# self.home.opened_communities_tab.click()
# if not self.home.element_by_text(waku_user.communities['member_pending']).is_element_displayed(30):
# self.errors.append("Pending community %s was not restored from waku-backup!" % waku_user.communities['member_pending'])
self.home.just_fyi("Check contacts/blocked users")
self.home.chats_tab.click()
@@ -445,33 +433,23 @@ class TestCommunityOneDeviceMerged(MultipleSharedDeviceTestCase):
if shown_name_text in waku_user.contacts:
waku_user.contacts.remove(shown_name_text)
continue
# else:
# contact_row.click()
# shown_name_text = profile.default_username_text.text
# if shown_name_text in waku_user.contacts:
# waku_user.contacts.remove(shown_name_text)
# continue
# else:
# chat = self.home.get_chat_view()
# chat.profile_send_message_button.click()
# for name in waku_user.contacts:
# if chat.element_starts_with_text(name).is_element_displayed(sec=20):
# waku_user.contacts.remove(name)
# continue
else:
contact_row.click()
shown_name_text = profile.default_username_text.text
if shown_name_text in waku_user.contacts:
waku_user.contacts.remove(shown_name_text)
continue
else:
chat = self.home.get_chat_view()
chat.profile_send_message_button.click()
for name in waku_user.contacts:
if chat.element_starts_with_text(name).is_element_displayed(sec=20):
waku_user.contacts.remove(name)
continue
if waku_user.contacts:
self.errors.append(
"Contact(s) was (were) not restored from backup: %s!" % ", ".join(waku_user.contacts))
self.home.just_fyi("Check restored communities")
self.home.communities_tab.click()
for key in ['admin_open', 'member_open', 'admin_closed', 'member_closed']:
if not self.home.element_by_text(waku_user.communities[key]).is_element_displayed(30):
self.errors.append("%s was not restored from waku-backup!!" % key)
# TODO: there is a bug when pending community sometimes restored as joined; needs investigation
# self.home.opened_communities_tab.click()
# if not self.home.element_by_text(waku_user.communities['member_pending']).is_element_displayed(30):
# self.errors.append("Pending community %s was not restored from waku-backup!" % waku_user.communities['member_pending'])
if not pytest_config_global['pr_number']:
self.home.just_fyi("Perform back up")
self.home.click_system_back_button_until_element_is_shown()
@@ -520,7 +498,7 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase):
'username': self.username_1}),
(self.device_2.create_user, {'username': self.username_2}))))
self.homes = self.home_1, self.home_2 = self.device_1.get_home_view(), self.device_2.get_home_view()
self.public_key_2 = self.home_2.get_public_key_via_share_profile_tab()
self.public_key_2 = self.home_2.get_public_key()
self.profile_1 = self.home_1.get_profile_view()
[home.click_system_back_button_until_element_is_shown() for home in self.homes]
[home.chats_tab.click() for home in self.homes]
@@ -19,8 +19,7 @@ class TestActivityCenterContactRequestMultipleDevicePR(MultipleSharedDeviceTestC
(self.device_2.create_user, {'username': self.username_2}))))
self.homes = self.home_1, self.home_2 = self.device_1.get_home_view(), self.device_2.get_home_view()
self.profile_1, self.profile_2 = self.home_1.get_profile_view(), self.home_2.get_profile_view()
self.public_key_1 = self.home_1.get_public_key()
self.public_key_2 = self.home_2.get_public_key_via_share_profile_tab()
self.public_key_1, self.public_key_2 = (home.get_public_key() for home in self.homes)
[home.click_system_back_button_until_element_is_shown() for home in self.homes]
[home.chats_tab.click() for home in self.homes]
@@ -79,22 +78,9 @@ class TestActivityCenterContactRequestMultipleDevicePR(MultipleSharedDeviceTestC
@marks.testrail_id(702851)
def test_activity_center_contact_request_accept_swipe_mark_all_as_read(self):
self.device_2.just_fyi('Creating a new user on Device2')
self.device_2.just_fyi('Device2 re-sends a contact request to Device1')
self.home_2.jump_to_messages_home()
self.home_2.profile_button.click()
self.profile_2.logout()
new_username = "new user"
self.device_2.create_user(second_user=True, username=new_username)
self.device_2.just_fyi('Device2 sends a contact request to Device1 via Paste button and check user details')
self.home_2.driver.set_clipboard_text(self.public_key_1)
self.home_2.new_chat_button.click_until_presence_of_element(self.home_2.add_a_contact_chat_bottom_sheet_button)
self.home_2.add_a_contact_chat_bottom_sheet_button.click()
self.home_2.element_by_translation_id("paste").click()
self.home_2.element_by_translation_id("user-found").wait_for_visibility_of_element(10)
chat = self.home_2.get_chat_view()
chat.view_profile_new_contact_button.click_until_presence_of_element(chat.profile_block_contact_button)
chat.profile_add_to_contacts_button.click()
self.home_2.add_contact(self.public_key_1, remove_from_contacts=True)
self.device_1.just_fyi('Device1 accepts pending contact request by swiping')
self.home_1.chats_tab.click()
@@ -102,7 +88,7 @@ class TestActivityCenterContactRequestMultipleDevicePR(MultipleSharedDeviceTestC
self.home_1.open_activity_center_button.click()
self.home_1.just_fyi("Mark all as read")
cr_element = self.home_1.get_element_from_activity_center_view(new_username)
cr_element = self.home_1.get_element_from_activity_center_view(self.username_2)
self.home_1.more_options_activity_button.click()
self.home_1.mark_all_read_activity_button.click()
if cr_element.is_element_displayed():
@@ -114,7 +100,7 @@ class TestActivityCenterContactRequestMultipleDevicePR(MultipleSharedDeviceTestC
self.home_1.activity_notification_swipe_button.click_inside_element_by_coordinate(rel_x=0.5, rel_y=0.5)
self.home_1.close_activity_centre.click()
self.home_1.contacts_tab.click()
if not self.home_1.contact_details_row(username=new_username).is_element_displayed(20):
if not self.home_1.contact_details_row(username=self.username_2).is_element_displayed(20):
self.errors.append("Contact was not added to contact list after accepting contact request (as receiver)")
self.device_2.just_fyi('Device1 check that contact appeared in contact list mutually')
+2 -3
View File
@@ -7,6 +7,5 @@ communities = {
'member_closed': 'test_comm_enc',
'member_pending': 'RC1 testing community'
}
# contacts = ['Test_contact', 'MyCustomNickname'] # enable back when https://github.com/status-im/status-mobile/issues/15500 is fixed
contacts = ['Used Bulky Wirehair', 'Vengeful Healthy Arcticseal']
blocked_user = 'Clear Flat Milkweedbug'
contacts = ['Test_contact', 'MyCustomNickname']
blocked_user = 'Clear Flat Milkweedbug'
-14
View File
@@ -240,7 +240,6 @@ class HomeView(BaseView):
# Notification centre
self.notifications_button = Button(self.driver, accessibility_id="notifications-button")
self.notifications_unread_badge = BaseElement(self.driver, accessibility_id="activity-center-unread-count")
self.show_qr_code_button = Button(self.driver, accessibility_id="show-qr-button")
self.open_activity_center_button = Button(self.driver, accessibility_id="open-activity-center-button")
self.close_activity_centre = Button(self.driver, accessibility_id="close-activity-center")
@@ -314,11 +313,6 @@ class HomeView(BaseView):
self.more_options_activity_button = Button(self.driver, accessibility_id="activity-center-open-more")
self.mark_all_read_activity_button = Button(self.driver, translation_id="mark-all-notifications-as-read")
# Share tab
self.link_to_profile_text = Text(
self.driver,
xpath="(//*[@content-desc='link-to-profile']/preceding-sibling::*[1]/android.widget.TextView)[1]")
def wait_for_syncing_complete(self):
self.driver.info('Waiting for syncing to complete')
while True:
@@ -524,11 +518,3 @@ class HomeView(BaseView):
def get_contact_rows_count(self):
return len(ContactDetailsRow(self.driver).find_elements())
def get_public_key_via_share_profile_tab(self):
self.driver.info("Getting public key via Share tab")
self.show_qr_code_button.click()
self.link_to_profile_text.click()
c_text = self.driver.get_clipboard_text()
self.click_system_back_button()
return c_text.split("/")[-1]
+1 -5
View File
@@ -224,11 +224,7 @@ class SignInView(BaseView):
username="test user"):
self.driver.info("## Creating new multiaccount (password:'%s', keycard:'%s', enable_notification: '%s')" %
(password, str(keycard), str(enable_notifications)), device=False)
if second_user:
self.show_profiles_button.wait_and_click(20)
self.plus_profiles_button.click()
self.create_new_profile_button.click()
else:
if not second_user:
self.i_m_new_in_status_button.click_until_presence_of_element(self.generate_keys_button)
self.generate_keys_button.click_until_presence_of_element(self.profile_your_name_edit_box)
self.set_profile(username)