Merge branch 'fix/bottom-padding-after-input-field' into 'master'
Fix/bottom padding after input field Closes #493 See merge request bloodyhealth/drip!350
This commit is contained in:
@@ -4,11 +4,14 @@ import PropTypes from 'prop-types'
|
||||
|
||||
import { Colors, Spacing, Typography } from '../../styles'
|
||||
|
||||
const AppTextInput = ({ style, ...props }) => {
|
||||
const AppTextInput = ({ style, isKeyboardOffset, ...props }) => {
|
||||
const behavior = isKeyboardOffset ? "padding" : "height"
|
||||
const keyboardVerticalOffset = isKeyboardOffset ? 300 : 0
|
||||
|
||||
return (
|
||||
<KeyboardAvoidingView
|
||||
behavior="padding"
|
||||
keyboardVerticalOffset={300}
|
||||
behavior={behavior}
|
||||
keyboardVerticalOffset={keyboardVerticalOffset}
|
||||
>
|
||||
<TextInput style={[styles.input, style]} {...props} />
|
||||
</KeyboardAvoidingView>
|
||||
@@ -16,7 +19,12 @@ const AppTextInput = ({ style, ...props }) => {
|
||||
}
|
||||
|
||||
AppTextInput.propTypes = {
|
||||
style: PropTypes.object
|
||||
style: PropTypes.object,
|
||||
isKeyboardOffset: PropTypes.bool,
|
||||
}
|
||||
|
||||
AppTextInput.defultProps = {
|
||||
isKeyboardOffset: true,
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
|
||||
@@ -89,6 +89,7 @@ export default class PasswordPrompt extends Component {
|
||||
<Header isSideMenuEnabled={false} />
|
||||
<AppPage contentContainerStyle={styles.contentContainer}>
|
||||
<AppTextInput
|
||||
isKeyboardOffset={false}
|
||||
onChangeText={this.setPassword}
|
||||
secureTextEntry={true}
|
||||
placeholder={labels.enterPassword}
|
||||
|
||||
@@ -65,6 +65,7 @@ export default class EnterNewPassword extends Component {
|
||||
return (
|
||||
<React.Fragment>
|
||||
<AppTextInput
|
||||
isKeyboardOffset={false}
|
||||
onChangeText={this.handlePasswordInput}
|
||||
placeholder={labels.enterNew}
|
||||
textContentType="password"
|
||||
@@ -72,6 +73,7 @@ export default class EnterNewPassword extends Component {
|
||||
secureTextEntry={true}
|
||||
/>
|
||||
<AppTextInput
|
||||
isKeyboardOffset={false}
|
||||
onChangeText={this.handleConfirmationInput}
|
||||
placeholder={labels.confirmPassword}
|
||||
textContentType="password"
|
||||
|
||||
Reference in New Issue
Block a user