Skip to content

Commit 372298b

Browse files
author
pwysowski
committed
fix: formated documents with prettier
1 parent 5bc5778 commit 372298b

File tree

3 files changed

+22
-47
lines changed

3 files changed

+22
-47
lines changed

src/predefinedComponents/AvatarHeader/AvatarHeader.js

Lines changed: 12 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class AvatarHeader extends React.Component {
2121
this.scrollY = new ValueXY()
2222
}
2323

24-
setHeaderSize = headerLayout => this.setState({ headerLayout })
24+
setHeaderSize = (headerLayout) => this.setState({ headerLayout })
2525

2626
scrollPosition(value) {
2727
const {
@@ -89,10 +89,7 @@ class AvatarHeader extends React.Component {
8989
const startSize = constants.responsiveWidth(18)
9090
const endSize = constants.responsiveWidth(12)
9191

92-
const [startImgAnimation, finishImgAnimation] = [
93-
this.scrollPosition(27),
94-
this.scrollPosition(31)
95-
]
92+
const [startImgAnimation, finishImgAnimation] = [this.scrollPosition(27), this.scrollPosition(31)]
9693
const [startAuthorFade, finishAuthorFade] = [this.scrollPosition(40), this.scrollPosition(50)]
9794

9895
const [startAboutFade, fininshAboutFade] = [this.scrollPosition(60), this.scrollPosition(70)]
@@ -121,19 +118,12 @@ class AvatarHeader extends React.Component {
121118
return (
122119
<View style={styles.foreground}>
123120
<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 }]} />
128122
</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>
137127
</Animated.View>
138128
<Animated.View style={[styles.infoContainer, { opacity: aboutOpacity }]}>
139129
<Text style={styles.infoText}>{subtitle}</Text>
@@ -148,8 +138,9 @@ class AvatarHeader extends React.Component {
148138
} = this.state
149139
const { backgroundColor, hasBorderRadius } = this.props
150140

151-
const headerBorderRadius = hasBorderRadius
152-
&& this.scrollY.y.interpolate({
141+
const headerBorderRadius =
142+
hasBorderRadius &&
143+
this.scrollY.y.interpolate({
153144
inputRange: [0, height],
154145
outputRange: [80, 0],
155146
extrapolate: 'extend'
@@ -169,14 +160,7 @@ class AvatarHeader extends React.Component {
169160
}
170161

171162
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
180164

181165
return (
182166
<React.Fragment>
@@ -228,7 +212,7 @@ AvatarHeader.defaultProps = {
228212
title: Brandon.author,
229213
subtitle: Brandon.about,
230214
image: Brandon.image,
231-
renderBody: user => <RenderContent user={user} />,
215+
renderBody: (user) => <RenderContent user={user} />,
232216
bounces: true,
233217
snapToEdge: true,
234218
hasBorderRadius: true

src/predefinedComponents/DetailsHeader/DetailsHeader.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,15 @@ class DetailsHeader extends React.Component {
7373
extrapolate: 'clamp'
7474
})
7575

76-
7776
return (
7877
<View style={styles.foreground}>
7978
<Animated.View style={[styles.foregroundTitle, { opacity: labelOpacity, labelColor }]}>
8079
<Text style={styles.foregroundText}>{tag}</Text>
8180
</Animated.View>
8281
<Animated.View style={[styles.messageContainer, { opacity: titleOpacity }]}>
83-
<Text numberOfLines={3} style={styles.message}>{title}</Text>
82+
<Text numberOfLines={3} style={styles.message}>
83+
{title}
84+
</Text>
8485
</Animated.View>
8586
<Animated.View style={[styles.infoContainer, { opacity: authorOpacity }]}>
8687
<View style={styles.iconContainer}>
@@ -89,7 +90,9 @@ class DetailsHeader extends React.Component {
8990
</View>
9091
<View style={styles.footerContainer}>
9192
<Image source={image} style={styles.authorPhoto} resizeMode="contain" />
92-
<Text numberOfLines={1} style={styles.authorName}>{user.author}</Text>
93+
<Text numberOfLines={1} style={styles.authorName}>
94+
{user.author}
95+
</Text>
9396
</View>
9497
</Animated.View>
9598
</View>

src/predefinedComponents/TabbedHeader/TabbedHeader.js

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export default class TabbedHeader extends React.Component {
2929
this.scrollY.y.removeListener()
3030
}
3131

32-
setHeaderSize = headerLayout => this.setState({ headerLayout })
32+
setHeaderSize = (headerLayout) => this.setState({ headerLayout })
3333

3434
scrollPosition = (value) => {
3535
const { headerLayout } = this.state
@@ -42,11 +42,7 @@ export default class TabbedHeader extends React.Component {
4242

4343
return (
4444
<View style={[styles.headerWrapper, { backgroundColor }]}>
45-
<Image
46-
resizeMode="contain"
47-
source={require('../../assets/images/logo.png')}
48-
style={styles.logo}
49-
/>
45+
<Image resizeMode="contain" source={require('../../assets/images/logo.png')} style={styles.logo} />
5046
</View>
5147
)
5248
}
@@ -121,15 +117,7 @@ export default class TabbedHeader extends React.Component {
121117
}
122118

123119
render() {
124-
const {
125-
tabs,
126-
headerHeight,
127-
backgroundColor,
128-
backgroundImage,
129-
bounces,
130-
snapToEdge,
131-
renderBody
132-
} = this.props
120+
const { tabs, headerHeight, backgroundColor, backgroundImage, bounces, snapToEdge, renderBody } = this.props
133121

134122
return (
135123
<React.Fragment>
@@ -177,7 +165,7 @@ TabbedHeader.defaultProps = {
177165
title: "Mornin' Mark! \nReady for a quiz?",
178166
bounces: true,
179167
snapToEdge: true,
180-
renderBody: title => <RenderContent title={title} />,
168+
renderBody: (title) => <RenderContent title={title} />,
181169
tabs: [
182170
{
183171
title: 'Popular',

0 commit comments

Comments
 (0)