Skip to content

Commit

Permalink
fix: format code
Browse files Browse the repository at this point in the history
  • Loading branch information
siddarthkay committed Sep 9, 2023
1 parent fc09e87 commit 64731fa
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 38 deletions.
48 changes: 24 additions & 24 deletions src/quo/components/animated_header.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
[]
(let [y 0 ;;(animated/value 0)
animation-value 0 ;;(animated/value 0)
; animation (animated/with-timing-transition
; animation-value
; {:duration 250
; :easing (:ease-in animated/easings)})
; on-scroll (animated/on-scroll {:y y})
; animation (animated/with-timing-transition
; animation-value
; {:duration 250
; :easing (:ease-in animated/easings)})
; on-scroll (animated/on-scroll {:y y})
layout (reagent/atom {})
offset (reagent/atom 0)
on-layout (fn [evt]
Expand Down Expand Up @@ -63,29 +63,29 @@
:title-component [animated/view {:style (title-style @layout)}
[extended-header
{:value y
; :animation animation
; :animation animation
:minimized true
:offset @offset}]]
:title-align :left}
(dissoc props :extended-header))]]
; (into [animated/scroll-view
; {:on-scroll on-scroll
; :refreshControl (when refresh-control
; (refresh-control
; (and @refreshing-sub
; @refreshing-counter)))
; :style {:z-index 1}
; :scrollEventThrottle 16}
; [animated/view {:pointer-events :box-none}
; [animated/view
; {:pointer-events :box-none
; :on-layout on-layout}
; [extended-header
; {:value y
;; :animation animation
; :offset @offset}]]]]
; children)
])))
; (into [animated/scroll-view
; {:on-scroll on-scroll
; :refreshControl (when refresh-control
; (refresh-control
; (and @refreshing-sub
; @refreshing-counter)))
; :style {:z-index 1}
; :scrollEventThrottle 16}
; [animated/view {:pointer-events :box-none}
; [animated/view
; {:pointer-events :box-none
; :on-layout on-layout}
; [extended-header
; {:value y
;; :animation animation
; :offset @offset}]]]]
; children)
])))

(defn header
[{:keys [use-insets] :as props} & children]
Expand Down
31 changes: 19 additions & 12 deletions src/react_native/reanimated.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,12 @@
SlideInUp
SlideOutUp
FadeIn
; enableLayoutAnimations
runOnJS)]
[reagent.core :as reagent]
["react-native-redash" :refer (withPause)]
[react-native.flat-list :as rn-flat-list]
[utils.worklets.core :as worklets.core]))

;;commented out to upgrade react-native-reanimated to v3 and react-native to 0.72
;;TODO: verify if app works properly without enableLayoutAnimations since we are on v3
;(def enable-layout-animations enableLayoutAnimations)

(def ^:const default-duration 300)

;; Animations
Expand All @@ -37,7 +32,6 @@
;;;; LinearTransition is deprecated
;;;; https://github.com/software-mansion/react-native-reanimated/issues/4362#issuecomment-1508682400
;;;; temporarily using FadeIn as a replacement to Linear Transition

(def linear-transition FadeIn)

;; Animated Components
Expand Down Expand Up @@ -78,11 +72,13 @@

(def run-on-js runOnJS)

;; Easings
(def bezier (.-bezier ^js Easing))

(def in-out
(.-inOut ^js Easing))

;; trying to put default-easing inside easings map causes test to fail
(defn default-easing [] (in-out (.-quad ^js Easing)))

(def easings
Expand Down Expand Up @@ -123,27 +119,35 @@
[anim v duration easing]
(set-shared-value anim
(with-timing v
(js-obj "duration" duration "easing" (get easings easing)))))
(js-obj "duration" duration
"easing" (get easings easing)))))

(defn animate-shared-value-with-delay
[anim v duration easing delay]
(set-shared-value
anim
(with-delay delay (with-timing v (js-obj "duration" duration "easing" (get easings easing))))))
(with-delay delay
(with-timing v
(js-obj "duration" duration
"easing" (get easings easing))))))

(defn animate-delay
([animation v delay]
(animate-delay animation v delay default-duration))
([animation v delay duration]
(set-shared-value
animation
(with-delay delay (with-timing v (clj->js {:duration duration :easing (default-easing)}))))))
(with-delay delay
(with-timing v
(clj->js {:duration duration
:easing (default-easing)}))))))

(defn animate-shared-value-with-repeat
[anim v duration easing number-of-repetitions reverse?]
(set-shared-value anim
(with-repeat (with-timing v
(js-obj "duration" duration "easing" (get easings easing)))
(js-obj "duration" duration
"easing" (get easings easing)))
number-of-repetitions
reverse?)))

Expand Down Expand Up @@ -181,9 +185,12 @@
([animation value duration]
(set-shared-value animation
(with-timing value
(clj->js {:duration duration :easing (default-easing)})))))
(clj->js {:duration duration
:easing (default-easing)})))))


(defn with-timing-duration
[v duration]
(with-timing v (clj->js {:duration duration :easing (in-out (.-quad ^js Easing))})))
(with-timing v
(clj->js {:duration duration
:easing (in-out (.-quad ^js Easing))})))
3 changes: 1 addition & 2 deletions src/status_im/browser/eip3085.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@
(if (network/chain-id-available? networks network)
{:dispatch [:bottom-sheet/show-sheet-old
{:content (fn []
[sheet/permissions-panel dapp-name message-id
params])}]}
[sheet/permissions-panel dapp-name message-id params])}]}
(send-success-call-to-bridge cofx id message-id)))
{:browser/send-to-bridge {:type constants/web3-send-async-callback
:messageId message-id
Expand Down
1 change: 1 addition & 0 deletions src/status_im/signals/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,5 @@
(js->clj event-js :keywordize-keys true))
"curated.communities.update" (rf/dispatch [:fetched-contract-communities
(js->clj event-js :keywordize-keys true)])

(log/debug "Event " type " not handled"))))

0 comments on commit 64731fa

Please sign in to comment.