diff --git a/src/common/pages/App/index.js b/src/common/pages/App/index.js index 9033be0..f65a9a8 100644 --- a/src/common/pages/App/index.js +++ b/src/common/pages/App/index.js @@ -400,9 +400,9 @@ export default class App extends React.Component { } - className={(this.state.selectedMenu === '/app/dashboard') ? "menuAkunItem active" : 'menuAkunItem'}>Hotel + diff --git a/src/common/pages/Hotel/index.js b/src/common/pages/Hotel/index.js new file mode 100644 index 0000000..a63ca69 --- /dev/null +++ b/src/common/pages/Hotel/index.js @@ -0,0 +1,312 @@ +import React from 'react'; +import {inject, observer} from 'mobx-react'; +import { + Card, + CardTitle, + Divider, + RaisedButton, + Table, + TableBody, + TableHeader, + TableHeaderColumn, + TableRow, + TableRowColumn, + TextField, + Toolbar, + ToolbarGroup, + ToolbarSeparator, + IconButton, + IconMenu, MenuItem, +} from 'material-ui'; +import {Table as TableAntd} from 'antd'; +import {startCase} from 'lodash'; +import {LINKS} from "../../routes"; +import {Link} from 'react-router-dom'; +import SearchIcon from 'material-ui/svg-icons/action/search'; +import UnarchiveIcon from 'material-ui/svg-icons/content/unarchive'; +import ArchiveIcon from 'material-ui/svg-icons/content/archive'; +import DC from 'decimal.js-light'; +import NumberFormat from 'react-number-format'; +import MoreIcon from 'material-ui/svg-icons/navigation/more-vert'; +import LoadingDialog from "../LoadingDialog"; +import Loader from 'react-loader-advanced'; +import './style.scss'; +import {DIALOG} from "../../stores/global_ui"; +import EmptyComponent from '../EmptyComponent'; + +@inject('appstate') +@observer +export default class HotelComponent extends React.Component { + constructor(props) { + super(props); + this.props = props; + this.state = { + value: 1, + searchText: '', + slideIndex: 0, + filteredInfo: null, + sortedInfo: null, + }; + this.defaultState = Object.assign({}, this.state); + this.http = props.appstate.http; + this.authStore = props.appstate.auth; + this.globalUI = props.appstate.globalUI; + this.transactionStore = props.appstate.transaction; + this.bankStore = props.appstate.bank; + this.userData = props.appstate.userData; + } + + componentDidMount() { + this.globalUI.openLoading(); + this.transactionStore.getAll().then(res => { + this.globalUI.closeLoading(); + }); + this.transactionStore.getAmount(); + this.bankStore.getByUserID('tesss'); + // this.globalUI.closeLoading(); + // this.authStore.getWallet(); + } + + handleUpdateInput = (searchText) => { + this.setState({ + searchText: searchText, + }); + }; + + handleNewRequest = () => { + this.setState({ + searchText: '', + }); + }; + + tabsHandleChange = (value) => { + this.setState({ + slideIndex: value, + }); + }; + + search = (event)=>{ + if(event.target.value.length == 0){ + this.transactionStore.isSearching = false; + } + else{ + this.transactionStore.isSearching = true; + this.transactionStore.search(event.target.value); + } + }; + + handleChangeSorter = (pagination, filters, sorter) => { + // console.log('Various parameters', pagination, filters, sorter); + this.setState({ + filteredInfo: filters, + sortedInfo: sorter, + }); + }; + + handleChange = (event, index, value) => this.setState({value}); + + render() { + const undeposit_fund = ; + const balance = ; + + + const columns = [{ + title: 'Id', + dataIndex: 'id', + key: 'id', + className: 'recentOrder-noOrder', + render: (text) => {{(text.split("-")[0])}}, + }, + { + title: 'Date', + dataIndex: 'created_at', + key: 'created_at', + className: 'recentOrder-noOrder', + render: (text) => ( +
+ {moment(text).format('MMM DD, YYYY')} {moment(text).format('hh:mm')} +
+ ) + }, + { + title: 'Type', + dataIndex: 'type', + key: 'type', + className: 'recentOrder-noOrder', + render: (text) => {text.name} + }, + + { + title: 'Status', + dataIndex: 'status', + key: 'status', + className: 'recentOrder-status', + render: (text) =>
{text === 'created' ? 'Waiting Approval' : startCase(text)}
+ }, + { + title: 'Amount', + dataIndex: 'amount', + key: 'amount', + className: 'recentOrder-customer bolder green', + render: (text) => { + return + + } + + }]; + + return ( +
+
+
+
+

Wallet

+
+
+ { + (this.transactionStore.saldo.length === 2) ? +
+
+ + + +
+
+ + + +
+
+ : +
+ + + +
+ } + +
+ + + + + + + + + {(window.innerWidth < 600) ? +
+ } + anchorOrigin={{horizontal: 'left', vertical: 'top'}} + targetOrigin={{horizontal: 'left', vertical: 'top'}} + > + this.globalUI.showDialog(DIALOG.WALLET.DEPOSIT)}/> + this.globalUI.showDialog(DIALOG.WALLET.WITHDRAW)}/> + +
+ : +
+ {/*}*/} + {/*label="Deposit"*/} + {/*style={{marginRight: 20}}*/} + {/*onClick={() => this.globalUI.showDialog(DIALOG.WALLET.DEPOSIT)}*/} + {/*primary={true}/>*/} + } + label="Withdraw" + onClick={() => this.globalUI.showDialog(DIALOG.WALLET.WITHDRAW)} + primary={true}/> +
+ } + +
+
+ +
+ } + messageStyle={{textAlign: 'center'}} + backgroundStyle={{backgroundColor: 'rgba(255,255,255,0.5)'}}> + {` + // return { + // onClick: () => { + // this.props.history.push(`${LINKS.ORDER}/${record.id}`); + // }, // click row + // }; + // }} + /> + {/**/} + {/**/} + {/**/} + {/*Id*/} + {/*Date*/} + {/*Type*/} + {/*Status*/} + {/*Amount*/} + {/**/} + {/**/} + {/**/} + {/*{*/} + {/*(this.transactionStore.isSearching ? this.transactionStore.transactionListFiltered : this.transactionStore.list).map((item, index) => {*/} + + {/*return (*/} + {/**/} + {/**/} + {/*{item.id.split('-')[0]}*/} + {/**/} + {/*{moment(item.created_at).format('MMMM Do YYYY, hh:mm:ss')}*/} + {/*{item.type.name}*/} + {/*{item.status === 'created' ? 'Waiting Approved' : item.status}*/} + {/**/} + {/**/} + {/*);*/} + {/*})*/} + {/*}*/} + {/*{*/} + {/*(this.transactionStore.list.length === 0) ?*/} + {/**/} + {/**/} + {/**/} + {/**/} + {/* : ""*/} + {/*}*/} + {/**/} + {/*
*/} +
+
+
+
+ + +
+ ) + } +} diff --git a/src/common/pages/Hotel/style.scss b/src/common/pages/Hotel/style.scss new file mode 100644 index 0000000..0cdb30e --- /dev/null +++ b/src/common/pages/Hotel/style.scss @@ -0,0 +1,49 @@ +.wallet { + margin-top: 35px; + .container { + padding: 25px; + + .ant-card { + background: #fff; + border-radius: 0px; + font-size: 12px; + position: relative; + overflow: hidden; + transition: all .3s; + } + .ant-card-head { + height: 48px; + line-height: 48px; + background: #fff; + border-bottom: 0px solid #e9e9e9; + padding: 0 24px; + } + .ant-card:hover { + box-shadow: 4px 4px 40px rgba(0, 0, 0, .05); + border-color: transparent; + } + .ant-card-body-dashboard { + padding: 10px; + } + } + + + .label-form { + font-size: 14px; + line-height: 30px; + color: rgb(153, 153, 153); + text-shadow: rgb(255, 255, 255) 0px 1px 0px; + margin-bottom: -8px; + } + + .backgroundImage { + height: 182px; + background-image: url('/assets/images/material3.jpg'); + background-position: center; + background-size: cover; + cursor: pointer; + min-height: 75px; + position: relative; + width: 100%; + } +} diff --git a/src/common/routes.js b/src/common/routes.js index 04bff28..77f85a4 100644 --- a/src/common/routes.js +++ b/src/common/routes.js @@ -105,7 +105,8 @@ export const LINKS = { FEATURED_CATEGORY : '/app/featured_categories', FEATURED_ITEMS : '/app/featured_banners', CUSTOM_MENU : '/app/custom_menu', - PROMOTION:'/app/promotion' + PROMOTION:'/app/promotion', + HOTEL:'/app/hotel' }; @inject('appstate')