From 40921c6af54b515f3ec9ad7e5c9c9e956500add4 Mon Sep 17 00:00:00 2001 From: enggar_ganteng Date: Fri, 1 Feb 2019 17:49:27 +0700 Subject: [PATCH] pages --- src/common/pages/RegisterNew/styles.js | 3 +- src/common/pages/ResendEmail/index.js | 145 +++++++++++++++++++++++++ src/common/routes.js | 3 + 3 files changed, 149 insertions(+), 2 deletions(-) create mode 100644 src/common/pages/ResendEmail/index.js diff --git a/src/common/pages/RegisterNew/styles.js b/src/common/pages/RegisterNew/styles.js index 7f6ce1b..496d937 100644 --- a/src/common/pages/RegisterNew/styles.js +++ b/src/common/pages/RegisterNew/styles.js @@ -3,10 +3,9 @@ export const styles = theme => ({ container : { flex :1, flexGrow : 1, - height : '100%', + height : "100vh", backgroundColor:'#024f8e', marginTop: '-56px', - paddingBottom:50 }, gridContainer : { flex :1, diff --git a/src/common/pages/ResendEmail/index.js b/src/common/pages/ResendEmail/index.js new file mode 100644 index 0000000..bc7404d --- /dev/null +++ b/src/common/pages/ResendEmail/index.js @@ -0,0 +1,145 @@ +import React from 'react'; +import withStyles from "@material-ui/core/styles/withStyles"; +import { styles } from '../RegisterNew/styles'; +import Grid from '@material-ui/core/Grid'; +import Paper from '@material-ui/core/Paper'; +import Typography from '@material-ui/core/Typography'; +import TextField from '@material-ui/core/TextField'; +import Visibility from '@material-ui/icons/Visibility'; +import VisibilityOff from '@material-ui/icons/VisibilityOff'; +import Button from '@material-ui/core/Button'; +import Hidden from '@material-ui/core/Hidden'; +import InputAdornment from '@material-ui/core/InputAdornment'; +import IconButton from '@material-ui/core/IconButton'; +import CircularProgress from '@material-ui/core/CircularProgress'; +import Snackbar from '@material-ui/core/Snackbar'; + +import { Link } from 'react-router-dom' +import { inject, observer } from "mobx-react"; +import schema from 'async-validator' +import { startCase } from 'lodash'; +import { Upload, Icon, message } from 'antd'; + +import AutoComplete from './../../components/AutoComplete'; +import {appConfig} from "../../config/app"; +import {LINKS} from "../../routes"; + +// const province = require("./../../../../assets/data/province.json"); +// const city = require("./../../../../assets/data/city.json"); +// const district = require("./../../../../assets/data/district.json"); +// const subdistrict = require("./../../../../assets/data/subdistrict.json"); + +@inject('appstate') +@observer +class ResendEmail extends React.Component { + state = { + showPassword: false, + showConfirmPassword: false, + openDialog: false, + isLoading: false, + + // form + email: "", + }; + + constructor(props) { + super(props); + this.authStore = props.appstate.auth; + this.http = props.appstate.http; + } + + componentDidMount() { + + } + + handleChange = name => event => { + this.setState({ + [name]: event.target.value, + }); + }; + + send = () => { + + this.setState({ isLoading: true }); + + let data = { + email: this.state.email, + }; + this.authStore.resendEmail(data).then(res => { + //message.success("Please check your email to confirm your account");this.props.history.push(LINKS.LOGIN); + setTimeout(() => { + this.setState({ isLoading: false }); + this.props.history.push(LINKS.REGISTER_COMPLETED); + // this.props.history.push(LINKS.LOGIN); + }, 250); + }).catch(err => { + this.setState({ isLoading: false }); + + if (err.type === 'BodyValidationError') { + message.error(err.detail[0].message); + } else { + message.error(err.message); + } + }); + }; + + render() { + const { classes } = this.props; + + return ( +
+ + + + + + + + + + + + Tukarkan point! + + + Dapatkan promo dan keuntungan dengan BTN + + + + + + + Kirim Ulang Email + + + + + +
+ +
+
+
+
+
+
+
+ ) + } +} + +export default withStyles(styles)(ResendEmail); diff --git a/src/common/routes.js b/src/common/routes.js index 5bdb793..fae80aa 100644 --- a/src/common/routes.js +++ b/src/common/routes.js @@ -12,6 +12,7 @@ import InviteConfirmationLoginComponent from './pages/InviteConfirmationLogin/in import AcceptInvite from "./pages/AcceptInvite/index"; import OtpPage from "./pages/Otp"; import RegisterCompletedComponent from "./pages/RegisterCompleted"; +import ResendEmail from "./pages/ResendEmail"; import ConfirmationCompletedComponent from "./pages/ConfirmationCompleted"; export const LINKS = { @@ -80,6 +81,7 @@ export const LINKS = { ORDER_DETAIL_AIRLINES: '/app/order_detail_airline/:id', ORDER_DETAIL_AIRLINES_WO_ID: '/app/order_detail_airline', REGISTER: '/register', + RESEND_EMAIL: '/resend_email', REGISTER_COMPLETED: '/register_completed', CONFIRMATION_COMPLETED: '/confirmation_completed', LOGIN: '/login', @@ -163,6 +165,7 @@ export default class Routes extends React.Component { pathname: this.authStore.isLoggedIn ? LINKS.REGISTER : LINKS.REGISTER }}/>)}/> +