Skip to content

Commit

Permalink
fix: composer bottom shadow and maximized state atom
Browse files Browse the repository at this point in the history
  • Loading branch information
clauxx authored and churik committed Dec 28, 2023
1 parent b349735 commit 934f74e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
15 changes: 8 additions & 7 deletions src/status_im/contexts/chat/composer/gradients/style.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@
:position :absolute
:bottom 0
:left 0
:right 0
:z-index 2})
:right 0})

(defn bottom-gradient
[]
{:colors [(colors/theme-colors colors/white colors/neutral-95)
(colors/theme-colors colors/white-opa-0 colors/neutral-95-opa-0)]
:start {:x 0 :y 1}
:end {:x 0 :y 0}
:style bottom-gradient-style})
{:colors [(colors/theme-colors colors/white-opa-90 colors/neutral-95-opa-60)
(colors/theme-colors colors/white-opa-30 colors/neutral-95-opa-0)
]
:start {:x 0 :y 1}
:end {:x 0 :y 0}
:locations [0.3 1]
:style bottom-gradient-style})
1 change: 1 addition & 0 deletions src/status_im/contexts/chat/composer/gradients/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
(when show-bottom-gradient?
[rn/pressable
{:on-press #(when @input-ref (.focus ^js @input-ref))
:style {:z-index 1}
:accessibility-label :bottom-gradient}
[linear-gradient/linear-gradient (style/bottom-gradient)]])]))

Expand Down
5 changes: 3 additions & 2 deletions src/status_im/contexts/chat/composer/handlers.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
(defn focus
"Animate to the `saved-height`, display background-overlay if needed, and set cursor position"
[{:keys [input-ref] :as props}
{:keys [text-value focused? lock-selection? saved-cursor-position]}
{:keys [text-value focused? lock-selection? saved-cursor-position maximized?]}
{:keys [height saved-height last-height opacity background-y container-opacity]
:as animations}
{:keys [max-height] :as dimensions}
Expand All @@ -29,6 +29,7 @@
(reanimated/set-shared-value saved-height new-height)
(reanimated/animate container-opacity 1)
(when (> last-height-value (* constants/background-threshold max-height))
(reset! maximized? true)
(reanimated/animate opacity 1)
(reanimated/set-shared-value background-y 0)))

Expand All @@ -42,7 +43,7 @@
(defn blur
"Save the current height, minimize the composer, animate-out the background, and save cursor position"
[{:keys [text-value focused? lock-selection? cursor-position saved-cursor-position gradient-z-index
maximized? recording?]}
maximized? recording? minimized?]}
{:keys [height saved-height last-height gradient-opacity container-opacity opacity background-y]}
{:keys [content-height max-height window-height]}
{:keys [images link-previews? reply]}]
Expand Down

0 comments on commit 934f74e

Please sign in to comment.