Work item delete working
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import React from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import { TextInput, Text, View } from 'react-native'
|
||||
import autobind from 'autobind-decorator'
|
||||
import React from "react"
|
||||
import PropTypes from "prop-types"
|
||||
import { TextInput, Text, View } from "react-native"
|
||||
import autobind from "autobind-decorator"
|
||||
|
||||
export class BoundInput extends React.Component {
|
||||
static propTypes = {
|
||||
@@ -37,9 +37,7 @@ export class BoundInput extends React.Component {
|
||||
const { binder, name } = this.props
|
||||
const state = binder.getFieldState(name)
|
||||
|
||||
if (!state.readOnly && !state.disabled) {
|
||||
this.setState(binder.updateFieldValue(name, newText))
|
||||
}
|
||||
this.setState(binder.updateFieldValue(name, newText))
|
||||
}
|
||||
|
||||
render() {
|
||||
@@ -51,14 +49,16 @@ export class BoundInput extends React.Component {
|
||||
}
|
||||
|
||||
return (
|
||||
<View style={{ width: '100%' }}>
|
||||
<Text style={{ color: 'black', fontSize: 14, marginBottom: 5 }}>{label}</Text>
|
||||
<View style={{ width: "100%" }}>
|
||||
<Text style={{ color: "black", fontSize: 14, marginBottom: 5 }}>
|
||||
{label}
|
||||
</Text>
|
||||
<TextInput
|
||||
style={{
|
||||
width: '100%',
|
||||
width: "100%",
|
||||
paddingLeft: 5,
|
||||
paddingRight: 5,
|
||||
borderColor: 'gray',
|
||||
borderColor: "gray",
|
||||
borderWidth: 1,
|
||||
fontSize: 16,
|
||||
paddingTop: 7,
|
||||
@@ -67,17 +67,21 @@ export class BoundInput extends React.Component {
|
||||
multiline={lines > 1}
|
||||
numberOfLines={lines}
|
||||
editable={!disabled}
|
||||
autoCapitalize='none'
|
||||
underlineColorAndroid='white'
|
||||
autoCapitalize="none"
|
||||
underlineColorAndroid="white"
|
||||
value={value}
|
||||
secureTextEntry={password}
|
||||
onChangeText={this.handleChangeText}
|
||||
placeholder={placeholder} />
|
||||
<Text style={{
|
||||
fontSize: 12,
|
||||
display: valid ? 'none' : 'flex',
|
||||
color: 'red',
|
||||
}}>{message}</Text>
|
||||
placeholder={placeholder}
|
||||
/>
|
||||
<Text
|
||||
style={{
|
||||
fontSize: 12,
|
||||
display: valid ? "none" : "flex",
|
||||
color: "red",
|
||||
}}>
|
||||
{message}
|
||||
</Text>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ export class BoundOptionStrip extends React.Component {
|
||||
options: PropTypes.arrayOf(
|
||||
PropTypes.shape({ value: PropTypes.string, text: PropTypes.string })
|
||||
).isRequired,
|
||||
message: PropTypes.string,
|
||||
}
|
||||
|
||||
constructor(props) {
|
||||
@@ -31,8 +32,8 @@ export class BoundOptionStrip extends React.Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
const { name, label, options } = this.props
|
||||
const { visible, disabled, value } = this.state
|
||||
const { name, label, options, message } = this.props
|
||||
const { visible, disabled, value, valid } = this.state
|
||||
|
||||
return (
|
||||
<View
|
||||
@@ -49,6 +50,14 @@ export class BoundOptionStrip extends React.Component {
|
||||
options={options}
|
||||
onValueChanged={this.handleValueChanged}
|
||||
/>
|
||||
<Text
|
||||
style={{
|
||||
fontSize: 12,
|
||||
display: valid ? "none" : "flex",
|
||||
color: "red",
|
||||
}}>
|
||||
{message}
|
||||
</Text>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user