11import { Shimmer , ShimmerProvider } from 'react-native-fast-shimmer' ;
2- import { View , StyleSheet , SafeAreaView } from 'react-native' ;
2+ import { View , StyleSheet , SafeAreaView , Text } from 'react-native' ;
3+ import { Easing } from 'react-native-reanimated' ;
34
45export default function App ( ) {
56 return (
67 < SafeAreaView style = { styles . container } >
7- < ShimmerProvider duration = { 1000 } >
8- < View style = { styles . shimmer1 } >
9- < Shimmer style = { styles . shimmerMain } />
8+ < View style = { styles . configsContainer } >
9+ < View style = { styles . configContainer } >
10+ < Text > Shared config</ Text >
11+ < ShimmerProvider duration = { 3000 } >
12+ < View style = { styles . sharedConfigWrapper } >
13+ < View style = { styles . shimmer } >
14+ < Shimmer style = { styles . shimmerMain } />
15+ </ View >
16+ < View style = { styles . shimmer } >
17+ < Shimmer style = { styles . shimmerMain } />
18+ </ View >
19+ < View style = { styles . shimmer } >
20+ < Shimmer style = { styles . shimmerMain } />
21+ </ View >
22+ </ View >
23+ </ ShimmerProvider >
1024 </ View >
11- < View style = { styles . shimmer2 } >
12- < Shimmer style = { styles . shimmerMain } />
25+ < View style = { styles . configContainer } >
26+ < Text > Individual override</ Text >
27+ < ShimmerProvider duration = { 3000 } >
28+ < View style = { styles . sharedConfigWrapper } >
29+ < View style = { styles . shimmer } >
30+ < Shimmer
31+ gradientEnd = { { x : 0 , y : 0 } }
32+ gradientStart = { { x : 0.2 , y : 0 } }
33+ style = { styles . shimmerMain }
34+ />
35+ </ View >
36+ < View style = { styles . shimmer } >
37+ < Shimmer
38+ linearGradients = { [ '#FF000000' , '#0000FFFF' , '#FF000000' ] }
39+ style = { styles . shimmerMain }
40+ />
41+ </ View >
42+ < View style = { styles . shimmer } >
43+ < Shimmer speed = { 2 } style = { styles . shimmerMain } />
44+ </ View >
45+ </ View >
46+ </ ShimmerProvider >
1347 </ View >
14- < View style = { styles . shimmer3 } >
15- < Shimmer style = { styles . shimmerMain } />
16- </ View >
17- </ ShimmerProvider >
48+ </ View >
49+ < View style = { styles . longShimmers } >
50+ < ShimmerProvider duration = { 3000 } >
51+ < View style = { styles . easingShimmerContainer } >
52+ < Text > Linear</ Text >
53+ < View style = { [ styles . shimmerMain , styles . longShimmer ] } >
54+ < Shimmer easing = { Easing . linear } />
55+ </ View >
56+ </ View >
57+
58+ < View style = { styles . easingShimmerContainer } >
59+ < Text > Ease</ Text >
60+ < View style = { [ styles . shimmerMain , styles . longShimmer ] } >
61+ < Shimmer easing = { Easing . ease } />
62+ </ View >
63+ </ View >
64+ < View style = { styles . easingShimmerContainer } >
65+ < Text > Cubic</ Text >
66+ < View style = { [ styles . shimmerMain , styles . longShimmer ] } >
67+ < Shimmer easing = { Easing . cubic } />
68+ </ View >
69+ </ View >
70+ < View style = { styles . easingShimmerContainer } >
71+ < Text > Circle</ Text >
72+ < View style = { [ styles . shimmerMain , styles . longShimmer ] } >
73+ < Shimmer easing = { Easing . circle } />
74+ </ View >
75+ </ View >
76+ < View style = { styles . avatarShimmers } >
77+ < View style = { styles . avatarsContainer } >
78+ < View style = { styles . avatarCircle } >
79+ < Shimmer easing = { Easing . ease } />
80+ </ View >
81+ < View style = { styles . avatarCircle } >
82+ < Shimmer easing = { Easing . ease } />
83+ </ View >
84+ < View style = { styles . avatarCircle } >
85+ < Shimmer easing = { Easing . ease } />
86+ </ View >
87+ < View style = { styles . avatarCircle } >
88+ < Shimmer easing = { Easing . ease } />
89+ </ View >
90+ < View style = { styles . avatarCircle } >
91+ < Shimmer easing = { Easing . ease } />
92+ </ View >
93+ < View style = { styles . avatarCircle } >
94+ < Shimmer easing = { Easing . ease } />
95+ </ View >
96+ </ View >
97+ </ View >
98+ </ ShimmerProvider >
99+ </ View >
18100 </ SafeAreaView >
19101 ) ;
20102}
@@ -26,25 +108,65 @@ const styles = StyleSheet.create({
26108 justifyContent : 'flex-start' ,
27109 gap : 12 ,
28110 } ,
29- shimmer1 : {
30- width : 200 ,
31- height : 50 ,
32- borderRadius : 10 ,
33- backgroundColor : 'gray' ,
111+ configsContainer : {
112+ display : 'flex' ,
113+ flexDirection : 'row' ,
114+ gap : 10 ,
115+ paddingHorizontal : 20 ,
34116 } ,
35- shimmer2 : {
117+ configContainer : {
118+ display : 'flex' ,
119+ flexDirection : 'column' ,
120+ gap : 10 ,
121+ alignItems : 'center' ,
122+ } ,
123+ sharedConfigWrapper : {
124+ alignItems : 'center' ,
125+ justifyContent : 'center' ,
126+ gap : 12 ,
127+ } ,
128+ shimmer : {
36129 width : 200 ,
37130 height : 50 ,
38- borderRadius : 10 ,
39- backgroundColor : 'gray' ,
40131 } ,
41- shimmer3 : {
42- width : 200 ,
132+ longShimmer : {
133+ width : '100%' ,
43134 height : 50 ,
44- borderRadius : 10 ,
45- backgroundColor : 'gray' ,
46135 } ,
47136 shimmerMain : {
137+ backgroundColor : 'gray' ,
48138 borderRadius : 10 ,
49139 } ,
140+ avatarsContainer : {
141+ display : 'flex' ,
142+ flexDirection : 'row' ,
143+ flexWrap : 'wrap' ,
144+ gap : 10 ,
145+ width : '100%' ,
146+ justifyContent : 'space-between' ,
147+ } ,
148+ avatarCircle : {
149+ width : 100 ,
150+ height : 100 ,
151+ backgroundColor : 'gray' ,
152+ borderRadius : 50 ,
153+ } ,
154+ easingShimmerContainer : {
155+ display : 'flex' ,
156+ flexDirection : 'column' ,
157+ justifyContent : 'center' ,
158+ alignItems : 'center' ,
159+ gap : 10 ,
160+ width : '100%' ,
161+ } ,
162+ longShimmers : {
163+ width : '100%' ,
164+ alignItems : 'center' ,
165+ paddingHorizontal : 10 ,
166+ } ,
167+ avatarShimmers : {
168+ width : '100%' ,
169+ height : 300 ,
170+ marginTop : 20 ,
171+ } ,
50172} ) ;
0 commit comments