Skip to content

Commit 4278659

Browse files
author
William Porto
committed
styles(prettier): formatting code with prettier
1 parent 2d1636d commit 4278659

File tree

6 files changed

+53
-52
lines changed

6 files changed

+53
-52
lines changed
Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
1-
import React, { FC, ReactNode } from "react";
1+
import React, { FC, ReactNode } from 'react';
22
import {
33
KeyboardAwareScrollView,
4-
KeyboardAwareScrollViewProps,
5-
} from "react-native-keyboard-aware-scroll-view";
4+
KeyboardAwareScrollViewProps
5+
} from 'react-native-keyboard-aware-scroll-view';
66

7-
interface KeyboardAwareScrollViewComponentProps
8-
extends KeyboardAwareScrollViewProps {
7+
interface KeyboardAwareScrollViewComponentProps extends KeyboardAwareScrollViewProps {
98
children: ReactNode;
109
}
1110

1211
/**
1312
* @deprecated https://github.com/APSL/react-native-keyboard-aware-scroll-view/issues/494#issuecomment-900089166
1413
*/
15-
const KeyboardAwareScrollViewComponent: FC<KeyboardAwareScrollViewComponentProps> =
16-
({ children, ...rest }) => (
17-
<KeyboardAwareScrollView
18-
showsVerticalScrollIndicator={false}
19-
showsHorizontalScrollIndicator={false}
20-
{...rest}
21-
>
22-
{children}
23-
</KeyboardAwareScrollView>
24-
);
14+
const KeyboardAwareScrollViewComponent: FC<KeyboardAwareScrollViewComponentProps> = ({
15+
children,
16+
...rest
17+
}) => (
18+
<KeyboardAwareScrollView
19+
showsVerticalScrollIndicator={false}
20+
showsHorizontalScrollIndicator={false}
21+
{...rest}
22+
>
23+
{children}
24+
</KeyboardAwareScrollView>
25+
);
2526

2627
export default KeyboardAwareScrollViewComponent;

template/src/screens/Form/Form.tsx

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import React, { FC, useRef, MutableRefObject, useState } from "react";
2-
import { ScrollView } from "react-native";
3-
import { useForm, Controller } from "react-hook-form";
4-
import { yupResolver } from "@hookform/resolvers/yup";
1+
import React, { FC, useRef, MutableRefObject, useState } from 'react';
2+
import { ScrollView } from 'react-native';
3+
import { useForm, Controller } from 'react-hook-form';
4+
import { yupResolver } from '@hookform/resolvers/yup';
55

6-
import { Column, Input, InputRef, Button } from "src/components";
6+
import { Column, Input, InputRef, Button } from 'src/components';
77

8-
import { FormExampleSchema } from "src/utils";
8+
import { FormExampleSchema } from 'src/utils';
99

1010
interface FormExampleData {
1111
email: string;
@@ -17,14 +17,14 @@ const Form: FC = () => {
1717
control,
1818
handleSubmit,
1919
reset,
20-
formState: { errors },
20+
formState: { errors }
2121
} = useForm<FormExampleData>({
22-
reValidateMode: "onSubmit",
22+
reValidateMode: 'onSubmit',
2323
resolver: yupResolver(FormExampleSchema),
2424
defaultValues: {
25-
email: "",
26-
password: "",
27-
},
25+
email: '',
26+
password: ''
27+
}
2828
});
2929
const passwordInputRef = useRef() as MutableRefObject<InputRef>;
3030

@@ -44,19 +44,19 @@ const Form: FC = () => {
4444
<ScrollView
4545
contentContainerStyle={{
4646
flex: 1,
47-
justifyContent: "center",
48-
padding: 16,
47+
justifyContent: 'center',
48+
padding: 16
4949
}}
5050
>
5151
<Controller
52-
name="email"
52+
name='email'
5353
control={control}
5454
render={({ field: { onChange, value } }): JSX.Element => (
5555
<Input
56-
label="E-mail"
57-
placeholder="[email protected]"
58-
keyboardType="email-address"
59-
returnKeyType="next"
56+
label='E-mail'
57+
placeholder='[email protected]'
58+
keyboardType='email-address'
59+
returnKeyType='next'
6060
value={value}
6161
error={errors.email?.message}
6262
onSubmitEditing={() => handleFocus(passwordInputRef)}
@@ -66,15 +66,15 @@ const Form: FC = () => {
6666
/>
6767

6868
<Controller
69-
name="password"
69+
name='password'
7070
control={control}
7171
render={({ field: { onChange, value } }): JSX.Element => (
7272
<Input
7373
ref={passwordInputRef}
7474
secureTextEntry={isPasswordInput}
75-
label="Password"
76-
placeholder="password"
77-
returnKeyType="done"
75+
label='Password'
76+
placeholder='password'
77+
returnKeyType='done'
7878
value={value}
7979
error={errors.password?.message}
8080
onChangeText={onChange}
@@ -84,9 +84,9 @@ const Form: FC = () => {
8484
)}
8585
/>
8686

87-
<Button text="Submit form" onPress={handleSubmit(onSubmit)} mt={20} />
87+
<Button text='Submit form' onPress={handleSubmit(onSubmit)} mt={20} />
8888

89-
<Button variant="secondary" text="Reset form" onPress={() => reset()} />
89+
<Button variant='secondary' text='Reset form' onPress={() => reset()} />
9090
</ScrollView>
9191
</Column>
9292
);

template/storybook/stories/Button/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ export default function Button({ onPress, children }) {
88

99
Button.defaultProps = {
1010
children: null,
11-
onPress: () => {},
11+
onPress: () => {}
1212
};
1313

1414
Button.propTypes = {
1515
children: PropTypes.node,
16-
onPress: PropTypes.func,
16+
onPress: PropTypes.func
1717
};

template/storybook/stories/CenterView/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ export default function CenterView({ children }) {
88
}
99

1010
CenterView.defaultProps = {
11-
children: null,
11+
children: null
1212
};
1313

1414
CenterView.propTypes = {
15-
children: PropTypes.node,
15+
children: PropTypes.node
1616
};

template/storybook/stories/CenterView/style.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ export default {
33
flex: 1,
44
justifyContent: 'center',
55
alignItems: 'center',
6-
backgroundColor: '#F5FCFF',
7-
},
6+
backgroundColor: '#F5FCFF'
7+
}
88
};

template/storybook/stories/Welcome/index.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@ export default class Welcome extends React.Component {
77
wrapper: {
88
flex: 1,
99
padding: 24,
10-
justifyContent: 'center',
10+
justifyContent: 'center'
1111
},
1212
header: {
1313
fontSize: 18,
14-
marginBottom: 18,
14+
marginBottom: 18
1515
},
1616
content: {
1717
fontSize: 12,
1818
marginBottom: 10,
19-
lineHeight: 18,
20-
},
19+
lineHeight: 18
20+
}
2121
};
2222

23-
showApp = (event) => {
23+
showApp = event => {
2424
const { showApp } = this.props;
2525
event.preventDefault();
2626

@@ -49,9 +49,9 @@ export default class Welcome extends React.Component {
4949
}
5050

5151
Welcome.defaultProps = {
52-
showApp: null,
52+
showApp: null
5353
};
5454

5555
Welcome.propTypes = {
56-
showApp: PropTypes.func,
56+
showApp: PropTypes.func
5757
};

0 commit comments

Comments
 (0)