import React, { Component } from "react";
import Drawer from "./drawer";

import CircularProgress from "@material-ui/core/CircularProgress";
import FlatButton from "material-ui/FlatButton";
import Dialog from "material-ui/Dialog";
import api from "./api/api";
import cookie from "react-cookies";
class past_member_para_four extends Component {
  constructor(props) {
    super(props);
    if (
     // localStorage.getItem("current_state") !== "freebie1" ||
      cookie.load("user_id") == "" ||
      cookie.load("user_id") == "undefined" ||
      typeof cookie.load("user_id") == undefined
    ) {
      this.props.history.push("/");
    }
    console.log("session", localStorage.getItem("current_state"));
    console.log("is_active", localStorage.getItem("login_is_active"));
    this.state = {
      loader: false,
      is_active: localStorage.getItem("login_is_active") == 1 ? true : false,
      open: false,
      alertmsg: "",
      product_orientation: false
    };
    this.handleClose.bind(this);
  }
  handleClose = () => {
    this.setState({ open: false });
  };

  render() {
    return (
      <div className="">
        <center>
          {this.state.loader && (
            <div>
              <CircularProgress
                size={100}
                style={{ color: "black", marginTop: "17%" }}
              />
            </div>
          )}
          {this.state.is_active && <Drawer prop={this.props} />}
        </center>

        <div className="inner_container2 mt40 ">
          <Dialog
            style={{ textTransform: "capitalize" }}
            actions={
              <FlatButton
                label="Close"
                labelStyle={{ color: "#000" }}
                onClick={this.handleClose.bind(this)}
              />
            }
            modal={false}
            open={this.state.open}
            onRequestClose={this.handleClose}
          >
            {this.state.alertmsg}
          </Dialog>
          {!this.state.loader && (
            <div className="new_member_start_account_header_div">
              <div>
                <div className="">
                  <b style={{ fontSize: 17 }}>Get Started</b>
                </div>
                <p className="new_member_start_account_para_two">Review &</p>
                <p className="new_member_start_account_para_three">
                  <span className="nm_start_account_p">P</span>
                  <span className="nm_start_account_e">E</span>
                  <span className="nm_start_account_r">R</span>
                  <span className="nm_start_account_s">S</span>
                  <span className="nm_start_account_o">O</span>
                  <span className="nm_start_account_n">N</span>
                  <span className="nm_start_account_a">A</span>
                  <span className="nm_start_account_l">L</span>
                  <span className="nm_start_account_i">I</span>
                  <span className="nm_start_account_z">Z</span>
                  <span className="nm_start_account_e1">E</span>
                </p>
                <p className="new_member_start_account_para_four">
                  Your Account!
                </p>
              </div>
              <div
                className="mainactive_later mt70"
                style={{ cursor: "pointer" }}
              >
                <a
                  onClick={() => {localStorage.setItem("current_state","signup"),this.props.history.push("/signup_step-1")}}
                  className="active_later new_member_start_account_anchor"
                >
                  <span>
                    Let's go{" "}
                    <i className="new_member_start_account_anchor_icon">
                      <img
                        src={api.image_path+"next_arrow.jpg"}
                        alt=""
                        title=""
                        width="30"
                      />
                    </i>
                  </span>
                </a>
              </div>
            </div>
          )}
        </div>
      </div>
    );
  }
}
export default past_member_para_four;
