diff --git a/assets/images/login/error.png b/assets/images/login/error.png new file mode 100644 index 0000000..b2c8eca Binary files /dev/null and b/assets/images/login/error.png differ diff --git a/assets/images/login/logo_new.png b/assets/images/login/logo_new.png new file mode 100644 index 0000000..95f2c08 Binary files /dev/null and b/assets/images/login/logo_new.png differ diff --git a/assets/images/login/register_image.png b/assets/images/login/register_image.png new file mode 100644 index 0000000..9694275 Binary files /dev/null and b/assets/images/login/register_image.png differ diff --git a/assets/images/login/register_image_2.png b/assets/images/login/register_image_2.png new file mode 100644 index 0000000..a4c75f9 Binary files /dev/null and b/assets/images/login/register_image_2.png differ diff --git a/assets/images/login/success_new.gif b/assets/images/login/success_new.gif new file mode 100644 index 0000000..3660cba Binary files /dev/null and b/assets/images/login/success_new.gif differ diff --git a/package-lock.json b/package-lock.json index c50e7f7..160ffa5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5731,10 +5731,6 @@ "resolved": "https://registry.npmjs.org/expect.js/-/expect.js-0.2.0.tgz", "integrity": "sha1-EChTPSwcNj90pnlv9X7AUg3tK+E=" }, - "exploder": { - "version": "git://github.com/cezary/exploder.git#721e1a2f777ff5dafe853981ca21b8874aae1fb0", - "from": "git://github.com/cezary/exploder.git" - }, "express": { "version": "4.16.4", "resolved": "https://registry.npmjs.org/express/-/express-4.16.4.tgz", @@ -6418,11 +6414,13 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true + "bundled": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -6435,15 +6433,18 @@ }, "code-point-at": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "concat-map": { "version": "0.0.1", - "bundled": true + "bundled": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -6546,7 +6547,8 @@ }, "inherits": { "version": "2.0.3", - "bundled": true + "bundled": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -6556,6 +6558,7 @@ "is-fullwidth-code-point": { "version": "1.0.0", "bundled": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -6568,17 +6571,20 @@ "minimatch": { "version": "3.0.4", "bundled": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", - "bundled": true + "bundled": true, + "optional": true }, "minipass": { "version": "2.2.4", "bundled": true, + "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -6595,6 +6601,7 @@ "mkdirp": { "version": "0.5.1", "bundled": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -6667,7 +6674,8 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true + "bundled": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -6677,6 +6685,7 @@ "once": { "version": "1.4.0", "bundled": true, + "optional": true, "requires": { "wrappy": "1" } @@ -6782,6 +6791,7 @@ "string-width": { "version": "1.0.2", "bundled": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -14052,8 +14062,11 @@ "version": "0.1.0", "resolved": "https://registry.npmjs.org/react-gif/-/react-gif-0.1.0.tgz", "integrity": "sha1-/A21vUnTHdRRnIVRAp+zXTtk04E=", - "requires": { - "exploder": "git://github.com/cezary/exploder.git#721e1a2f777ff5dafe853981ca21b8874aae1fb0" + "dependencies": { + "exploder": { + "version": "git://github.com/cezary/exploder.git#721e1a2f777ff5dafe853981ca21b8874aae1fb0", + "from": "git://github.com/cezary/exploder.git#721e1a2f777ff5dafe853981ca21b8874aae1fb0" + } } }, "react-google-charts": { diff --git a/package.json b/package.json index bcb3ac8..de64247 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,8 @@ "dependencies": { "@firebase/app": "^0.3.4", "@material-ui/core": "^3.9.1", + "@material-ui/icons": "^3.0.2", + "@material-ui/styles": "^3.0.0-alpha.2", "@mdi/font": "^2.3.54", "antd": "^3.9.3", "async-validator": "^1.8.2", diff --git a/src/common/components/Alert/AlertSuccess.js b/src/common/components/Alert/AlertSuccess.js new file mode 100644 index 0000000..bfe2cb4 --- /dev/null +++ b/src/common/components/Alert/AlertSuccess.js @@ -0,0 +1,109 @@ +import React from 'react'; +import withStyles from "@material-ui/core/styles/withStyles"; +import Button from '@material-ui/core/Button'; +import Dialog from '@material-ui/core/Dialog'; +import DialogActions from '@material-ui/core/DialogActions'; +import DialogContent from '@material-ui/core/DialogContent'; +import DialogContentText from '@material-ui/core/DialogContentText'; +import DialogTitle from '@material-ui/core/DialogTitle'; +import Zoom from '@material-ui/core/Zoom'; +import Typography from "@material-ui/core/Typography/Typography"; +import {inject, observer} from "mobx-react"; +import withMobileDialog from '@material-ui/core/withMobileDialog'; + +function Transition(props) { + return ; +} + +@inject('store') +@observer +class AlertSuccess extends React.Component{ + // state = { + // open: this.props.open, + // callback : this.props.onClose + // }; + + constructor(props){ + super(props); + this.global_ui = props.store.global_ui; + } + + // componentDidUpdate(prevProps){ + // if (this.props.open !== prevProps.open) { + // this.setState({open : this.props.open}); + // } + // } + + handleClose = () => { + this.global_ui.closeAlert(); + }; + + onActionClick = async ()=>{ + if(typeof this.global_ui.successAlertCB === 'function') { + let cbResult = this.global_ui.successAlertCB(); + if(cbResult && cbResult.then && typeof cbResult.then === 'function'){ + await cbResult + } + } + this.global_ui.closeAlert() + }; + + renderIcon = (type)=>{ + if(type === 'success'){ + return + } + else { + return ( + + ) + } + }; + + render() { + let actions = this.props.actions.length ? this.props.actions : []; + const { fullScreen } = this.props; + return ( + + + { + this.renderIcon(this.global_ui.alertDialog.type) + } + + + {this.global_ui.alertDialog.title} + + + {this.global_ui.alertDialog.subtitle} + + + + { + actions.map(it=>it) + } + + + ); + } +} + +AlertSuccess.defaultProps = { + open : false, + title : 'Alert', + subtitle : '', + onClose : ()=>{}, + actions : [], + type : 'error' +}; + +export default withMobileDialog()(AlertSuccess); \ No newline at end of file diff --git a/src/common/pages/App/index.js b/src/common/pages/App/index.js index 31fedb0..e526dda 100644 --- a/src/common/pages/App/index.js +++ b/src/common/pages/App/index.js @@ -47,6 +47,7 @@ import { Route as RouteDOM } from 'react-router-dom' import WalletComponent from "./WalletComponent"; import {APP_TYPE} from "../../config/app"; + faker.locale = 'id_ID'; @inject("appstate") @observer @@ -71,7 +72,7 @@ export default class App extends React.Component { .location .pathname .split('/') - .map(path => startcase(path)) + .map(path => startcase(path)), }; this.defaultState = Object.assign({}, this.state); this.user = props.appstate.user; @@ -363,6 +364,7 @@ export default class App extends React.Component { + @@ -403,44 +405,40 @@ export default class App extends React.Component { } className={(this.state.selectedMenu === '/app/dashboard') ? "menuAkunItem active" : 'menuAkunItem'}>Home - } className={(this.state.selectedMenu === '/app/flight') ? "menuAkunItem active" : 'menuAkunItem'}>Flight } className={(this.state.selectedMenu === '/app/hotel') ? "menuAkunItem active" : 'menuAkunItem'}>Hotel } className={(this.state.selectedMenu === '/app/car') ? "menuAkunItem active" : 'menuAkunItem'}>Car } className={(this.state.selectedMenu === '/app/shop') ? "menuAkunItem active" : 'menuAkunItem'}>Shop + className="menuAkun">Shop */} - } + .bind(this, '/app/vouchers')} + to={LINKS.VOUCHERS} + >Vouchers + className="menuAkun">Vouchers */} {/* + {/* this.setModalTopup(true)}> + Add Voucher + + */} + + + + ) : ''} + + {this.props.appstate.wallet.data.wallet ? ( +
+ +

Profile

+
Please complete your profile
+ +
+
+ ) : ''} - return( -
-
- -
- + + {this.props.appstate.wallet.data.wallet ? ( +
+ +

Credit Card

+
Please add your credit card
+ +
+
+ ) : ''} +
-
- -
-
- -
-
- -
-
- -
- +
-
- - + + + +
+
+
-
-
-

- Popular Items + +

+
+ +
+
+ +
+
+ +
+
+ +
+ +
+ +
+ + +
+
+
+

+ Popular Items

- - - + + + +
-
- - -
-
-
-

- New Products + + +
+
+
+

+ New Products

- - - + + + +
-

- - -
-
-
-

- Voucher & Gift Card + + +
+
+
+

+ Voucher & Gift Card

- - {data.map((item, index) => { - return ( this.setState({isOpened: true, data: item})} key={index} span={6}> - - ) - })} - + + { + ( this.vouchersStore.list.length > 0) ? + this.vouchersStore.list.map((item, index) => { + return ( this.setState({isOpened: true, data: item})} key={index} span={6}> + + ) + }) + : ( + + ) + } + - {/* this.setState({isOpened: false})}*/} - {/*onCancel={() => this.setState({isOpened: false})}*/} - {/*/>*/} + this.setState({isOpened: false})} + onCancel={() => this.setState({isOpened: false})} + /> +
-

+ - {/* - xs=12 sm=6 - - - xs=12 sm=6 - - - xs=3 sm=3 - - - xs=3 sm=3 - - - xs=3 sm=3 - - - xs=3 sm=3 - */} - +
+ this.setModalTopup(false)} onCancel={() => this.setModalTopup(false)} isVisible={this.state.modalTopup} />
); } diff --git a/src/common/pages/Dashboard/style.scss b/src/common/pages/Dashboard/style.scss index 6732ead..c117212 100644 --- a/src/common/pages/Dashboard/style.scss +++ b/src/common/pages/Dashboard/style.scss @@ -91,7 +91,7 @@ .value { - font-size: 1.8rem; + font-size: 1rem; letter-spacing: 1px; line-height: 1.2; display: inline-block; diff --git a/src/common/pages/Login/LoginBtn.js b/src/common/pages/Login/LoginBtn.js new file mode 100644 index 0000000..180a692 --- /dev/null +++ b/src/common/pages/Login/LoginBtn.js @@ -0,0 +1,110 @@ +import React from 'react'; +import withStyles from "@material-ui/core/styles/withStyles"; +import {styles} from '../Register/registerStyle'; +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 { Link } from 'react-router-dom' + +class BTNLoginPage extends React.Component{ + state = { + email : "", + password : "", + showPassword : false + }; + + handleChange = name => event => { + this.setState({ + [name]: event.target.value, + }); + }; + + viewPassword = ()=>{ + this.setState({ + showPassword : !this.state.showPassword + }) + }; + + render(){ + const { classes } = this.props; + return ( +
+ + + + + + + + + + + Welcome to BTN Points + + + Sign in to get various voucher and items + + + + + + + Login to BTN Point + + + Doesn't have an account? Register + + + {/*
*/} + + + {this.state.showPassword ? : } + + + ), + }} + /> +
+ +
+ + + + + +
+ ) + } +} + +export default withStyles(styles)(BTNLoginPage); \ No newline at end of file diff --git a/src/common/pages/Login/style.scss b/src/common/pages/Login/style.scss index dc1bc01..6e0b2a4 100644 --- a/src/common/pages/Login/style.scss +++ b/src/common/pages/Login/style.scss @@ -80,3 +80,4 @@ textarea:focus, input:focus{ outline: none; } + diff --git a/src/common/pages/Register/registerStyle.js b/src/common/pages/Register/registerStyle.js new file mode 100644 index 0000000..24f9058 --- /dev/null +++ b/src/common/pages/Register/registerStyle.js @@ -0,0 +1,36 @@ +import yellow from '@material-ui/core/colors/yellow'; +export const styles = theme => ({ + container : { + flex :1, + flexGrow : 1, + height : '100vh', + marginTop: "-56px !important", + background : '#024F8E' + }, + gridContainer : { + flex :1, + justifyContent:'center' + }, + registerContainer: { + marginTop : 50 + }, + formRegister : { + padding : 20, + display : 'flex', + flexDirection: 'column', + textAlign : 'center' + }, + registerPaper : { + flex :1, + flexDirection : 'row', + justifyContent:'center' + }, + logo : { + width : '200px' + }, + logoContainer : { + textAlign : 'center', + background : yellow['500'], + padding : 20 + } +}); \ No newline at end of file diff --git a/src/common/pages/Vouchers/index.js b/src/common/pages/Vouchers/index.js index c80b79b..57bc09e 100644 --- a/src/common/pages/Vouchers/index.js +++ b/src/common/pages/Vouchers/index.js @@ -28,12 +28,6 @@ export default class VouchersComponent extends React.Component { additional_data: { information:'' }, - // option: [ - // { - // value: '', - // cost: '' - // }, - // ], sku: [ { id:'', @@ -49,7 +43,6 @@ export default class VouchersComponent extends React.Component { componentDidMount() { this.vouchersStore.getList(); - console.log('res list component',this.vouchersStore.getList()) } render() { @@ -74,19 +67,6 @@ export default class VouchersComponent extends React.Component { ) } - - - {/* { - (data.length > 0) ? - data.map((item, index) => { - return ( this.setState({isOpened: true, data: item})} key={index} span={6}> - - ) - }) - : ( - - ) - } */} {this.state.isOpened && ( diff --git a/src/common/routes.js b/src/common/routes.js index dbd132b..1aa28d7 100644 --- a/src/common/routes.js +++ b/src/common/routes.js @@ -3,6 +3,7 @@ import {observer, inject} from 'mobx-react'; import {BrowserRouter as Router, Route, Switch, Redirect} from "react-router-dom"; import RegisterComponent from "./pages/RegisterNew"; import LoginComponent from "./pages/Login"; +import LoginBTNComponent from "./pages/Login/LoginBtn"; import ForgotPasswordComponent from "./pages/ForgotPassword"; import ChangePassword from './pages/ChangePassword'; import AppContainer from "./pages/App"; @@ -155,7 +156,7 @@ export default class Routes extends React.Component { pathname: this.authStore.isLoggedIn ? LINKS.DASHBOARD : LINKS.LOGIN }}/>)}/> - + diff --git a/src/common/stores/global_ui.js b/src/common/stores/global_ui.js index c833eb8..b1e3f86 100644 --- a/src/common/stores/global_ui.js +++ b/src/common/stores/global_ui.js @@ -149,4 +149,29 @@ export default class GlobalUI { this.globalAlert = ''; this[DIALOG.UI.ALERT] = false; } + + @observable successAlertCB = ()=>{ + this.closeAlert(); + }; + + @action + openAlert({title=false,subtitle=false,cb=false,type='error'}){ + if(typeof cb === 'function'){ + this.successAlertCB = cb; + } + this.alertDialog= { + title : title, + open : true, + subtitle : subtitle, + type : type + } + }; + + @action + closeAlert(){ + this.alertDialog.title = false; + this.alertDialog.open = false; + this.alertDialog.subtitle = false; + this.successAlertCB = ()=>this.closeAlert(); + } }