diff --git a/components/Button.tsx b/components/Button.tsx index 02ceaf7bb..cab99da5f 100644 --- a/components/Button.tsx +++ b/components/Button.tsx @@ -1,6 +1,7 @@ import * as React from 'react'; import { Button as ElementsButton } from 'react-native-elements'; import { themeColor } from './../utils/ThemeUtils'; +import { StyleProp, ViewStyle } from 'react-native'; interface ButtonProps { title: string; @@ -15,7 +16,7 @@ interface ButtonProps { iconOnly?: boolean; adaptiveWidth?: boolean; containerStyle?: any; - buttonStyle?: any; + buttonStyle?: StyleProp; noUppercase?: boolean; disabled?: boolean; } diff --git a/components/Header.tsx b/components/Header.tsx index 94700230e..14aa3f995 100644 --- a/components/Header.tsx +++ b/components/Header.tsx @@ -1,12 +1,13 @@ import React from 'react'; import { Header, Icon } from 'react-native-elements'; import { themeColor } from '../utils/ThemeUtils'; +import { StyleProp, ViewStyle } from 'react-native'; interface HeaderProps { leftComponent?: 'Back' | 'Close' | JSX.Element; centerComponent?: JSX.Element; rightComponent?: JSX.Element; - containerStyle?: any; + containerStyle?: StyleProp; placement?: 'left' | 'center' | 'right' | undefined; navigation?: any; onBack?: () => void; diff --git a/components/TextInput.tsx b/components/TextInput.tsx index a29c258ff..59e2f15bd 100644 --- a/components/TextInput.tsx +++ b/components/TextInput.tsx @@ -1,10 +1,13 @@ import * as React from 'react'; import { + StyleProp, StyleSheet, Text, TextInput as TextInputRN, + TextStyle, TouchableOpacity, - View + View, + ViewStyle } from 'react-native'; import { themeColor } from './../utils/ThemeUtils'; @@ -13,7 +16,8 @@ interface TextInputProps { value?: string; onChangeText?: any; numberOfLines?: number; - style?: any; + style?: StyleProp; + textInputStyle?: StyleProp; placeholderTextColor?: string; locked?: boolean; keyboardType?: string; @@ -36,6 +40,7 @@ export default function TextInput(props: TextInputProps) { onChangeText, numberOfLines, style, + textInputStyle, placeholderTextColor, locked, keyboardType, @@ -96,7 +101,11 @@ export default function TextInput(props: TextInputProps) { value={value} onChangeText={onChangeText} numberOfLines={numberOfLines || 1} - style={{ ...styles.input, color: themeColor('text') }} + style={{ + ...textInputStyle, + ...styles.input, + color: themeColor('text') + }} placeholderTextColor={ placeholderTextColor || themeColor('secondaryText') } diff --git a/views/AddNotes.tsx b/views/AddNotes.tsx index 4632f5ecc..356692b8d 100644 --- a/views/AddNotes.tsx +++ b/views/AddNotes.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { Keyboard, View, TextInput } from 'react-native'; +import { Keyboard, View } from 'react-native'; import EncryptedStorage from 'react-native-encrypted-storage'; import { inject, observer } from 'mobx-react'; @@ -11,6 +11,7 @@ import { localeString } from '../utils/LocaleUtils'; import { themeColor } from '../utils/ThemeUtils'; import NotesStore from '../stores/NotesStore'; +import TextInput from '../components/TextInput'; interface AddNotesProps { navigation: any; @@ -69,21 +70,30 @@ export default class AddNotes extends React.Component< const { notes } = this.state; return ( -
- + > +
{ this.setState({ notes: text }); @@ -96,28 +106,51 @@ export default class AddNotes extends React.Component< }} multiline numberOfLines={0} - style={{ fontSize: 20, color: themeColor('text') }} + style={{ + padding: 20, + flexGrow: 1, + flexShrink: 1 + }} + textInputStyle={{ + height: '100%', + textAlignVertical: 'top', + marginTop: -13 + }} value={notes} placeholder={localeString('views.Payment.writeNote')} onSubmitEditing={() => Keyboard.dismiss()} /> + +