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 {Link} from 'react-router-dom'; import SearchIcon from 'material-ui/svg-icons/action/search'; import UnarchiveIcon from 'material-ui/svg-icons/content/unarchive'; 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 faker from 'faker'; import ModalTopupComponent from "./Modal"; @inject('appstate') @observer export default class WalletComponent extends React.Component { constructor(props) { super(props); this.props = props; this.state = { value: 1, searchText: '', slideIndex: 0, filteredInfo: null, sortedInfo: null, modalTopup: false, }; this.defaultState = Object.assign({}, this.state); this.http = props.appstate.http; this.purchasedItemStore = props.appstate.purchased_items; } componentDidMount() { this.purchasedItemStore.getAll().then(res => { console.log(res, 'ini purchased items') }) // this.globalUI.openLoading(); // this.transactionStore.getAll().then(res => { // this.globalUI.closeLoading(); // }); // this.transactionStore.getAmount(); // this.bankStore.getByUserID('tesss'); // this.globalUI.closeLoading(); // this.authStore.getWallet(); } setModalTopup = (bool) => { this.setState({modalTopup: bool}); }; render() { const voucher = ; const points = ; const data = [ { id: faker.random.uuid(), created_at: faker.date.past(), type: 'Points', amount: faker.commerce.price() }, { id: faker.random.uuid(), created_at: faker.date.past(), type: 'Points', amount: faker.commerce.price() }, { id: faker.random.uuid(), created_at: faker.date.past(), type: 'Voucher', amount: faker.commerce.price() }, { id: faker.random.uuid(), created_at: faker.date.past(), type: 'Voucher', amount: faker.commerce.price() }, { id: faker.random.uuid(), created_at: faker.date.past(), type: 'Points', amount: faker.commerce.price() }, ]; 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} }, // { // 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

{(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="Top Up" onClick={() => this.setModalTopup(true)} 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) ?*/} {/**/} {/**/} {/**/} {/**/} {/* : ""*/} {/*}*/} {/**/} {/*
*/}
this.setModalTopup(false)} onCancel={() => this.setModalTopup(false)} isVisible={this.state.modalTopup} />
) } }