"use strict";
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 __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
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;
};
Object.defineProperty(exports, "__esModule", { value: true });
var React = __importStar(require("react"));
var TokensStyledComponents_1 = require("../TokensStyledComponents");
var TokensTextComponents_1 = require("../TokensTextComponents");
var UniswapBuySection_1 = require("./UniswapBuySection");
var AirswapBuySection_1 = require("./AirswapBuySection");
var UsdEthConverter_1 = require("../../CurrencyConverter/UsdEthConverter");
var FeatureFlag_1 = require("../../features/FeatureFlag");
var containers_1 = require("../../containers");
var Notice_1 = require("../../Notice");
var TokensTabBuyActive = /** @class */ (function (_super) {
    __extends(TokensTabBuyActive, _super);
    function TokensTabBuyActive(props) {
        var _this = _super.call(this, props) || this;
        _this.state = { etherToSpend: 0, usdToSpend: 0 };
        return _this;
    }
    TokensTabBuyActive.prototype.render = function () {
        var _this = this;
        var _a = this.props, foundationAddress = _a.foundationAddress, network = _a.network, onBuyComplete = _a.onBuyComplete;
        return (React.createElement(React.Fragment, null,
            React.createElement(Notice_1.Notice, { type: Notice_1.NoticeTypes.ALERT },
                React.createElement(TokensTextComponents_1.TokenBuyText, null)),
            React.createElement(TokensStyledComponents_1.TokenAirswapSection, null,
                React.createElement(TokensStyledComponents_1.TokenAirswapSection, null,
                    React.createElement(TokensTextComponents_1.TokenAirswapFoundationText, null),
                    React.createElement(containers_1.PaddedSection, null,
                        React.createElement(UsdEthConverter_1.UsdEthConverter, { onConversion: function (usd, eth) { return _this.setConvertedAmount(usd, eth); } })),
                    React.createElement(AirswapBuySection_1.AirswapBuySection, { foundationAddress: foundationAddress, usdToSpend: this.state.usdToSpend, ethToSpend: this.state.etherToSpend, onBuyComplete: onBuyComplete, network: network })),
                React.createElement(FeatureFlag_1.FeatureFlag, { feature: "uniswap" },
                    React.createElement(TokensStyledComponents_1.TokenOrBreak, null,
                        React.createElement(TokensTextComponents_1.TokenOrText, null)),
                    React.createElement(UniswapBuySection_1.UniswapBuySection, { usdToSpend: this.state.usdToSpend, ethToSpend: this.state.etherToSpend, onBuyComplete: onBuyComplete }),
                    React.createElement(TokensTextComponents_1.TokenAirswapExchangeTermsOfSaleText, null)))));
    };
    TokensTabBuyActive.prototype.setConvertedAmount = function (usdToSpend, etherToSpend) {
        this.setState(__assign(__assign({}, this.state), { usdToSpend: usdToSpend, etherToSpend: etherToSpend }));
    };
    return TokensTabBuyActive;
}(React.Component));
exports.TokensTabBuyActive = TokensTabBuyActive;
//# sourceMappingURL=TokensTabBuyActive.js.map