Skip to content

Commit

Permalink
Merge branch 'develop' into jc/recent-transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
J-Son89 committed May 13, 2024
2 parents 2b5068a + 2618a55 commit 531dc5c
Show file tree
Hide file tree
Showing 26 changed files with 289 additions and 203 deletions.
2 changes: 2 additions & 0 deletions src/quo/components/avatars/channel_avatar/style.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
(defn outer-container
[{:keys [size customization-color theme]}]
(let [container-size (case size
:size-80 80
:size-64 64
:size-32 32
24)]
Expand All @@ -21,6 +22,7 @@
[size]
{:text-align :center
:font-size (case size
:size-80 36
:size-64 24
:size-32 15
11)})
Expand Down
6 changes: 3 additions & 3 deletions src/quo/components/avatars/channel_avatar/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@

(defn- initials
[{:keys [full-name size customization-color theme]}]
(let [amount-initials (if (#{:size-32 :size-64} size) 2 1)
(let [amount-initials (if (#{:size-32 :size-64 :size-80} size) 2 1)
channel-name (utils.string/safe-replace full-name "#" "")]
[text/text
(cond-> {:accessibility-label :initials
:style {:color (colors/resolve-color customization-color theme)}
:size :paragraph-2
:weight :semi-bold}
(= size :size-64) (assoc :size :heading-1
:weight :medium))
(#{:size-64 :size-80} size) (assoc :size :heading-1
:weight :medium))
(utils.string/get-initials channel-name amount-initials)]))

(defn- lock
Expand Down
19 changes: 13 additions & 6 deletions src/quo/components/avatars/collection_avatar/style.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,17 @@
:size-20 20
nil))

(defn collection-avatar
(defn collection-avatar-container
[theme size]
{:width (get-dimensions size)
:height (get-dimensions size)
:border-width 1
:border-color (colors/theme-colors colors/neutral-80-opa-10 colors/white-opa-10 theme)
:border-radius 6})
{:width (get-dimensions size)
:height (get-dimensions size)
:border-width 1
:border-color (colors/theme-colors colors/neutral-80-opa-10 colors/white-opa-10 theme)
:border-radius 6
:justify-content :center
:align-items :center})

(defn collection-avatar
[size]
{:width (get-dimensions size)
:height (get-dimensions size)})
16 changes: 9 additions & 7 deletions src/quo/components/avatars/collection_avatar/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@
(:require
[quo.components.avatars.collection-avatar.style :as style]
[quo.theme :as quo.theme]
[react-native.core :as rn]
[react-native.fast-image :as fast-image]))

(defn view
"Opts:
:image - collection image
:theme - keyword -> :light/:dark"
[{:keys [image size on-load-end on-error] :or {size :size-24}}]
(let [theme (quo.theme/use-theme)]
[fast-image/fast-image
{:accessibility-label :collection-avatar
:source image
:on-load-end on-load-end
:on-error on-error
:style (style/collection-avatar theme size)}]))
[rn/view {:style (style/collection-avatar-container theme size)}
[fast-image/fast-image
{:accessibility-label :collection-avatar
:source image
:on-load-end on-load-end
:on-error on-error
:style (style/collection-avatar size)}]]))
11 changes: 1 addition & 10 deletions src/quo/components/avatars/group_avatar/view.cljs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
(ns quo.components.avatars.group-avatar.view
(:require
[clojure.string :as string]
[quo.components.avatars.group-avatar.style :as style]
[quo.components.icon :as icon]
[quo.components.markdown.text :as text]
Expand All @@ -22,7 +21,7 @@
:container 80}})

(defn view
[{:keys [size customization-color picture icon-name emoji chat-name]
[{:keys [size customization-color picture icon-name emoji]
:or {size :size-20
customization-color :blue
picture nil
Expand Down Expand Up @@ -50,14 +49,6 @@
{:size :paragraph-1
:style (dissoc (style/avatar-identifier theme) :font-size)}
emoji])
chat-name
(if (= size :size-80)
[rn/text
{:style (style/avatar-identifier theme)}
((comp first string/upper-case) chat-name)]
[text/text
{:size :paragraph-1}
((comp first string/upper-case) chat-name)])
:else
[icon/icon icon-name
{:size icon-size
Expand Down
28 changes: 14 additions & 14 deletions src/quo/components/notifications/toast/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -67,27 +67,26 @@

(defn toast
"Options:
:type => :neutral/:negative/:positive
"
[{:keys [type icon title text action undo-duration undo-on-press container-style theme user]
[{:keys [type icon title text action undo-duration undo-on-press container-style user]
:or {type :neutral icon :i/placeholder}}]
(let [context-theme (quo.theme/use-theme)
context-theme (or theme context-theme)
icon-name (case type
:positive (if (= theme :light)
:i/correct
:i/correct-dark)
:negative (if (= theme :light)
:i/incorrect
:i/incorrect-dark)
:neutral icon)]
[quo.theme/provider context-theme
(let [theme (quo.theme/use-theme)
icon-name (case type
:positive (if (= theme :light)
:i/correct
:i/correct-dark)
:negative (if (= theme :light)
:i/incorrect
:i/incorrect-dark)
:neutral icon)]
[quo.theme/provider theme
[toast-container
{:left (cond user
[user-avatar/user-avatar user]
icon-name
[icon/icon icon-name (style/icon type context-theme)])
[icon/icon icon-name (style/icon type theme)])
:title title
:text text
:right (if undo-duration
Expand All @@ -96,3 +95,4 @@
:undo-on-press undo-on-press}]
action)
:container-style container-style}]]))

9 changes: 6 additions & 3 deletions src/quo/components/settings/data_item/style.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,19 @@
[quo.foundations.colors :as colors]))

(defn container
[size card? blur? theme]
[{:keys [size card? blur? actionable? theme]}]
{:flex-direction :row
:justify-content :space-between
:padding-vertical (when (= size :default) 8)
:padding-horizontal (when (= size :default) 12)
:border-radius 16
:border-width (when (and card? (not= size :small)) 1)
:background-color (if blur?
colors/white-opa-5
(colors/theme-colors colors/white colors/neutral-95 theme))
(if actionable? :transparent colors/white-opa-5)
(colors/theme-colors
(if actionable? colors/white colors/neutral-2_5)
(if actionable? colors/neutral-95 colors/neutral-90)
theme))
:border-color (if blur?
colors/white-opa-10
(colors/theme-colors colors/neutral-10
Expand Down
7 changes: 6 additions & 1 deletion src/quo/components/settings/data_item/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,12 @@
{:accessibility-label :data-item
:disabled (not icon-right?)
:on-press on-press
:style (merge (style/container size card? blur? theme) container-style)}
:style (merge (style/container {:size size
:card? card?
:blur? blur?
:actionable? on-press
:theme theme})
container-style)}
[left-side props]
(when (and (= :default status) (not= :small size))
[right-side
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

(def container
{:flex-direction :row
:flex 1
:justify-content :space-between})

(def right-counter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@

(def ^:const default-dimension 1000)

(def ^:const margin 8)
(def ^:const margin 16)
3 changes: 2 additions & 1 deletion src/status_im/common/scroll_page/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@
[quo/page-nav
(cond-> {:margin-top (safe-area/get-top)
:type :no-title
:background (if (= 1 (reanimated/get-shared-value opacity-animation))
:background (if (or (:blur? page-nav-props)
(= 1 (reanimated/get-shared-value opacity-animation)))
:blur
:photo)
:right-side page-nav-right-section-buttons
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
(:require
[oops.core :as oops]
[quo.core :as quo]
[react-native.platform :as platform]
[reagent.core :as reagent]
[status-im.common.lightbox.constants :as constants]
[status-im.contexts.chat.messenger.messages.content.lightbox.style :as style]
Expand Down Expand Up @@ -36,7 +35,6 @@
[:lightbox/save-image-to-gallery
uri
#(rf/dispatch [:toasts/upsert
{:id :random-id
:type :positive
:container-style {:bottom (when platform/android? 20)}
:text (i18n/label :t/photo-saved)}])]))}]]]))
{:id :random-id
:type :positive
:text (i18n/label :t/photo-saved)}])]))}]]]))
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,11 @@
{:transform [{:scale scale}]
:top top
:left left}
{:position :absolute
:border-width 4
:border-radius 50
:border-color (colors/theme-colors colors/white colors/neutral-95 theme)}))
{:position :absolute
:border-width 4
:border-radius 50
:background-color (colors/theme-colors colors/white colors/neutral-95 theme)
:border-color (colors/theme-colors colors/white colors/neutral-95 theme)}))

