diff --git a/frontend/src/components/pages/IndividualPage/index.js b/frontend/src/components/pages/IndividualPage/index.js index 165881e..f59f899 100644 --- a/frontend/src/components/pages/IndividualPage/index.js +++ b/frontend/src/components/pages/IndividualPage/index.js @@ -1,9 +1,14 @@ import React from 'react' import PropTypes from 'prop-types' import { Link } from 'react-router-dom' -import { Button, Header, List, Block } from 'components' +import { Button, Header, List, Block, ListItem } from 'components' const IndividualPage = ({ sendlist, getlist, roomurl, nickname }) => ( + + sendlist = [{to:"1", label:"123"}], + roomurl = "cenkuwj", + nickname = "1", +
@@ -13,7 +18,7 @@ const IndividualPage = ({ sendlist, getlist, roomurl, nickname }) => ( { sendlist && sendlist.map( ({ to, label }, idx) => ( - + ) ) } @@ -22,11 +27,12 @@ const IndividualPage = ({ sendlist, getlist, roomurl, nickname }) => (

받을 돈

+ { getlist && getlist.map( ({ to, label }, idx) => ( - + ) ) } diff --git a/frontend/src/components/pages/MainPage/index.js b/frontend/src/components/pages/MainPage/index.js index ba95adb..96631c2 100644 --- a/frontend/src/components/pages/MainPage/index.js +++ b/frontend/src/components/pages/MainPage/index.js @@ -5,7 +5,7 @@ import { Link } from 'react-router-dom' * import할 때 복잡하게 상대참조 할 필요 없이 'components', 'containers'만 지정해주면 된다. * ???Form 계열, ???Page 계열은 redux 로직이 필요하므로 'components'가 아닌 'containers'에서 import 한다. */ -import { Block } from 'components' +import { Block, Header } from 'components' import { LoginForm } from 'containers' /** @@ -17,8 +17,8 @@ import { LoginForm } from 'containers' const MainPage = (props) => { return (
+
-

Dutch Broomstick

diff --git a/frontend/src/containers/AccountPage.js b/frontend/src/containers/AccountPage.js index ecf857b..1bbc594 100644 --- a/frontend/src/containers/AccountPage.js +++ b/frontend/src/containers/AccountPage.js @@ -3,30 +3,38 @@ import { connect } from 'react-redux' import { AccountPage } from 'components' import { Redirect } from 'react-router-dom' -const AccountPageContainer = (props) => { +class AccountPageContainer extends React.Component { + + componentDidMount(){ + const { roomname, toname, member, money, account, onAccoutPage } = this.props + onAccoutPage(toname) + } + render(){ + /* - if( !props.roomname ){ - return( - - ) - } - else if( !props.toname ){ - return( - - ) - } - else { + if( !props.roomname ){ + return( + + ) + } + else if( !props.toname ){ + return( + + ) + } + else { + return ( + + ) + } + */ return ( - + ) - } - */ - return ( - - ) + } } @@ -35,9 +43,14 @@ const mapStateToProps = (state) => ({ roomname : state.room.room.roomname, toname : state.payment.senddata.to, + member: state.member.members, money : state.payment.senddata.label, account : state.payment.account, }) -export default connect(mapStateToProps)(AccountPageContainer) \ No newline at end of file +const mapDispatchToProps = dispatch => ({ + onAccoutPage: (toname,member) => dispatch(accountinRequest(toname,member)), +}) + +export default connect(mapStateToProps,mapDispatchToProps)(AccountPageContainer) \ No newline at end of file diff --git a/frontend/src/containers/IndividualPage.js b/frontend/src/containers/IndividualPage.js index 989c761..5501dbf 100644 --- a/frontend/src/containers/IndividualPage.js +++ b/frontend/src/containers/IndividualPage.js @@ -5,6 +5,7 @@ import { Redirect } from 'react-router-dom' const IndividualPageContainer = (props) => { + /* if( !props.roomname ){ return( @@ -20,6 +21,10 @@ const IndividualPageContainer = (props) => { ) } + */ + return ( + + ) } @@ -33,4 +38,8 @@ const mapStateToProps = (state) => ({ roomurl : state.room.room.url }) -export default connect(mapStateToProps)(IndividualPageContainer) \ No newline at end of file +const mapDispatchToProps = dispatch => ({ + +}) + +export default connect(mapStateToProps,mapDispatchToProps)(IndividualPageContainer) \ No newline at end of file diff --git a/frontend/src/containers/RoomPage.js b/frontend/src/containers/RoomPage.js index ad0f7c7..89fbffb 100644 --- a/frontend/src/containers/RoomPage.js +++ b/frontend/src/containers/RoomPage.js @@ -17,7 +17,7 @@ class RoomPageContainer extends React.Component { const { room, member } = this.props if (member) { - return + return } if (room) { diff --git a/frontend/src/store/payment/actions.js b/frontend/src/store/payment/actions.js index 7565b75..c651dce 100644 --- a/frontend/src/store/payment/actions.js +++ b/frontend/src/store/payment/actions.js @@ -11,3 +11,11 @@ export const paymentCreateRequest = (room, payment) => ({ export const paymentCreateSuccess = (room, payment) => ({ }) + +export const ACCOUNT_IN_REQUEST = "ACCOUNT_IN_REQUEST" + +export const accountinRequest = ( toname, member ) => ({ + type : ACCOUNT_IN_REQUEST, + toname, + member, +}) \ No newline at end of file diff --git a/frontend/src/store/payment/reducer.js b/frontend/src/store/payment/reducer.js index 44de6f7..827c0dc 100644 --- a/frontend/src/store/payment/reducer.js +++ b/frontend/src/store/payment/reducer.js @@ -1,6 +1,6 @@ import { } from 'store/actions' -import { } from './actions'; +import { ACCOUNT_IN_REQUEST } from './actions'; const initialState = { //after simplify, if room -> individual, update a member's send or get datas @@ -15,6 +15,15 @@ import { } from './actions'; const paymentReducer = (state = initialState, action) => { switch(action.type) { + case ACCOUNT_IN_REQUEST: + const edge = getlist.find(m => action.toname == m.to) + const acc = action.member.find(m => edge.to == m.membername) + return { + ...state, + senddata: edge, + accounts: acc.account, + } + default: return state }