From e1665a67400cbaebb6ac7d4bdaa6250680ff3133 Mon Sep 17 00:00:00 2001 From: Daniel Adepoju Date: Wed, 22 Apr 2020 23:27:42 +0100 Subject: [PATCH 1/4] register page and fixed rendering of error message on input --- src/assets/style.js | 7 + src/assets/svgs/AppSvg.js | 71 ++++++++ src/components/FloatingLabelInput.js | 122 ++++++------- src/navigators/AuthNavigator.js | 2 + src/screens/Auth/Intro.js | 34 ++-- src/screens/Auth/Login.js | 222 +++++++++++++++--------- src/screens/Auth/Register.js | 250 +++++++++++++++++++++++++++ 7 files changed, 556 insertions(+), 152 deletions(-) create mode 100644 src/assets/svgs/AppSvg.js create mode 100644 src/screens/Auth/Register.js diff --git a/src/assets/style.js b/src/assets/style.js index 21035dd..b404eaf 100644 --- a/src/assets/style.js +++ b/src/assets/style.js @@ -130,4 +130,11 @@ export const loginScreenStyles = { textAlign: 'center', marginBottom: scale(10), }, + bottomText: { + fontFamily: fonts.regularText.fontFamily, + fontSize: scale(fonts.h5.fontSize - 1), + color: colors.abuttoDark, + textAlign: 'center', + marginBottom: scale(10), + }, }; diff --git a/src/assets/svgs/AppSvg.js b/src/assets/svgs/AppSvg.js new file mode 100644 index 0000000..aee2903 --- /dev/null +++ b/src/assets/svgs/AppSvg.js @@ -0,0 +1,71 @@ +import React from 'react'; +import {Svg, Rect, Path, G} from 'react-native-svg'; +import {scale} from '../style'; + + +export const MenuSVG = ({color}) => ( + + + + + +); + +export const RightChevronSVG = ({color, size = 1}) => ( + + + + + +); + +export const LeftChevronSVG = ({color, size = 1}) => ( + + + + + +); diff --git a/src/components/FloatingLabelInput.js b/src/components/FloatingLabelInput.js index 553c8ed..4d2b60a 100644 --- a/src/components/FloatingLabelInput.js +++ b/src/components/FloatingLabelInput.js @@ -59,69 +59,73 @@ const FloatingLabelInput = forwardRef((props, ref) => { }; return ( - - {label} - + - {icon ? ( - props.secureTextEntry ? ( - { - setState((prevState) => ({ - secureTextInput: !prevState.secureTextInput, - })); - }}> - + height: scale(48), + borderRadius: scale(5), + borderWidth: 2, + borderColor: props.error + ? colors.abuttoError + : state.isFocused + ? colors.abuttoBlue + : colors.abuttoGrey, + }}> + {label} + + {icon ? ( + props.secureTextEntry ? ( + { + setState((prevState) => ({ + secureTextInput: !prevState.secureTextInput, + })); + }}> + + + + + ) : ( + - - ) : ( - - - - ) - ) : null} - + ) + ) : null} + + {props.error} diff --git a/src/navigators/AuthNavigator.js b/src/navigators/AuthNavigator.js index 9f5029d..45a67ce 100644 --- a/src/navigators/AuthNavigator.js +++ b/src/navigators/AuthNavigator.js @@ -2,6 +2,7 @@ import React from 'react'; import {createStackNavigator} from '@react-navigation/stack'; import Login from '../screens/Auth/Login'; import Intro from '../screens/Auth/Intro'; +import Register from '../screens/Auth/Register'; const AuthStack = createStackNavigator(); @@ -14,6 +15,7 @@ export default function AuthNavigator() { }}> + ); } diff --git a/src/screens/Auth/Intro.js b/src/screens/Auth/Intro.js index 6177de9..f9d811b 100644 --- a/src/screens/Auth/Intro.js +++ b/src/screens/Auth/Intro.js @@ -50,31 +50,37 @@ export default function Intro(props) { alignItems: 'center', paddingTop: scaleVertical(10), }}> -