diff --git a/.expo-shared/assets.json b/.expo-shared/assets.json deleted file mode 100644 index 1e6decf..0000000 --- a/.expo-shared/assets.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "12bb71342c6255bbf50437ec8f4441c083f47cdb74bd89160c15e4f43e52a1cb": true, - "40b842e832070c58deac6aa9e08fa459302ee3f9da492c7e77d93d2fbf4a56fd": true -} diff --git a/babel.config.js b/babel.config.js index 560beed..5d3992c 100644 --- a/babel.config.js +++ b/babel.config.js @@ -16,6 +16,7 @@ module.exports = { allowUndefined: true } ], - ['@babel/plugin-proposal-class-properties'] + ['@babel/plugin-proposal-class-properties'], // Comment out when running "yarn run ", but needed for doing serverless web app deploy + ['@babel/plugin-transform-flow-strip-types'] // Needed for react navigation issue - https://github.com/react-navigation/react-navigation/issues/6058 ] }; diff --git a/package.json b/package.json index f8a352c..068d02f 100644 --- a/package.json +++ b/package.json @@ -49,6 +49,8 @@ "yup": "^0.32.0" }, "devDependencies": { + "@babel/plugin-proposal-class-properties": "^7.13.0", + "@babel/plugin-transform-flow-strip-types": "^7.13.0", "@expo/next-adapter": "^2.1.41", "@testing-library/jest-native": "^4.0.0", "@testing-library/react-native": "^7.1.0", diff --git a/src/interfaces/index.ts b/src/interfaces/index.ts index 8635872..88b73fd 100644 --- a/src/interfaces/index.ts +++ b/src/interfaces/index.ts @@ -40,13 +40,17 @@ export interface LoadFontProps { fontsToLoad: { [fontFamily: string]: FontSource; }; + // eslint-disable-next-line no-unused-vars setFontLoaded: (fontLoaded: boolean) => void; } export interface TextInputProps { + // eslint-disable-next-line no-unused-vars onChangeText?: (text: string) => void; + // eslint-disable-next-line no-unused-vars onBlur?: (e: NativeSyntheticEvent) => void; onSubmitEditing?: ( + // eslint-disable-next-line no-unused-vars e: NativeSyntheticEvent ) => void; placeholder?: string; diff --git a/src/pages/login.tsx b/src/pages/login.tsx index b41be49..174624e 100644 --- a/src/pages/login.tsx +++ b/src/pages/login.tsx @@ -1,10 +1,9 @@ -import React, { FC, FormEvent, useRef } from 'react'; +import React, { FC, FormEvent } from 'react'; import { GestureResponderEvent, KeyboardAvoidingView, NativeSyntheticEvent, Platform, - StyleSheet, Text, TextInput, TextInputSubmitEditingEventData @@ -27,27 +26,16 @@ const loginSchema = Yup.object().shape({ password: Yup.string().required('Password is required') }); -const styles = StyleSheet.create({ - errorInput: { - color: 'red', - fontSize: 12, - marginLeft: 16 - }, - fbLoginButton: { - height: 45, - marginTop: 10, - backgroundColor: 'transparent' - }, - loginButton: { - borderRadius: 5, +const FBLoginButton = styled(Button).attrs({ + buttonStyle: { + backgroundColor: 'transparent', height: 45, - marginTop: 10, - backgroundColor: colors.lightBlue + marginTop: 10 }, - signUp: { - textAlign: 'center' + titleStyle: { + color: colors.lightBlue } -}); +})``; const KeyboardAvoidingViewStyled = styled(({ ...rest }) => ( @@ -57,6 +45,14 @@ const KeyboardAvoidingViewStyled = styled(({ ...rest }) => ( width: ${Platform.OS == 'web' ? '100%' : '75%'}; `; +const LoginButton = styled(Button).attrs({ + buttonStyle: { + borderRadius: 5, + height: 45, + marginTop: 10 + } +})``; + const LoginFormView = styled.View` flex: 1; height: 2000px; @@ -71,7 +67,11 @@ const LogoText = styled.Text` text-align: center; `; -const SignUpText = styled( +const SignUpText = styled.Text` + text-align: center; +`; + +const SignUpTextNav = styled( ({ navigation, ...rest }: SignUpButtonProps): JSX.Element => { const router = useRouter(); return ( @@ -93,29 +93,32 @@ const SignUpText = styled( color: ${colors.lightBlue}; `; +const StyledErrorText = styled.Text` + color: red; + font-size: 12px; + margin-left: 16px; +`; + const TextLoginInputField = styled( ({ touched, error, ...rest - }: TextInputProps & TouchedProps & ErrorProps): JSX.Element => { - const passwordInput = useRef(null); - - return ( - <> - - {touched && error ? ( - {error} - ) : null} - - ); - } + }: TextInputProps & TouchedProps & ErrorProps): JSX.Element => ( + <> + + {touched && error ? ( + <> + {error} + + ) : null} + + ) )` font-size: 14px; border-radius: 5px; @@ -232,8 +235,8 @@ const Login: FC = ({ navigation }): JSX.Element => ( touched={touched.password} value={values.password} /> -