"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.StatusIcon = exports.Default = exports.default = void 0;

var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));

var _react = _interopRequireWildcard(require("react"));

var _Grid = _interopRequireDefault(require("@material-ui/core/Grid"));

var _styles = require("@material-ui/core/styles");

var _TestTopNavBar = require("../../components/navigation/TestTopNavBar");

var _TestRadioInputSection = _interopRequireDefault(require("../../components/userInput/TestRadioInputSection"));

var _TestRadioButton = _interopRequireDefault(require("../../components/elements/TestRadioButton"));

var _core = require("@material-ui/core");

function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

var _default = {
  title: 'Navigation/TestTopNavBar',
  component: _TestTopNavBar.TestTopNavBar
};
exports.default = _default;

var Default = function Default() {
  var _useState = (0, _react.useState)(false),
      _useState2 = (0, _slicedToArray2.default)(_useState, 2),
      collapsed = _useState2[0],
      setCollapsed = _useState2[1];

  var theme = (0, _styles.useTheme)();
  (0, _react.useEffect)(function () {
    if (collapsed) {
      return;
    }

    var handleScroll = function handleScroll() {
      setCollapsed(true);
    };

    window.addEventListener("scroll", handleScroll);
    return function () {
      return window.removeEventListener("scroll", handleScroll);
    };
  }, [collapsed]);
  return /*#__PURE__*/_react.default.createElement(_TestTopNavBar.TestTopNavBar, {
    exitOnClick: function exitOnClick() {
      alert('Exiting!');
    },
    collapsedTitle: "\u0417\u0430\u0432\u0434\u0430\u043D\u043D\u044F 1",
    setCollapsed: setCollapsed,
    collapsed: collapsed
  }, /*#__PURE__*/_react.default.createElement(_core.Typography, {
    variant: "h3",
    style: {
      paddingTop: theme.spacing(1)
    }
  }, "\u0417\u0430\u0432\u0434\u0430\u043D\u043D\u044F 1"), /*#__PURE__*/_react.default.createElement(_core.Typography, {
    variant: "body2"
  }, "2019 \u043E\u0441\u043D\u043E\u0432\u043D\u0430 \u0441\u0435\u043A\u0446\u0456\u044F"), /*#__PURE__*/_react.default.createElement(_TestRadioInputSection.default, {
    style: {
      paddingTop: theme.spacing(2)
    },
    testRadioButtonsList: [/*#__PURE__*/_react.default.createElement(_TestRadioButton.default, {
      label: "1"
    }), /*#__PURE__*/_react.default.createElement(_TestRadioButton.default, {
      label: "2"
    }), /*#__PURE__*/_react.default.createElement(_TestRadioButton.default, {
      label: "3"
    }), /*#__PURE__*/_react.default.createElement(_TestRadioButton.default, {
      label: "4"
    }), /*#__PURE__*/_react.default.createElement(_TestRadioButton.default, {
      label: "5"
    }), /*#__PURE__*/_react.default.createElement(_TestRadioButton.default, {
      label: "6"
    }), /*#__PURE__*/_react.default.createElement(_TestRadioButton.default, {
      label: "7"
    }), /*#__PURE__*/_react.default.createElement(_TestRadioButton.default, {
      label: "8"
    }), /*#__PURE__*/_react.default.createElement(_TestRadioButton.default, {
      label: "9"
    }), /*#__PURE__*/_react.default.createElement(_TestRadioButton.default, {
      label: "10"
    }), /*#__PURE__*/_react.default.createElement(_TestRadioButton.default, {
      label: "11"
    }), /*#__PURE__*/_react.default.createElement(_TestRadioButton.default, {
      label: "12"
    }), /*#__PURE__*/_react.default.createElement(_TestRadioButton.default, {
      label: "13"
    }), /*#__PURE__*/_react.default.createElement(_TestRadioButton.default, {
      label: "14"
    }), /*#__PURE__*/_react.default.createElement(_TestRadioButton.default, {
      label: "15"
    }), /*#__PURE__*/_react.default.createElement(_TestRadioButton.default, {
      label: "16"
    }), /*#__PURE__*/_react.default.createElement(_TestRadioButton.default, {
      label: "17"
    }), /*#__PURE__*/_react.default.createElement(_TestRadioButton.default, {
      label: "18"
    }), /*#__PURE__*/_react.default.createElement(_TestRadioButton.default, {
      label: "19"
    }), /*#__PURE__*/_react.default.createElement(_TestRadioButton.default, {
      label: "20"
    }), /*#__PURE__*/_react.default.createElement(_TestRadioButton.default, {
      label: "21"
    }), /*#__PURE__*/_react.default.createElement(_TestRadioButton.default, {
      label: "22"
    }), /*#__PURE__*/_react.default.createElement(_TestRadioButton.default, {
      label: "23"
    }), /*#__PURE__*/_react.default.createElement(_TestRadioButton.default, {
      label: "24"
    }), /*#__PURE__*/_react.default.createElement(_TestRadioButton.default, {
      label: "25"
    }), /*#__PURE__*/_react.default.createElement(_TestRadioButton.default, {
      label: "26"
    }), /*#__PURE__*/_react.default.createElement(_TestRadioButton.default, {
      label: "27"
    }), /*#__PURE__*/_react.default.createElement(_TestRadioButton.default, {
      label: "28"
    }), /*#__PURE__*/_react.default.createElement(_TestRadioButton.default, {
      label: "29"
    }), /*#__PURE__*/_react.default.createElement(_TestRadioButton.default, {
      label: "30"
    })]
  }));
};

