tj-sga-website-react/oldbuild/20250314/build/static/js/124.0934d14d.chunk.js
2025-03-14 15:33:32 -04:00

2 lines
3.3 KiB
JavaScript

"use strict";(self.webpackChunksga_website=self.webpackChunksga_website||[]).push([[124],{336:(t,e,i)=>{i.d(e,{A:()=>l});var n=i(579);function l(t){let{imageURL:e="/images/hero.jpg",heading:i="TJHSST SGA"}=t;return(0,n.jsxs)("div",{className:"hero",children:[(0,n.jsx)("span",{className:"hero-heading",children:i}),(0,n.jsx)("img",{src:e,alt:"Background",style:{width:"100vw",maxHeight:"60vh",objectFit:"contain"}})]})}},3124:(t,e,i)=>{i.r(e),i.d(e,{default:()=>o});var n=i(5043),l=(i(4757),i(3628)),a=i(5649),d=i(579);function r(t){let{onClick:e,children:i}=t;return(0,d.jsx)("button",{onClick:e,className:"blue-button",children:i})}var s=i(8597);function c(){let[t,e]=n.useState([]),[i,c]=n.useState(!1);const h=async(t,i)=>{const n={last_date:t,last_title:i};let a=await l.A.fetch('*[_type == "article" && (\n\t\t\t\tpublish_date < $last_date ||\n\t\t\t\t(\n\t\t\t\t\tpublish_date == $last_date && \n\t\t\t\t\ttitle > $last_title\n\t\t\t\t)\n\t\t\t)] | order(publish_date desc, title) [0...3]',n);a.length<3&&c(!0),e((t=>t.concat(a)))};if(n.useEffect((()=>{h("3000-01-01","")}),[]),!t)return null;let o;o=i?(0,d.jsx)("div",{children:"No more articles to show"}):(0,d.jsx)(r,{onClick:()=>{let{publish_date:e,title:i}=t[t.length-1];h(e,i)},children:"Load more articles"});const g=t.map((t=>(0,d.jsx)(a.A,{article:t},t._id)));return(0,d.jsxs)("div",{children:[g,(0,d.jsx)(s.A,{children:o})]})}var h=i(336);function o(){return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h.A,{heading:"News"}),(0,d.jsx)("main",{children:(0,d.jsx)("div",{style:{paddingTop:"1em"},children:(0,d.jsx)(c,{})})})]})}},3213:(t,e,i)=>{i.d(e,{A:()=>a});var n=i(5475),l=i(579);function a(t){let{href:e,children:i,target:a}=t;return e.startsWith("http")?(0,l.jsx)("a",{href:e,className:"clickable-link",target:a,children:i}):(0,l.jsx)(n.N_,{to:e,className:"clickable-link",children:i})}},4757:()=>{},5649:(t,e,i)=>{i.d(e,{A:()=>s});i(5043),i(4757);var n=i(8294),l=i(3213),a=i(579);function d(t){let{paddingLeft:e,paddingRight:i,marginTop:n,marginBottom:l,children:d}=t;return(0,a.jsx)("div",{style:{display:"flex",flexDirection:"row",paddingLeft:e,paddingRight:i,marginTop:n,marginBottom:l},children:d})}function r(t){let{children:e,flex:i,paddingLeft:n,paddingRight:l,paddingTop:d,paddingBottom:r,paddingX:s,paddingY:c}=t;return null!=s&&(n=l=s),null!=c&&(d=r=c),(0,a.jsx)("div",{style:{flex:i,paddingLeft:n,paddingRight:l,paddingTop:d,paddingBottom:r},children:e})}function s(t){var e;let{article:i}=t,s=null;var c;i.thumbnail&&(s=(0,a.jsx)("img",{src:null!==(c=(0,n.A)(i.thumbnail).url())&&void 0!==c?c:void 0,alt:i.title}));const h="/news/"+i._id+"/"+i.title.toLowerCase().replace(/ /g,"-");return(0,a.jsxs)(d,{marginTop:"4em",marginBottom:"4em",children:[(0,a.jsx)(r,{flex:1,paddingY:"0.5em",paddingRight:"1em",children:s}),(0,a.jsxs)(r,{flex:3,paddingY:"0.5em",paddingRight:"1em",children:[(0,a.jsx)(l.A,{href:h,target:"_blank",children:(0,a.jsx)("h3",{style:{margin:"0px"},children:i.title})}),(0,a.jsx)("i",{className:"text-sm",children:i.publish_date}),(0,a.jsx)("br",{}),(0,a.jsx)("i",{children:null!==(e=i.author)&&void 0!==e?e:"No author"}),(0,a.jsx)("br",{}),(0,a.jsx)("p",{children:i.summary})]})]})}},8294:(t,e,i)=>{i.d(e,{A:()=>r});var n=i(138),l=i.n(n),a=i(3628);const d=l()(a.A);function r(t){return d.image(t)}}}]);
//# sourceMappingURL=124.0934d14d.chunk.js.map