Skip to content

Commit

Permalink
Clean up and refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
parasharrajat committed Mar 10, 2022
1 parent e70019e commit ec717fe
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
12 changes: 2 additions & 10 deletions src/components/TextInput/BaseTextInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ class BaseTextInput extends Component {
const hasLabel = Boolean(this.props.label.length);
const inputHelpText = this.props.errorText || this.props.hint;
const formHelpStyles = this.props.errorText ? styles.formError : styles.formHelp;
const placeholder = (this.props.prefixCharacter || this.state.isFocused || !hasLabel || (hasLabel && this.props.forceActiveLabel)) ? this.props.placeholder : null;
const textInputContainerStyles = _.reduce([
styles.textInputContainer,
...this.props.textInputContainerStyles,
Expand Down Expand Up @@ -251,16 +252,7 @@ class BaseTextInput extends Component {
// eslint-disable-next-line
{...inputProps}
defaultValue={this.state.value}
placeholder={
(
this.props.prefixCharacter
|| this.state.isFocused
|| !hasLabel
|| (hasLabel && this.props.forceActiveLabel)
)
? this.props.placeholder
: null
}
placeholder={placeholder}
placeholderTextColor={themeColors.placeholderText}
underlineColorAndroid="transparent"
style={[
Expand Down
1 change: 0 additions & 1 deletion src/components/TextInput/baseTextInputPropTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ const propTypes = {
prefixCharacter: PropTypes.string,

/** Form props */

/** Indicates that the input is being used with the Form component */
isFormInput: PropTypes.bool,

Expand Down
2 changes: 1 addition & 1 deletion src/stories/Composer.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ const parser = new ExpensiMark();
const Default = (args) => {
const [pastedFile, setPastedFile] = useState(null);
const [comment, setComment] = useState(args.defaultValue);
const renderedHTML = parser.replace(comment);
const [droppingFile, setDroppingFile] = useState(false);
const [isComposerDroppingTarget, setIsComposerDroppingTarget] = useState(false);
const renderedHTML = parser.replace(comment);

return (
<View>
Expand Down

0 comments on commit ec717fe

Please sign in to comment.