Skip to content

Commit

Permalink
Merge branch 'develop' into milad/15948
Browse files Browse the repository at this point in the history
  • Loading branch information
mmilad75 authored Jun 8, 2023
2 parents dff232d + 032c254 commit 5174019
Show file tree
Hide file tree
Showing 28 changed files with 323 additions and 248 deletions.
3 changes: 2 additions & 1 deletion src/quo2/components/profile/profile_card/style.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
{:color colors/white})

(def emoji-hash
{:margin-top 12})
{:margin-top 12
:letter-spacing 1.5})

(def user-hash
{:margin-top 2
Expand Down
5 changes: 2 additions & 3 deletions src/quo2/components/profile/profile_card/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,8 @@
style/keycard-icon))]
(when show-user-hash?
[text/text
{:weight :monospace
:number-of-lines 1
:style style/user-hash} hash])
{:weight :monospace
:style style/user-hash} hash])
(when (and show-emoji-hash? emoji-hash)
[text/text
{:weight :monospace
Expand Down
9 changes: 5 additions & 4 deletions src/status_im/data_store/messages.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,11 @@
(update :link-previews #(map <-link-preview-rpc %))
(update :quoted-message
set/rename-keys
{:parsedText :parsed-text
:deleted :deleted?
:deletedForMe :deleted-for-me?
:communityId :community-id})
{:parsedText :parsed-text
:deleted :deleted?
:deletedForMe :deleted-for-me?
:communityId :community-id
:albumImagesCount :album-images-count})
(update :outgoing-status keyword)
(update :command-parameters
set/rename-keys
Expand Down
4 changes: 3 additions & 1 deletion src/status_im2/common/bottom_sheet/styles.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@
:bottom 0})

(defn selected-item
[override-theme]
[override-theme window-height sheet-height {:keys [top]}]
{:position :absolute
:bottom 10
:max-height (- window-height sheet-height top)
:overflow :hidden
:left 0
:right 0
:border-radius 12
Expand Down
85 changes: 45 additions & 40 deletions src/status_im2/common/bottom_sheet/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
[react-native.gesture :as gesture]
[oops.core :as oops]
[react-native.hooks :as hooks]
[react-native.blur :as blur]))
[react-native.blur :as blur]
[reagent.core :as reagent]))

(def duration 450)
(def timing-options #js {:duration duration})
Expand Down Expand Up @@ -51,44 +52,48 @@
(show translate-y bg-opacity)
(hide translate-y bg-opacity window-height on-close))))))

(defn view
[{:keys [hide? insets]}
{:keys [content override-theme selected-item padding-bottom-override on-close shell?]}]
(let [{window-height :height} (rn/get-window)
bg-opacity (reanimated/use-shared-value 0)
translate-y (reanimated/use-shared-value window-height)
sheet-gesture (get-sheet-gesture translate-y bg-opacity window-height on-close)]
(rn/use-effect
#(if hide? (hide translate-y bg-opacity window-height on-close) (show translate-y bg-opacity))
[hide?])
(hooks/use-back-handler #(do (when (fn? on-close)
(on-close))
(rf/dispatch [:hide-bottom-sheet])
true))
[rn/view {:flex 1}
;; backdrop
[rn/touchable-without-feedback {:on-press #(rf/dispatch [:hide-bottom-sheet])}
[reanimated/view
{:style (reanimated/apply-animations-to-style
{:opacity bg-opacity}
{:flex 1 :background-color colors/neutral-100-opa-70})}]]
;; sheet
[gesture/gesture-detector {:gesture sheet-gesture}
[reanimated/view
{:style (reanimated/apply-animations-to-style
{:transform [{:translateY translate-y}]}
(styles/sheet insets window-height override-theme padding-bottom-override shell?))}
(defn f-view
[_ _]
(let [sheet-height (reagent/atom 0)]
(fn [{:keys [hide? insets]}
{:keys [content override-theme selected-item padding-bottom-override on-close shell?]}]
(let [{window-height :height} (rn/get-window)
bg-opacity (reanimated/use-shared-value 0)
translate-y (reanimated/use-shared-value window-height)
sheet-gesture (get-sheet-gesture translate-y bg-opacity window-height on-close)]
(rn/use-effect
#(if hide? (hide translate-y bg-opacity window-height on-close) (show translate-y bg-opacity))
[hide?])
(hooks/use-back-handler #(do (when (fn? on-close)
(on-close))
(rf/dispatch [:hide-bottom-sheet])
true))
[rn/view {:style {:flex 1}}
;; backdrop
[rn/touchable-without-feedback {:on-press #(rf/dispatch [:hide-bottom-sheet])}
[reanimated/view
{:style (reanimated/apply-animations-to-style
{:opacity bg-opacity}
{:flex 1 :background-color colors/neutral-100-opa-70})}]]
;; sheet
[gesture/gesture-detector {:gesture sheet-gesture}
[reanimated/view
{:style (reanimated/apply-animations-to-style
{:transform [{:translateY translate-y}]}
(styles/sheet insets
window-height
override-theme
padding-bottom-override
shell?))
:on-layout #(reset! sheet-height (oops/oget % "nativeEvent" "layout" "height"))}
(when shell? [blur/ios-view {:style styles/shell-bg}])

(when shell?
[blur/ios-view
{:style styles/shell-bg}])
(when selected-item
[rn/view
[rn/view {:style (styles/selected-item override-theme window-height @sheet-height insets)}
[selected-item]]])

(when selected-item
[rn/view
[rn/view {:style (styles/selected-item override-theme)}
[selected-item]]])

;; handle
[rn/view {:style (styles/handle override-theme)}]
;; content
[content]]]]))
;; handle
[rn/view {:style (styles/handle override-theme)}]
;; content
[content]]]]))))
18 changes: 10 additions & 8 deletions src/status_im2/common/home/actions/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,15 @@
:chevron? true})))

