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

1 line
11 KiB
Plaintext

{"version":3,"file":"static/js/124.0934d14d.chunk.js","mappings":"sIAEe,SAASA,EAAIC,GAMxB,IANyB,SAC5BC,EAAW,mBAAkB,QAC7BC,EAAU,cAIVF,EACA,OACCG,EAAAA,EAAAA,MAAA,OAAKC,UAAU,OAAMC,SAAA,EACpBC,EAAAA,EAAAA,KAAA,QAAMF,UAAU,eAAcC,SAAEH,KAChCI,EAAAA,EAAAA,KAAA,OACCC,IAAKN,EACLO,IAAI,aACJC,MAAO,CACNC,MAAO,QACPC,UAAW,OACXC,UAAW,eAKhB,C,oGCrBe,SAASC,EAAUb,GAM9B,IAN+B,QAClCc,EAAO,SACPT,GAIAL,EACA,OACCM,EAAAA,EAAAA,KAAA,UAAQQ,QAASA,EAASV,UAAU,cAAaC,SAC/CA,GAGJ,C,cCPe,SAASU,IACvB,IAAKC,EAAUC,GAAeC,EAAAA,SAAsC,KAC/DC,EAAYC,GAAiBF,EAAAA,UAAwB,GAG1D,MAAMG,EAAcC,MAAOC,EAAmBC,KAC7C,MAQMC,EAAS,CACdF,YACAC,cAGD,IAAIR,QAAiBU,EAAAA,EAAOC,MAbd,qNAakDF,GAE5DT,EAASY,OAAS,GACrBR,GAAc,GAIfH,GAAaY,GAAgBA,EAAYC,OAAOd,IAAU,EAO3D,GAJAE,EAAAA,WAAgB,KACfG,EAAY,aAAc,GAAG,GAC3B,KAEEL,EACJ,OAAO,KAGR,IAAIe,EAEHA,EADGZ,GACeb,EAAAA,EAAAA,KAAA,OAAAD,SAAK,8BAGtBC,EAAAA,EAAAA,KAACO,EAAU,CACVC,QAASA,KACR,IAAI,aAAEkB,EAAY,MAAEC,GAAUjB,EAASA,EAASY,OAAS,GACzDP,EAAYW,EAAcC,EAAM,EAC/B5B,SACF,uBAMH,MAAM6B,EAAclB,EAASmB,KAAKC,IACjC9B,EAAAA,EAAAA,KAAC+B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ueButton.tsx","components/ArticleList.tsx","pages/news.tsx","components/ClickableLink.tsx","components/FlexRow.tsx","components/FlexRowSection.tsx","components/ArticleRow.tsx","lib/imageUrl.ts"],"sourcesContent":["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 { MouseEventHandler } from 'react';\r\n\r\nexport default function BlueButton({\r\n\tonClick,\r\n\tchildren,\r\n}: {\r\n\tonClick?: MouseEventHandler;\r\n\tchildren: React.ReactNode;\r\n}) {\r\n\treturn (\r\n\t\t<button onClick={onClick} className='blue-button'>\r\n\t\t\t{children}\r\n\t\t</button>\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport '../css/article.css';\r\nimport sanity from '../sanity';\r\nimport ArticleRow from './ArticleRow';\r\nimport BlueButton from './BlueButton';\r\nimport Centered from './Centered';\r\n\r\nexport default function ArticleList() {\r\n\tlet [articles, setArticles] = React.useState<SGA.ArticleDocument[]>([]);\r\n\tlet [reachedEnd, setReachedEnd] = React.useState<boolean>(false);\r\n\r\n\t// Fetch the next three articles\r\n\tconst addArticles = async (last_date: string, last_title: string) => {\r\n\t\tconst query = `*[_type == \"article\" && (\r\n\t\t\t\tpublish_date < $last_date ||\r\n\t\t\t\t(\r\n\t\t\t\t\tpublish_date == $last_date && \r\n\t\t\t\t\ttitle > $last_title\r\n\t\t\t\t)\r\n\t\t\t)] | order(publish_date desc, title) [0...3]`;\r\n\r\n\t\tconst params = {\r\n\t\t\tlast_date,\r\n\t\t\tlast_title,\r\n\t\t};\r\n\r\n\t\tlet articles = await sanity.fetch<SGA.ArticleDocument[]>(query, params);\r\n\r\n\t\tif (articles.length < 3) {\r\n\t\t\tsetReachedEnd(true);\r\n\t\t}\r\n\r\n\t\t// Add the next articles\r\n\t\tsetArticles((oldArticles) => oldArticles.concat(articles));\r\n\t};\r\n\r\n\tReact.useEffect(() => {\r\n\t\taddArticles('3000-01-01', '');\r\n\t}, []);\r\n\r\n\tif (!articles) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tlet bottomComponent: any;\r\n\tif (reachedEnd) {\r\n\t\tbottomComponent = <div>No more articles to show</div>;\r\n\t} else {\r\n\t\tbottomComponent = (\r\n\t\t\t<BlueButton\r\n\t\t\t\tonClick={() => {\r\n\t\t\t\t\tlet { publish_date, title } = articles[articles.length - 1];\r\n\t\t\t\t\taddArticles(publish_date, title);\r\n\t\t\t\t}}\r\n\t\t\t>\r\n\t\t\t\tLoad more articles\r\n\t\t\t</BlueButton>\r\n\t\t);\r\n\t}\r\n\r\n\tconst articleList = articles.map((article) => (\r\n\t\t<ArticleRow key={article._id} article={article} />\r\n\t));\r\n\r\n\treturn (\r\n\t\t<div>\r\n\t\t\t{articleList}\r\n\t\t\t<Centered>{bottomComponent}</Centered>\r\n\t\t</div>\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport ArticleList from '../components/ArticleList';\r\nimport Hero from '../components/Hero';\r\n\r\nexport default function News() {\r\n\treturn (\r\n\t\t<>\r\n\t\t\t<Hero heading='News' />\r\n\t\t\t<main>\r\n\t\t\t\t<div style={{ paddingTop: '1em' }}>\r\n\t\t\t\t\t<ArticleList />\r\n\t\t\t\t</div>\r\n\t\t\t</main>\r\n\t\t</>\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","export default function FlexRow({\r\n\tpaddingLeft,\r\n\tpaddingRight,\r\n\tmarginTop,\r\n\tmarginBottom,\r\n\tchildren,\r\n}: {\r\n\tpaddingLeft?: string;\r\n\tpaddingRight?: string;\r\n\tmarginTop?: string;\r\n\tmarginBottom?: string;\r\n\tchildren: React.ReactNode;\r\n}) {\r\n\treturn (\r\n\t\t<div\r\n\t\t\tstyle={{\r\n\t\t\t\tdisplay: 'flex',\r\n\t\t\t\tflexDirection: 'row',\r\n\t\t\t\tpaddingLeft,\r\n\t\t\t\tpaddingRight,\r\n\t\t\t\tmarginTop,\r\n\t\t\t\tmarginBottom,\r\n\t\t\t}}\r\n\t\t>\r\n\t\t\t{children}\r\n\t\t</div>\r\n\t);\r\n}\r\n","export default function FlexRowSection({\r\n\tchildren,\r\n\tflex,\r\n\tpaddingLeft,\r\n\tpaddingRight,\r\n\tpaddingTop,\r\n\tpaddingBottom,\r\n\tpaddingX,\r\n\tpaddingY,\r\n}: {\r\n\tchildren: React.ReactNode;\r\n\tflex: number;\r\n\tpaddingLeft?: string;\r\n\tpaddingRight?: string;\r\n\tpaddingTop?: string;\r\n\tpaddingBottom?: string;\r\n\tpaddingX?: string;\r\n\tpaddingY?: string;\r\n}) {\r\n\tif (paddingX != null) {\r\n\t\tpaddingLeft = paddingRight = paddingX;\r\n\t}\r\n\tif (paddingY != null) {\r\n\t\tpaddingTop = paddingBottom = paddingY;\r\n\t}\r\n\treturn (\r\n\t\t<div style={{ flex, paddingLeft, paddingRight, paddingTop, paddingBottom }}>\r\n\t\t\t{children}\r\n\t\t</div>\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport '../css/article.css';\r\nimport imageUrl from '../lib/imageUrl';\r\nimport ClickableLink from './ClickableLink';\r\nimport FlexRow from './FlexRow';\r\nimport FlexRowSection from './FlexRowSection';\r\n\r\nexport default function ArticleRow({\r\n\tarticle,\r\n}: {\r\n\tarticle: SGA.ArticleDocument;\r\n}) {\r\n\tlet thumbnail: React.ReactElement | null = null;\r\n\tif (article.thumbnail) {\r\n\t\tthumbnail = (\r\n\t\t\t<img\r\n\t\t\t\tsrc={imageUrl(article.thumbnail).url() ?? undefined}\r\n\t\t\t\talt={article.title}\r\n\t\t\t/>\r\n\t\t);\r\n\t}\r\n\r\n\tconst slug = (s: string) => s.toLowerCase().replace(/ /g, '-');\r\n\tconst articleUrl = '/news/' + article._id + '/' + slug(article.title);\r\n\r\n\treturn (\r\n\t\t<FlexRow marginTop='4em' marginBottom='4em'>\r\n\t\t\t<FlexRowSection flex={1} paddingY='0.5em' paddingRight='1em'>\r\n\t\t\t\t{thumbnail}\r\n\t\t\t</FlexRowSection>\r\n\t\t\t<FlexRowSection flex={3} paddingY='0.5em' paddingRight='1em'>\r\n\t\t\t\t<ClickableLink href={articleUrl} target='_blank'>\r\n\t\t\t\t\t<h3 style={{ margin: '0px' }}>{article.title}</h3>\r\n\t\t\t\t</ClickableLink>\r\n\r\n\t\t\t\t<i className='text-sm'>{article.publish_date}</i>\r\n\t\t\t\t<br />\r\n\r\n\t\t\t\t<i>{article.author ?? 'No author'}</i>\r\n\t\t\t\t<br />\r\n\r\n\t\t\t\t<p>{article.summary}</p>\r\n\t\t\t</FlexRowSection>\r\n\t\t</FlexRow>\r\n\t);\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":["Hero","_ref","imageURL","heading","_jsxs","className","children","_jsx","src","alt","style","width","maxHeight","objectFit","BlueButton","onClick","ArticleList","articles","setArticles","React","reachedEnd","setReachedEnd","addArticles","async","last_date","last_title","params","sanity","fetch","length","oldArticles","concat","bottomComponent","publish_date","title","articleList","map","article","ArticleRow","_id","Centered","News","_Fragment","paddingTop","ClickableLink","href","target","startsWith","Link","to","FlexRow","paddingLeft","paddingRight","marginTop","marginBottom","display","flexDirection","FlexRowSection","flex","paddingBottom","paddingX","paddingY","_article$author","thumbnail","_imageUrl$url","imageUrl","url","undefined","articleUrl","toLowerCase","replace","margin","author","summary","builder","ImageUrlBuilder","source","image"],"sourceRoot":""}