Skip to content

Commit b3df9d4

Browse files
author
yenda
committed
[fix] class calls
This concerns: - touchable-opacity - animated-view - scroll-view Tip for rebasing: search in project for `scroll-view)` `animated-view)` and `touchable-opacity)` Signed-off-by: yenda <eric@status.im>
1 parent 1cb7f3b commit b3df9d4

49 files changed

Lines changed: 155 additions & 146 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

components/src/status_im/ui/components/react.cljs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353

5454
(def status-bar-class (when-not platform/desktop? (get-react-property "StatusBar")))
5555

56-
(def scroll-view (get-class "ScrollView"))
56+
(def scroll-view-class (get-class "ScrollView"))
5757
(def web-view (get-class "WebView"))
5858
(def keyboard-avoiding-view-class (get-class "KeyboardAvoidingView"))
5959

@@ -84,7 +84,7 @@
8484

8585
(def touchable-highlight-class (get-class "TouchableHighlight"))
8686
(def touchable-without-feedback-class (get-class "TouchableWithoutFeedback"))
87-
(def touchable-opacity (get-class "TouchableOpacity"))
87+
(def touchable-opacity-class (get-class "TouchableOpacity"))
8888
(def activity-indicator-class (get-class "ActivityIndicator"))
8989

9090
(defn activity-indicator [props]
@@ -94,9 +94,13 @@
9494

9595
(def pan-responder (lazy-get-react-property "PanResponder"))
9696
(def animated (lazy-get-react-property "Animated"))
97-
(defn animated-view []
97+
98+
(defn animated-view-class []
9899
(reagent/adapt-react-class (.-View (animated))))
99100

101+
(defn animated-view [props & content]
102+
(vec (conj content props (animated-view-class))))
103+
100104
(def dimensions (lazy-get-react-property "Dimensions"))
101105
(def keyboard (lazy-get-react-property "Keyboard"))
102106
(def linking (lazy-get-react-property "Linking"))
@@ -162,6 +166,9 @@
162166
:resizeMode "contain"
163167
:style style}]))
164168

169+
(defn touchable-opacity [props content]
170+
[(touchable-opacity-class) props content])
171+
165172
(defn touchable-highlight [props content]
166173
[(touchable-highlight-class)
167174
(merge {:underlay-color :transparent} props)
@@ -232,10 +239,13 @@
232239
[view props])]
233240
(vec (concat view-element children))))
234241

242+
(defn scroll-view [props & children]
243+
(vec (conj children props (scroll-view-class))))
244+
235245
(views/defview with-activity-indicator
236246
[{:keys [timeout style enabled? preview]} comp]
237247
(views/letsubs
238-
[loading (reagent/atom true)]
248+
[loading (reagent/atom true)]
239249
{:component-did-mount (fn []
240250
(if (or (nil? timeout)
241251
(> 100 timeout))

src/status_im/chat/commands/impl/transactions.cljs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@
401401
{:on-press on-press-handler
402402
:style transactions-styles/command-request-image-touchable
403403
:accessibility-label (request-button-label (:name command))}
404-
[(react/animated-view) {:style (transactions-styles/command-request-image-view command scale-anim-val)}
404+
[react/animated-view {:style (transactions-styles/command-request-image-view command scale-anim-val)}
405405
(when command-icon
406406
[react/icon command-icon transactions-styles/command-request-image])]]))})))
407407

src/status_im/extensions/capacities/components.cljs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@
4747
[tooltip/tooltip error (styles/error error)])])
4848

4949
(defn touchable-opacity [{:keys [style on-press]} & children]
50-
(into [(react/touchable-opacity) (merge (when on-press {:on-press #(on-press {})})
51-
(when style {:style style}))] children))
50+
(into [react/touchable-opacity (merge (when on-press {:on-press #(on-press {})})
51+
(when style {:style style}))] children))
5252

5353
(defn image [{:keys [source uri style]}]
5454
[react/image (merge {:style (merge {:width 100 :height 100} style)} {:source (if source source {:uri uri})})])
@@ -119,7 +119,7 @@
119119
(apply abstract-view react/view o children))
120120

121121
(defn scroll-view [o & children]
122-
(apply abstract-view (react/scroll-view) o children))
122+
(apply abstract-view react/scroll-view o children))
123123

124124
(defn keyboard-avoiding-view [o & children]
125125
(apply abstract-view react/keyboard-avoiding-view o children))

src/status_im/ui/components/bottom_bar/core.cljs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,13 @@
134134
:enter-pin-settings} view-id)
135135
(if platform/ios?
136136
[tabs-animation-wrapper-ios
137-
[(react/animated-view)
137+
[react/animated-view
138138
{:style (tabs.styles/animated-container visible? keyboard-shown?)}
139139
[tabs tab]]]
140140
[tabs-animation-wrapper-android
141141
keyboard-shown?
142142
view-id
143-
[(react/animated-view)
143+
[react/animated-view
144144
{:style (tabs.styles/animated-container visible? keyboard-shown?)}
145145
[tabs tab]]])))}))
146146

src/status_im/ui/components/bottom_sheet/view.cljs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@
110110
{:on-press #(cancel opts on-cancel)
111111
:style styles/container}
112112

