diff --git a/web/pages/tournaments/_cspi/Chinese_Military_Action_against_Taiwan.png b/web/pages/tournaments/_cspi/Chinese_Military_Action_against_Taiwan.png new file mode 100644 index 00000000..8acde90c Binary files /dev/null and b/web/pages/tournaments/_cspi/Chinese_Military_Action_against_Taiwan.png differ diff --git a/web/pages/tournaments/_cspi/Monkeypox_Cases.png b/web/pages/tournaments/_cspi/Monkeypox_Cases.png new file mode 100644 index 00000000..0efa3b1e Binary files /dev/null and b/web/pages/tournaments/_cspi/Monkeypox_Cases.png differ diff --git a/web/pages/tournaments/_cspi/Supreme_Court_Ban_Race_in_College_Admissions.png b/web/pages/tournaments/_cspi/Supreme_Court_Ban_Race_in_College_Admissions.png new file mode 100644 index 00000000..09d3341f Binary files /dev/null and b/web/pages/tournaments/_cspi/Supreme_Court_Ban_Race_in_College_Admissions.png differ diff --git a/web/pages/tournaments/_cspi/Will_Elon_Buy_Twitter.png b/web/pages/tournaments/_cspi/Will_Elon_Buy_Twitter.png new file mode 100644 index 00000000..64ca4ff0 Binary files /dev/null and b/web/pages/tournaments/_cspi/Will_Elon_Buy_Twitter.png differ diff --git a/web/pages/tournaments/index.tsx b/web/pages/tournaments/index.tsx index b93a9725..f30549f7 100644 --- a/web/pages/tournaments/index.tsx +++ b/web/pages/tournaments/index.tsx @@ -12,6 +12,7 @@ import customParseFormat from 'dayjs/plugin/customParseFormat' import timezone from 'dayjs/plugin/timezone' import utc from 'dayjs/plugin/utc' import { keyBy, mapValues, throttle } from 'lodash' +import Image, { ImageProps, StaticImageData } from 'next/image' import Link from 'next/link' import { ReactNode, useEffect, useRef, useState } from 'react' import { ContractCard } from 'web/components/contract/contract-card' @@ -22,6 +23,11 @@ import { Page } from 'web/components/page' import { SEO } from 'web/components/SEO' import { listContractsByGroupSlug } from 'web/lib/firebase/contracts' import { getGroup, groupPath } from 'web/lib/firebase/groups' +import elon_pic from './_cspi/Will_Elon_Buy_Twitter.png' +import china_pic from './_cspi/Chinese_Military_Action_against_Taiwan.png' +import mpox_pic from './_cspi/Monkeypox_Cases.png' +import race_pic from './_cspi/Supreme_Court_Ban_Race_in_College_Admissions.png' +import { SiteLink } from 'web/components/site-link' dayjs.extend(utc) dayjs.extend(timezone) @@ -43,7 +49,30 @@ const Salem = { url: 'https://salemcenter.manifold.markets/', award: '$25,000', endTime: toDate('Jul 31, 2023'), -} as const + markets: [], + images: [ + { + marketUrl: + 'https://salemcenter.manifold.markets/SalemCenter/will-elon-musk-buy-twitter', + image: elon_pic, + }, + { + marketUrl: + 'https://salemcenter.manifold.markets/SalemCenter/chinese-military-action-against-tai', + image: china_pic, + }, + { + marketUrl: + 'https://salemcenter.manifold.markets/SalemCenter/over-100000-monkeypox-cases-in-2022', + image: mpox_pic, + }, + { + marketUrl: + 'https://salemcenter.manifold.markets/SalemCenter/over-100000-monkeypox-cases-in-2022', + image: race_pic, + }, + ], +} const tourneys: Tourney[] = [ { @@ -114,7 +143,7 @@ export default function TournamentPage(props: { markets={markets[groupId] ?? []} /> ))} -
+
) @@ -128,8 +157,9 @@ function Section(props: { ppl?: number endTime?: Dayjs markets: Contract[] + images?: { marketUrl: string; image: StaticImageData }[] // hack for cspi }) { - const { title, url, blurb, award, ppl, endTime, markets } = props + const { title, url, blurb, award, ppl, endTime, markets, images } = props return (
@@ -171,15 +201,42 @@ function Section(props: { /> )) ) : ( -
- Coming Soon... -
+ <> + {images?.map(({ marketUrl, image }) => ( + + + + ))} + + See more + + )}
) } +// stole: https://stackoverflow.com/questions/66845889/next-js-image-how-to-maintain-aspect-ratio-and-add-letterboxes-when-needed +const NaturalImage = (props: ImageProps) => { + const [ratio, setRatio] = useState(4 / 1) + + return ( + + setRatio(naturalWidth / naturalHeight) + } + /> + ) +} + function Carousel(props: { children: ReactNode; className?: string }) { const { children, className } = props