mirror of
https://github.com/tjsga/tj-sga-website-react.git
synced 2025-04-03 20:00:17 -04:00
1 line
8.4 KiB
Plaintext
1 line
8.4 KiB
Plaintext
{"version":3,"file":"static/js/538.0d0d65c9.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,gBCvBe,SAASC,EACvBC,EACAC,GAEA,MAAMC,EAAc,CAAC,EACrB,IAAK,MAAM,IAAEC,EAAG,KAAEC,KAAUJ,EAC3BE,EAAYC,GAAOF,EAAUI,WAAWC,GAAUA,IAAUF,IAG7D,OAAOJ,EAAQO,MAAK,CAACC,EAAGC,KACvB,IAAIC,EAAiBR,EAAYM,EAAEL,KAAOD,EAAYO,EAAEN,KACxD,OAAuB,IAAnBO,EACIA,EAEHF,EAAEG,KAAOF,EAAEE,MACN,EACEH,EAAEG,KAAOF,EAAEE,KACd,EAEA,CAET,GAEF,C,wICjBA,MAAMC,EAAe,CACpB,gBACA,qBACA,gBACA,iBAGc,SAASC,IACvB,MAAOC,EAAUC,IAAeC,EAAAA,EAAAA,aAEhCC,EAAAA,EAAAA,YAAU,KACTC,EAAAA,EACEC,MAAM,kDAAmD,CACzDC,UAAW,YAEXC,KAAKN,EAAY,GACjB,IAEH,MAAMO,GAAiBvB,EAAAA,EAAAA,GAAsB,OAARe,QAAQ,IAARA,EAAAA,EAAY,GAAIF,GAErD,OACCvB,EAAAA,EAAAA,MAAAkC,EAAAA,SAAA,CAAAhC,SAAA,EACCC,EAAAA,EAAAA,KAACP,EAAAA,EAAI,CAACG,QAAQ,WAAWD,SAAS,qCACl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AAEuD,WAAY,OAAQC,YAAa,OAAQ5D,UACtDC,EAAAA,EAAAA,KAAA,OAAKC,IAAKmD,EAAWlD,IAAKiC,EAAOhB,SAGhC,QAELtB,EAAAA,EAAAA,MAAA,OAAKM,MAAO,CAAEqD,KAAM,GAAIzD,SAAA,EACvBC,EAAAA,EAAAA,KAACiD,EAAa,CAAAlD,SAAEoC,EAAOhB,QACvBtB,EAAAA,EAAAA,MAACqD,EAAgB,CAAAnD,SAAA,CACfoC,EAAOvB,KAAK,KAAGuB,EAAO0B,SAExB7D,EAAAA,EAAAA,KAAA,UACAA,EAAAA,EAAAA,KAAA,KAAAD,SAAIoC,EAAO2B,WAIf,C","sources":["components/Hero.tsx","lib/sortCommittee.ts","pages/officers.tsx","lib/imageUrl.ts","components/ConstrainedImage.tsx","components/RowItemHeader.tsx","components/RowItemSubheader.tsx","components/MemberRow.tsx"],"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","export default function sortCommittee(\r\n\tmembers: SGA.MemberDocument[],\r\n\troleOrder: string[]\r\n) {\r\n\tconst roleIndexes = {};\r\n\tfor (const { _id, role } of members) {\r\n\t\troleIndexes[_id] = roleOrder.findIndex((role_) => role_ === role);\r\n\t}\r\n\r\n\treturn members.sort((a, b) => {\r\n\t\tlet roleDifference = roleIndexes[a._id] - roleIndexes[b._id];\r\n\t\tif (roleDifference !== 0) {\r\n\t\t\treturn roleDifference;\r\n\t\t} else {\r\n\t\t\tif (a.name < b.name) {\r\n\t\t\t\treturn -1;\r\n\t\t\t} else if (a.name > b.name) {\r\n\t\t\t\treturn 1;\r\n\t\t\t} else {\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n}\r\n","import React, { useEffect, useState } from 'react';\r\nimport Hero from '../components/Hero';\r\nimport MemberRow from '../components/MemberRow';\r\nimport sortCommittee from '../lib/sortCommittee';\r\nimport sanity from '../sanity';\r\n\r\nconst officerOrder = [\r\n\t'SGA President',\r\n\t'SGA Vice President',\r\n\t'SGA Treasurer',\r\n\t'SGA Secretary',\r\n];\r\n\r\nexport default function Officers() {\r\n\tconst [officers, setOfficers] = useState<SGA.MemberDocument[]>();\r\n\r\n\tuseEffect(() => {\r\n\t\tsanity\r\n\t\t\t.fetch(\"*[_type == 'member' && committee == $committee]\", {\r\n\t\t\t\tcommittee: 'officer',\r\n\t\t\t})\r\n\t\t\t.then(setOfficers);\r\n\t}, []);\r\n\r\n\tconst officersSorted = sortCommittee(officers ?? [], officerOrder);\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t<Hero heading='Officers' imageURL='/images/who-we-are/officers.jpg' />\r\n\t\t\t<main>\r\n\t\t\t\t{officersSorted.map((officer) => (\r\n\t\t\t\t\t<MemberRow member={officer} />\r\n\t\t\t\t))}\r\n\t\t\t</main>\r\n\t\t</>\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","import { CSSProperties } from 'react';\r\n\r\nexport default function ConstrainedImage({\r\n\talt,\r\n\tsrc,\r\n\tstyle,\r\n}: {\r\n\talt: string;\r\n\tsrc: string;\r\n\tstyle?: CSSProperties;\r\n}) {\r\n\treturn (\r\n\t\t<div\r\n\t\t\tstyle={{\r\n\t\t\t\t// required: center the image with flexbox\r\n\t\t\t\tdisplay: 'flex',\r\n\t\t\t\tjustifyContent: 'center',\r\n\t\t\t\talignItems: 'center',\r\n\t\t\t\toverflow: 'hidden',\r\n\t\t\t\t...style,\r\n\t\t\t}}\r\n\t\t>\r\n\t\t\t<img\r\n\t\t\t\tsrc={src}\r\n\t\t\t\talt={alt}\r\n\t\t\t\tstyle={{\r\n\t\t\t\t\tminWidth: '100%',\r\n\t\t\t\t\tminHeight: '100%',\r\n\t\t\t\t\tflexShrink: 0,\r\n\t\t\t\t\tobjectFit: 'cover',\r\n\t\t\t\t}}\r\n\t\t\t/>\r\n\t\t</div>\r\n\t);\r\n}\r\n","export default function RowItemHeader({\r\n\tchildren,\r\n}: {\r\n\tchildren: React.ReactNode;\r\n}) {\r\n\treturn <h3 className='header'>{children}</h3>;\r\n}\r\n","export default function RowItemSubheader({ children }) {\r\n\treturn <i>{children}</i>;\r\n}\r\n","import '../css/article.css';\r\nimport imageUrl from '../lib/imageUrl';\r\nimport ConstrainedImage from './ConstrainedImage';\r\nimport RowItemHeader from './RowItemHeader';\r\nimport RowItemSubheader from './RowItemSubheader';\r\n\r\nexport default function MemberRow({\r\n\tmember,\r\n\tlimitPhotoHeight = false,\r\n}: {\r\n\tmember: SGA.MemberDocument;\r\n\tlimitPhotoHeight?: boolean;\r\n}) {\r\n\tlet thumbnail = member.profile_photo\r\n\t\t? imageUrl(member.profile_photo).url()\r\n\t\t: undefined;\r\n\r\n\treturn (\r\n\t\t<div className='d-flex my-4'>\r\n\t\t\t<div style={{ flex: 1, textAlign: 'right' }}>\r\n\t\t\t\t{thumbnail ? (\r\n\t\t\t\t\tlimitPhotoHeight ? (\r\n\t\t\t\t\t\t<ConstrainedImage\r\n\t\t\t\t\t\t\tsrc={thumbnail}\r\n\t\t\t\t\t\t\talt={member.name}\r\n\t\t\t\t\t\t\tstyle={{\r\n\t\t\t\t\t\t\t\tmarginLeft: 'auto',\r\n\t\t\t\t\t\t\t\tmarginRight: '2em',\r\n\t\t\t\t\t\t\t\twidth: '10em',\r\n\t\t\t\t\t\t\t\theight: '15em',\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t) : (\r\n\t\t\t\t\t\t<div style={{ marginLeft: 'auto', marginRight: '2em' }}>\r\n\t\t\t\t\t\t\t<img src={thumbnail} alt={member.name} />\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t)\r\n\t\t\t\t) : null}\r\n\t\t\t</div>\r\n\t\t\t<div style={{ flex: 3 }}>\r\n\t\t\t\t<RowItemHeader>{member.name}</RowItemHeader>\r\n\t\t\t\t<RowItemSubheader>\r\n\t\t\t\t\t{member.role}, {member.year}\r\n\t\t\t\t</RowItemSubheader>\r\n\t\t\t\t<br />\r\n\t\t\t\t<p>{member.bio}</p>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t);\r\n}\r\n"],"names":["Hero","_ref","imageURL","heading","_jsxs","className","children","_jsx","src","alt","style","width","maxHeight","objectFit","sortCommittee","members","roleOrder","roleIndexes","_id","role","findIndex","role_","sort","a","b","roleDifference","name","officerOrder","Officers","officers","setOfficers","useState","useEffect","sanity","fetch","committee","then","officersSorted","_Fragment","map","officer","MemberRow","member","builder","ImageUrlBuilder","imageUrl","source","image","ConstrainedImage","display","justifyContent","alignItems","overflow","minWidth","minHeight","flexShrink","RowItemHeader","RowItemSubheader","limitPhotoHeight","thumbnail","profile_photo","url","undefined","flex","textAlign","marginLeft","marginRight","height","year","bio"],"sourceRoot":""} |