@@ -6,12 +6,11 @@ import {
66 spin ,
77} from 'react-native-css-animations' ;
88
9- import { Platform , SafeAreaView , StyleSheet , Text , View } from 'react-native' ;
9+ import { SafeAreaView , StyleSheet , Text , View } from 'react-native' ;
1010import Animated from 'react-native-reanimated' ;
1111import Fontisto from '@expo/vector-icons/Fontisto' ;
1212import Entypo from '@expo/vector-icons/Entypo' ;
1313import EvilIcons from '@expo/vector-icons/EvilIcons' ;
14- import MaskedView from '@react-native-masked-view/masked-view' ;
1514
1615export default function App ( ) {
1716 return (
@@ -35,6 +34,7 @@ export default function App() {
3534
3635 < Text style = { styles . label } > Pulse</ Text >
3736 < View style = { styles . skeletonContainer } >
37+ { /* Pulse animation ⬇️ */ }
3838 < Animated . View style = { [ styles . skeletonAvatar , pulse ] } />
3939 < Animated . View style = { [ styles . skeletonText , pulse ] } />
4040 </ View >
@@ -45,25 +45,11 @@ export default function App() {
4545 < Entypo name = "chevron-down" size = { 24 } color = "black" />
4646 </ Animated . View >
4747
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 >
6753 </ SafeAreaView >
6854 ) ;
6955}
@@ -81,13 +67,6 @@ const styles = StyleSheet.create({
8167 marginBottom : 18 ,
8268 marginTop : 24 ,
8369 } ,
84- box : {
85- width : 100 ,
86- height : 100 ,
87- backgroundColor : 'red' ,
88- alignItems : 'center' ,
89- justifyContent : 'center' ,
90- } ,
9170 button : {
9271 flexDirection : 'row' ,
9372 alignItems : 'center' ,
@@ -146,14 +125,10 @@ const styles = StyleSheet.create({
146125 borderColor : '#e2e8f0' ,
147126 } ,
148127 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 ,
157132 } ,
158133 gradient : {
159134 flex : 1 ,
@@ -162,6 +137,6 @@ const styles = StyleSheet.create({
162137 [ process . env . EXPO_OS === 'web'
163138 ? 'backgroundImage'
164139 : 'experimental_backgroundImage' ] :
165- 'linear-gradient(100deg, #e2e8f0 46%, #f8fafc 50%, #e2e8f0 54%)' ,
140+ 'linear-gradient(100deg, #ebeff5 46%, #fafafa 50%, #ebeff5 54%)' ,
166141 } ,
167142} ) ;
0 commit comments