text: webpackHotUpdate("static/development/pages/orders.js",{
  
  /***/ "./components/Orders.js":
  /*!******************************!*\
    !*** ./components/Orders.js ***!
    \******************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  /* harmony import */ var react_apollo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-apollo */ "./node_modules/react-apollo/react-apollo.browser.umd.js");
  /* harmony import */ var react_apollo__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_apollo__WEBPACK_IMPORTED_MODULE_1__);
  /* harmony import */ var date_fns__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! date-fns */ "./node_modules/date-fns/esm/index.js");
  /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! next/link */ "./node_modules/next/link.js");
  /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__);
  /* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! styled-components */ "./node_modules/styled-components/dist/styled-components.browser.esm.js");
  /* harmony import */ var _lib_formatMoney__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../lib/formatMoney */ "./lib/formatMoney.js");
  /* harmony import */ var _styles_OrderItemStyles__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./styles/OrderItemStyles */ "./components/styles/OrderItemStyles.js");
  /* harmony import */ var _components_ErrorMessage__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../components/ErrorMessage */ "./components/ErrorMessage.js");
  /* harmony import */ var _queries_queries__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../queries/queries */ "./queries/queries.js");
  var _jsxFileName = "/Users/FlaviuVadan/Documents/Git/sick-fits/frontend/components/Orders.js";
  
  function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  
  function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  
  
  
  
  
  
  
  
  
  
  var OrdersList = styled_components__WEBPACK_IMPORTED_MODULE_4__["default"].ul.withConfig({
    displayName: "Orders__OrdersList",
    componentId: "sc-1km0nir-0"
  })(["display:grid;grid-gap:4rem;grid-template-columns:repeat(auto-fit,minimax(40%,1fr));"]);
  
  var Orders =
  /*#__PURE__*/
  function (_Component) {
    _inherits(Orders, _Component);
  
    function Orders() {
      _classCallCheck(this, Orders);
  
      return _possibleConstructorReturn(this, _getPrototypeOf(Orders).apply(this, arguments));
    }
  
    _createClass(Orders, [{
      key: "render",
      value: function render() {
        return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_apollo__WEBPACK_IMPORTED_MODULE_1__["Query"], {
          query: _queries_queries__WEBPACK_IMPORTED_MODULE_8__["ORDERS_QUERY"],
          __source: {
            fileName: _jsxFileName,
            lineNumber: 21
          },
          __self: this
        }, function (_ref) {
          var orders = _ref.data.orders,
              loading = _ref.loading,
              error = _ref.error;
          if (error) return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_ErrorMessage__WEBPACK_IMPORTED_MODULE_7__["default"], {
            error: error,
            __source: {
              fileName: _jsxFileName,
              lineNumber: 23
            },
            __self: this
          });
          if (loading) return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("p", {
            __source: {
              fileName: _jsxFileName,
              lineNumber: 24
            },
            __self: this
          }, "Loading...");
          return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
            __source: {
              fileName: _jsxFileName,
              lineNumber: 27
            },
            __self: this
          }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h2", {
            __source: {
              fileName: _jsxFileName,
              lineNumber: 28
            },
            __self: this
          }, "You have ", orders.length, " orders"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(OrdersList, {
            __source: {
              fileName: _jsxFileName,
              lineNumber: 29
            },
            __self: this
          }, orders.map(function (order) {
            return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_styles_OrderItemStyles__WEBPACK_IMPORTED_MODULE_6__["default"], {
              key: order.id,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 32
              },
              __self: this
            }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(next_link__WEBPACK_IMPORTED_MODULE_3___default.a, {
              href: {
                pathname: '/order',
                query: {
                  id: order.id
                }
              },
              __source: {
                fileName: _jsxFileName,
                lineNumber: 33
              },
              __self: this
            }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
              __source: {
                fileName: _jsxFileName,
                lineNumber: 39
              },
              __self: this
            }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
              className: "order-meta",
              __source: {
                fileName: _jsxFileName,
                lineNumber: 40
              },
              __self: this
            }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("p", {
              __source: {
                fileName: _jsxFileName,
                lineNumber: 41
              },
              __self: this
            }, order.items.reduce(function (total, item) {
              return total + item.quantity;
            }, 0), " items"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("p", {
              __source: {
                fileName: _jsxFileName,
                lineNumber: 42
              },
              __self: this
            }, order.items.length, " products"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("p", {
              __source: {
                fileName: _jsxFileName,
                lineNumber: 43
              },
              __self: this
            }, Object(date_fns__WEBPACK_IMPORTED_MODULE_2__["formatDistance"])(order.createdAt, new Date()), " ago"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("p", {
              __source: {
                fileName: _jsxFileName,
                lineNumber: 44
              },
              __self: this
            }, Object(_lib_formatMoney__WEBPACK_IMPORTED_MODULE_5__["default"])(order.total), " order total")))));
          })));
        });
      }
    }]);
  
    return Orders;
  }(react__WEBPACK_IMPORTED_MODULE_0__["Component"]);
  
  /* harmony default export */ __webpack_exports__["default"] = (Orders);
  
  /***/ })
  
  })
  //# sourceMappingURL=orders.js.c61431292a3c89e4b297.hot-update.js.map