Skip to content

Commit

Permalink
AccountPage bug
Browse files Browse the repository at this point in the history
  • Loading branch information
y123ob committed Jun 19, 2019
1 parent 7526acb commit b5eaaf7
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 31 deletions.
59 changes: 36 additions & 23 deletions frontend/src/components/pages/AccountPage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,44 @@ import { Link } from 'react-router-dom'
import { Button, Header, List, Block } from 'components'
import { CopyToClipboard } from 'react-copy-to-clipboard';

const AccountPage = ({ toname, money, account }) => (
//toname = '정유석',
//money = '10000',
//account = '국민 353901-01-142611',

<div>
<Header />
<Block>
<h3>To.{toname}</h3>
<h3>{money}</h3>
<h4>{account}</h4>
</Block>
const AccountPage = ({ match, roomname, sendlist, members }) => {
const to = match.params.to
const toname = to
console.log(toname)
console.log(sendlist)
const edge = sendlist.find(m=> m.to == toname)
console.log(edge)
const member = members.find(m=> m.membername == toname)
console.log(member)
const money = edge.label
const account = member.account
console.log(account)
return (
//toname = '정유석',
//money = '10000',
//account = '국민 353901-01-142611',

<div>
<Header />
<Block>
<h3>To.{toname}</h3>
<h3>{money}</h3>
<h4>{account}</h4>
</Block>

<CopyToClipboard
text={`${account} ${toname}`}
onCopy={() => { }}>
<span>
<Button>
Copy Account!
</Button>
</span>
</CopyToClipboard>
<CopyToClipboard
text={`${account} ${toname}`}
onCopy={() => { }}>
<span>
<Button>
Copy Account!
</Button>
</span>
</CopyToClipboard>

</div>
)
</div>
)
}


export default AccountPage
21 changes: 13 additions & 8 deletions frontend/src/containers/AccountPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ import { connect } from 'react-redux'
import { AccountPage } from 'components'
import { Redirect } from 'react-router-dom'


class AccountPageContainer extends React.Component {

/*
componentDidMount(){
const { roomname, toname, member, money, account, onAccoutPage } = this.props
onAccoutPage(toname)
onAccoutPage(toname,member)
}

*/
render(){

/*
Expand All @@ -31,7 +33,7 @@ class AccountPageContainer extends React.Component {
}
*/
return (
<AccountPage {...props} />
<AccountPage {...this.props} />
)

}
Expand All @@ -41,16 +43,19 @@ class AccountPageContainer extends React.Component {
const mapStateToProps = (state) => ({

roomname : state.room.room.roomname,
sendlist: state.payment.sendlist,
members : state.member.members

toname : state.payment.senddata.to,
member: state.member.members,
money : state.payment.senddata.label,
account : state.payment.account,
//toname : state.payment.senddata.to,
//member: state.member.members,

//money : state.payment.senddata.label,
//account : state.payment.account,

})

const mapDispatchToProps = dispatch => ({
onAccoutPage: (toname,member) => dispatch(accountinRequest(toname,member)),
//onAccoutPage: (toname,member) => dispatch(accountinRequest(toname,member)),
})

export default connect(mapStateToProps,mapDispatchToProps)(AccountPageContainer)

0 comments on commit b5eaaf7

Please sign in to comment.