Skip to content

Commit 57d27b7

Browse files
authored
Merge pull request #107 from coding-blocks/buy_link_coupon_feature
removed loader on user selection
2 parents 56bd221 + a887d0c commit 57d27b7

File tree

1 file changed

+5
-19
lines changed

1 file changed

+5
-19
lines changed

pages/admin/products/generateLink.js

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React from 'react'
22
import Head from '../../../components/head';
3-
import Backdrop from '@material-ui/core/Backdrop';
43
import CircularProgress from '@material-ui/core/CircularProgress';
54
import Layout from "../../../components/layout";
65
import ProductLinkForm from "../../../forms/ProductLink";
@@ -11,7 +10,6 @@ import * as couponController from '../../../controllers/v2/couponsV2'
1110
import ProductLinkCard from "../../../components/ProductLinkCard"
1211
import ErrorHandler from "../../../helpers/ErrorHandler";
1312
import Swal from 'sweetalert2';
14-
import { withStyles } from '@material-ui/core';
1513
import Table from '@material-ui/core/Table';
1614
import TableBody from '@material-ui/core/TableBody';
1715
import TableCell from '@material-ui/core/TableCell';
@@ -21,13 +19,6 @@ import TableHead from '@material-ui/core/TableHead';
2119
import TableRow from '@material-ui/core/TableRow';
2220
import Typography from '@material-ui/core/Typography';
2321

24-
const useStyles = theme => ({
25-
backdrop: {
26-
zIndex: theme.zIndex.drawer + 1,
27-
color: '#fff',
28-
}
29-
});
30-
3122
class GenerateLink extends React.Component {
3223

3324
constructor(props) {
@@ -286,24 +277,19 @@ class GenerateLink extends React.Component {
286277
})
287278
}
288279

289-
hideSpinner = () => {
280+
handleLoading = () => {
290281
this.setState({
291282
loading: false
292283
});
293284
};
294285

295286
render() {
296-
const { classes } = this.props;
297287
return (
298288
<div>
299289
<Head title="Coding Blocks | Dukaan | Generate Product Link"/>
300290
<Layout/>
301291
<CheckLogin>
302292

303-
<Backdrop className={classes.backdrop} open={this.state.loading}>
304-
<CircularProgress color="inherit" />
305-
</Backdrop>
306-
307293
<div className={"row"}>
308294
<div className={"col-md-3 pull-left"}>
309295
<ProductLinkForm {...this.state}
@@ -331,7 +317,7 @@ class GenerateLink extends React.Component {
331317
<b> User Details </b>
332318
</Typography>
333319

334-
<Table className={classes.table} aria-label="simple table">
320+
<Table aria-label="simple table">
335321
<TableHead>
336322
<TableRow>
337323
<TableCell align="center">Name</TableCell>
@@ -367,7 +353,7 @@ class GenerateLink extends React.Component {
367353
<iframe
368354
src={this.state.activeCartIframeUrl}
369355
frameBorder="0"
370-
onLoad={this.hideSpinner}
356+
onLoad={this.handleLoading}
371357
width="100%"
372358
height="220"
373359
allowtransparency='true'
@@ -379,7 +365,7 @@ class GenerateLink extends React.Component {
379365
<iframe
380366
src={this.state.purchasedProductIframeurl}
381367
frameBorder="0"
382-
onLoad={this.hideSpinner}
368+
onLoad={this.handleLoading}
383369
width="100%"
384370
height="350"
385371
allowtransparency='true'
@@ -412,4 +398,4 @@ class GenerateLink extends React.Component {
412398
}
413399
}
414400

415-
export default withStyles(useStyles)(GenerateLink)
401+
export default GenerateLink

0 commit comments

Comments
 (0)