Skip to content

Commit ea160f5

Browse files
authored
Merge pull request #12 from yowiputra/master
merging with yohan's master
2 parents 33d5bf2 + 313e0f8 commit ea160f5

24 files changed

+1434
-139
lines changed

client/actions/userDataActions.jsx

+9
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,13 @@ export function currentUserDataRequest() {
88
return res.data;
99
});
1010
}
11+
}
12+
13+
export function userUpdateProfile(userProfileData) {
14+
return dispatch => {
15+
return axios.post('/api/profileupdate', userProfileData).then(res => {
16+
console.log('outcoming data' + res.data);
17+
return res.data;
18+
});
19+
}
1120
}

client/package-lock.json

+161
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,16 @@
2020
"material-ui": "^0.19.0",
2121
"node-sass": "^4.5.3",
2222
"prop-types": "^15.5.10",
23+
"rc-slider": "^8.3.1",
2324
"react": "^15.6.1",
2425
"react-bootstrap": "^0.31.2",
2526
"react-dom": "^15.6.1",
27+
"react-popup": "^0.8.0",
28+
"react-popupbox": "^2.0.1",
2629
"react-redux": "^5.0.6",
2730
"react-router": "^4.1.2",
2831
"react-router-dom": "^4.1.2",
2932
"react-swipe-card": "^0.1.4",
30-
"react-popupbox":"^2.0.1",
3133
"react-tap-event-plugin": "^2.0.1",
3234
"redux": "^3.7.2",
3335
"redux-devtools-extension": "^2.13.2",

client/src/App.jsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import LoginPage from './LoginPage.jsx';
88
import ProfilePage from './ProfilePage.jsx';
99
import MatchmakerPage from './MainApp/MatchmakerPage.jsx';
1010
import { connect } from 'react-redux';
11+
import ProfileForm from './ProfileForm.jsx';
1112

1213
class App extends Component {
1314
constructor(props) {
@@ -28,12 +29,12 @@ class App extends Component {
2829
<Route path="/login" component={LoginPage} />
2930
<Route path="/profile" component={ProfilePage} />
3031
<Route path="/matchmaker" render={() => ( isAuthenticated ? <MatchmakerPage/> : <Redirect to="/"/> )} />
32+
<Route path="/profileupdate" component={ProfileForm} />
3133
</div>
3234
);
3335
}
3436
}
3537

36-
3738
function mapStateToProps(state) {
3839
return {
3940
auth: state.auth

client/src/MainApp/MatchmakerEvent.jsx

+18-16
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,31 @@
11
import React, { Component } from 'react';
22
import Cards, { Card } from 'react-swipe-card';
3-
import PopupChat from './PopupChat.jsx';
43

54
class MatchmakerEvent extends Component {
65
render () {
76
// data will be an array of objects(most probably JSON), which each objects will contain the information from a user: username, text description, avatar, etc
87
// Each card should have an output for showing username, avatar, text description, and a button to send an invite
9-
const data = ['Match #1', 'Match #2', 'Match #3', 'Match #4', 'Match #5', 'Match #6']
8+
const data = this.props.compatUsers
9+
console.log(data)
1010
return (
1111
<div>
12-
<PopupChat />
1312
<Cards onEnd={() => console.log('end')} className='master-root'>
14-
{data.map(item =>
15-
//make card and card border bigger
16-
//make sure it's mobile responsive
17-
<Card
18-
onSwipeLeft={() => console.log('swipe left')}
19-
onSwipeRight={() => console.log('swipe right')}>
20-
<h2>{item}</h2>
21-
<img className="avatar" src="" alt="avatar image"/>
22-
<p>Username</p>
23-
<p className="card-text-description">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas vitae risus risus.</p>
24-
<button className="btn-poke">Poke!</button>
25-
</Card>
26-
)}
13+
{
14+
data.map(item =>
15+
//make card and card border bigger
16+
//make sure it's mobile responsive
17+
<Card
18+
onSwipeLeft={() => console.log('reject ' + item.username)}
19+
onSwipeRight={() => {
20+
console.log('accept ' + item.username);
21+
this.props.inviteUserB(item);
22+
}}>
23+
<h2>{item.username}</h2>
24+
<img className="avatar" src={item.imageurl} alt="avatar image"/>
25+
<p className="card-text-description">{item.tagline}</p>
26+
<p className="card-text-description">{item.blurb}</p>
27+
</Card>
28+
)}
2729
</Cards>
2830
</div>
2931
)

0 commit comments

Comments
 (0)