Skip to content

Commit 6438a6f

Browse files
committed
Added eslint
1 parent 13b4e14 commit 6438a6f

File tree

6,294 files changed

+416091
-93
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

6,294 files changed

+416091
-93
lines changed

.eslintrc.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"parser": "babel-eslint",
3+
"extends": "airbnb",
4+
"rules": {
5+
"no-confusing-arrow": "off",
6+
"no-shadow": "off",
7+
"no-param-reassign": "off",
8+
"import/no-unresolved": "off",
9+
"import/extensions": "off",
10+
"import/no-extraneous-dependencies": "off",
11+
"react/jsx-filename-extension": "off",
12+
"react/sort-comp": "off"
13+
}
14+
}

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
/npm-debug.log
1+
/npm-debug.log
2+
/node_modules

index.js

+104-90
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
import React, { Component, PropTypes } from 'react';
42
import {
53
StyleSheet,
@@ -9,18 +7,49 @@ import {
97
TouchableNativeFeedback,
108
TouchableOpacity,
119
Animated,
12-
Easing
10+
Easing,
1311
} from 'react-native';
1412

15-
const sharp_easing_values = {
13+
const sharpEasingValues = {
1614
entry: Easing.bezier(0.0, 0.0, 0.2, 1),
17-
exit: Easing.bezier(0.4, 0.0, 0.6, 1)
18-
}
15+
exit: Easing.bezier(0.4, 0.0, 0.6, 1),
16+
};
1917

20-
const duration_values = {
18+
const durationValues = {
2119
entry: 225,
22-
exit: 195
23-
}
20+
exit: 195,
21+
};
22+
23+
const styles = StyleSheet.create({
24+
addButton: {
25+
borderRadius: 50,
26+
alignItems: 'stretch',
27+
shadowColor: '#000000',
28+
shadowOpacity: 0.8,
29+
shadowRadius: 2,
30+
shadowOffset: {
31+
height: 1,
32+
width: 0,
33+
},
34+
elevation: 2,
35+
},
36+
fab_box: {
37+
position: 'absolute',
38+
bottom: 20,
39+
right: 20,
40+
height: 56,
41+
width: 56,
42+
alignItems: 'center',
43+
justifyContent: 'center',
44+
borderRadius: 50,
45+
},
46+
addButtonInnerView: {
47+
flex: 1,
48+
borderRadius: 50,
49+
alignItems: 'center',
50+
justifyContent: 'center',
51+
},
52+
});
2453

2554
export default class FAB extends Component {
2655

@@ -29,29 +58,28 @@ export default class FAB extends Component {
2958
iconTextColor: PropTypes.string,
3059
onClickAction: PropTypes.func,
3160
iconTextComponent: PropTypes.element,
32-
visible: PropTypes.bool
61+
visible: PropTypes.bool,
3362
}
3463

3564
static defaultProps = {
3665
buttonColor: 'red',
3766
iconTextColor: '#FFFFFF',
38-
onClickAction: ()=>{},
67+
onClickAction: () => {},
3968
iconTextComponent: <Text>+</Text>,
40-
visible: true
69+
visible: true,
4170
};
4271

4372
state = {
44-
translateValue: new Animated.Value(0)
73+
translateValue: new Animated.Value(0),
4574
};
4675

4776
componentDidMount() {
4877
const { translateValue } = this.state;
4978
const { visible } = this.props;
5079

51-
if(visible) {
80+
if (visible) {
5281
translateValue.setValue(1);
53-
}
54-
else {
82+
} else {
5583
translateValue.setValue(0);
5684
}
5785
}
@@ -60,24 +88,23 @@ export default class FAB extends Component {
6088
const { translateValue } = this.state;
6189
const { visible } = this.props;
6290

63-
if((nextProps.visible)&&(!visible)) {
91+
if ((nextProps.visible) && (!visible)) {
6492
Animated.timing(
6593
translateValue,
6694
{
67-
duration: duration_values.entry,
95+
duration: durationValues.entry,
6896
toValue: 1,
69-
easing: sharp_easing_values.entry
70-
}
97+
easing: sharpEasingValues.entry,
98+
},
7199
).start();
72-
}
73-
else if((!nextProps.visible)&&(visible)) {
100+
} else if ((!nextProps.visible) && (visible)) {
74101
Animated.timing(
75102
translateValue,
76103
{
77-
duration: duration_values.exit,
104+
duration: durationValues.exit,
78105
toValue: 0,
79-
easing: sharp_easing_values.exit
80-
}
106+
easing: sharpEasingValues.exit,
107+
},
81108
).start();
82109
}
83110
}
@@ -103,98 +130,85 @@ export default class FAB extends Component {
103130
outputRange: ['-90deg', '0deg'],
104131
});
105132

106-
if(Platform.OS==='ios') {
133+
if (Platform.OS === 'ios') {
107134
return (
108135
<View style={styles.fab_box}>
109136
<Animated.View
110137
style={[
111-
styles.addButton,
112-
{
138+
styles.addButton, {
113139
height: dimensionInterpolate,
114-
width: dimensionInterpolate
115-
}
140+
width: dimensionInterpolate,
141+
},
116142
]}
117143
>
118-
<TouchableOpacity onPress={()=>{onClickAction()}} style={[styles.addButtonInnerView, {backgroundColor: buttonColor}]}>
119-
<Animated.Text style={{
120-
transform: [
121-
{scale: translateValue},
122-
{rotate: rotateInterpolate}
123-
],
124-
fontSize: 24
125-
}}>
126-
{React.cloneElement(iconTextComponent, {style: {
144+
<TouchableOpacity
145+
onPress={() => { onClickAction(); }}
146+
style={[
147+
styles.addButtonInnerView, {
148+
backgroundColor: buttonColor,
149+
},
150+
]}
151+
>
152+
<Animated.Text
153+
style={{
154+
transform: [
155+
{ scale: translateValue },
156+
{ rotate: rotateInterpolate },
157+
],
127158
fontSize: 24,
128-
color: iconTextColor
129-
}})}
159+
}}
160+
>
161+
{React.cloneElement(iconTextComponent, { style: {
162+
fontSize: 24,
163+
color: iconTextColor,
164+
} })}
130165
</Animated.Text>
131166
</TouchableOpacity>
132167
</Animated.View>
133168
</View>
134-
);
135-
}
136-
else if(Platform.OS==='android') {
169+
);
170+
} else if (Platform.OS === 'android') {
137171
return (
138172
<View style={styles.fab_box}>
139173
<Animated.View
140174
style={[
141175
styles.addButton,
142176
{
143177
height: dimensionInterpolate,
144-
width: dimensionInterpolate
145-
}
178+
width: dimensionInterpolate,
179+
},
146180
]}
147181
>
148-
<TouchableNativeFeedback background={TouchableNativeFeedback.SelectableBackgroundBorderless()} onPress={()=>{onClickAction()}}>
149-
<View style={[styles.addButtonInnerView, {backgroundColor: buttonColor}]}>
150-
<Animated.Text style={{
151-
transform: [
152-
{scaleX: translateValue},
153-
{rotate: rotateInterpolate}
154-
],
155-
fontSize: 24
156-
}}>
157-
{React.cloneElement(iconTextComponent, {style: {
182+
<TouchableNativeFeedback
183+
background={TouchableNativeFeedback.SelectableBackgroundBorderless()}
184+
onPress={() => { onClickAction(); }}
185+
>
186+
<View
187+
style={[
188+
styles.addButtonInnerView, {
189+
backgroundColor: buttonColor,
190+
},
191+
]}
192+
>
193+
<Animated.Text
194+
style={{
195+
transform: [
196+
{ scaleX: translateValue },
197+
{ rotate: rotateInterpolate },
198+
],
158199
fontSize: 24,
159-
color: iconTextColor
160-
}})}
200+
}}
201+
>
202+
{React.cloneElement(iconTextComponent, { style: {
203+
fontSize: 24,
204+
color: iconTextColor,
205+
} })}
161206
</Animated.Text>
162207
</View>
163208
</TouchableNativeFeedback>
164209
</Animated.View>
165210
</View>
166-
);
211+
);
167212
}
168213
}
169214
}
170-
171-
const styles = StyleSheet.create({
172-
addButton: {
173-
borderRadius: 50,
174-
alignItems: 'stretch',
175-
shadowColor: "#000000",
176-
shadowOpacity: 0.8,
177-
shadowRadius: 2,
178-
shadowOffset: {
179-
height: 1,
180-
width: 0
181-
},
182-
elevation: 2
183-
},
184-
fab_box: {
185-
position: 'absolute',
186-
bottom: 20,
187-
right:20,
188-
height: 56,
189-
width: 56,
190-
alignItems: 'center',
191-
justifyContent: 'center',
192-
borderRadius: 50
193-
},
194-
addButtonInnerView: {
195-
flex: 1,
196-
borderRadius: 50,
197-
alignItems: 'center',
198-
justifyContent: 'center'
199-
}
200-
});

node_modules/.bin/eslint

+15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/eslint.cmd

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)