{"ast":null,"code":"import _regeneratorRuntime from \"@babel/runtime/regenerator\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _asyncToGenerator from \"@babel/runtime/helpers/esm/asyncToGenerator\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { Fragment as _Fragment } from \"react/jsx-runtime\";\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nimport cn from 'classnames';\nimport BoxButton from 'components/gui/BoxButton';\nimport CustomBlockContent from 'components/gui/CustomBlockContent';\nimport useLocale from 'contexts/useLocale';\nimport { useIsDesktop } from 'hooks/useIsDevice'; // import { useIsDesktop } from 'hooks/useIsDevipuseIsDesktope'\n\nimport { getNewsPage, imageBuilder } from 'lib/api';\nimport SliceIntro from 'slices/SliceIntro/SliceIntro';\nimport styles from './News.module.scss';\nvar news = [{\n  _id: 'a',\n  title: \"Un appartement se libe\\u0300re dans l\\u2019habitation VERNE \\xE0 Nantes.\"\n}, {\n  _id: 'b',\n  title: 'Explorez votre nouvelle ville entre habitants en toute simplicité ce week-end !'\n}, {\n  _id: 'c',\n  title: 'Le potager partagé de Cinq prend forme à Bordeaux.'\n}, {\n  _id: 'd',\n  title: 'Cinq ouvre très prochainement à Bordeaux ! 11 logements sont disponibles.'\n}, {\n  _id: 'aa',\n  title: \"Un appartement se libe\\u0300re dans l\\u2019habitation VERNE \\xE0 Nantes.\"\n}, {\n  _id: 'bb',\n  title: 'Explorez votre nouvelle ville entre habitants en toute simplicité ce week-end !'\n}, {\n  _id: 'cc',\n  title: 'Le potager partagé de Cinq prend forme à Bordeaux.'\n}, {\n  _id: 'dd',\n  title: 'Cinq ouvre très prochainement à Bordeaux ! 11 logements sont disponibles.'\n}];\n\nvar NewsPage = function NewsPage(slug) {\n  return function (_ref) {\n    var lang = _ref.lang,\n        title = _ref.title,\n        followOnInsta = _ref.followOnInsta,\n        news = _ref.news;\n    // const locale = useLocale()\n    var isDesktop = useIsDesktop();\n    var imageURL = 'https://www.colivingfactory.com/assets/coresider/images/1.png';\n    return /*#__PURE__*/_jsxs(_Fragment, {\n      children: [isDesktop ? /*#__PURE__*/_jsx(SliceIntro, {\n        text: title || 'Actualité',\n        large: true\n      }) : /*#__PURE__*/_jsx(\"h1\", {\n        className: cn('h--2', styles.title),\n        children: title || 'Actualité'\n      }), news.map(function (news, i) {\n        return /*#__PURE__*/_jsx(\"section\", {\n          className: cn(styles.newsSlice) // style={{\n          // \tbackgroundImage: isDesktop && `url(${imageURL})`,\n          // }}\n          ,\n          children: isDesktop ? /*#__PURE__*/_jsxs(_Fragment, {\n            children: [/*#__PURE__*/_jsx(\"div\", {\n              className: cn(styles.backgroundImage),\n              children: /*#__PURE__*/_jsx(\"img\", {\n                src: imageURL\n              })\n            }), /*#__PURE__*/_jsxs(\"div\", {\n              className: cn(styles.newsMiddle, i % 2 == 1 && styles.reverse),\n              children: [/*#__PURE__*/_jsx(\"div\", {\n                className: cn(styles.newsColumn, styles.imageContent),\n                children: /*#__PURE__*/_jsx(\"img\", {\n                  src: imageURL\n                })\n              }), /*#__PURE__*/_jsxs(\"div\", {\n                className: cn(styles.newsColumn, styles.textContent),\n                children: [/*#__PURE__*/_jsx(\"h2\", {\n                  className: cn('h--2'),\n                  children: news.title\n                }), /*#__PURE__*/_jsx(\"p\", {\n                  className: cn('p--m'),\n                  children: \"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sit in amet vivamus amet congue in nulla convallis. Urna pellentesque magnis pellentesque feugiat ipsum. Cursus in turpis volutpat sit id ipsum dolor urna. Et vel morbi cursus et risus, ornare sed. Est viverra integer adipiscing vulputate ut sagittis. At facilisis scelerisque volutpat et at. Id vitae pharetra, a eu urna, adipiscing ac. Purus ut sed egestas sit ac interdum et augue. Nisi volutpat tortor congue velit. Ultrices augue amet dignissim volutpat, et ut in massa. Facilisi nullam cras ante mi ultrices arcu, nulla. Nulla enim rhoncus at vitae.\"\n                }), /*#__PURE__*/_jsx(BoxButton, {\n                  className: cn(styles.button),\n                  label: followOnInsta,\n                  fullWidth: true,\n                  href: 'https://www.instagram.com/colivingfactory',\n                  icon: \"right\"\n                })]\n              })]\n            })]\n          }) : /*#__PURE__*/_jsxs(_Fragment, {\n            children: [/*#__PURE__*/_jsx(\"img\", {\n              src: imageURL\n            }), /*#__PURE__*/_jsx(\"h2\", {\n              className: cn('h--3'),\n              children: news.title\n            }), /*#__PURE__*/_jsx(\"p\", {\n              className: cn('p--m'),\n              children: \"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sit in amet vivamus amet congue in nulla convallis. Urna pellentesque magnis pellentesque feugiat ipsum. Cursus in turpis volutpat sit id ipsum dolor urna. Et vel morbi cursus et risus, ornare sed. Est viverra integer adipiscing vulputate ut sagittis. At facilisis scelerisque volutpat et at. Id vitae pharetra, a eu urna, adipiscing ac. Purus ut sed egestas sit ac interdum et augue. Nisi volutpat tortor congue velit. Ultrices augue amet dignissim volutpat, et ut in massa. Facilisi nullam cras ante mi ultrices arcu, nulla. Nulla enim rhoncus at vitae.\"\n            }), /*#__PURE__*/_jsx(BoxButton, {\n              className: cn(styles.button),\n              label: followOnInsta,\n              fullWidth: true,\n              href: 'https://www.instagram.com/colivingfactory',\n              icon: \"right\"\n            })]\n          })\n        }, news._id);\n      }), isDesktop && /*#__PURE__*/_jsx(SliceIntro, {\n        left: news.length % 2 == 1\n      })]\n    });\n  };\n};\n\nexport function getStaticPropsNews(lang) {\n  return /*#__PURE__*/function () {\n    var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref2) {\n      var _ref2$preview, preview, previewData, newsPage;\n\n      return _regeneratorRuntime.wrap(function _callee$(_context) {\n        while (1) {\n          switch (_context.prev = _context.next) {\n            case 0:\n              _ref2$preview = _ref2.preview, preview = _ref2$preview === void 0 ? false : _ref2$preview, previewData = _ref2.previewData;\n              _context.next = 3;\n              return getNewsPage(lang);\n\n            case 3:\n              newsPage = _context.sent;\n              return _context.abrupt(\"return\", {\n                props: _objectSpread({\n                  lang: lang,\n                  preview: preview,\n                  news: news\n                }, newsPage)\n              });\n\n            case 5:\n            case \"end\":\n              return _context.stop();\n          }\n        }\n      }, _callee);\n    }));\n\n    return function (_x) {\n      return _ref3.apply(this, arguments);\n    };\n  }();\n}\nexport default NewsPage;","map":null,"metadata":{},"sourceType":"module"}