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'
|
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 (
|
return (
|
||||||
<KeyboardAvoidingView
|
<KeyboardAvoidingView
|
||||||
behavior="padding"
|
behavior={behavior}
|
||||||
keyboardVerticalOffset={300}
|
keyboardVerticalOffset={keyboardVerticalOffset}
|
||||||
>
|
>
|
||||||
<TextInput style={[styles.input, style]} {...props} />
|
<TextInput style={[styles.input, style]} {...props} />
|
||||||
</KeyboardAvoidingView>
|
</KeyboardAvoidingView>
|
||||||
@@ -16,7 +19,12 @@ const AppTextInput = ({ style, ...props }) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
AppTextInput.propTypes = {
|
AppTextInput.propTypes = {
|
||||||
style: PropTypes.object
|
style: PropTypes.object,
|
||||||
|
isKeyboardOffset: PropTypes.bool,
|
||||||
|
}
|
||||||
|
|
||||||
|
AppTextInput.defultProps = {
|
||||||
|
isKeyboardOffset: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
|
|||||||
@@ -89,6 +89,7 @@ export default class PasswordPrompt extends Component {
|
|||||||
<Header isSideMenuEnabled={false} />
|
<Header isSideMenuEnabled={false} />
|
||||||
<AppPage contentContainerStyle={styles.contentContainer}>
|
<AppPage contentContainerStyle={styles.contentContainer}>
|
||||||
<AppTextInput
|
<AppTextInput
|
||||||
|
isKeyboardOffset={false}
|
||||||
onChangeText={this.setPassword}
|
onChangeText={this.setPassword}
|
||||||
secureTextEntry={true}
|
secureTextEntry={true}
|
||||||
placeholder={labels.enterPassword}
|
placeholder={labels.enterPassword}
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ export default class EnterNewPassword extends Component {
|
|||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<AppTextInput
|
<AppTextInput
|
||||||
|
isKeyboardOffset={false}
|
||||||
onChangeText={this.handlePasswordInput}
|
onChangeText={this.handlePasswordInput}
|
||||||
placeholder={labels.enterNew}
|
placeholder={labels.enterNew}
|
||||||
textContentType="password"
|
textContentType="password"
|
||||||
@@ -72,6 +73,7 @@ export default class EnterNewPassword extends Component {
|
|||||||
secureTextEntry={true}
|
secureTextEntry={true}
|
||||||
/>
|
/>
|
||||||
<AppTextInput
|
<AppTextInput
|
||||||
|
isKeyboardOffset={false}
|
||||||
onChangeText={this.handleConfirmationInput}
|
onChangeText={this.handleConfirmationInput}
|
||||||
placeholder={labels.confirmPassword}
|
placeholder={labels.confirmPassword}
|
||||||
textContentType="password"
|
textContentType="password"
|
||||||
|
|||||||
Reference in New Issue
Block a user