Fix bugs when adding activity

This commit is contained in:
John Lyon-Smith
2018-04-27 18:10:39 -07:00
parent 93f3d462b2
commit 53a4df55a2
8 changed files with 138 additions and 79 deletions

View File

@@ -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)
)
}
}

View 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>
)
}
}

View File

@@ -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"