diff --git a/src/common/config/app.js b/src/common/config/app.js index 3af42e4..0e08284 100644 --- a/src/common/config/app.js +++ b/src/common/config/app.js @@ -30,9 +30,11 @@ imageUrl = "https://giift-api.asacreative.com"; type = 'localhost'; if(window.location.href.includes("localhost") || window.location.href.includes("marketplace-store")){ // appUrl = 'http://localhost:7700'; - apiUrl = "http://localhost:4001/" + apiUrl = "https://giift-api.asacreative.com/"; + // apiUrl = "http://localhost:4001/" }else{ - appUrl = 'https://sillyfish.asacreative.com'; + // appUrl = 'https://sillyfish.asacreative.com'; + appUrl = 'https://giift-api.asacreative.com'; } export const APP_TYPE = 'btn'; diff --git a/src/common/pages/App/WalletComponent.js b/src/common/pages/App/WalletComponent.js index 9140b1d..a6fc731 100644 --- a/src/common/pages/App/WalletComponent.js +++ b/src/common/pages/App/WalletComponent.js @@ -19,7 +19,7 @@ export default class WalletComponent extends React.Component {

Voucher

(

history.push(LINKS.WALLET)} className={'textVoucher'}> - +

)} /> @@ -27,7 +27,7 @@ export default class WalletComponent extends React.Component {

Points

(

history.push(LINKS.WALLET)} className={'textPoints'}> - +

)} /> diff --git a/src/common/pages/App/index.js b/src/common/pages/App/index.js index 0de5898..1b32474 100644 --- a/src/common/pages/App/index.js +++ b/src/common/pages/App/index.js @@ -9,21 +9,30 @@ import { LINKS } from "../../routes"; import startcase from "lodash.startcase"; import Route from "./routes"; import moment from 'moment'; -import { Icon, Button, Modal, notification } from 'antd'; import { - Divider, - Drawer, - List, - ListItem, - IconMenu, - IconButton, - MenuItem, + Icon, + Button, + Modal, + notification +} from 'antd'; +import { + // Divider, + // Drawer, + // List, + // ListItem, + // IconMenu, + // IconButton, + // MenuItem, DropDownMenu, RaisedButton, Paper, Dialog, Snackbar, - Toolbar, ToolbarGroup, ToolbarSeparator, ToolbarTitle, Badge + // Toolbar, + // ToolbarGroup, + // ToolbarSeparator, + // ToolbarTitle, + // Badge } from 'material-ui'; import IconUserCircle from 'material-ui/svg-icons/action/account-circle'; import ShoppingCart from 'material-ui/svg-icons/action/shopping-cart'; @@ -47,10 +56,39 @@ import WalletComponent from "./WalletComponent"; import { APP_TYPE } from "../../config/app"; +//new material ui +import AppBar from '@material-ui/core/AppBar'; +import Toolbar from '@material-ui/core/Toolbar'; +import IconButton from '@material-ui/core/IconButton'; +import Typography from '@material-ui/core/Typography'; +import InputBase from '@material-ui/core/InputBase'; +import Badge from '@material-ui/core/Badge'; +import MenuItem from '@material-ui/core/MenuItem'; +import Menu from '@material-ui/core/Menu'; +import { withStyles } from '@material-ui/core/styles'; +import MenuIcon from '@material-ui/icons/Menu'; +import SearchIcon from '@material-ui/icons/Search'; +import AccountCircle from '@material-ui/icons/AccountCircle'; +import CartIcon from '@material-ui/icons/ShoppingCart'; +import NotificationsIcon from '@material-ui/icons/Notifications'; +import MoreIcon from '@material-ui/icons/MoreVert'; +import CancelIcon from '@material-ui/icons/Cancel'; +import { styles } from './styles'; + +import Drawer from '@material-ui/core/Drawer'; +// import Button from '@material-ui/core/Button'; +import List from '@material-ui/core/List'; +import Divider from '@material-ui/core/Divider'; +import ListItem from '@material-ui/core/ListItem'; +import ListItemIcon from '@material-ui/core/ListItemIcon'; +import ListItemText from '@material-ui/core/ListItemText'; +import InboxIcon from '@material-ui/icons/MoveToInbox'; +import MailIcon from '@material-ui/icons/Mail'; + faker.locale = 'id_ID'; @inject("appstate") @observer -export default class App extends React.Component { +class App extends React.Component { constructor(props) { super(props); this.props = props; @@ -72,6 +110,10 @@ export default class App extends React.Component { .pathname .split('/') .map(path => startcase(path)), + + anchorEl: null, + mobileMoreAnchorEl: null, + left: false, }; this.defaultState = Object.assign({}, this.state); this.user = props.appstate.user; @@ -271,7 +313,34 @@ export default class App extends React.Component { }); }; + + //new + handleProfileMenuOpen = event => { + this.setState({ anchorEl: event.currentTarget }); + }; + + handleMenuClose = () => { + this.setState({ anchorEl: null }); + this.handleMobileMenuClose(); + }; + + handleMobileMenuOpen = event => { + this.setState({ mobileMoreAnchorEl: event.currentTarget }); + }; + + handleMobileMenuClose = () => { + this.setState({ mobileMoreAnchorEl: null }); + }; + + toggleDrawerNew = (open) => () => { + this.setState({ + left: open, + }); + }; + render() { + const { anchorEl, mobileMoreAnchorEl } = this.state; + const { classes } = this.props; const { redirect } = this.state; if (redirect) { @@ -297,28 +366,6 @@ export default class App extends React.Component { } }; - // ROLE dan Menu - // agent, ga ada setting, member, task - // if (window && !window.Tawk_API) { - // const script = document.createElement("script"); - // (this.settingStore.setting.tawkto_siteid && !this.state.scriptTawkto && this.appstate.userData.role === 'agent') ? (() => { - // const scriptText = document.createTextNode(` - // var Tawk_API=Tawk_API||{}, Tawk_LoadStart=new Date(); - // (function(){ - // var s1=document.createElement("script"),s0=document.getElementsByTagName("script")[0]; - // s1.async=true; - // s1.src='https://embed.tawk.to/${this.settingStore.setting.tawkto_siteid}/default'; - // s1.charset='UTF-8'; - // s1.setAttribute('crossorigin','*'); - // s0.parentNode.insertBefore(s1,s0); - // })();`); - // script.appendChild(scriptText); - // script.async = true; - // document.body.appendChild(script); - // this.setState({scriptTawkto: true}) - // })() : ''; - // } - const { userData } = this.appstate; // const applicationIcon = (this.settingStore.isIconEmpty) ? "/assets/images/bankbtn.png" : this.http.appendImagePath(this.settingStore.setting.icon); // let applicationIcon = "http://giift.asacreative.com/giift_logo_wide.4d15de72.png"; @@ -338,6 +385,145 @@ export default class App extends React.Component { // } return `${LINKS.ORDER}`; } + + const isMenuOpen = Boolean(anchorEl); + const isMobileMenuOpen = Boolean(mobileMoreAnchorEl); + + const renderMenu = ( + + + Profile + + + Sign Out + + + ); + + const renderMobileMenu = ( + + {window.location.pathname.split("/")[2] == "shop" ? ( + + + + + + +

Cart

+
+ ) : "" } + + + + + + +

