"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 __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 PaymentsStyledComponents_1 = require("./PaymentsStyledComponents");
var PaymentsTextComponents_1 = require("./PaymentsTextComponents");
var AvatarLogin_1 = require("./AvatarLogin");
var elements_1 = require("@joincivil/elements");
var context_1 = require("../context");
var PaymentsWrapper = /** @class */ (function (_super) {
    __extends(PaymentsWrapper, _super);
    function PaymentsWrapper() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    PaymentsWrapper.prototype.render = function () {
        return (React.createElement(PaymentsStyledComponents_1.PaymentWrapperStyled, null,
            React.createElement(PaymentsStyledComponents_1.PaymentHeader, null, this.context.renderContext === context_1.RENDER_CONTEXT.EMBED ? this.renderEmbedHeader() : this.renderHeader()),
            this.props.paymentAdjustedWarning && this.props.handleEditAmount && (React.createElement(PaymentsTextComponents_1.PayWithCardMinimumText, { handleEditAmount: this.props.handleEditAmount })),
            this.props.paymentAdjustedStripe && React.createElement(PaymentsTextComponents_1.PayWithCardMinimumAdjustedText, null),
            this.props.paymentAdjustedEth && (React.createElement(PaymentsTextComponents_1.PaymentUpdatedByEthText, { usdToSpend: this.props.usdToSpend, etherToSpend: this.props.etherToSpend })),
            this.props.children));
    };
    PaymentsWrapper.prototype.renderHeader = function () {
        return (React.createElement(React.Fragment, null,
            React.createElement(PaymentsTextComponents_1.SendPaymentHdrText, null),
            React.createElement(PaymentsStyledComponents_1.PaymentHeaderFlex, null,
                React.createElement(PaymentsStyledComponents_1.PaymentHeaderNewsroom, null, this.props.newsroomName),
                this.props.usdToSpend && this.renderBoostAmount()),
            React.createElement(PaymentsStyledComponents_1.PaymentHeaderTip, null,
                React.createElement(PaymentsTextComponents_1.PaymentToNewsroomsTipText, null))));
    };
    PaymentsWrapper.prototype.renderEmbedHeader = function () {
        return (React.createElement(React.Fragment, null,
            React.createElement(PaymentsStyledComponents_1.PaymentHeaderFlex, null,
                this.props.handleBack ? (React.createElement(PaymentsStyledComponents_1.PaymentBackBtn, { onClick: this.props.handleBack },
                    React.createElement(elements_1.DisclosureArrowIcon, null),
                    "Back")) : (React.createElement("div", null)),
                React.createElement(PaymentsStyledComponents_1.PaymentCivilLogo, null,
                    React.createElement(elements_1.CivilLogo, { width: 50, height: 13 })),
                React.createElement(AvatarLogin_1.AvatarLogin, null)),
            React.createElement(PaymentsStyledComponents_1.PaymentHeaderCenter, null,
                !this.props.usdToSpend && (React.createElement(React.Fragment, null,
                    React.createElement(PaymentsTextComponents_1.SendPaymentHdrEmbedText, { newsroomName: this.props.newsroomName }),
                    React.createElement(PaymentsStyledComponents_1.PaymentHeaderTip, null,
                        React.createElement(PaymentsTextComponents_1.PaymentToNewsroomsTipText, null)))),
                this.props.usdToSpend && this.renderBoostAmount())));
    };
    PaymentsWrapper.prototype.renderBoostAmount = function () {
        return (React.createElement("div", null,
            React.createElement(PaymentsStyledComponents_1.PaymentHeaderBoostLabel, null, this.props.paymentAdjustedWarning || this.props.paymentAdjustedEth || this.props.paymentAdjustedStripe
                ? "Selected Boost"
                : "Boost"),
            React.createElement(PaymentsStyledComponents_1.PaymentHeaderAmount, null, this.props.paymentAdjustedEth || this.props.paymentAdjustedStripe ? ("$" + this.props.selectedUsdToSpend) : (React.createElement("b", null, "$" + this.props.usdToSpend)))));
    };
    PaymentsWrapper.contextType = context_1.CivilContext;
    return PaymentsWrapper;
}(React.Component));
exports.PaymentsWrapper = PaymentsWrapper;
//# sourceMappingURL=PaymentsWrapper.js.map