File tree 5 files changed +23
-25
lines changed
5 files changed +23
-25
lines changed Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
import {
3
- View ,
4
- Dimensions ,
5
3
Animated ,
6
4
StyleSheet ,
5
+ useWindowDimensions ,
6
+ View ,
7
7
ViewStyle ,
8
8
} from 'react-native' ;
9
-
10
9
export interface ExpandingDotProps {
11
10
data : Array < Object > ;
12
11
scrollX : Animated . Value ;
@@ -18,8 +17,6 @@ export interface ExpandingDotProps {
18
17
activeDotColor ?: string ;
19
18
}
20
19
21
- const { width } = Dimensions . get ( 'screen' ) ;
22
-
23
20
const ExpandingDot = ( {
24
21
scrollX,
25
22
data,
@@ -30,6 +27,8 @@ const ExpandingDot = ({
30
27
expandingDotWidth,
31
28
activeDotColor,
32
29
} : ExpandingDotProps ) => {
30
+ const { width } = useWindowDimensions ( ) ;
31
+
33
32
const defaultProps = {
34
33
inActiveDotColor : inActiveDotColor || '#000' ,
35
34
inActiveDotOpacity : inActiveDotOpacity || 0.5 ,
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
import {
3
- View ,
4
3
Animated ,
5
- Dimensions ,
6
- ViewStyle ,
7
4
StyleSheet ,
5
+ useWindowDimensions ,
6
+ View ,
7
+ ViewStyle ,
8
8
} from 'react-native' ;
9
9
import { Line , Svg } from 'react-native-svg' ;
10
-
11
10
export interface LiquidLikeProps {
12
11
data : Array < Object > ;
13
12
scrollX : Animated . Value ;
@@ -26,7 +25,6 @@ export interface LiquidLikeProps {
26
25
27
26
const AnimatedLine = Animated . createAnimatedComponent ( Line ) ;
28
27
const AnimatedSvg = Animated . createAnimatedComponent ( Svg ) ;
29
- const { width } = Dimensions . get ( 'screen' ) ;
30
28
const LiquidLike = ( {
31
29
scrollX,
32
30
data,
@@ -42,6 +40,8 @@ const LiquidLike = ({
42
40
strokeWidth,
43
41
bigHeadScale,
44
42
} : LiquidLikeProps ) => {
43
+ const { width } = useWindowDimensions ( ) ;
44
+
45
45
const defaultProps = {
46
46
dotSize : dotSize || 12 ,
47
47
marginHorizontal : marginHorizontal || 6 ,
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
import {
3
- View ,
4
- Dimensions ,
5
3
Animated ,
6
4
StyleSheet ,
5
+ useWindowDimensions ,
6
+ View ,
7
7
ViewStyle ,
8
8
} from 'react-native' ;
9
-
10
9
export interface ScalingDotProps {
11
10
data : Array < Object > ;
12
11
scrollX : Animated . Value ;
@@ -18,8 +17,6 @@ export interface ScalingDotProps {
18
17
activeDotColor ?: string ;
19
18
}
20
19
21
- const { width } = Dimensions . get ( 'screen' ) ;
22
-
23
20
const ScalingDot = ( {
24
21
scrollX,
25
22
data,
@@ -30,6 +27,8 @@ const ScalingDot = ({
30
27
activeDotScale,
31
28
activeDotColor,
32
29
} : ScalingDotProps ) => {
30
+ const { width } = useWindowDimensions ( ) ;
31
+
33
32
const defaultProps = {
34
33
inActiveDotColor : inActiveDotColor || '#347af0' ,
35
34
activeDotColor : activeDotColor || '#347af0' ,
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
import {
3
- View ,
4
- Dimensions ,
5
- StyleSheet ,
6
3
Animated ,
4
+ StyleSheet ,
5
+ useWindowDimensions ,
6
+ View ,
7
7
ViewStyle ,
8
8
} from 'react-native' ;
9
-
10
9
export interface SlidingBorderProps {
11
10
data : Array < Object > ;
12
11
scrollX : Animated . Value ;
@@ -18,7 +17,6 @@ export interface SlidingBorderProps {
18
17
slidingIndicatorStyle ?: ViewStyle ;
19
18
}
20
19
21
- const { width } = Dimensions . get ( 'screen' ) ;
22
20
const SlidingBorder = ( {
23
21
scrollX,
24
22
data,
@@ -29,6 +27,8 @@ const SlidingBorder = ({
29
27
slidingIndicatorStyle,
30
28
borderPadding,
31
29
} : SlidingBorderProps ) => {
30
+ const { width } = useWindowDimensions ( ) ;
31
+
32
32
const defaultProps = {
33
33
dotSize : dotSize || 24 ,
34
34
borderPadding : borderPadding || - 5 ,
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
import {
3
- View ,
4
- Dimensions ,
5
- StyleSheet ,
6
3
Animated ,
4
+ StyleSheet ,
5
+ useWindowDimensions ,
6
+ View ,
7
7
ViewStyle ,
8
8
} from 'react-native' ;
9
-
10
9
export interface SlidingDotProps {
11
10
data : Array < Object > ;
12
11
scrollX : Animated . Value ;
@@ -18,7 +17,6 @@ export interface SlidingDotProps {
18
17
marginHorizontal ?: number ;
19
18
}
20
19
21
- const { width } = Dimensions . get ( 'screen' ) ;
22
20
const SlidingDot = ( {
23
21
scrollX,
24
22
data,
@@ -28,6 +26,8 @@ const SlidingDot = ({
28
26
slidingIndicatorStyle,
29
27
marginHorizontal,
30
28
} : SlidingDotProps ) => {
29
+ const { width } = useWindowDimensions ( ) ;
30
+
31
31
const defaultProps = {
32
32
dotSize : dotSize || 12 ,
33
33
marginHorizontal : marginHorizontal || 3 ,
You can’t perform that action at this time.
0 commit comments