File tree Expand file tree Collapse file tree 4 files changed +17
-14
lines changed Expand file tree Collapse file tree 4 files changed +17
-14
lines changed Original file line number Diff line number Diff line change @@ -220,6 +220,7 @@ const Button = (
220
220
) ;
221
221
const { roundness, isV3, animation } = theme ;
222
222
const uppercase = uppercaseProp ?? ! theme . isV3 ;
223
+ const isWeb = Platform . OS === 'web' ;
223
224
224
225
const hasPassedTouchHandler = hasTouchHandler ( {
225
226
onPress,
@@ -255,8 +256,7 @@ const Button = (
255
256
toValue : activeElevation ,
256
257
duration : 200 * scale ,
257
258
useNativeDriver :
258
- Platform . OS === 'web' ||
259
- Platform . constants . reactNativeVersion . minor <= 72 ,
259
+ isWeb || Platform . constants . reactNativeVersion . minor <= 72 ,
260
260
} ) . start ( ) ;
261
261
}
262
262
} ;
@@ -269,8 +269,7 @@ const Button = (
269
269
toValue : initialElevation ,
270
270
duration : 150 * scale ,
271
271
useNativeDriver :
272
- Platform . OS === 'web' ||
273
- Platform . constants . reactNativeVersion . minor <= 72 ,
272
+ isWeb || Platform . constants . reactNativeVersion . minor <= 72 ,
274
273
} ) . start ( ) ;
275
274
}
276
275
} ;
Original file line number Diff line number Diff line change @@ -213,6 +213,7 @@ const Chip = ({
213
213
} : Props ) => {
214
214
const theme = useInternalTheme ( themeOverrides ) ;
215
215
const { isV3, roundness } = theme ;
216
+ const isWeb = Platform . OS === 'web' ;
216
217
217
218
const { current : elevation } = React . useRef < Animated . Value > (
218
219
new Animated . Value ( isV3 && elevated ? 1 : 0 )
@@ -234,8 +235,7 @@ const Chip = ({
234
235
toValue : isV3 ? ( elevated ? 2 : 0 ) : 4 ,
235
236
duration : 200 * scale ,
236
237
useNativeDriver :
237
- Platform . OS === 'web' ||
238
- Platform . constants . reactNativeVersion . minor <= 72 ,
238
+ isWeb || Platform . constants . reactNativeVersion . minor <= 72 ,
239
239
} ) . start ( ) ;
240
240
} ) ;
241
241
@@ -246,8 +246,7 @@ const Chip = ({
246
246
toValue : isV3 && elevated ? 1 : 0 ,
247
247
duration : 150 * scale ,
248
248
useNativeDriver :
249
- Platform . OS === 'web' ||
250
- Platform . constants . reactNativeVersion . minor <= 72 ,
249
+ isWeb || Platform . constants . reactNativeVersion . minor <= 72 ,
251
250
} ) . start ( ) ;
252
251
} ) ;
253
252
Original file line number Diff line number Diff line change @@ -56,6 +56,8 @@ const InputLabel = (props: InputLabelProps) => {
56
56
const { INPUT_PADDING_HORIZONTAL } = getConstants ( isV3 ) ;
57
57
const { width } = useWindowDimensions ( ) ;
58
58
59
+ const isWeb = Platform . OS === 'web' ;
60
+
59
61
const paddingOffset =
60
62
paddingLeft && paddingRight ? { paddingLeft, paddingRight } : { } ;
61
63
@@ -111,9 +113,10 @@ const InputLabel = (props: InputLabelProps) => {
111
113
: labeled ,
112
114
} ,
113
115
] ,
114
- ...( Platform . constants . reactNativeVersion . minor >= 73 && {
115
- transformOrigin : 'left' ,
116
- } ) ,
116
+ ...( ! isWeb &&
117
+ Platform . constants . reactNativeVersion . minor >= 73 && {
118
+ transformOrigin : 'left' ,
119
+ } ) ,
117
120
} ;
118
121
119
122
const labelWidth =
@@ -147,9 +150,9 @@ const InputLabel = (props: InputLabelProps) => {
147
150
pointerEvents = "none"
148
151
style = { [
149
152
StyleSheet . absoluteFill ,
150
- Platform . OS !== 'web' && { width } ,
153
+ ! isWeb && { width } ,
151
154
{ opacity } ,
152
- Platform . constants . reactNativeVersion . minor <= 72 &&
155
+ ( isWeb || Platform . constants . reactNativeVersion . minor <= 72 ) &&
153
156
labelTranslationX ,
154
157
] }
155
158
>
Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ const LabelBackground = ({
17
17
maxFontSizeMultiplier,
18
18
testID,
19
19
} : LabelBackgroundProps ) => {
20
+ const isWeb = Platform . OS === 'web' ;
21
+
20
22
const opacity = labeled . interpolate ( {
21
23
inputRange : [ 0 , 0.6 ] ,
22
24
outputRange : [ 1 , 0 ] ,
@@ -52,7 +54,7 @@ const LabelBackground = ({
52
54
bottom : Math . max ( roundness , 2 ) ,
53
55
opacity,
54
56
} ,
55
- Platform . constants . reactNativeVersion . minor <= 72 && {
57
+ ( isWeb || Platform . constants . reactNativeVersion . minor <= 72 ) && {
56
58
transform : [ labelTranslationX ] ,
57
59
} ,
58
60
] }
You can’t perform that action at this time.
0 commit comments