@@ -21,7 +21,7 @@ class AvatarHeader extends React.Component {
21
21
this . scrollY = new ValueXY ( )
22
22
}
23
23
24
- setHeaderSize = headerLayout => this . setState ( { headerLayout } )
24
+ setHeaderSize = ( headerLayout ) => this . setState ( { headerLayout } )
25
25
26
26
scrollPosition ( value ) {
27
27
const {
@@ -89,10 +89,7 @@ class AvatarHeader extends React.Component {
89
89
const startSize = constants . responsiveWidth ( 18 )
90
90
const endSize = constants . responsiveWidth ( 12 )
91
91
92
- const [ startImgAnimation , finishImgAnimation ] = [
93
- this . scrollPosition ( 27 ) ,
94
- this . scrollPosition ( 31 )
95
- ]
92
+ const [ startImgAnimation , finishImgAnimation ] = [ this . scrollPosition ( 27 ) , this . scrollPosition ( 31 ) ]
96
93
const [ startAuthorFade , finishAuthorFade ] = [ this . scrollPosition ( 40 ) , this . scrollPosition ( 50 ) ]
97
94
98
95
const [ startAboutFade , fininshAboutFade ] = [ this . scrollPosition ( 60 ) , this . scrollPosition ( 70 ) ]
@@ -121,19 +118,12 @@ class AvatarHeader extends React.Component {
121
118
return (
122
119
< View style = { styles . foreground } >
123
120
< Animated . View style = { { opacity : imageOpacity } } >
124
- < Animated . Image
125
- source = { image }
126
- style = { [ styles . profilePic , { width : imageSize , height : imageSize } ] }
127
- />
121
+ < Animated . Image source = { image } style = { [ styles . profilePic , { width : imageSize , height : imageSize } ] } />
128
122
</ Animated . View >
129
- < Animated . View
130
- style = { [
131
- styles . messageContainer ,
132
- styles . userModalMessageContainer ,
133
- { opacity : authorOpacity }
134
- ] }
135
- >
136
- < Text numberOfLines = { 2 } style = { [ styles . message , styles . foregroundTitle ] } > { title } </ Text >
123
+ < Animated . View style = { [ styles . messageContainer , styles . userModalMessageContainer , { opacity : authorOpacity } ] } >
124
+ < Text numberOfLines = { 2 } style = { [ styles . message , styles . foregroundTitle ] } >
125
+ { title }
126
+ </ Text >
137
127
</ Animated . View >
138
128
< Animated . View style = { [ styles . infoContainer , { opacity : aboutOpacity } ] } >
139
129
< Text style = { styles . infoText } > { subtitle } </ Text >
@@ -148,8 +138,9 @@ class AvatarHeader extends React.Component {
148
138
} = this . state
149
139
const { backgroundColor, hasBorderRadius } = this . props
150
140
151
- const headerBorderRadius = hasBorderRadius
152
- && this . scrollY . y . interpolate ( {
141
+ const headerBorderRadius =
142
+ hasBorderRadius &&
143
+ this . scrollY . y . interpolate ( {
153
144
inputRange : [ 0 , height ] ,
154
145
outputRange : [ 80 , 0 ] ,
155
146
extrapolate : 'extend'
@@ -169,14 +160,7 @@ class AvatarHeader extends React.Component {
169
160
}
170
161
171
162
render ( ) {
172
- const {
173
- backgroundColor,
174
- backgroundImage,
175
- renderBody,
176
- headerHeight,
177
- snapToEdge,
178
- bounces
179
- } = this . props
163
+ const { backgroundColor, backgroundImage, renderBody, headerHeight, snapToEdge, bounces } = this . props
180
164
181
165
return (
182
166
< React . Fragment >
@@ -228,7 +212,7 @@ AvatarHeader.defaultProps = {
228
212
title : Brandon . author ,
229
213
subtitle : Brandon . about ,
230
214
image : Brandon . image ,
231
- renderBody : user => < RenderContent user = { user } /> ,
215
+ renderBody : ( user ) => < RenderContent user = { user } /> ,
232
216
bounces : true ,
233
217
snapToEdge : true ,
234
218
hasBorderRadius : true
0 commit comments