@@ -6,12 +6,11 @@ import {
6
6
spin ,
7
7
} from 'react-native-css-animations' ;
8
8
9
- import { Platform , SafeAreaView , StyleSheet , Text , View } from 'react-native' ;
9
+ import { SafeAreaView , StyleSheet , Text , View } from 'react-native' ;
10
10
import Animated from 'react-native-reanimated' ;
11
11
import Fontisto from '@expo/vector-icons/Fontisto' ;
12
12
import Entypo from '@expo/vector-icons/Entypo' ;
13
13
import EvilIcons from '@expo/vector-icons/EvilIcons' ;
14
- import MaskedView from '@react-native-masked-view/masked-view' ;
15
14
16
15
export default function App ( ) {
17
16
return (
@@ -35,6 +34,7 @@ export default function App() {
35
34
36
35
< Text style = { styles . label } > Pulse</ Text >
37
36
< View style = { styles . skeletonContainer } >
37
+ { /* Pulse animation ⬇️ */ }
38
38
< Animated . View style = { [ styles . skeletonAvatar , pulse ] } />
39
39
< Animated . View style = { [ styles . skeletonText , pulse ] } />
40
40
</ View >
@@ -45,25 +45,11 @@ export default function App() {
45
45
< Entypo name = "chevron-down" size = { 24 } color = "black" />
46
46
</ Animated . View >
47
47
48
- { ( Platform . OS === 'ios' || Platform . OS === 'android' ) && (
49
- < >
50
- < Text style = { styles . label } > Shimmer</ Text >
51
- < View style = { styles . shimmerContainer } >
52
- < MaskedView
53
- style = { styles . mask }
54
- maskElement = {
55
- < View style = { styles . skeletonContainer } >
56
- < Animated . View style = { styles . skeletonAvatar } />
57
- < Animated . View style = { styles . skeletonText } />
58
- </ View >
59
- }
60
- >
61
- { /* Shimmer animation ⬇️ */ }
62
- < Animated . View style = { [ styles . gradient , shimmer ] } />
63
- </ MaskedView >
64
- </ View >
65
- </ >
66
- ) }
48
+ < Text style = { styles . label } > Shimmer</ Text >
49
+ < View style = { styles . shimmerContainer } >
50
+ { /* Shimmer animation ⬇️ */ }
51
+ < Animated . View style = { [ styles . gradient , shimmer ] } />
52
+ </ View >
67
53
</ SafeAreaView >
68
54
) ;
69
55
}
@@ -81,13 +67,6 @@ const styles = StyleSheet.create({
81
67
marginBottom : 18 ,
82
68
marginTop : 24 ,
83
69
} ,
84
- box : {
85
- width : 100 ,
86
- height : 100 ,
87
- backgroundColor : 'red' ,
88
- alignItems : 'center' ,
89
- justifyContent : 'center' ,
90
- } ,
91
70
button : {
92
71
flexDirection : 'row' ,
93
72
alignItems : 'center' ,
@@ -146,14 +125,10 @@ const styles = StyleSheet.create({
146
125
borderColor : '#e2e8f0' ,
147
126
} ,
148
127
shimmerContainer : {
149
- width : '100%' ,
150
- height : 48 ,
151
- alignItems : 'center' ,
152
- justifyContent : 'center' ,
153
- } ,
154
- mask : {
155
- height : 48 ,
156
- width : 210 ,
128
+ width : 180 ,
129
+ height : 42 ,
130
+ overflow : 'hidden' ,
131
+ borderRadius : 8 ,
157
132
} ,
158
133
gradient : {
159
134
flex : 1 ,
@@ -162,6 +137,6 @@ const styles = StyleSheet.create({
162
137
[ process . env . EXPO_OS === 'web'
163
138
? 'backgroundImage'
164
139
: 'experimental_backgroundImage' ] :
165
- 'linear-gradient(100deg, #e2e8f0 46%, #f8fafc 50%, #e2e8f0 54%)' ,
140
+ 'linear-gradient(100deg, #ebeff5 46%, #fafafa 50%, #ebeff5 54%)' ,
166
141
} ,
167
142
} ) ;
0 commit comments