113-
[(react/animated-view) (styles/shadow opacity-value)]]
114-
[(react/animated-view)
113+
[react/animated-view (styles/shadow opacity-value)]]
114+
[react/animated-view
115115
{:style (styles/content-container height bottom-value)}
116116
[react/view styles/content-header
117117
[react/view styles/handle]]

src/status_im/ui/components/connectivity/view.cljs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@
5353
:top -3
5454
:height 3
5555
:background-color colors/white}}
56-
[(react/animated-view) {:style (animated-bar-style blue-bar-left-margin
57-
parent-width
58-
colors/blue)}]
59-
[(react/animated-view) {:style (assoc (animated-bar-style white-bar-left-margin
60-
parent-width
61-
colors/white)
62-
:left (* 0.15 parent-width))}]]))
56+
[react/animated-view {:style (animated-bar-style blue-bar-left-margin
57+
parent-width
58+
colors/blue)}]
59+
[react/animated-view {:style (assoc (animated-bar-style white-bar-left-margin
60+
parent-width
61+
colors/white)
62+
:left (* 0.15 parent-width))}]]))
6363

6464
(defonce show-connected? (reagent/atom true))
6565

@@ -108,15 +108,15 @@
108108
connected? connecting? loading-indicator?] :as opts}]
109109
(when (or (not connected?)
110110
@show-connected?)
111-
[(react/animated-view) {:style (styles/text-wrapper
112-
(assoc opts
113-
:height anim-height
114-
:background-color (if connected?
115-
colors/green
116-
colors/gray)
117-
:opacity anim-opacity
118-
:modal? (= view-id :chat-modal)))
119-
:accessibility-label :connection-status-text}
111+
[react/animated-view {:style (styles/text-wrapper
112+
(assoc opts
113+
:height anim-height
114+
:background-color (if connected?
115+
colors/green
116+
colors/gray)
117+
:opacity anim-opacity
118+
:modal? (= view-id :chat-modal)))
119+
:accessibility-label :connection-status-text}
120120
(when connecting?
121121
[react/activity-indicator {:animated true
122122
:color colors/white

src/status_im/ui/components/icons/vector_icons.cljs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,8 @@
258258
[name {:keys [color container-style accessibility-label width height]
259259
:or {accessibility-label :icon}}]
260260
^{:key name}
261-
[(react/animated-view) {:style container-style
262-
:accessibility-label accessibility-label}
261+
[react/animated-view {:style container-style
262+
:accessibility-label accessibility-label}
263263
(if-let [icon-fn (get icons name)]
264264
(let [icon-vec (icon-fn (match-color color))]
265265
(if width
@@ -272,4 +272,3 @@
272272
([name options]
273273
(let [icon-fn (if platform/desktop? desktop-icon mobile-icon)]
274274
[icon-fn name options])))
275-

src/status_im/ui/components/list/views.cljs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@
310310
swipe-pan-responder (responder/swipe-pan-responder offset-x styles/delete-button-width id swiped?)
311311
swipe-pan-handler (responder/pan-handlers swipe-pan-responder)]
312312
[react/view swipe-pan-handler
313-
[(react/animated-view) {:style {:flex 1 :right offset-x}}
313+
[react/animated-view {:style {:flex 1 :right offset-x}}
314314
body
315315
[react/touchable-highlight {:style styles/delete-icon-highlight
316316
:on-press on-delete}

src/status_im/ui/components/qr_code_viewer/views.cljs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
[{:keys [style hint-style footer-style footer-button value hint legend
1616
show-tribute-to-talk-warning?]}]
1717
(letsubs [{:keys [width]} [:dimensions/window]]
18-
[(react/scroll-view) {:content-container-style {:align-items :center
19-
:margin-top 16
20-
:justify-content :center}
21-
:style (merge {:flex 1} style)}
18+
[react/scroll-view {:content-container-style {:align-items :center
19+
:margin-top 16
20+
:justify-content :center}
21+
:style (merge {:flex 1} style)}
2222
(when show-tribute-to-talk-warning?
2323
[react/view {:style {:margin-horizontal 16}}
2424
[tribute-to-talk/enabled-note]])

src/status_im/ui/components/tooltip/views.cljs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
opacity-value (animation/create-value 0)]
1515
{:component-did-mount (animations/animate-tooltip bottom-value bottom-anim-value opacity-value 10)}
1616
[react/view (merge styles/tooltip-container container-style)
17-
[(react/animated-view) {:style (styles/tooltip-animated bottom-anim-value opacity-value)}
17+
[react/animated-view {:style (styles/tooltip-animated bottom-anim-value opacity-value)}
1818
[react/view (styles/tooltip-text-container color)
1919
[react/text {:style (styles/tooltip-text font-size)} label]]
2020
[vector-icons/icon :icons/tooltip-triangle {:color color :style styles/tooltip-triangle}]]]))
@@ -24,7 +24,7 @@
2424
opacity-value (animation/create-value 0)]
2525
{:component-did-mount (animations/animate-tooltip -150 bottom-anim-value opacity-value -10)}
2626
[react/view styles/bottom-tooltip-container
27-
[(react/animated-view) {:style (styles/tooltip-animated bottom-anim-value opacity-value)}
27+
[react/animated-view {:style (styles/tooltip-animated bottom-anim-value opacity-value)}
2828
[vector-icons/icon :icons/tooltip-triangle {:color colors/gray
2929
:style styles/tooltip-triangle
3030
:container-style {:transform [{:rotate "180deg"}]}}]

0 commit comments

Comments
 (0)