Skip to content

Commit 5f91681

Browse files
committed
linter in components
1 parent 644c23a commit 5f91681

File tree

3 files changed

+42
-38
lines changed

3 files changed

+42
-38
lines changed

example/src/components/Button.tsx

Lines changed: 39 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,45 +3,49 @@ import {
33
TouchableOpacity as RNTouchableOpacity,
44
StyleSheet,
55
Text as RNText,
6-
} from 'react-native'
6+
} from 'react-native';
77

88
// @ts-ignore
9-
function Button(props) {
10-
const { intercom_title, intercom_disabled, intercom_onPress, intercom_accesibilityLabel } = props;
11-
const onPress = useCallback(() => {
12-
intercom_onPress();
13-
}, [intercom_onPress]);
9+
function Button(props) {
10+
const {
11+
intercom_title,
12+
intercom_disabled,
13+
intercom_onPress,
14+
intercom_accesibilityLabel,
15+
} = props;
16+
const onPress = useCallback(() => {
17+
intercom_onPress();
18+
}, [intercom_onPress]);
1419

15-
return (
16-
<RNTouchableOpacity
17-
style={buttonStyles(props).touchableOpacity}
18-
onPress={onPress}
19-
disabled={intercom_disabled}
20-
accessibilityLabel={intercom_accesibilityLabel}
21-
>
22-
<RNText
23-
style={buttonStyles(props).text}
24-
allowFontScaling={false}>
25-
{intercom_title}
26-
</RNText>
27-
</RNTouchableOpacity>
28-
)
20+
return (
21+
<RNTouchableOpacity
22+
style={buttonStyles(props).touchableOpacity}
23+
onPress={onPress}
24+
disabled={intercom_disabled}
25+
accessibilityLabel={intercom_accesibilityLabel}
26+
>
27+
<RNText style={buttonStyles(props).text} allowFontScaling={false}>
28+
{intercom_title}
29+
</RNText>
30+
</RNTouchableOpacity>
31+
);
2932
}
3033

3134
// @ts-ignore
32-
export const buttonStyles = (props) => StyleSheet.create({
33-
touchableOpacity: {
34-
backgroundColor: props.intercom_disabled? '#f4f4f4' : '#0096FF',
35-
borderRadius: 5,
36-
padding: 8,
37-
justifyContent: 'center',
38-
alignItems: 'center',
39-
marginTop: 3,
40-
marginBottom: 3
41-
},
42-
text: {
43-
color: props.intercom_disabled ? '#808080' : 'white'
44-
},
45-
});
35+
export const buttonStyles = (props) =>
36+
StyleSheet.create({
37+
touchableOpacity: {
38+
backgroundColor: props.intercom_disabled ? '#f4f4f4' : '#0096FF',
39+
borderRadius: 5,
40+
padding: 8,
41+
justifyContent: 'center',
42+
alignItems: 'center',
43+
marginTop: 3,
44+
marginBottom: 3,
45+
},
46+
text: {
47+
color: props.intercom_disabled ? '#808080' : 'white',
48+
},
49+
});
4650

47-
export default memo(Button);
51+
export default memo(Button);

example/src/components/Input.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const Input = ({
1717

1818
const styles = StyleSheet.create({
1919
container: { marginVertical: 8 },
20-
title: {
20+
title: {
2121
marginBottom: 3,
2222
},
2323
input: {
@@ -27,7 +27,7 @@ const styles = StyleSheet.create({
2727
paddingVertical: 4,
2828
borderRadius: 4,
2929
backgroundColor: 'white',
30-
color: '#808080'
30+
color: '#808080',
3131
},
3232
});
3333

example/src/constants.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ export const SEARCH_TERM = Config.SEARCH_TERM;
1111
export const TOKEN = Platform.select({
1212
ios: 'RN-IOS-TOKEN',
1313
default: 'RN-ANDROID-TOKEN',
14-
});
14+
});

0 commit comments

Comments
 (0)