From 3de92b9f77d1d9197818f123a80c602cf12cd538 Mon Sep 17 00:00:00 2001 From: mashazyu Date: Mon, 23 Mar 2020 15:51:23 +0100 Subject: [PATCH] Moves unique styles of AppTextInput to local file and does some cleanup --- components/common/app-text-input.js | 16 ++++++---------- styles/containers.js | 6 ------ 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/components/common/app-text-input.js b/components/common/app-text-input.js index 79bcee9..389490e 100644 --- a/components/common/app-text-input.js +++ b/components/common/app-text-input.js @@ -2,24 +2,22 @@ import React from 'react' import PropTypes from 'prop-types' import { StyleSheet, TextInput } from 'react-native' -import { Containers } from '../../styles/redesign' +import { Colors } from '../../styles/redesign' const AppTextInput = ({ autoFocus, onChangeText, placeholder, value, - style, ...props }) => { - if (!Array.isArray(style)) style = [style] return ( @@ -30,17 +28,15 @@ AppTextInput.propTypes = { autoFocus: PropTypes.bool, onChangeText: PropTypes.func, placeholder: PropTypes.string, - style: PropTypes.oneOfType([PropTypes.array, PropTypes.object]), value: PropTypes.string, } -AppTextInput.defaultProps = { - style: [] -} - const styles = StyleSheet.create({ input: { - ...Containers.greyBorder + borderColor: Colors.grey, + borderRadius: 5, + borderStyle: 'solid', + borderWidth: 1, } }) diff --git a/styles/containers.js b/styles/containers.js index 32a2404..1d96f0e 100644 --- a/styles/containers.js +++ b/styles/containers.js @@ -6,12 +6,6 @@ export default { flex: 1, justifyContent: 'center' }, - greyBorder: { - borderColor: Colors.grey, - borderRadius: 5, - borderStyle: 'solid', - borderWidth: 1, - }, page: { backgroundColor: Colors.tourquiseLight, flex: 1