diff --git a/client/app/containers/RegisterPage/actions.js b/client/app/containers/RegisterPage/actions.js index 88dbda7..44f0c36 100644 --- a/client/app/containers/RegisterPage/actions.js +++ b/client/app/containers/RegisterPage/actions.js @@ -4,10 +4,49 @@ * */ -import { DEFAULT_ACTION } from './constants'; +import Actions, { DEFAULT_ACTION } from './constants'; export function defaultAction() { return { type: DEFAULT_ACTION, }; } + +export function register() { + return { + type: Actions.REGISTER.REQUEST, + }; +} + +export function registerSucceed() { + return { + type: Actions.REGISTER.SUCCEED, + }; +} + +export function registerFailed() { + return { + type: Actions.REGISTER.FAILED, + }; +} + +export function inputEmailChanged({ email }) { + return { + type: Actions.INPUT.EMAIL_CHANGED, + email, + }; +} + +export function inputPasswordChanged({ password }) { + return { + type: Actions.INPUT.PASSWORD_CHANGED, + password, + }; +} + +export function inputPasswordConfChanged({ passwordConf }) { + return { + type: Actions.INPUT.PASSWORD_CONF_CHANGED, + passwordConf, + }; +} diff --git a/client/app/containers/RegisterPage/constants.js b/client/app/containers/RegisterPage/constants.js index f43555f..1efaca4 100644 --- a/client/app/containers/RegisterPage/constants.js +++ b/client/app/containers/RegisterPage/constants.js @@ -5,3 +5,16 @@ */ export const DEFAULT_ACTION = 'app/RegisterPage/DEFAULT_ACTION'; + +export default { + REGISTER: { + REQUEST: 'app/RegisterPage/REGISTER_REQUEST', + SUCCEED: 'app/RegisterPage/REGISTER_SUCCEED', + FAILED: 'app/RegisterPage/REGISTER_FAILED', + }, + INPUT: { + EMAIL_CHANGED: 'app/RegisterPage/INPUT_EMAIL_CHANGED', + PASSWORD_CHANGED: 'app/RegisterPage/INPUT_PASSWORD_CHANGED', + PASSWORD_CONF_CHANGED: 'app/RegisterPage/INPUT_PASSWORD_CONF_CHANGED', + }, +}; diff --git a/client/app/containers/RegisterPage/index.js b/client/app/containers/RegisterPage/index.js index 2794b55..d597276 100644 --- a/client/app/containers/RegisterPage/index.js +++ b/client/app/containers/RegisterPage/index.js @@ -19,17 +19,32 @@ import Typography from '@material-ui/core/Typography'; import { useInjectSaga } from 'utils/injectSaga'; import { useInjectReducer } from 'utils/injectReducer'; -import makeSelectRegisterPage from './selectors'; +import makeSelectRegisterPage, { + makeSelectEmail, + makeSelectPassword, + makeSelectPasswordConf, +} from './selectors'; +import { + register, + inputEmailChanged, + inputPasswordChanged, + inputPasswordConfChanged, +} from './actions'; import reducer from './reducer'; import saga from './saga'; import messages from './messages'; -import { Wrapper, Card, FormRow, TextField } from './styled'; +import { Wrapper, Card, CardHeader, FormRow, TextField } from './styled'; -export function RegisterPage() { +export function RegisterPage({ dispatch, register }) { useInjectReducer({ key: 'registerPage', reducer }); useInjectSaga({ key: 'registerPage', saga }); + const formSubmit = e => { + e.preventDefault(); + register(); + }; + return (
@@ -38,26 +53,54 @@ export function RegisterPage() { -
+ + + Currency Rate + + + - + + dispatch(inputEmailChanged({ email: e.target.value })) + } + /> - + + dispatch( + inputPasswordChanged({ password: e.target.value }), + ) + } + /> - + + dispatch( + inputPasswordConfChanged({ + passwordConf: e.target.value, + }), + ) + } + /> -