-
Notifications
You must be signed in to change notification settings - Fork 0
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
Styling/form labels #101
Styling/form labels #101
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import React, { Component } from "react"; | ||
import { StyleSheet, View, TextInput } from "react-native"; | ||
import { StyleSheet, View, TextInput, Text } from "react-native"; | ||
import { updateFlyEntry, clearFlyEntry } from "../actions"; | ||
import { connect } from "react-redux"; | ||
|
||
|
@@ -19,25 +19,28 @@ class FlyForm extends Component { | |
handleChange = (property, text) => { | ||
this.setState({ property: text }); | ||
this.props.updateFlyEntry(property, text); | ||
} | ||
}; | ||
|
||
render() { | ||
return ( | ||
<View style={styles.container}> | ||
<Text style={styles.label}>Fly Name:</Text> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for adding these labels for these input fields in the fly editing and adding page. This make things more understandable for the user when filling out fly information. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're welcome! Thanks for bringing this to the group's attention! |
||
<TextInput | ||
style={styles.input} | ||
placeholder="Enter Fly Name" | ||
value={this.props.currentFlyEntry.name} | ||
onChangeText={(text) => this.handleChange("name", text)} | ||
/> | ||
|
||
<Text style={styles.label}>Fly Color:</Text> | ||
<TextInput | ||
style={styles.input} | ||
placeholder="Enter Fly Color" | ||
value={this.props.currentFlyEntry.color} | ||
onChangeText={(text) => this.handleChange("color", text)} | ||
/> | ||
|
||
<Text style={styles.label}>Fly Size:</Text> | ||
<TextInput | ||
style={styles.input} | ||
placeholder="Enter Fly Size" | ||
|
@@ -46,13 +49,15 @@ class FlyForm extends Component { | |
onChangeText={(text) => this.handleChange("size", text)} | ||
/> | ||
|
||
<Text style={styles.label}>Type of Fly:</Text> | ||
<TextInput | ||
style={styles.input} | ||
placeholder="Enter Fly Category" | ||
placeholder="Enter Fly Type" | ||
value={this.props.currentFlyEntry.category} | ||
onChangeText={(text) => this.handleChange("category", text)} | ||
/> | ||
|
||
<Text style={styles.label}>Quantity:</Text> | ||
<TextInput | ||
style={styles.input} | ||
placeholder="Enter Fly Amount" | ||
|
@@ -70,7 +75,15 @@ const styles = StyleSheet.create({ | |
flex: 1, | ||
justifyContent: "center", | ||
alignItems: "center", | ||
paddingTop: 45, | ||
paddingTop: 10, | ||
marginVertical: "10%", | ||
}, | ||
|
||
label: { | ||
color: "#212326", | ||
fontSize: 14, | ||
fontWeight: "500", | ||
marginBottom: 5, | ||
}, | ||
|
||
input: { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A good call to move this to the ApiCalls. This make it the proper formatting for the fetch calls.