Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🍒 Cherry pick PR #4741 to staging 🍒 #4791

Merged
merged 2 commits into from
Aug 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001008607
versionName "1.0.86-7"
versionCode 1001008608
versionName "1.0.86-8"
}
splits {
abi {
Expand Down
2 changes: 1 addition & 1 deletion ios/NewExpensify/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.0.86.7</string>
<string>1.0.86.8</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
Expand Down
2 changes: 1 addition & 1 deletion ios/NewExpensifyTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0.86.7</string>
<string>1.0.86.8</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "new.expensify",
"version": "1.0.86-7",
"version": "1.0.86-8",
"author": "Expensify, Inc.",
"homepage": "https://new.expensify.com",
"description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.",
Expand Down
85 changes: 46 additions & 39 deletions src/components/ExpensiTextInput/BaseExpensiTextInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
} from 'react-native';
import Str from 'expensify-common/lib/str';
import ExpensiTextInputLabel from './ExpensiTextInputLabel';
import Text from '../Text';
import {propTypes, defaultProps} from './propTypes';
import themeColors from '../../styles/themes/default';
import styles from '../../styles/styles';
Expand Down Expand Up @@ -112,6 +113,7 @@ class BaseExpensiTextInput extends Component {
label,
value,
placeholder,
errorText,
hasError,
containerStyles,
inputStyle,
Expand All @@ -123,46 +125,51 @@ class BaseExpensiTextInput extends Component {

const hasLabel = Boolean(label.length);
return (
<View style={[styles.componentHeightLarge, ...containerStyles]}>
<TouchableWithoutFeedback onPress={() => this.input.focus()} focusable={false}>
<View
style={[
styles.expensiTextInputContainer,
!hasLabel && styles.pv0,
this.state.isFocused && styles.borderColorFocus,
hasError && styles.borderColorDanger,
]}
>
{hasLabel ? (
<ExpensiTextInputLabel
label={label}
labelTranslateX={
ignoreLabelTranslateX
? new Animated.Value(0)
: this.state.labelTranslateX
}
labelTranslateY={this.state.labelTranslateY}
labelScale={this.state.labelScale}
<View>
<View style={[styles.componentHeightLarge, ...containerStyles]}>
<TouchableWithoutFeedback onPress={() => this.input.focus()} focusable={false}>
<View
style={[
styles.expensiTextInputContainer,
!hasLabel && styles.pv0,
this.state.isFocused && styles.borderColorFocus,
(hasError || errorText) && styles.borderColorDanger,
]}
>
{hasLabel ? (
<ExpensiTextInputLabel
label={label}
labelTranslateX={
ignoreLabelTranslateX
? new Animated.Value(0)
: this.state.labelTranslateX
}
labelTranslateY={this.state.labelTranslateY}
labelScale={this.state.labelScale}
/>
) : null}
<TextInput
ref={(ref) => {
if (typeof innerRef === 'function') { innerRef(ref); }
this.input = ref;
}}
// eslint-disable-next-line
{...inputProps}
value={value}
placeholder={(this.state.isFocused || !label) ? placeholder : null}
placeholderTextColor={themeColors.placeholderText}
underlineColorAndroid="transparent"
style={[...inputStyle, errorText ? styles.errorOutline : undefined]}
onFocus={this.onFocus}
onBlur={this.onBlur}
onChangeText={this.setValue}
/>
) : null}
<TextInput
ref={(ref) => {
if (typeof innerRef === 'function') { innerRef(ref); }
this.input = ref;
}}
// eslint-disable-next-line
{...inputProps}
value={value}
placeholder={(this.state.isFocused || !label) ? placeholder : null}
placeholderTextColor={themeColors.placeholderText}
underlineColorAndroid="transparent"
style={inputStyle}
onFocus={this.onFocus}
onBlur={this.onBlur}
onChangeText={this.setValue}
/>
</View>
</TouchableWithoutFeedback>
</View>
</TouchableWithoutFeedback>
</View>
{Boolean(errorText) && (
<Text style={[styles.formError, styles.mt1]}>{errorText}</Text>
)}
</View>
);
}
Expand Down
4 changes: 4 additions & 0 deletions src/components/ExpensiTextInput/propTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ const propTypes = {
/** Input value placeholder */
placeholder: PropTypes.string,

/** Error text to display */
errorText: PropTypes.string,

/** Should the input be styled for errors */
hasError: PropTypes.bool,

Expand All @@ -28,6 +31,7 @@ const propTypes = {

const defaultProps = {
label: '',
errorText: '',
placeholder: '',
error: false,
containerStyles: [],
Expand Down