Notifications

+
+ + + + + +

Profile

+
+ + + + + + +

Sign Out

+
+ +
+ ); + + const sideList = ( +
+
+ + + +
+ + + Home + Flight + + Hotel + + Car + + Shop + + Vouchers + + + + +
+ + + +
+
+
+ ); + return (
@@ -363,15 +549,84 @@ export default class App extends React.Component { - - - +
+ + +
+ + + +
+ + + +
+
+ +
+ +
+
+
+ + {window.location.pathname.split("/")[2] == "shop" ? ( + + + + ) : "" } + + + + + + + + + +
+
+ + + +
+ + + {renderMenu} + {renderMobileMenu} +
+ +
+ {sideList} +
+
+ {/* this.toggleDrawer()}> - {/* */} - @@ -383,12 +638,12 @@ export default class App extends React.Component { src={applicationIcon} /> - {/**/} - {/* this.toggleDrawer()}>*/} - {/**/} - {/**/} - {/* */} + - {/*Home*/} + Home - {/* Shop */} + className="menuAkun">Shop - {/* Vouchers */} + className="menuAkun">Vouchers - {/* */} + @@ -476,7 +731,6 @@ export default class App extends React.Component { return ( } primaryText={item.notification.title} secondaryText={
@@ -632,7 +886,7 @@ export default class App extends React.Component { - + */}
({ + root: { + width: '100%', + }, + toolbar:{ + position: "fixed", + width: "100%", + top: 0, + zIndex: 1000, + backgroundColor: yellow['500'], + height: '70px !important', + padding: "8px 24px", + borderBottom: "1px solid rgb(223, 223, 223)" + }, + grow: { + flexGrow: 1, + }, + menuButton: { + // color: '#0336ff !important', + marginLeft: -12, + marginRight: 20, + }, + title: { + color: '#0336ff !important', + display: 'none', + [theme.breakpoints.up('sm')]: { + display: 'block', + }, + }, + search: { + color: '#9E9E9E !important', + position: 'relative', + borderRadius: theme.shape.borderRadius, + backgroundColor: fade(theme.palette.common.white, 0.50), + '&:hover': { + backgroundColor: fade(theme.palette.common.white, 0.60), + }, + marginRight: theme.spacing.unit * 2, + marginLeft: 0, + width: '100%', + [theme.breakpoints.up('sm')]: { + marginLeft: theme.spacing.unit * 3, + width: 'auto', + }, + }, + searchIcon: { + color: '#9E9E9E !important', + width: theme.spacing.unit * 9, + height: '100%', + position: 'absolute', + pointerEvents: 'none', + display: 'flex', + alignItems: 'center', + justifyContent: 'center', + }, + inputRoot: { + color: 'inherit', + width: '100%', + }, + inputInput: { + paddingTop: theme.spacing.unit, + paddingRight: theme.spacing.unit, + paddingBottom: theme.spacing.unit, + paddingLeft: theme.spacing.unit * 10, + transition: theme.transitions.create('width'), + width: '100%', + [theme.breakpoints.up('md')]: { + width: 200, + }, + }, + sectionDesktop: { + color: '#0336ff !important', + display: 'none', + [theme.breakpoints.up('md')]: { + display: 'flex', + }, + }, + sectionMobile: { + color: '#424770 !important', + display: 'flex', + [theme.breakpoints.up('md')]: { + display: 'none', + }, + }, + list: { + width: 250, + }, + backgroundLogo:{ + padding:"15px 20px", + backgroundColor: yellow['500'], + }, + fullList: { + width: 'auto', + }, +}); \ No newline at end of file