exports.Default = Default;

var StatusIcon = function StatusIcon() {
  var _useState3 = (0, _react.useState)(false),
      _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
      collapsed = _useState4[0],
      setCollapsed = _useState4[1];

  var theme = (0, _styles.useTheme)();
  (0, _react.useEffect)(function () {
    if (collapsed) {
      return;
    }

    var handleScroll = function handleScroll() {
      setCollapsed(true);
    };

    window.addEventListener("scroll", handleScroll);
    return function () {
      return window.removeEventListener("scroll", handleScroll);
    };
  }, [collapsed]);
  return /*#__PURE__*/_react.default.createElement(_Grid.default, {
    container: true,
    direction: "column"
  }, /*#__PURE__*/_react.default.createElement(_Grid.default, {
    item: true
  }, /*#__PURE__*/_react.default.createElement(_TestTopNavBar.TestTopNavBar, {
    collapsedTitle: "\u0417\u0430\u0432\u0434\u0430\u043D\u043D\u044F 1",
    collapsed: true,
    currentQuestionCorrectness: "correct"
  })), /*#__PURE__*/_react.default.createElement(_Grid.default, {
    item: true
  }, /*#__PURE__*/_react.default.createElement(_TestTopNavBar.TestTopNavBar, {
    collapsedTitle: "\u0417\u0430\u0432\u0434\u0430\u043D\u043D\u044F 1",
    collapsed: true,
    currentQuestionCorrectness: "part-correct"
  })), /*#__PURE__*/_react.default.createElement(_Grid.default, {
    item: true
  }, /*#__PURE__*/_react.default.createElement(_TestTopNavBar.TestTopNavBar, {
    collapsedTitle: "\u0417\u0430\u0432\u0434\u0430\u043D\u043D\u044F 1",
    collapsed: true,
    currentQuestionCorrectness: "incorrect"
  })), /*#__PURE__*/_react.default.createElement(_Grid.default, {
    item: true
  }, /*#__PURE__*/_react.default.createElement(_TestTopNavBar.TestTopNavBar, {
    collapsedTitle: "\u0417\u0430\u0432\u0434\u0430\u043D\u043D\u044F 1",
    collapsed: true,
    currentQuestionStarted: true
  })));
};

exports.StatusIcon = StatusIcon;