@@ -38,7 +38,7 @@ class TripSummary extends Component {

componentWillMount() {

// axiosRoutes.getTripData(this.props.tripId)
// axiosRoutes.getTripData(this.props.match.params.tripId)
// .then((res) => {
// if(res.body.userId === this.props.userId) {
// this.setState({
@@ -55,6 +55,17 @@ class TripSummary extends Component {
this.setState({
tripData: trip
})
console.log('Mounted trip id is ', this.props.match.params.tripId)
}


componentWillReceiveProps(nextProps) {
//get confirmed friends, all places, tripInfo
console.log('received props', nextProps.match.params.tripId)
}
componentDidMount() {
//update every 10 seconds
//get confirmed friends, all places, this.props.match.params.tripId
}

handleEditButtonClick() {
@@ -36,6 +36,9 @@ class UserHome extends Component {
// })
// .catch(err => console.log(err))
// }
goTo(route) {
this.props.history.replace(`/${route}`)
}

handleCreateTripButtonClick() {
this.setState({
@@ -57,7 +60,7 @@ class UserHome extends Component {
return (
<div style={{display: 'flex', flexDirection: 'row'}}>
<div style={{flexGrow: 5, flexShrink: 5}}>
<UserUpcomingTripsList />
<UserUpcomingTripsList redirect={this.goTo.bind(this)}/>
<UserPreviousTripsList />
</div>
<div style={{flexGrow: 1, flexShrink: 1}}>
@@ -4,7 +4,7 @@ const UserUpcomingTripEntry = ({upcomingTrip, handleEntryClick}) => {
return (
<tr>
<td onClick={() => (
handleEntryClick(upcomingTrip.title)
handleEntryClick(upcomingTrip.id)
)}>{upcomingTrip.title}</td>
</tr>
)
@@ -9,6 +9,7 @@ import Avatar from 'material-ui/Avatar';

const dummyTripData = [
{
id: 1,
profileImg: "https://a1-images.myspacecdn.com/images03/3/8aeccb762a84407ebac956949fb30659/300x300.jpg",
img: "http://cdn1.buuteeq.com/upload/18138/llama-at-the-machu-picchu-unesco-peru-andbeyond.jpg",
title: "Let's go to Peru!!",
@@ -17,7 +18,8 @@ const dummyTripData = [
startDate: "10/09/17",
endDate: "10/11/17"
},
{
{
id: 2,
profileImg: "http://bbsimg.ngfiles.com/1/20732000/ngbbs4b6e2d81cb802.jpg",
img: "https://static1.squarespace.com/static/54d29f9ee4b00906e82cc34a/t/5887e319e3df28abe39d7da7/1485300510967/shutterstock_225726403+%281%29.jpg?format=2500w",
title: "Next Stop Mexico",
@@ -27,6 +29,7 @@ const dummyTripData = [
endDate: "11/20/17"
},
{
id: 3,
profileImg: "https://i.ytimg.com/vi/2SzkZm7JP58/hqdefault.jpg",
img: "https://68.media.tumblr.com/124bf5e49c1a435ca69a2b1dbbd81fb2/tumblr_my36u1EXtI1rnuaico1_500.gif",
title: "California Love",
@@ -36,6 +39,7 @@ const dummyTripData = [
endDate: "11/11/15"
},
{
id: 4,
profileImg: "http://omgface.com/z/hard_work_1454965684.jpg",
img: "http://www.telegraph.co.uk/content/dam/Travel/leadAssets/28/00/wall4_2800060a-large.jpg",
title: "The Great Wall",
@@ -85,9 +89,10 @@ class UserUpcomingTripsList extends Component {
// })
// }

handleEntryClick(upcomingTrip) {
handleEntryClick(upcomingTripId) {
//add redirect to the upcoming trip info page
console.log('You will be redirected once our routers work', upcomingTrip)
this.props.redirect(`event/${upcomingTripId}`)

}

render() {
@@ -102,7 +107,7 @@ class UserUpcomingTripsList extends Component {
<Subheader style={{fontSize: 30 + "px", textAlign: "left"}}>Upcoming Trips</Subheader>
{dummyTripData.map((tile) => (
<GridTile
onClick={()=>console.log('Take me to ' + tile.title)}
onClick={()=> this.handleEntryClick(tile.id)}
style={{borderRadius: 5 + 'px'}}
key={tile.img}
title={tile.title}