"use strict";
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
    if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
    return cooked;
};
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
    result["default"] = mod;
    return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var React = __importStar(require("react"));
var styled_components_1 = __importDefault(require("styled-components"));
var TokensStyledComponents_1 = require("../TokensStyledComponents");
var TokensTextComponents_1 = require("../TokensTextComponents");
var UniswapSellSection_1 = require("./UniswapSellSection");
var Heading_1 = require("../../Heading");
var FullscreenModal_1 = require("../../FullscreenModal");
var ModalContent_1 = require("../../ModalContent");
var react_router_dom_1 = require("react-router-dom");
var BalanceContainer = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n  display: flex;\n  flex-direction: row;\n  > :first-child {\n    flex-grow: 1;\n  }\n"], ["\n  display: flex;\n  flex-direction: row;\n  > :first-child {\n    flex-grow: 1;\n  }\n"])));
var TokenInfoContainer = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n  margin: 20px;\n  font-size: 16px;\n  align-items: start;\n  > p {\n    font-size: 16px;\n  }\n"], ["\n  margin: 20px;\n  font-size: 16px;\n  align-items: start;\n  > p {\n    font-size: 16px;\n  }\n"])));
var CVLBalanceHeader = /** @class */ (function (_super) {
    __extends(CVLBalanceHeader, _super);
    function CVLBalanceHeader(props) {
        var _this = _super.call(this, props) || this;
        _this.state = {};
        return _this;
    }
    CVLBalanceHeader.prototype.render = function () {
        var _this = this;
        var balance = this.props.balance;
        return (React.createElement("div", null,
            React.createElement(BalanceContainer, null,
                React.createElement(Heading_1.Heading, null, "Available CVL to Sell"),
                React.createElement(Heading_1.Heading, null, balance)),
            React.createElement("div", null,
                React.createElement("a", { href: "#", onClick: function (e) { return _this.showModal(e); } }, "Don't see all of your tokens?")),
            React.createElement(FullscreenModal_1.FullScreenModal, { open: this.state.showModal, dismissOnOutsideClick: true, handleClose: function () { return _this.hideModal(); } },
                React.createElement(TokenInfoContainer, null,
                    React.createElement(ModalContent_1.ModalHeading, null, "Don't see all of your tokens?"),
                    React.createElement(ModalContent_1.ModalContent, null, "Check the amount of CVL in your voting balance."),
                    React.createElement(ModalContent_1.ModalContent, null,
                        "If your voting tokens are not used for any challenges, or votes, transfer them to your Available Balance in order to sell. You can do this within the",
                        " ",
                        React.createElement(react_router_dom_1.Link, { to: "/dashboard/tasks/transfer-voting-tokens" }, "Dashboard section"),
                        " .")))));
    };
    CVLBalanceHeader.prototype.showModal = function (e) {
        e.preventDefault();
        this.setState({ showModal: true });
    };
    CVLBalanceHeader.prototype.hideModal = function () {
        this.setState({ showModal: false });
    };
    return CVLBalanceHeader;
}(React.Component));
exports.TokensTabSellActive = function (props) {
    var onSellComplete = props.onSellComplete, balance = props.balance;
    return (React.createElement(React.Fragment, null,
        React.createElement(TokensStyledComponents_1.TokenBuyIntro, null,
            React.createElement(CVLBalanceHeader, { balance: balance })),
        React.createElement(TokensTextComponents_1.TokenSellInstructionsText, null),
        React.createElement(UniswapSellSection_1.UniswapSellSection, { onComplete: onSellComplete })));
};
var templateObject_1, templateObject_2;
//# sourceMappingURL=TokensTabSellActive.js.map