From 6f9a7c92e27bd3efee536fcccdbb4040f9d78ea8 Mon Sep 17 00:00:00 2001 From: Matheus Oliveira Date: Tue, 22 May 2018 17:43:02 -0300 Subject: [PATCH] #166 - MINOR: Styles enhancements; Minor Fixes --- __tests__/screens/RegisterScreen.test.js | 14 ++--- src/Styles/RegisterStyles.js | 66 +++++++++++++++++++++++ src/screens/RegisterScreen.js | 68 +----------------------- 3 files changed, 75 insertions(+), 73 deletions(-) create mode 100644 src/Styles/RegisterStyles.js diff --git a/__tests__/screens/RegisterScreen.test.js b/__tests__/screens/RegisterScreen.test.js index 352cb82..0e3d67d 100644 --- a/__tests__/screens/RegisterScreen.test.js +++ b/__tests__/screens/RegisterScreen.test.js @@ -2,16 +2,16 @@ import React from 'react'; import Enzyme, { shallow } from 'enzyme'; import Adapter from 'enzyme-adapter-react-16'; import configureStore from 'redux-mock-store'; -import { TouchableOpacity, TextInput, ActivityIndicator, Picker } from 'react-native'; +import { TouchableOpacity, /* TextInput, */ ActivityIndicator, Picker } from 'react-native'; // imported as a connected component! import RegisterScreenContainer from '../../src/Containers/RegisterScreenContainer'; import RegisterScreen from '../../src/screens/RegisterScreen'; -import CpfField from '../../src/components/CpfField'; -import NameField from '../../src/components/NameField'; -import GenericField from '../../src/components/GenericField'; -import EmailField from '../../src/components/EmailField'; -import PasswordField from '../../src/components/PasswordField'; -import PhoneField from '../../src/components/PhoneField'; +// import CpfField from '../../src/components/CpfField'; +// import NameField from '../../src/components/NameField'; +// import GenericField from '../../src/components/GenericField'; +// import EmailField from '../../src/components/EmailField'; +// import PasswordField from '../../src/components/PasswordField'; +// import PhoneField from '../../src/components/PhoneField'; import DropdownComponent from '../../src/components/DropdownComponent'; import ButtonWithActivityIndicator from '../../src/components/ButtonWithActivityIndicator'; diff --git a/src/Styles/RegisterStyles.js b/src/Styles/RegisterStyles.js new file mode 100644 index 0000000..d9a719e --- /dev/null +++ b/src/Styles/RegisterStyles.js @@ -0,0 +1,66 @@ +import { StyleSheet } from 'react-native'; + +const styles = StyleSheet.create({ + principal: { + flex: 1, + backgroundColor: 'white', + }, + + content: { + flex: 6, + marginTop: 8, + }, + + footer: { + flex: 0.5, + borderTopColor: '#a9a9a9', + borderTopWidth: 1, + justifyContent: 'center', + alignItems: 'center', + }, + + icon: { + marginRight: 6, + }, + + InputFieldStyle: { + padding: 8, + marginTop: 1, + backgroundColor: '#FAFAFA', + flexDirection: 'row', + justifyContent: 'flex-start', + alignItems: 'center', + borderRadius: 7, + marginBottom: 10, + borderWidth: 1, + borderColor: 'gray', + }, + + InputFieldDropdown: { + marginTop: 1, + borderColor: 'gray', + borderWidth: 1, + borderRadius: 7, + marginBottom: 10, + }, + + InputStyle: { + flex: 1, + }, + + buttonContainer: { + paddingVertical: 14, + marginVertical: 20, + borderRadius: 8, + borderWidth: 1, + alignItems: 'center', + backgroundColor: '#FF9500', + }, + + buttonText: { + color: 'white', + fontSize: 18, + }, +}); + +export default styles; diff --git a/src/screens/RegisterScreen.js b/src/screens/RegisterScreen.js index a8c83ec..cbed15e 100644 --- a/src/screens/RegisterScreen.js +++ b/src/screens/RegisterScreen.js @@ -2,7 +2,6 @@ import React from 'react'; import PropTypes from 'prop-types'; import { Text, - StyleSheet, ScrollView, View, TouchableOpacity, @@ -34,75 +33,12 @@ import DropdownComponent from '../components/DropdownComponent'; import MunicipalDistrict from '../components/MunicipalDistrict'; import ButtonWithActivityIndicator from '../components/ButtonWithActivityIndicator'; import { backHandlerPop } from '../NavigationFunctions'; + +import styles from '../Styles/RegisterStyles'; import regex from '../../src/RegexList'; const FILE_NAME = 'RegisterScreen.js'; -const styles = StyleSheet.create({ - - principal: { - flex: 1, - backgroundColor: 'white', - }, - - content: { - flex: 6, - marginTop: 8, - }, - - footer: { - flex: 0.5, - borderTopColor: '#a9a9a9', - borderTopWidth: 1, - justifyContent: 'center', - alignItems: 'center', - }, - - icon: { - marginRight: 6, - }, - - InputFieldStyle: { - padding: 8, - marginTop: 1, - backgroundColor: '#FAFAFA', - flexDirection: 'row', - justifyContent: 'flex-start', - alignItems: 'center', - borderRadius: 7, - marginBottom: 10, - borderWidth: 1, - borderColor: 'gray', - }, - - InputFieldDropdown: { - marginTop: 1, - borderColor: 'gray', - borderWidth: 1, - borderRadius: 7, - marginBottom: 10, - }, - - InputStyle: { - flex: 1, - }, - - buttonContainer: { - paddingVertical: 14, - marginVertical: 20, - borderRadius: 8, - borderWidth: 1, - alignItems: 'center', - backgroundColor: '#FF9500', - }, - - buttonText: { - color: 'white', - fontSize: 18, - }, - -}); - const UfInitials = (CAE_UF) => { if (CAE_UF !== '') { return CAE_UF.substr(0, 2);