369 lines
13 KiB
JavaScript
369 lines
13 KiB
JavaScript
import React from "react";
|
||
import {inject, observer} from "mobx-react";
|
||
import QueueAnim from 'rc-queue-anim';
|
||
import "./style.scss";
|
||
import NumberFormat from 'react-number-format';
|
||
import {LINKS} from './../../routes'
|
||
import {Link} from 'react-router-dom';
|
||
import CardAdmin from './CardAdmin';
|
||
import CardAgent from './CardAgent';
|
||
import moment from 'moment';
|
||
import {Icon, Button, notification, Table, Tooltip as TooltipAntd, Col, Row} from 'antd';
|
||
import DC from 'decimal.js-light';
|
||
import {
|
||
Paper,
|
||
Card,
|
||
CardActions,
|
||
CardHeader,
|
||
CardMedia,
|
||
CardTitle,
|
||
CardText,
|
||
FlatButton,
|
||
GridList,
|
||
GridTile,
|
||
Divider, ListItem, List
|
||
} from 'material-ui';
|
||
import Grid from '@material-ui/core/Grid';
|
||
import EmptyComponent from '../EmptyComponent';
|
||
import * as _ from 'lodash';
|
||
import {grey400, darkBlack, lightBlack, black} from 'material-ui/styles/colors';
|
||
import './style.scss';
|
||
import {Carousel} from 'react-responsive-carousel'
|
||
import {ActionGrade, ContentDrafts, ContentInbox, ContentSend} from "material-ui/svg-icons/index";
|
||
import {constant} from "../../config/const";
|
||
import Slider from "react-slick";
|
||
import 'slick-carousel/slick/slick.css';
|
||
import 'slick-carousel/slick/slick-theme.css';
|
||
import VoucherComponent from '../Vouchers/index';
|
||
import slider1 from '../../../../assets/images/slider/1.jpg';
|
||
import slider2 from '../../../../assets/images/slider/2.jpg';
|
||
import slider3 from '../../../../assets/images/slider/3.jpg';
|
||
import slider4 from '../../../../assets/images/slider/4.jpg';
|
||
import slider5 from '../../../../assets/images/slider/5.jpg';
|
||
import {ItemCard} from "../Vouchers/ItemCard";
|
||
import ModalVouchersComponent from "../Vouchers/Modal";
|
||
import PopularItemCardComponent from "./PopularItemCard";
|
||
import NewItemCardComponent from "./NewItemCard";
|
||
import '../Vouchers/style.scss';
|
||
|
||
const {
|
||
LineChart,
|
||
AreaChart,
|
||
BarChart,
|
||
Bar,
|
||
Line,
|
||
XAxis,
|
||
YAxis,
|
||
ReferenceLine,
|
||
CartesianGrid,
|
||
Tooltip,
|
||
Legend,
|
||
Area,
|
||
ResponsiveContainer
|
||
} = require('recharts/umd/Recharts.min');
|
||
|
||
@inject('appstate')
|
||
@observer
|
||
export default class DashboardComponent extends React.Component {
|
||
|
||
constructor(props){
|
||
super(props);
|
||
this.state = {
|
||
isOpened: false,
|
||
data: {
|
||
name: '',
|
||
image: '',
|
||
description: '',
|
||
additional_information: '',
|
||
background_color: '',
|
||
option: [
|
||
{
|
||
value: '',
|
||
cost: ''
|
||
},
|
||
]
|
||
},
|
||
};
|
||
}
|
||
|
||
componentDidMount(){
|
||
|
||
}
|
||
|
||
render(){
|
||
const settings = {
|
||
arrows: true,
|
||
infinite: true,
|
||
speed: 500,
|
||
slidesToShow: 1,
|
||
slidesToScroll: 1,
|
||
fade: true
|
||
};
|
||
|
||
const data = [
|
||
{
|
||
name: 'KFC',
|
||
images: {
|
||
logo: 'https://ecs7.tokopedia.net/img/recharge/operator/kfc-box_150px_74px.png'
|
||
},
|
||
description: 'KFC merupakan restoran cepat saji yang menyediakan ayam goreng serta berbagai menu pilihan lainnya seperti burger, sup, dan salad. Dengan rasa yang renyah dan gurih, siapa pun dijamin ketagihan dengan ayam goreng yang satu ini.',
|
||
additional_information: 'Voucher ini berlaku hingga 29 hari setelah pembelian.',
|
||
background_color: 'linear-gradient(rgb(214, 18, 53), rgb(100, 23, 24))',
|
||
option: [
|
||
{
|
||
value: 'Rp. 50.000',
|
||
cost: '50 Points'
|
||
},
|
||
{
|
||
value: 'Rp. 100.000',
|
||
cost: '100 Points'
|
||
},
|
||
{
|
||
value: 'Super Besar 1',
|
||
cost: '34 Points'
|
||
},
|
||
{
|
||
value: 'Super Besar 2',
|
||
cost: '49 Points'
|
||
},
|
||
]
|
||
},
|
||
{
|
||
name: 'Grab',
|
||
images: {
|
||
logo: 'https://ecs7.tokopedia.net/img/recharge/operator/grab_150px_74px.png'
|
||
},
|
||
description: 'Grab adalah platform transportasi terkemuka di Asia Tenggara. Kami percaya setiap orang harus bisa pergi ke mana saja dan percaya bahwa mereka dapat memesan perjalanan yang aman.',
|
||
additional_information: 'Voucher ini berlaku hingga 28 Februari 2019. Voucher ini hanya bisa digunakan untuk layanan GrabCar, GrabBike, dan GrabExpress. ',
|
||
background_color: 'linear-gradient(rgb(0, 174, 66), rgb(0, 93, 36))',
|
||
option: [
|
||
{
|
||
value: 'Rp. 10.000',
|
||
cost: '10 Points'
|
||
},
|
||
{
|
||
value: 'Rp. 20.000',
|
||
cost: '20 Points'
|
||
},
|
||
{
|
||
value: 'Rp. 50.000',
|
||
cost: '50 Points'
|
||
},
|
||
{
|
||
value: 'Rp. 100.000',
|
||
cost: '100 Points'
|
||
},
|
||
]
|
||
},
|
||
{
|
||
name: 'OYO Hotel',
|
||
images: {
|
||
logo: 'https://ecs7.tokopedia.net/img/recharge/operator/oyo_150px_74px.png'
|
||
},
|
||
description: 'OYO Hotel adalah jaringan hotel terbesar di Asia Selatan dan terdapat di 11 negara dengan lebih dari 12,000 hotel tersebar di seluruh dunia.',
|
||
additional_information: 'Voucher ini berlaku hingga 31 Januari 2019.',
|
||
background_color: 'linear-gradient(rgb(253, 234, 225), rgb(255, 138, 98))',
|
||
option: [
|
||
{
|
||
value: 'Rp. 75.000',
|
||
cost: '25 Points'
|
||
},
|
||
]
|
||
},
|
||
{
|
||
name: 'Carrefour',
|
||
images: {
|
||
logo: 'https://ecs7.tokopedia.net/img/recharge/operator/carrefour_150px_74px.png'
|
||
},
|
||
description: 'Carrefour membantu semua orang agar dapat menikmati kualitas hidup yang lebih baik setiap harinya. Menyediakan berbagai kebutuhan harian sekaligus bulanan, sebagai tujuan utama berbelanja keluarga dengan memberikan pelayanan dan produk berkualitas dimanapun dan kapanpun.',
|
||
additional_information: 'Voucher ini berlaku hingga 29 hari setelah pembelian.',
|
||
background_color: 'linear-gradient(rgb(236, 249, 250), rgb(73, 176, 228))',
|
||
option: [
|
||
{
|
||
value: 'Rp. 100.000',
|
||
cost: '100 Points'
|
||
},
|
||
{
|
||
value: 'Rp. 200.000',
|
||
cost: '200 Points'
|
||
},
|
||
]
|
||
},
|
||
{
|
||
name: "Domino's Pizza",
|
||
images: {
|
||
logo: 'https://ecs7.tokopedia.net/img/recharge/operator/dominos_150px_74px.png'
|
||
},
|
||
description: "Domino's Pizza adalah pemimpin Pizza delivery di dunia. Dengan 130 toko yang tersebar di Jabodetabek, Bali, Bandung, Serang, dan Sukabumi, Domino’s menyajikan pizza paling lezat dengan harga terbaik untuk jutaan pelanggan. Domino’s juga mengantarkan pizza hangat dengan jaminan 30 menit sampai.",
|
||
additional_information: "Voucher ini berlaku hingga 29 hari setelah pembelian",
|
||
background_color: 'linear-gradient(rgb(11, 110, 174), rgb(2, 61, 96))',
|
||
option: [
|
||
{
|
||
value: 'Rp. 100.000',
|
||
cost: '90 Points'
|
||
},
|
||
{
|
||
value: 'Rp. 200.000',
|
||
cost: '180 Points'
|
||
},
|
||
]
|
||
},
|
||
{
|
||
name: 'Timezone',
|
||
images: {
|
||
logo: 'https://ecs7.tokopedia.net/img/recharge/operator/new-timezone_150px_74px.png',
|
||
},
|
||
description: 'Timezone merupakan tempat permainan semua keluarga di Indonesia. Beragam permainan menarik yang disediakan untuk memberikan pengalaman yang menyenangkan bagi setiap pengunjung. Selain permainan – permainan yang cukup menarik dan sensasi berbeda, pengunjung yang hadir ke Timezone juga berkesempatan mendapatkan hadiah-hadiah menarik dari mesin-mesin yang dimainkan ataupun souvenir, boneka dari tiket yang ditukarkan',
|
||
additional_information: 'Voucher ini berlaku hingga 29 hari setelah pembelian.',
|
||
background_color: 'linear-gradient(rgb(255, 118, 90), rgb(255, 40, 12))',
|
||
option: [
|
||
{
|
||
value: 'Value Voucher Rp 200.000 (Saldo Rp 150.000 & Free Games Rp 50.000)',
|
||
cost: '135 Points'
|
||
},
|
||
{
|
||
value: 'Value Voucher Rp 500.000 (Saldo Rp 300.000 & Free Games Rp 200.000)',
|
||
cost: '285 Points'
|
||
},
|
||
]
|
||
},
|
||
{
|
||
name: 'Bakmi GM',
|
||
images: {
|
||
logo: 'https://ecs7.tokopedia.net/img/recharge/operator/bakmigm_150px_74px.png'
|
||
},
|
||
description: 'BAKMI GM dirancang khusus untuk memberikan rasa yang lezat, yang dibuat dari bahan baku pilihan dan disajikan dengan harga yang ekonomis. Tersedia lebih dari 50 menu yang dapat dipilih oleh pelanggan, dengan menu Bakmi Special GM dan Pangsit Goreng yang menjadi favorit pelanggan.',
|
||
additional_information: 'Voucher ini berlaku hingga 11 Januari 2019.',
|
||
background_color: 'linear-gradient(rgb(254, 239, 73), rgb(241, 186, 54))',
|
||
option: [
|
||
{
|
||
value: 'Rp. 50.000',
|
||
cost: '47 Points'
|
||
},
|
||
{
|
||
value: 'Rp. 100.000',
|
||
cost: '94 Points'
|
||
},
|
||
]
|
||
},
|
||
{
|
||
name: 'CFC',
|
||
images: {
|
||
logo: 'https://ecs7.tokopedia.net/img/recharge/operator/cfc_150px_74px.png'
|
||
},
|
||
description: 'CFC merupakan salah satu brand fast food yang tersebar di berbagai daerah di Indonesia. CFC menyediakan berbagai menu makanan dan minuman yang praktis dan bervariasi sesuai dengan selera keluarga Indonesia. Mulai dari berbagai menu berbahan dasar ayam seperti : Crispy Fried Chicken, Chicken Strips, Chicken Pop, Chicken Burger, Ayam Geprek, hingga Nasi Goreng, Spaghetti, Ice blended, Calblend Float, dan masih banyak lagi.',
|
||
additional_information: 'Voucher ini berlaku hingga 29 hari setelah pembelian. Maksimal penggunaan 3 e-Voucher dalam 1 kali transaksi',
|
||
background_color: 'linear-gradient(rgb(255, 255, 255), rgb(192, 192, 192))',
|
||
option: [
|
||
{
|
||
value: 'Rp. 50.000',
|
||
cost: '44 Points'
|
||
},
|
||
]
|
||
},
|
||
];
|
||
|
||
return(
|
||
<div style={{marginLeft:'10%',marginRight:'10%',marginTop:20,flexGrow:1, minHeight:window.innerHeight-70, backgroundColor:'#fff'}}>
|
||
<div>
|
||
<Slider {...settings}>
|
||
<div>
|
||
<img src={slider1} width={'100%'} />
|
||
</div>
|
||
<div>
|
||
<img src={slider2} width={'100%'} />
|
||
</div>
|
||
<div>
|
||
<img src={slider3} width={'100%'} />
|
||
</div>
|
||
<div>
|
||
<img src={slider4} width={'100%'} />
|
||
</div>
|
||
<div>
|
||
<img src={slider5} width={'100%'} />
|
||
</div>
|
||
</Slider>
|
||
</div>
|
||
|
||
<div>
|
||
<Grid container spacing={0} style={{}}>
|
||
<Grid item xs={12}>
|
||
<div>
|
||
<div className="row">
|
||
<div className="col l12 m12 s12 padding">
|
||
<h3>
|
||
Popular Items
|
||
</h3>
|
||
<Row gutter={10}>
|
||
<PopularItemCardComponent/>
|
||
</Row>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</Grid>
|
||
<Grid item xs={12}>
|
||
<div>
|
||
<div className="row">
|
||
<div className="col l12 m12 s12 padding">
|
||
<h3>
|
||
New Products
|
||
</h3>
|
||
<Row gutter={10}>
|
||
<NewItemCardComponent/>
|
||
</Row>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</Grid>
|
||
<Grid item xs={12}>
|
||
<div className={"voucher"} style={{marginTop:0}}>
|
||
<div className="row">
|
||
<div className="col l12 m12 s12 padding">
|
||
<h3>
|
||
Voucher & Gift Card
|
||
</h3>
|
||
|
||
<Row gutter={10}>
|
||
{data.map((item, index) => {
|
||
return (<Col xs={24} xl={6} onClick={() => this.setState({isOpened: true, data: item})} key={index} span={6}>
|
||
<ItemCard data={item}/>
|
||
</Col>)
|
||
})}
|
||
</Row>
|
||
|
||
{/*<ModalVouchersComponent*/}
|
||
{/*title={this.state.data.name+' Vouchers'}*/}
|
||
{/*data={this.state.data}*/}
|
||
{/*isVisible={this.state.isOpened}*/}
|
||
{/*onOk={() => this.setState({isOpened: false})}*/}
|
||
{/*onCancel={() => this.setState({isOpened: false})}*/}
|
||
{/*/>*/}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</Grid>
|
||
{/* <Grid item xs={12} sm={6}>
|
||
<Paper>xs=12 sm=6</Paper>
|
||
</Grid>
|
||
<Grid item xs={12} sm={6}>
|
||
<Paper>xs=12 sm=6</Paper>
|
||
</Grid>
|
||
<Grid item xs={6} sm={3}>
|
||
<Paper>xs=3 sm=3</Paper>
|
||
</Grid>
|
||
<Grid item xs={6} sm={3}>
|
||
<Paper>xs=3 sm=3</Paper>
|
||
</Grid>
|
||
<Grid item xs={6} sm={3}>
|
||
<Paper>xs=3 sm=3</Paper>
|
||
</Grid>
|
||
<Grid item xs={6} sm={3}>
|
||
<Paper>xs=3 sm=3</Paper>
|
||
</Grid> */}
|
||
</Grid>
|
||
</div>
|
||
</div>
|
||
);
|
||
}
|
||
}
|