-
Notifications
You must be signed in to change notification settings - Fork 0
/
component---src-pages-index-tsx-5b147a3b57307511f0e6.js
1 lines (1 loc) · 5.35 KB
/
component---src-pages-index-tsx-5b147a3b57307511f0e6.js
1
(self.webpackChunkvsp_official_site=self.webpackChunkvsp_official_site||[]).push([[691],{7082:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}});var r=n(7294),o=n(5444),a=n(5937);function i(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var c=function(e){var t=e.post,n=e.className,c=void 0===n?"":n;i(e,["post","className"]);return r.createElement(o.Link,{to:"".concat(t.category.slug,"/").concat(t.slug),className:"PostCard ".concat(c)},t.featuredImages[0]&&r.createElement("div",{className:"PostCard--Image relative"},r.createElement(a.Z,{background:!0,cmsImage:t.featuredImages[0],size:400})),r.createElement("div",{className:"PostCard--Content"},t.title&&r.createElement("h3",{className:"PostCard--Title"},t.title),t.description&&r.createElement("div",{className:"PostCard--Excerpt"},t.description)))};function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=d(e);if(t){var o=d(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return m(this,n)}}function m(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?p(e):t}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var y=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(s,e);var t,n,a,i=f(s);function s(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),b(p(t=i.call(this,e)),"state",{limit:t.props.limit}),b(p(t),"increaseLimit",(function(){return t.setState((function(e){return{limit:e.limit+t.props.perPageLimit}}))})),t.state.limit=e.limit,t}return t=s,(n=[{key:"render",value:function(){var e=this.props,t=e.slug,n=e.title,a=e.description,i=e.showLoadMore,s=e.showHeader,l=e.loadMoreTitle,u=e.posts,f=this.state.limit,m=u.slice(0,f||u.length);return r.createElement("div",{className:"PostSection"},s&&r.createElement("div",{className:"PostSection--Header"},r.createElement("div",{className:"PostSection--TitleBlock"},n&&r.createElement("h2",{className:"PostSection--Title"},n),a&&r.createElement("h3",{className:"PostSection--Description"},a)),r.createElement("div",{className:"PostSection--ListLink"},r.createElement(o.Link,{to:t},"一覧"))),!!m.length&&r.createElement("div",{className:"PostSection--Grid"},m.map((function(e,t){return r.createElement(c,{post:e,key:e.id})}))),i&&m.length<u.length&&r.createElement("div",{className:"taCenter"},r.createElement("button",{className:"button",onClick:this.increaseLimit},l)))}}])&&l(t.prototype,n),a&&l(t,a),s}(r.Component);b(y,"defaultProps",{posts:[],limit:12,showLoadMore:!0,showHeader:!1,loadMoreTitle:"Load More",perPageLimit:12});var v=y},8308:function(e,t,n){"use strict";n.r(t),n.d(t,{IndexTemplate:function(){return s}});var r=n(7294),o=n(6630),a=n(4871),i=n(7082);function c(){return(c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var s=function(e){e.title,e.subtitle;var t=e.contents,n=e.postCategories,o=void 0===n?[]:n;return r.createElement("main",{className:"index"},t.trim()&&r.createElement("section",{className:"section container"},r.createElement(a.Z,{source:t})),r.createElement("span",{className:"bottom-info container"},!!o.length&&r.createElement("section",{className:"postList container"},o.map((function(e){return r.createElement("div",{className:"posts",key:e.id},r.createElement(i.Z,c({},e,{showHeader:!0,showLoadMore:!1,limit:6})))}))),r.createElement("section",{className:"twitter-tl container"},r.createElement("a",{className:"twitter-timeline","data-height":"600",href:"https://twitter.com/vsp_vrc?ref_src=twsrc%5Etfw"},"Tweets by vsp_vrc"))))};t.default=function(e){var t=e.data.cms.homepage;return r.createElement(o.Z,{title:t.title,useTitle:!1,subtitle:t.subtitle,featuredImages:t.featuredImages,size:"large"},r.createElement(s,{title:t.title,subtitle:t.subtitle,postCategories:t.categories,contents:t.contentsTransformed}))}}}]);