Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
ibrkhalil committed Aug 13, 2023
1 parent 42996a4 commit eb085d8
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/status_im2/common/scroll_page/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@

(defn f-scroll-page-header
[scroll-height height name page-nav logo sticky-header top-nav title-colum navigate-back?]
(let [input-range (if platform/ios? [-47 10] [0 10])
output-range (if platform/ios? [-208 0] [-208 -45])
y (reanimated/use-shared-value scroll-height)
translate-animation (reanimated/interpolate y
input-range
output-range
{:extrapolateLeft "clamp"
:extrapolateRight "clamp"})
opacity-animation (reanimated/use-shared-value 0)
threshold (if platform/ios? 30 170)
opaque? (= 1 (reanimated/get-shared-value opacity-animation))
{:keys [sheets]} (rf/sub [:bottom-sheet])
show-blurred-right-section-button? (or (seq sheets)
opaque?)]
(let [input-range (if platform/ios? [-47 10] [0 10])
output-range (if platform/ios? [-208 0] [-208 -45])
y (reanimated/use-shared-value scroll-height)
translate-animation (reanimated/interpolate y
input-range
output-range
{:extrapolateLeft "clamp"
:extrapolateRight "clamp"})
opacity-animation (reanimated/use-shared-value 0)
threshold (if platform/ios? 30 170)
opaque? (= 1 (reanimated/get-shared-value opacity-animation))
{:keys [sheets]} (rf/sub [:bottom-sheet])
blur-right-section-buttons? (or (seq sheets)
opaque?)]
(rn/use-effect
#(do
(reanimated/set-shared-value y scroll-height)
Expand Down Expand Up @@ -78,13 +78,13 @@
:mid-section {:type :text-with-description
:main-text nil
:description-img nil}
:right-section-buttons (if show-blurred-right-section-button?
:right-section-buttons (if blur-right-section-buttons?
(mapv #(assoc % :icon-background :blur) page-nav)
page-nav)}
(when navigate-back?
{:left-section {:icon :i/close
:type :grey
:icon-background (if show-blurred-right-section-button?
:icon-background (if blur-right-section-buttons?
:blur
:photo)
:on-press #(rf/dispatch [:navigate-back])}}))]])
Expand Down

0 comments on commit eb085d8

Please sign in to comment.