Skip to content

Commit

Permalink
Merge pull request #18 from BinaryStudioAcademy/task/bt-1-add-mobile-…
Browse files Browse the repository at this point in the history
…starter

bt-1: fix editorconfig issue
  • Loading branch information
nikita-remeslov authored Aug 21, 2023
2 parents ea831f4 + 8abed60 commit 4624044
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 90 deletions.
7 changes: 7 additions & 0 deletions .ecrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"Exclude": [
"mobile/ios/**",
"mobile/android/**",
"mobile/Gemfile.lock"
]
}
15 changes: 0 additions & 15 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,3 @@ indent_size = unset

[*.yml]
indent_size = unset

[/mobile/ios/**]
indent_size = unset
end_of_line = unset
trim_trailing_whitespace = unset
insert_final_newline = unset

[/mobile/android/**]
indent_size = unset
end_of_line = unset
trim_trailing_whitespace = unset
insert_final_newline = unset

[/mobile/Gemfile.lock]
indent_size = unset
2 changes: 1 addition & 1 deletion mobile/.env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ENVIRONMENT=development
API_URL=http://localhost:3001/api/v1
API_URL=http://10.0.2.2:3001/api/v1
13 changes: 7 additions & 6 deletions mobile/.eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
parserOptions:
project:
- ./tsconfig.json
project:
- ./tsconfig.json

extends:
- ../.eslintrc.yml
- ../.eslintrc.yml
- plugin:react-hooks/recommended

settings:
import/ignore:
- "node_modules/react-native/index\\.js$"
import/ignore:
- 'react-native'

rules:
import/extensions: off
import/extensions: off
1 change: 1 addition & 0 deletions mobile/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
apply plugin: "com.android.application"
apply plugin: "com.facebook.react"
apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"

/**
* This is the configuration block to customize your React Native Android app.
Expand Down
1 change: 1 addition & 0 deletions mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"@react-navigation/native": "6.1.7",
"@react-navigation/native-stack": "6.9.13",
"@reduxjs/toolkit": "1.9.5",
"eslint-plugin-react-hooks": "4.6.0",
"fast-text-encoding": "1.0.6",
"react": "18.2.0",
"react-hook-form": "7.45.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
View,
} from '~/bundles/common/components/components';
import { RootScreenName } from '~/bundles/common/enums/enums';
import { useAppForm } from '~/bundles/common/hooks/hooks';
import { useAppForm, useCallback } from '~/bundles/common/hooks/hooks';
import {
type UserSignUpRequestDto,
userSignUpValidationSchema,
Expand All @@ -25,9 +25,9 @@ const SignUpForm: React.FC<Properties> = ({ onSubmit }) => {
validationSchema: userSignUpValidationSchema,
});

const handleFormSubmit = (): void => {
handleSubmit(onSubmit);
};
const handleFormSubmit = useCallback((): void => {
void handleSubmit(onSubmit)();
}, [handleSubmit, onSubmit]);

return (
<View>
Expand Down
2 changes: 1 addition & 1 deletion mobile/src/bundles/auth/screens/auth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const Auth: React.FC = () => {
(payload: UserSignUpRequestDto): void => {
void dispatch(authActions.signUp(payload));
},
[],
[dispatch],
);

const getScreen = (screen: string): React.ReactNode => {
Expand Down
6 changes: 5 additions & 1 deletion mobile/src/bundles/common/components/input/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,18 @@ const Input = <T extends FieldValues>({
}: Properties<T>): JSX.Element => {
const { field } = useFormController({ name, control });

const { value, onChange, onBlur } = field;

const error = errors[name]?.message;
const hasError = Boolean(error);

return (
<View>
<Text>{label}</Text>
<TextInput
{...field}
onChangeText={onChange}
value={value}
onBlur={onBlur}
placeholder={placeholder}
style={styles.input}
/>
Expand Down
Loading

0 comments on commit 4624044

Please sign in to comment.