From 95e160e64dc6a5763fdbdc7d7e5b814302446ba9 Mon Sep 17 00:00:00 2001 From: Justin Shillingford Date: Mon, 13 Jul 2020 13:17:40 -0400 Subject: [TMA-95] Verification Page UI (#15) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Removed header from view * Setup basic layout of Verification page Also created new SubmitButton component * Some light code cleanup * Implemented SubmitButton component on Login * Added basic verification field * Styled Verification CodeField * Quick typo fix * Some lint cleaning * Removed header from view * Setup basic layout of Verification page Also created new SubmitButton component * Some light code cleanup * Implemented SubmitButton component on Login * Added basic verification field * Styled Verification CodeField * Quick typo fix * Some lint cleaning * Verification isn't that exciting lol * Removed header from view * Setup basic layout of Verification page Also created new SubmitButton component * Some light code cleanup * Implemented SubmitButton component on Login * Added basic verification field * Styled Verification CodeField * Quick typo fix * Some lint cleaning * Light lint cleaning * Still not that exciting lol * Removed misplaced accessibility labels * Added documentation to SubmitButton component * Implemented KeyboardAvoidingView * Fixed wizard position consistency * Updated Verification CodeField to take 6 digits * Removed marginVertical prop from SubmitButton * Updated text to represent 6 digit code 🤦🏽‍♂️ * Made Background use centered prop Also found another 4 that needed to be a 6 🤦🏽‍♂️ --- src/components/onboarding/Background.tsx | 4 +-- src/components/onboarding/SubmitButton.tsx | 50 ++++++++++++++++++++++++++++++ src/components/onboarding/index.ts | 1 + 3 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 src/components/onboarding/SubmitButton.tsx (limited to 'src/components') diff --git a/src/components/onboarding/Background.tsx b/src/components/onboarding/Background.tsx index 85675b0d..054eeff6 100644 --- a/src/components/onboarding/Background.tsx +++ b/src/components/onboarding/Background.tsx @@ -5,7 +5,7 @@ import { TouchableWithoutFeedback, Keyboard, ViewProps, - View, + SafeAreaView, } from 'react-native'; import {CenteredView} from '../common'; @@ -24,7 +24,7 @@ const Background: React.FC = (props) => { {props.centered ? ( {props.children} ) : ( - {props.children} + {props.children} )} diff --git a/src/components/onboarding/SubmitButton.tsx b/src/components/onboarding/SubmitButton.tsx new file mode 100644 index 00000000..f946d390 --- /dev/null +++ b/src/components/onboarding/SubmitButton.tsx @@ -0,0 +1,50 @@ +import React from 'react'; +import { + TouchableOpacity, + TouchableOpacityProps, + Text, + StyleSheet, + View, +} from 'react-native'; + +interface SubmitButtonProps extends TouchableOpacityProps { + text: string; + color: string; +} + +/* + * A button component that creates a TouchableOpacity in the style of our onboarding buttons. It takes in props to define the text in the TouchableOpacity as well as the background color. +*/ +const SubmitButton: React.FC = ( + props: SubmitButtonProps, +) => { + return ( + + + {props.text} + + + ); +}; + +const styles = StyleSheet.create({ + button: { + width: 144, + height: 36, + justifyContent: 'center', + alignItems: 'center', + borderRadius: 18, + }, + text: { + fontSize: 16, + color: '#78a0ef', + fontWeight: 'bold', + }, +}); + +export default SubmitButton; diff --git a/src/components/onboarding/index.ts b/src/components/onboarding/index.ts index 01255c01..ef972194 100644 --- a/src/components/onboarding/index.ts +++ b/src/components/onboarding/index.ts @@ -2,3 +2,4 @@ export {default as ArrowButton} from './ArrowButton'; export {default as Background} from './Background'; export {default as RegistrationWizard} from './RegistrationWizard'; export {default as TermsConditions} from './TermsConditions'; +export {default as SubmitButton} from './SubmitButton'; -- cgit v1.2.3-70-g09d2