diff --git a/src/common/pages/Dashboard/index.js b/src/common/pages/Dashboard/index.js index 3e9717e..5f0457d 100644 --- a/src/common/pages/Dashboard/index.js +++ b/src/common/pages/Dashboard/index.js @@ -1,6 +1,8 @@ import React from "react"; import {inject, observer} from "mobx-react"; +import compose from 'recompose/compose'; import withStyles from "@material-ui/core/styles/withStyles"; +import withWidth, {isWidthUp} from '@material-ui/core/withWidth'; import QueueAnim from 'rc-queue-anim'; import "./style.scss"; import NumberFormat from 'react-number-format'; @@ -126,6 +128,21 @@ class DashboardComponent extends React.Component { render() { const {classes} = this.props; + const getGridListCols = () => { + if (isWidthUp('lg', this.props.width)) { + return 4; + } + + if (isWidthUp('md', this.props.width)) { + return 3; + } + + if (isWidthUp('sm', this.props.width)) { + return 2; + } + + return 1; + } const settings = { arrows: true, infinite: true, @@ -237,11 +254,11 @@ class DashboardComponent extends React.Component { spacing={24} style={{marginTop: 30}}> - + Voucher & Gift Card - @@ -253,83 +270,49 @@ class DashboardComponent extends React.Component { image = this.http.appendImagePath(image); } return ( - - - - - - - {item.name} - - - Ind - - - From: 100 Point - - - - this.setState({isOpened: true, data: item})} - size="small"> - Redeem - - - - + + + + + + + {item.name} + + + Ind + + + From: 100 Point + + + + this.setState({isOpened: true, data: item})} + size="small"> + Redeem + + + + ) }) : () } - - {/**/} - {/*
*/} - {/*
*/} - {/*
*/} - {/*

*/} - {/*Voucher & Gift Card*/} - {/*

*/} - - {/**/} - {/*{*/} - {/*(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})}*/} - {/*/>*/} - {/*
*/} - {/*
*/} - {/*
*/} - {/*
*/}