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

1 line
7.0 KiB
Plaintext

{"version":3,"file":"static/js/647.9dfaa63d.chunk.js","mappings":"qIAAe,SAASA,EAAaC,GAKH,IALI,SACrCC,KACGC,GAG2BF,EAC9B,OACCG,EAAAA,EAAAA,KAAA,MAAIC,UAAU,UAAWF,EAAKD,SAC5BA,GAGJ,C,8CCTe,SAASI,EAAIL,GAMxB,IANyB,SAC5BM,EAAW,mBAAkB,QAC7BC,EAAU,cAIVP,EACA,OACCQ,EAAAA,EAAAA,MAAA,OAAKJ,UAAU,OAAMH,SAAA,EACpBE,EAAAA,EAAAA,KAAA,QAAMC,UAAU,eAAcH,SAAEM,KAChCJ,EAAAA,EAAAA,KAAA,OACCM,IAAKH,EACLI,IAAI,aACJC,MAAO,CACNC,MAAO,QACPC,UAAW,OACXC,UAAW,eAKhB,C,yDCrBe,SAASC,EAAaf,GAQjC,IARkC,KACrCgB,EAAI,SACJf,EAAQ,OACRgB,GAKAjB,EACA,OAAIgB,EAAKE,WAAW,SAElBf,EAAAA,EAAAA,KAAA,KAAGa,KAAMA,EAAMZ,UAAU,iBAAiBa,OAAQA,EAAOhB,SACvDA,KAKFE,EAAAA,EAAAA,KAACgB,EAAAA,GAAI,CAACC,GAAIJ,EAAMZ,UAAU,iBAAgBH,SACxCA,GAIL,C,mGCtBe,SAASoB,EAA6BrB,GAIjD,IAJkD,OACrDsB,GAGAtB,EACA,OACCG,EAAAA,EAAAA,KAAA,OACCoB,IAAMA,IAGDA,GACHA,EAAIC,iBAAiB,KAAKC,SAASC,IAClCA,EAAKT,OAAS,QAAQ,GAExB,EACChB,UAEFE,EAAAA,EAAAA,KAACwB,IAAY,CAACL,OAAQA,EAAQM,UAAU,WAAWC,QAAQ,gBAG9D,C,iECZe,SAASC,IACvB,IAAI,UAAEC,IAAcC,EAAAA,EAAAA,KAChBC,ECTU,SAAwBF,GACtC,IAAKE,EAASC,IAAcC,EAAAA,EAAAA,UAA8B,MAM1D,OAJAC,EAAAA,EAAAA,YAAU,KACTC,EAAAA,EAAOC,MAAM,2BAA4B,CAAEP,cAAaQ,KAAKL,EAAW,GACtE,CAACH,IAEGE,CACR,CDCeO,CAAeT,GAAa,IAEtCU,EAAe,mBACR,OAAPR,QAAO,IAAPA,GAAAA,EAASS,YACZD,GAAeE,EAAAA,EAAAA,GAASV,EAAQS,WAAWE,OAG5C,MAAMC,GACL1C,EAAAA,EAAAA,KAACY,EAAAA,EAAa,CAACC,KAAK,QAAOf,SAAC,4BAG7B,OACCO,EAAAA,EAAAA,MAAAsC,EAAAA,SAAA,CAAA7C,SAAA,EACCE,EAAAA,EAAAA,KAACE,EAAAA,EAAI,CAACE,QAAQ,OAAOD,SAAUmC,QAAgBM,KAC/C5C,EAAAA,EAAAA,KAAA,QAAAF,SACEgC,GACAzB,EAAAA,EAAAA,MAAA,OAAKG,MAAO,CAAEqC,SAAU,QAASC,OAAQ,aAAchD,SAAA,CACrD4C,GACD1C,EAAAA,EAAAA,KAACJ,EAAAA,EAAa,CAAAE,SAAEgC,EAAQiB,SACxB1C,EAAAA,EAAAA,MAAA,KAAAP,SAAA,CAAG,UACMgC,EAAQkB,aAAa,OAAKlB,EAAQmB,QAAU,gBAErDjD,EAAAA,EAAAA,KAAA,UACAA,EAAAA,EAAAA,KAAA,OAAKC,UAAU,qBAAoBH,UAClCE,EAAAA,EAAAA,KAACkB,EAA6B,CAACC,OAAQW,EAAQoB,aAEhDlD,EAAAA,EAAAA,KAAA,SACC0C,KAEC,SAIR,C,8EE1CA,MAAMS,EAAUC,IAAgBlB,EAAAA,GAMjB,SAASM,EAASa,GAChC,OAAOF,EAAQG,MAAMD,EACtB,C","sources":["components/PrimaryHeader.tsx","components/Hero.tsx","components/ClickableLink.tsx","components/BlockContentWithExternalLinks.tsx","pages/newsarticle.tsx","hooks/useNewsArticle.ts","lib/imageUrl.ts"],"sourcesContent":["export default function PrimaryHeader({\r\n\tchildren,\r\n\t...props\r\n}: {\r\n\tchildren: React.ReactNode;\r\n} & JSX.IntrinsicElements['h1']) {\r\n\treturn (\r\n\t\t<h1 className='my-4' {...props}>\r\n\t\t\t{children}\r\n\t\t</h1>\r\n\t);\r\n}\r\n","import '../css/hero.css';\r\n\r\nexport default function Hero({\r\n\timageURL = '/images/hero.jpg',\r\n\theading = 'TJHSST SGA',\r\n}: {\r\n\timageURL?: string;\r\n\theading?: string;\r\n}) {\r\n\treturn (\r\n\t\t<div className='hero'>\r\n\t\t\t<span className='hero-heading'>{heading}</span>\r\n\t\t\t<img\r\n\t\t\t\tsrc={imageURL}\r\n\t\t\t\talt='Background'\r\n\t\t\t\tstyle={{\r\n\t\t\t\t\twidth: '100vw',\r\n\t\t\t\t\tmaxHeight: '60vh',\r\n\t\t\t\t\tobjectFit: 'contain',\r\n\t\t\t\t}}\r\n\t\t\t/>\r\n\t\t</div>\r\n\t);\r\n}\r\n","import { Link } from 'react-router-dom';\r\n\r\nexport default function ClickableLink({\r\n\thref,\r\n\tchildren,\r\n\ttarget,\r\n}: {\r\n\thref: string;\r\n\tchildren: React.ReactNode;\r\n\ttarget?: string;\r\n}) {\r\n\tif (href.startsWith('http')) {\r\n\t\treturn (\r\n\t\t\t<a href={href} className='clickable-link' target={target}>\r\n\t\t\t\t{children}\r\n\t\t\t</a>\r\n\t\t);\r\n\t} else {\r\n\t\treturn (\r\n\t\t\t<Link to={href} className='clickable-link'>\r\n\t\t\t\t{children}\r\n\t\t\t</Link>\r\n\t\t);\r\n\t}\r\n}\r\n","import BlockContent from '@sanity/block-content-to-react';\r\n\r\nexport default function BlockContentWithExternalLinks({\r\n\tblocks,\r\n}: {\r\n\tblocks: any[];\r\n}) {\r\n\treturn (\r\n\t\t<div\r\n\t\t\tref={(ref) => {\r\n\t\t\t\t// When this element loads, convert all the links to have target=\"_blank.\"\r\n\t\t\t\t// This ensures that the links open in a new tab\r\n\t\t\t\tif (ref) {\r\n\t\t\t\t\tref.querySelectorAll('a').forEach((link) => {\r\n\t\t\t\t\t\tlink.target = '_blank';\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}}\r\n\t\t>\r\n\t\t\t<BlockContent blocks={blocks} projectId='yi263kzm' dataset='production' />\r\n\t\t</div>\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport { useParams } from 'react-router-dom';\r\nimport BlockContentWithExternalLinks from '../components/BlockContentWithExternalLinks';\r\nimport ClickableLink from '../components/ClickableLink';\r\nimport Hero from '../components/Hero';\r\nimport PrimaryHeader from '../components/PrimaryHeader';\r\nimport '../css/article.css';\r\nimport useNewsArticle from '../hooks/useNewsArticle';\r\nimport imageUrl from '../lib/imageUrl';\r\n\r\nexport default function NewsArticle() {\r\n\tlet { articleId } = useParams<{ articleId: string }>();\r\n\tlet article = useNewsArticle(articleId || '');\r\n\r\n\tlet thumbnailUrl = '/images/hero.png';\r\n\tif (article?.thumbnail) {\r\n\t\tthumbnailUrl = imageUrl(article.thumbnail).url()!;\r\n\t}\r\n\r\n\tconst goToAllNewsArticles = (\r\n\t\t<ClickableLink href='/news'>Go to all news articles</ClickableLink>\r\n\t);\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t<Hero heading='News' imageURL={thumbnailUrl || undefined} />\r\n\t\t\t<main>\r\n\t\t\t\t{article ? (\r\n\t\t\t\t\t<div style={{ maxWidth: '640px', margin: '2rem auto' }}>\r\n\t\t\t\t\t\t{goToAllNewsArticles}\r\n\t\t\t\t\t\t<PrimaryHeader>{article.title}</PrimaryHeader>\r\n\t\t\t\t\t\t<i>\r\n\t\t\t\t\t\t\tPosted {article.publish_date} by {article.author || 'No author'}\r\n\t\t\t\t\t\t</i>\r\n\t\t\t\t\t\t<br />\r\n\t\t\t\t\t\t<div className='article-paragraphs'>\r\n\t\t\t\t\t\t\t<BlockContentWithExternalLinks blocks={article.content} />\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t<br />\r\n\t\t\t\t\t\t{goToAllNewsArticles}\r\n\t\t\t\t\t</div>\r\n\t\t\t\t) : null}\r\n\t\t\t</main>\r\n\t\t</>\r\n\t);\r\n}\r\n","import { useEffect, useState } from 'react';\r\nimport sanity from '../sanity';\r\n\r\nexport default function useNewsArticle(articleId: string) {\r\n\tlet [article, setArticle] = useState<SGA.ArticleDocument>(null!);\r\n\r\n\tuseEffect(() => {\r\n\t\tsanity.fetch('*[_id == $articleId] [0]', { articleId }).then(setArticle);\r\n\t}, [articleId]);\r\n\r\n\treturn article;\r\n}\r\n","import { default as ImageUrlBuilder } from '@sanity/image-url';\r\nimport sanity from '../sanity';\r\n\r\nconst builder = ImageUrlBuilder(sanity);\r\n\r\n/**\r\n * Build a URL for an image based on specified attributes\r\n * @param {SanityImageSource} source The source image\r\n */\r\nexport default function imageUrl(source: any) {\r\n\treturn builder.image(source);\r\n}\r\n"],"names":["PrimaryHeader","_ref","children","props","_jsx","className","Hero","imageURL","heading","_jsxs","src","alt","style","width","maxHeight","objectFit","ClickableLink","href","target","startsWith","Link","to","BlockContentWithExternalLinks","blocks","ref","querySelectorAll","forEach","link","BlockContent","projectId","dataset","NewsArticle","articleId","useParams","article","setArticle","useState","useEffect","sanity","fetch","then","useNewsArticle","thumbnailUrl","thumbnail","imageUrl","url","goToAllNewsArticles","_Fragment","undefined","maxWidth","margin","title","publish_date","author","content","builder","ImageUrlBuilder","source","image"],"sourceRoot":""}