(defn user-name-container
[top left]
Expand Down
14 changes: 10 additions & 4 deletions src/status_im/contexts/chat/messenger/messages/list/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,21 @@
community-channel? (= chat-type constants/community-chat-type)]
[reanimated/view
{:style (style/header-image scale top left theme)}
(if group-chat
(cond
community-channel?
[quo/channel-avatar
{:size :size-80
:full-name chat-name
:customization-color color
:emoji (when-not (string/blank? emoji)
(string/trim emoji))}]
group-chat
[quo/group-avatar
{:customization-color color
:size :size-80
:picture profile-picture
:emoji (when (and (not (string/blank? emoji))
community-channel?)
(string/trim emoji))
:chat-name chat-name}]
:else
[quo/user-avatar
{:full-name display-name
:online? online?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,18 @@
(cske/transform-keys transforms/->kebab-case-keyword derived-address)))}))

(rf/reg-event-fx :wallet/get-derived-addresses-success get-derived-addresses-success)

(rf/reg-event-fx
:wallet/set-private-key
(fn [{:keys [db]} [value]]
{:db (assoc-in db [:wallet :ui :create-account :private-key] (security/mask-data value))}))

(rf/reg-event-fx
:wallet/set-public-address
(fn [{:keys [db]} [value]]
{:db (assoc-in db [:wallet :ui :create-account :public-address] value)}))

(rf/reg-event-fx
:wallet/clear-private-key-data
(fn [{:keys [db]} _]
{:db (update-in db [:wallet :ui :create-account] dissoc :private-key :public-address)}))

0 comments on commit 531dc5c

Please sign in to comment.