(defn mark-as-read-entry
[chat-id]
[chat-id needs-divider?]
(entry {:icon :i/correct
:label (i18n/label :t/mark-as-read)
:on-press #(mark-all-read-action chat-id)
:danger? false
:accessibility-label :mark-as-read
:sub-label nil
:chevron? false
:add-divider? true}))
:add-divider? needs-divider?}))

(defn clear-history-entry
[chat-id]
Expand Down Expand Up @@ -403,8 +403,8 @@
(delete-chat-entry item inside-chat?))])

(defn notification-actions
[{:keys [chat-id group-chat public?]} inside-chat?]
[(mark-as-read-entry chat-id)
[{:keys [chat-id group-chat public?]} inside-chat? needs-divider?]
[(mark-as-read-entry chat-id needs-divider?)
(mute-chat-entry chat-id)
(notifications-entry false)
(when inside-chat?
Expand Down Expand Up @@ -433,15 +433,17 @@
[quo/action-drawer
[[(view-profile-entry chat-id)
(edit-nickname-entry chat-id)]
(notification-actions item inside-chat?)
(notification-actions item inside-chat? false)
(destructive-actions item inside-chat?)]])

(defn private-group-chat-actions
[item inside-chat?]
[quo/action-drawer
[(group-actions item inside-chat?)
(notification-actions item inside-chat?)
(destructive-actions item inside-chat?)]])
(let [show-group-actions? (:group-chat-member? item)]
[(when show-group-actions?
(group-actions item inside-chat?))
(notification-actions item inside-chat? show-group-actions?)
(destructive-actions item inside-chat?)])])

(defn contact-actions
[{:keys [public-key] :as contact} {:keys [chat-id admin?] :as extra-data}]
Expand Down
7 changes: 4 additions & 3 deletions src/status_im2/contexts/chat/composer/reply/style.cljs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
(ns status-im2.contexts.chat.composer.reply.style)
(ns status-im2.contexts.chat.composer.reply.style
(:require [react-native.platform :as platform]))


(defn container
[pin? in-chat-input?]
{:flex-direction :row
:height (when-not pin? 24)
:margin-left (when (and (not in-chat-input?) (not pin?)) 26)
:margin-left (if (and (not in-chat-input?) (not pin?)) 26 (if platform/android? 4 0))
:margin-bottom (when (and (not in-chat-input?) (not pin?)) 8)})
(defn reply-content
[pin?]
Expand Down Expand Up @@ -33,7 +34,7 @@
{:text-transform :none
:margin-left 4
:margin-top 2
:flex 1})
:flex-shrink 1})

(def gradient
{:position :absolute
Expand Down
45 changes: 25 additions & 20 deletions src/status_im2/contexts/chat/composer/reply/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@
in-chat-input? pin? recording-audio?]
(let [contact-name (rf/sub [:contacts/contact-name-by-identity from])
current-public-key (rf/sub [:multiaccount/public-key])
content-type (or content-type contentType)]
content-type (or content-type contentType)
text (get-quoted-text-with-mentions (or parsed-text (:parsed-text content)))]
[rn/view
{:style (style/container pin? in-chat-input?)
:accessibility-label :reply-message}
Expand All @@ -102,26 +103,30 @@
{:from from
:contact-name contact-name
:current-public-key current-public-key}]
(when (not-empty text)
[quo/text
{:number-of-lines 1
:size :label
:weight :regular
:accessibility-label :quoted-message
:ellipsize-mode :tail
:style style/message-text}
text])
[quo/text
{:number-of-lines 1
:size :label
:weight :regular
:accessibility-label :quoted-message
:ellipsize-mode :tail
:style (merge
style/message-text
(when (or (= constant/content-type-image content-type)
(= constant/content-type-sticker content-type)
(= constant/content-type-audio content-type))
{:color (colors/theme-colors colors/neutral-50 colors/neutral-40)}))}
(case (or content-type contentType)
constant/content-type-image (if album-images-count
(i18n/label :t/images-albums-count
{:album-images-count album-images-count})
(i18n/label :t/image))
constant/content-type-sticker (i18n/label :t/sticker)
constant/content-type-audio (i18n/label :t/audio)
(get-quoted-text-with-mentions (or parsed-text (:parsed-text content))))]])]
{:size :label
:weight :regular
:style {:color (colors/theme-colors colors/neutral-50 colors/neutral-40)
:margin-top 2}}
(str " "
(case (or content-type contentType)
constant/content-type-image (if (pos? album-images-count)
(i18n/label :t/album-images-count
{:album-images-count album-images-count})
(i18n/label :t/photo))
constant/content-type-sticker (i18n/label :t/sticker)
constant/content-type-audio (i18n/label :t/audio)
""))]
])]
(when (and in-chat-input? (not recording-audio?))
[quo/button
{:width 24
Expand Down
13 changes: 13 additions & 0 deletions src/status_im2/contexts/chat/home/style.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,16 @@
:right 0
:left 0
:padding-top top})

(def header-height 245)

(defn header-space
[top]
{:height (+ header-height top)})

(defn empty-content-container
[top]
{:flex 1
:margin-top (+ header-height top)
:margin-bottom 44
:justify-content :center})
Loading

0 comments on commit 5174019

Please sign in to comment.