Files
supabase/apps/www/components/LaunchWeek/13/Countdown.tsx
T
Francesco SansalvadoreandJonathan Summers-Muir f05a7c60c1 tiger init (#30620)
* lw13 interactive realtime grid

* 3d metal ticket

* add dynamic text to ticket

* reset ticket tilt on mouseout

* improve canvas sizing and ticket positioning and originate tilt from ticket

* test lw layout

* test lw layout

* fix imports

* .

* fix .length bug

* usual ticketing flow

* reduce ticket padding

* reduce fade delay

* add name from db

* text size

* use multiplayer.dev cursor logic

* lodash samplesize

* good state

* working users cursors

* single partyMode off

* clean up

* refactor ticket layout and positioning logic

* regular and platinum tickets

* regular theme based og

* add mono font to ticket, finish textures and ogs

* ticket cleanup

* restore countdown with ticket

* update og

* update og

* remote year add hour

* drag ticket to flip

* remove

* add presence

* remove cursor on own touch device

* test hidden mobile cursor

* fix mobile dragging

* scale ticket on interaction

* code logic

* secret ticket logic

* cleanup

* persist won game

* enable game on mobile

* fix mobile game

* add announcement banners

* update text layout

* hide game from share page and if game won

* fix mobile flip 🎉

* fix meetups time formatting

* faster flip

* tiger init styling (#30649)

* update

* mobile fix

---------

Co-authored-by: Jonathan Summers-Muir <MildTomato@users.noreply.github.com>

* use multilanguage font

* lineheight

* only published meetups

* comment on timezone column

* better mobile input positioning

* fix sudden lighting change

* increase cell size for better performance

* increase cell size for better performance

* last touches

---------

Co-authored-by: Jonathan Summers-Muir <MildTomato@users.noreply.github.com>
2024-11-25 13:45:21 -04:00

42 lines
902 B
TypeScript

import React from 'react'
import Countdown from 'react-countdown'
import { CountdownWidget } from 'ui-patterns/CountdownWidget'
const CountdownComponent = ({
date,
showCard = true,
className,
size = 'small',
}: {
date: string | number | Date
showCard?: boolean
className?: string
size?: 'small' | 'large'
}) => {
if (!date) return null
const renderer = ({ days, hours, minutes, seconds, completed }: any) => {
if (completed) {
// Render a completed state
return null
} else {
// Render countdown
return (
<CountdownWidget
days={days}
hours={hours}
minutes={minutes}
seconds={seconds}
showCard={showCard}
className={className}
size={size}
/>
)
}
}
return <Countdown date={new Date(date)} renderer={renderer} />
}
export default CountdownComponent