Skip to content

Commit 3fc68a6

Browse files
committed
(0.72.3) cleanup and make linter happy
1 parent 6e2663a commit 3fc68a6

File tree

20 files changed

+242
-144
lines changed

20 files changed

+242
-144
lines changed

src/quo/animated.cljs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
(ns quo.animated
22
(:refer-clojure :exclude [abs set delay divide])
3-
(:require ["react-native-reanimated" :default animated :refer (clockRunning EasingNode)]
3+
(:require ["react-native-reanimated" :default animated :refer
4+
(clockRunning
5+
; EasingNode
6+
)]
47
["react-native-redash" :as redash]
58
[oops.core :refer [ocall oget]]
69
[quo.gesture-handler :as gh]

src/quo/components/animated/pressable.cljs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@
7878
(fn []
7979
(animated/with-timing-transition active
8080
{:duration (animated/cond* active time-in time-out)
81-
;commented out to upgrade react-native-reanimated to v3 and react-native to 0.72
81+
;commented out to upgrade react-native-reanimated
82+
;to v3 and react-native to 0.72
8283
;TODO: replace this with an updated implementation
8384
; :easing
8485
;
@@ -103,7 +104,8 @@
103104
(when (and on-long-press
104105
(= gesture-state (:active gesture-handler/states)))
105106
(on-long-press)
106-
;commented out to upgrade react-native-reanimated to v3 and react-native to 0.72
107+
;commented out to upgrade react-native-reanimated to v3 and
108+
;react-native to 0.72
107109
;TODO: replace this with an updated implementation
108110
; (animated/set-value state
109111
; (:undetermined
@@ -115,7 +117,8 @@
115117
(when on-press
116118
(animated/cond* (= state (:end gesture-handler/states))
117119
[
118-
;commented out to upgrade react-native-reanimated to v3 and react-native to 0.72
120+
;commented out to upgrade react-native-reanimated to v3 and react-native to
121+
;0.72
119122
;TODO: replace this with an updated implementation
120123
; (animated/set state (:undetermined
121124
; gesture-handler/states))

src/quo/components/animated_header.cljs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@
4747
animation (animated/with-timing-transition
4848
animation-value
4949
{:duration 250
50-
;commented out to upgrade react-native-reanimated to v3 and react-native to 0.72
50+
;commented out to upgrade react-native-reanimated to v3 and react-native to
51+
;0.72
5152
;TODO: replace this with an updated implementation
5253
; :easing (:ease-in animated/easings)
5354
})

src/quo/components/bottom_sheet/view.cljs

Lines changed: 47 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
(defn bottom-sheet-hooks
2424
[props]
25-
(let [{on-cancel :onCancel
25+
(let [{; on-cancel :onCancel
2626
disable-drag? :disableDrag?
2727
show-handle? :showHandle?
2828
visible? :visible?
@@ -51,19 +51,25 @@
5151
;; implemented
5252
;; https://github.com/wix/react-native-navigation/issues/7225
5353
0))
54-
min-height (+ (* styles/vertical-padding 2) (:bottom safe-area))
54+
;commented out to upgrade react-native-reanimated to v3 and react-native to 0.72
55+
;TODO: uncomment this when this let binding is in use
56+
; min-height (+ (* styles/vertical-padding 2) (:bottom safe-area))
5557
max-height (- window-height (:top safe-area))
5658
visible (react/state false)
5759

5860
master-translation-y (animated/use-value 0)
5961
master-velocity-y (animated/use-value (:undetermined gesture-handler/states))
6062
master-state (animated/use-value (:undetermined gesture-handler/states))
6163
tap-state (animated/use-value 0)
62-
manual-open (animated/use-value 0)
64+
;commented out to upgrade react-native-reanimated to v3 and react-native to 0.72
65+
;TODO: replace this with an updated implementation
66+
; manual-open (animated/use-value 0)
6367
manual-close (animated/use-value 0)
64-
offset (animated/use-value 0)
65-
drag-over (animated/use-value 1)
66-
clock (animated/use-clock)
68+
;commented out to upgrade react-native-reanimated to v3 and react-native to 0.72
69+
;TODO: replace this with an updated implementation
70+
; offset (animated/use-value 0)
71+
; drag-over (animated/use-value 1)
72+
; clock (animated/use-clock)
6773
tap-gesture-handler (animated/use-gesture {:state tap-state})
6874
on-master-event (animated/use-gesture
6975
{:translationY master-translation-y
@@ -73,41 +79,45 @@
7379
sheet-height (min max-height
7480
(+ styles/border-radius @height))
7581

76-
open-snap-point (animated/use-value 0)
77-
close-snap-point 0
78-
on-close (fn []
79-
(when @visible
80-
(reset! visible false)
81-
(reset! height 0)
82-
(when on-cancel
83-
(on-cancel))))
82+
;commented out to upgrade react-native-reanimated to v3 and react-native to 0.72
83+
;TODO: replace this with an updated implementation
84+
; open-snap-point (animated/use-value 0)
85+
; close-snap-point 0
86+
; on-close (fn []
87+
; (when @visible
88+
; (reset! visible false)
89+
; (reset! height 0)
90+
; (when on-cancel
91+
; (on-cancel))))
8492
close-sheet (fn []
8593
(animated/set-value manual-close 1))
86-
on-snap (fn [pos]
87-
(when (= close-snap-point (aget pos 0))
88-
(on-close)))
94+
;commented out to upgrade react-native-reanimated to v3 and react-native to 0.72
95+
;TODO: replace this with an updated implementation
96+
; on-snap (fn [pos]
97+
; (when (= close-snap-point (aget pos 0))
98+
; (on-close)))
8999
;commented out to upgrade react-native-reanimated to v3 and react-native to 0.72
90100
;TODO: replace this with an updated implementation
91101
; interrupted (animated/and* (animated/eq master-state (:began gesture-handler/states))
92102
; (animated/clock-running clock))
93-
translate-y (react/use-memo
94-
(fn []
95-
;commented out to upgrade react-native-reanimated to v3 and react-native to 0.72
96-
;TODO: replace this with an updated implementation
97-
; (animated/with-easing
98-
; {:value (animated/cond* (animated/less-or-eq
99-
; master-translation-y 0)
100-
; (animated/divide
101-
; master-translation-y
102-
; 2)
103-
; master-translation-y)
104-
; :velocity master-velocity-y
105-
; :offset offset
106-
; :state master-state
107-
; :animation-over drag-over
108-
; :snap-points [open-snap-point close-snap-point]})
109-
)
110-
[])
103+
;commented out to upgrade react-native-reanimated to v3 and react-native to 0.72
104+
;TODO: replace this with an updated implementation
105+
; translate-y (react/use-memo
106+
; (fn []
107+
; (animated/with-easing
108+
; {:value (animated/cond* (animated/less-or-eq
109+
; master-translation-y 0)
110+
; (animated/divide
111+
; master-translation-y
112+
; 2)
113+
; master-translation-y)
114+
; :velocity master-velocity-y
115+
; :offset offset
116+
; :state master-state
117+
; :animation-over drag-over
118+
; :snap-points [open-snap-point close-snap-point]})
119+
; )
120+
; [])
111121
opacity (react/use-memo
112122
(fn []
113123
;commented out to upgrade react-native-reanimated to v3 and react-native to 0.72
@@ -213,7 +223,8 @@
213223
[animated/view
214224
{:style (merge (styles/content-container window-height)
215225
{:transform [{:translateY (* window-height 2)
216-
;commented out to upgrade react-native-reanimated to v3 and react-native to 0.72
226+
;commented out to upgrade react-native-reanimated to v3 and
227+
;react-native to 0.72
217228
;TODO: replace this with an updated implementation
218229
; (if (= sheet-height max-height)
219230
; (animated/add

src/quo/components/controls/view.cljs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
(defn control-builder
1313
[component]
1414
(fn [props]
15-
(let [{:keys [value onChange disabled]}
15+
(let [{:keys [
16+
; value
17+
onChange disabled]}
1618
(bean/bean props)
1719
state (animated/use-value 0)
1820
tap-state (animated/use-value (:undetermined gh/states))
@@ -32,9 +34,12 @@
3234
(:lazy
3335
animated/springs)))
3436
[])
35-
press-end (fn []
36-
(when (and (not disabled) onChange)
37-
(onChange (not value))))]
37+
;commented out to upgrade react-native-reanimated to v3 and react-native to 0.72
38+
;TODO: replace this with an updated implementation
39+
; press-end (fn []
40+
; (when (and (not disabled) onChange)
41+
; (onChange (not value))))
42+
]
3843
;commented out to upgrade react-native-reanimated to v3 and react-native to 0.72
3944
;TODO: replace this with an updated implementation
4045
; (animated/code!

src/quo/previews/text.cljs

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
(ns quo.previews.text
2-
(:require [quo.animated :as animated]
3-
[quo.core :as quo]
4-
[quo.design-system.colors :as colors]
5-
[quo.previews.preview :as preview]
6-
[quo.react-native :as rn]
7-
[reagent.core :as reagent]))
2+
(:require
3+
; [quo.animated :as animated]
4+
[quo.core :as quo]
5+
[quo.design-system.colors :as colors]
6+
[quo.previews.preview :as preview]
7+
[quo.react-native :as rn]
8+
[reagent.core :as reagent]))
89

910
(def all-props
1011
(preview/list-comp [size [:tiny :small :base :large :x-large :xx-large]
@@ -70,8 +71,12 @@
7071

7172
(defn cool-preview
7273
[]
73-
(let [state (reagent/atom {})
74-
animation (animated/value 0)]
74+
(let [state (reagent/atom {})
75+
;;;; Animated.Code is deprecated with reanimated version 1.
76+
;;;; commented out to upgrade react-native-reanimated to v3 and react-native to 0.72
77+
;;;; TODO: replace this with an updated implementation
78+
; animation (animated/value 0)
79+
]
7580
(fn []
7681
[rn/view
7782
{:margin-bottom 50
@@ -84,8 +89,13 @@
8489
[rn/view {:padding-vertical 16}
8590
[quo/text
8691
(merge @state
87-
(when (:animated? @state)
88-
{:opacity animation}))
92+
; (when (:animated? @state)
93+
;;;; Animated.Code is deprecated with reanimated version 1.
94+
;;;; commented out to upgrade react-native-reanimated to v3 and react-native to 0.72
95+
;;;; TODO: replace this with an updated implementation
96+
; {:opacity animation}
97+
; )
98+
)
8999
"This is a demo text 1 2 0 2x2 0x0"]]])))
90100

91101
(defn preview-text

src/quo2/components/drawers/drawer_buttons/view.cljs

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -129,53 +129,57 @@
129129
(reanimated/animate-shared-value-with-delay bottom-view-top
130130
(:height (rn/get-screen))
131131
animations-duration
132-
:easing4
132+
; :easing4
133133
animations-delay)
134134
(reanimated/animate-shared-value-with-delay
135135
height
136136
max-height
137137
animations-duration
138-
:easing4
138+
; :easing4
139139
animations-delay)
140140
(reanimated/animate-shared-value-with-delay
141141
top-padding
142142
(+ 68 (safe-area/get-top))
143143
animations-duration
144-
:easing4
144+
; :easing4
145145
animations-delay)
146146
(reanimated/animate-shared-value-with-delay
147147
top-children-opacity
148148
0
149149
animations-duration
150-
:easing4 animations-delay)
150+
; :easing4
151+
animations-delay)
151152
(reanimated/animate-shared-value-with-delay
152153
top-title-opacity
153154
0
154155
0
155-
:linear
156+
; :linear
156157
(+ animations-delay animations-duration 500)))
157158
reset-top-animation (fn []
158159
(reanimated/set-shared-value top-title-opacity 1)
159160
(reanimated/animate-shared-value-with-delay bottom-view-top
160161
80
161162
animations-duration
162-
:easing4
163+
; :easing4
163164
50)
164165
(reanimated/animate-shared-value-with-timing
165166
height
166167
default-height
167168
animations-duration
168-
:easing4)
169+
; :easing4
170+
)
169171
(reanimated/animate-shared-value-with-timing
170172
top-padding
171173
12
172174
animations-duration
173-
:easing4)
175+
; :easing4
176+
)
174177
(reanimated/animate-shared-value-with-timing
175178
top-children-opacity
176179
1
177180
animations-duration
178-
:easing4))]
181+
; :easing4
182+
))]
179183
(rn/use-effect (fn []
180184
(when on-init
181185
(on-init reset-top-animation))))

src/quo2/components/loaders/skeleton.cljs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,12 @@
3333
{:transform [{:translateX translate-x}]}
3434
{:width window-width
3535
:height "100%"})]
36-
(reanimated/animate-shared-value-with-repeat translate-x window-width 1000 :linear (- 1) false)
36+
(reanimated/animate-shared-value-with-repeat translate-x
37+
window-width
38+
1000
39+
; :linear
40+
(- 1)
41+
false)
3742
[masked-view/masked-view
3843
{:style {:height message-skeleton-height}
3944
:maskElement (reagent/as-element

src/quo2/components/record_audio/record_audio/helpers.cljs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@
77
shared-value
88
value
99
duration
10-
:linear))
10+
; :linear
11+
))
1112

1213
(defn animate-linear-with-delay
1314
[shared-value value duration delay]
1415
(reanimated/animate-shared-value-with-delay
1516
shared-value
1617
value
1718
duration
18-
:linear
19+
; :linear
1920
delay))
2021

2122
(defn animate-linear-with-delay-loop
@@ -24,7 +25,7 @@
2425
shared-value
2526
value
2627
duration
27-
:linear
28+
; :linear
2829
delay
2930
-1))
3031

@@ -34,15 +35,16 @@
3435
shared-value
3536
value
3637
duration
37-
:easing1))
38+
; :easing1
39+
))
3840

3941
(defn animate-easing-with-delay
4042
[shared-value value duration delay]
4143
(reanimated/animate-shared-value-with-delay
4244
shared-value
4345
value
4446
duration
45-
:easing1
47+
; :easing1
4648
delay))
4749

4850
(defn set-value

0 commit comments

Comments
 (0)