Skip to content

Commit

Permalink
WIP: cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
ulisesmac committed Nov 6, 2023
1 parent fb8ff8f commit 1519256
Show file tree
Hide file tree
Showing 3 changed files with 195 additions and 192 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,11 @@
})

(defn get-margin-bottom
[{:keys [show-background? keyboard-will-show?]}]
(cond
platform/android? 0
keyboard-will-show? (safe-area/get-top)
(and show-background? keyboard-will-show?) (safe-area/get-bottom)
:else (safe-area/get-bottom)))
[{:keys [blur? keyboard-will-show?]}]
(if (and platform/ios?
(or keyboard-will-show? blur?))
(safe-area/get-bottom)
0))

(defn animate-margin-bottom
[margin-bottom-shared-value]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,22 @@
[react-native.reanimated :as reanimated]
[status-im2.common.floating-button-page.floating-container.style :as style]))

(def duration 100)
(def ^:private duration 100)

(defn- blur-container
[{:keys [on-layout blur? theme] :as props} children]
(defn- content-container
[{:keys [blur? theme] :as props} children]
(let [styles (if blur?
{:overflow :hidden}
{:overflow :hidden
:padding-vertical 12
:padding-horizontal 20})]
[rn/view {:style styles
:on-layout on-layout}
[rn/view {:style styles}
(if blur?
[blur/view {:blur-amount 12
:blur-radius 25
;:blur-type (quo.theme/theme-value :light :dark theme)
:blur-type (quo.theme/theme-value :light :dark theme)
;:style (style/inner-blur-container theme)
:blur-type :light}
}
[rn/view {:style {:background-color :transparent
:padding-vertical 12
:padding-horizontal 20}}
Expand All @@ -35,16 +34,17 @@
[{:keys [on-layout keyboard-will-show? blur?]
:as props}
children]
(prn props)
(let [theme (quo.theme/use-theme-value)
margin-bottom (reanimated/use-shared-value (style/get-margin-bottom props))]
(rn/use-effect
#(reanimated/animate margin-bottom (style/get-margin-bottom props) duration)
[keyboard-will-show?])

[reanimated/view {:style (style/animate-margin-bottom margin-bottom)}
[blur-container {:theme theme
:on-layout on-layout
:blur? blur?}
[reanimated/view {:style (style/animate-margin-bottom margin-bottom)
:on-layout on-layout}
[content-container {:theme theme
:blur? blur?}
children]]))

(defn view
Expand Down
Loading

0 comments on commit 1519256

Please sign in to comment.