Fix bugs when adding activity
This commit is contained in:
@@ -34,10 +34,10 @@ export class BoundInput extends React.Component {
|
||||
|
||||
@autobind
|
||||
handleChangeText(newText) {
|
||||
const { binder, name } = this.props
|
||||
|
||||
if (binder) {
|
||||
this.setState(binder.updateFieldValue(name, newText))
|
||||
if (this.props.binder) {
|
||||
this.setState(
|
||||
this.props.binder.updateFieldValue(this.props.name, newText)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
46
mobile/src/ui/FormStaticInput.js
Normal file
46
mobile/src/ui/FormStaticInput.js
Normal file
@@ -0,0 +1,46 @@
|
||||
import React from "react"
|
||||
import PropTypes from "prop-types"
|
||||
import { TextInput, Text, View, Platform } from "react-native"
|
||||
import autobind from "autobind-decorator"
|
||||
|
||||
export class FormStaticInput extends React.Component {
|
||||
static propTypes = {
|
||||
label: PropTypes.string,
|
||||
value: PropTypes.string,
|
||||
}
|
||||
|
||||
render() {
|
||||
const { label, value } = this.props
|
||||
|
||||
return (
|
||||
<View style={{ width: "100%" }}>
|
||||
<Text
|
||||
style={{
|
||||
color: "black",
|
||||
fontSize: 14,
|
||||
marginBottom: 5,
|
||||
}}>
|
||||
{label}
|
||||
</Text>
|
||||
<TextInput
|
||||
style={{
|
||||
width: "100%",
|
||||
paddingLeft: 5,
|
||||
paddingRight: 5,
|
||||
borderColor: "gray",
|
||||
borderWidth: 1,
|
||||
fontSize: 16,
|
||||
paddingTop: 7,
|
||||
paddingBottom: Platform.OS === "ios" ? 7 : 0,
|
||||
textAlignVertical: "top",
|
||||
marginBottom: 5,
|
||||
}}
|
||||
editable={false}
|
||||
autoCapitalize="none"
|
||||
underlineColorAndroid="white"
|
||||
value={value}
|
||||
/>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ export { Header } from "./Header"
|
||||
export { OptionStrip } from "./OptionStrip"
|
||||
export { BoundSwitch } from "./BoundSwitch"
|
||||
export { BoundInput } from "./BoundInput"
|
||||
export { FormStaticInput } from "./FormStaticInput"
|
||||
export { BoundButton } from "./BoundButton"
|
||||
export { BoundOptionStrip } from "./BoundOptionStrip"
|
||||
export { BoundHeader } from "./BoundHeader"
|
||||
|
||||
Reference in New Issue
Block a user