Clicking on activity working

This commit is contained in:
John Lyon-Smith
2018-04-14 16:12:33 -07:00
parent 56db130612
commit 5c7b3fd1c2
2 changed files with 139 additions and 43 deletions

View File

@@ -84,8 +84,8 @@ export class Home extends React.Component {
}
@autobind
handleItemSelect(item, index) {
this.props.history.push("/activity")
handleItemSelect(item) {
this.props.history.push(`/activity?id=${item._id}`)
}
@autobind
@@ -207,12 +207,24 @@ export class Home extends React.Component {
<View
key={workItem._id}
style={{
flexDirection: "column",
justifyContent: "center",
flexDirection: "row",
justifyContent: "flex-start",
alignItems: "center",
backgroundColor: "#F4F4F4",
paddingLeft: 8,
height: 45,
}}>
<Icon
name={
workItem.workItemType === "order"
? "hardhat"
: workItem.workItemType === "complaint"
? "question"
: "clipboard"
}
size={16}
style={{ marginRight: 10 }}
/>
<Text style={{ fontSize: 16 }}>
{workItemTypeText[workItem.workItemType].toUpperCase()}{" "}
{pad(workItem.ticketNumber, 4)}
@@ -230,7 +242,7 @@ export class Home extends React.Component {
backgroundColor: "white",
}}
underlayColor="#EEEEEE"
onPress={() => this.handleItemSelect(activity, index)}>
onPress={() => this.handleItemSelect(activity)}>
<View
style={{
height: "100%",