app/components/UI/ActionView/index.js
/**
 * PureComponent that renders scrollable content above configurable buttons
 */
PureComponent that renders scrollable content above configurable buttons
PureComponent that renders scrollable content above configurable buttons
function ActionView({
	cancelTestID,
	confirmTestID,
	cancelText,
	children,
	confirmText,
	confirmButtonMode,
	onCancelPress,
	onConfirmPress,
	onTouchablePress,
	showCancelButton,
	showConfirmButton,
	confirmed,
	confirmDisabled,
	keyboardShouldPersistTaps = 'never'
}) {
	return (
		<View style={baseStyles.flexGrow}>
			<KeyboardAwareScrollView
				style={baseStyles.flexGrow}
				resetScrollToCoords={{ x: 0, y: 0 }}
				keyboardShouldPersistTaps={keyboardShouldPersistTaps}
			>
				<TouchableWithoutFeedback
					style={baseStyles.flexGrow}
					onPress={() => {
						if (keyboardShouldPersistTaps === 'handled') {
							Keyboard.dismiss();
						}
						onTouchablePress && onTouchablePress();
					}}
				>
					{children}
				</TouchableWithoutFeedback>
			</KeyboardAwareScrollView>
			<View style={styles.actionContainer}>
				{showCancelButton && (
					<StyledButton
						testID={cancelTestID}
						type={confirmButtonMode === 'sign' ? 'signingCancel' : 'cancel'}
						onPress={onCancelPress}
						containerStyle={[styles.button, styles.cancel]}
						disabled={confirmed}
					>
						{cancelText}
					</StyledButton>
				)}
				{showConfirmButton && (
					<StyledButton
						testID={confirmTestID}
						type={confirmButtonMode}
						onPress={onConfirmPress}
						containerStyle={[styles.button, styles.confirm]}
						disabled={confirmed || confirmDisabled}
					>
						{confirmed ? <ActivityIndicator size="small" color="white" /> : confirmText}
					</StyledButton>
				)}
			</View>
		</View>
	);
}
function ActionView ( { cancelTestID , confirmTestID , cancelText , children , confirmText , confirmButtonMode , onCancelPress , onConfirmPress , onTouchablePress , showCancelButton , showConfirmButton , confirmed , confirmDisabled , keyboardShouldPersistTaps = 'never' } ) { return ( < View style = { baseStyles . flexGrow } > < KeyboardAwareScrollView style = { baseStyles . flexGrow } resetScrollToCoords = { { x : 0 , y : 0 } } keyboardShouldPersistTaps = { keyboardShouldPersistTaps } > < TouchableWithoutFeedback style = { baseStyles . flexGrow } onPress = { ( ) => { if ( keyboardShouldPersistTaps === 'handled' ) { Keyboard . dismiss ( ) ; } onTouchablePress && onTouchablePress ( ) ; } } > { children } < / TouchableWithoutFeedback > < / KeyboardAwareScrollView > < View style = { styles . actionContainer } > { showCancelButton && ( < StyledButton testID = { cancelTestID } type = { confirmButtonMode === 'sign' ? 'signingCancel' : 'cancel' } onPress = { onCancelPress } containerStyle = { [ styles . button , styles . cancel ] } disabled = { confirmed } > { cancelText } < / StyledButton > ) } { showConfirmButton && ( < StyledButton testID = { confirmTestID } type = { confirmButtonMode } onPress = { onConfirmPress } containerStyle = { [ styles . button , styles . confirm ] } disabled = { confirmed || confirmDisabled } > { confirmed ? < ActivityIndicator size = "small" color = "white" / > : confirmText } < / StyledButton > ) } < / View > < / View > ) ; }
PureComponent that renders scrollable content above configurable buttons
PureComponent that renders scrollable content above configurable buttons
// eslint-disable-next-line react/jsx-no-bind