Files
supabase/packages/ui-patterns/CountdownWidget/index.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

54 lines
1.4 KiB
TypeScript

import { cn } from 'ui/src/lib/utils'
import CountdownStep from './CountdownStep'
interface CountdownWidgetProps {
days?: string
hours?: string
minutes?: string
seconds?: string
showCard?: boolean
className?: string
size?: 'small' | 'large'
}
export function CountdownWidget({
days,
hours,
minutes,
seconds,
showCard = true,
className,
size,
}: CountdownWidgetProps) {
const isLarge = size === 'large'
const Colon = () => (
<span className={cn('text-xs mx-px text-foreground-lighter', isLarge && 'text-lg')}>:</span>
)
return (
<div className={cn('flex gap-1 items-center text-foreground-lighter', className)}>
{days !== undefined && days != '0' ? (
<>
<CountdownStep value={days} unit="d" showCard={showCard} size={size} />
<Colon />
</>
) : null}
{hours !== undefined && hours != '0' ? (
<>
<CountdownStep value={hours} unit="h" showCard={showCard} size={size} />
<Colon />
</>
) : null}
{minutes !== undefined && minutes != '0' ? (
<>
<CountdownStep value={minutes} unit="m" showCard={showCard} size={size} />
{seconds !== undefined && <Colon />}
</>
) : null}
{seconds !== undefined ? (
<CountdownStep value={seconds} unit="s" showCard={showCard} size={size} />
) : null}
</div>
)
}