"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;
};
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 styleConstants_1 = require("../styleConstants");
var NavMenu_1 = require("./NavMenu");
var NavDrawer_1 = __importDefault(require("./NavDrawer"));
var UserAccount_1 = __importDefault(require("./UserAccount"));
var CivilLogo_1 = require("../CivilLogo");
var styledComponents_1 = require("./styledComponents");
var NavBar = /** @class */ (function (_super) {
    __extends(NavBar, _super);
    function NavBar(props) {
        var _this = _super.call(this, props) || this;
        _this.toggleDrawer = function () {
            _this.setState({ isUserDrawerOpen: !_this.state.isUserDrawerOpen });
        };
        _this.hideUserDrawer = function () {
            _this.setState({ isUserDrawerOpen: false });
        };
        _this.state = { isUserDrawerOpen: false };
        return _this;
    }
    NavBar.prototype.render = function () {
        var _a = this.props, authenticationURL = _a.authenticationURL, balance = _a.balance, userEthAddress = _a.userEthAddress, votingBalance = _a.votingBalance, userRevealVotesCount = _a.userRevealVotesCount, userClaimRewardsCount = _a.userClaimRewardsCount, userChallengesStartedCount = _a.userChallengesStartedCount, userChallengesVotedOnCount = _a.userChallengesVotedOnCount, buyCvlUrl = _a.buyCvlUrl, joinAsMemberUrl = _a.joinAsMemberUrl, applyURL = _a.applyURL, useGraphQL = _a.useGraphQL, onLogoutPressed = _a.onLogoutPressed, enableEthereum = _a.enableEthereum, onLoginPressed = _a.onLoginPressed, onSignupPressed = _a.onSignupPressed, onModalDefocussed = _a.onModalDefocussed, onViewDashboardPressed = _a.onViewDashboardPressed;
        var isUserDrawerOpen = this.state.isUserDrawerOpen;
        return (React.createElement(styledComponents_1.NavContainer, null,
            React.createElement(styledComponents_1.NavOuter, null,
                React.createElement(styledComponents_1.NavInner, null,
                    React.createElement(styledComponents_1.NavLogo, null,
                        React.createElement("a", { href: "https://civil.co" },
                            React.createElement(CivilLogo_1.CivilLogo, { color: styleConstants_1.colors.basic.WHITE }))),
                    React.createElement(NavMenu_1.NavMenu, null)),
                React.createElement(styledComponents_1.NavInnerRight, null,
                    React.createElement(UserAccount_1.default, { balance: balance, votingBalance: votingBalance, isUserDrawerOpen: isUserDrawerOpen, userEthAddress: userEthAddress, authenticationURL: authenticationURL, joinAsMemberUrl: joinAsMemberUrl, applyURL: applyURL, enableEthereum: enableEthereum, toggleDrawer: this.toggleDrawer, onLoginPressed: onLoginPressed, onSignupPressed: onSignupPressed, onModalDefocussed: onModalDefocussed }, isUserDrawerOpen && (React.createElement(NavDrawer_1.default, { balance: balance, votingBalance: votingBalance, userEthAddress: userEthAddress, userRevealVotesCount: userRevealVotesCount, userClaimRewardsCount: userClaimRewardsCount, userChallengesStartedCount: userChallengesStartedCount, userChallengesVotedOnCount: userChallengesVotedOnCount, buyCvlUrl: buyCvlUrl, useGraphQL: useGraphQL, onLogoutPressed: onLogoutPressed, onViewDashboardPressed: onViewDashboardPressed, handleOutsideClick: this.hideUserDrawer, onLoginPressed: onLoginPressed, onSignupPressed: onSignupPressed, onModalDefocussed: onModalDefocussed })))))));
    };
    return NavBar;
}(React.Component));
exports.NavBar = NavBar;
//# sourceMappingURL=NavBar.js.map