{"ast":null,"code":"import { 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\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\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';\nconst news = [{\n  _id: 'a',\n  title: `Un appartement se libère dans l’habitation VERNE à 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̀re dans l’habitation VERNE à 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\nconst NewsPage = slug => ({\n  lang,\n  title,\n  followOnInsta,\n  news\n}) => {\n  // const locale = useLocale()\n  const isDesktop = useIsDesktop();\n  const 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((news, i) => /*#__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)), isDesktop && /*#__PURE__*/_jsx(SliceIntro, {\n      left: news.length % 2 == 1\n    })]\n  });\n};\n\nexport function getStaticPropsNews(lang) {\n  return async ({\n    preview = false,\n    previewData\n  }) => {\n    //const news = await getNews(lang)\n    const newsPage = await getNewsPage(lang);\n    return {\n      props: _objectSpread({\n        lang,\n        preview,\n        news\n      }, newsPage)\n    };\n  };\n}\nexport default NewsPage;","map":null,"metadata":{},"sourceType":"module"}