mirror of
https://github.com/supabase/supabase.git
synced 2026-10-15 06:09:08 +03:00
* lw11 ga ticketing * add @types/animejs * build new game word * og ticket layout * ticket og layout * lw11 ticketing flow * remove unused assets * clean up old LW code * smol cleanup * update lw11 og function * update lw11 og function * prepare * main layout * layout * update naming * fix lw11 canvas resize * lw announcement countdown banner * hp badge * update lw page * cleanup * update banners * update ticket shape * update share string * update launch time * avatar in ticket * update lw11-og handler * mask ticket glow * update game with input-otp * clean up game * update ticketing page title * update * update awards * special event * update constants * fix mobile inputs bug * update announcements * dots grid * remove 2024 * gst * fix ticket user page * less stacked layout * lw * update secret ticket * update sharing layout * max width to ticket container * update tweet text * clean up merge * npm i * update hero announcement * update footer * update types * fix types * Update apps/www/lib/constants.ts * Update apps/www/lib/constants.ts * Update apps/www/lib/constants.ts * Apply suggestions from code review * update og * og * special announcement * special announcement * fix favicon * url timestamp for cache * cache * favicon * remove file * fix title * game only when signed in * user ticket nme * day * switch to /special-announcent * update /special-announcement * update /special-announcement * skip build * redirect * fix theme in /special-announcement * fix mobile ticket form * image not draggable * cleanup * restore latest manifest * update secret ticket tweet * secret share * update text * fix secret share * typo * remove comment * update deprecated icon * restore input.stories --------- Co-authored-by: Ant Wilson <awalias@users.noreply.github.com>
47 lines
1.2 KiB
TypeScript
47 lines
1.2 KiB
TypeScript
import { useEffect, useState } from 'react'
|
|
import { cn } from 'ui'
|
|
|
|
interface CountdownStepProps {
|
|
value: string | number
|
|
unit: string
|
|
showCard?: boolean
|
|
size?: 'small' | 'large'
|
|
}
|
|
|
|
function CountdownStep({ value, unit, showCard = true, size = 'small' }: CountdownStepProps) {
|
|
const isLarge = size === 'large'
|
|
const [isMounted, setIsMounted] = useState(false)
|
|
const valueWithZero = (value as number) > 9 ? value : '0' + value
|
|
|
|
useEffect(() => {
|
|
setIsMounted(true)
|
|
}, [])
|
|
|
|
if (!isMounted) return null
|
|
|
|
return (
|
|
<div
|
|
className={cn(
|
|
'font-mono uppercase tracking-[0.05rem] text-sm',
|
|
showCard
|
|
? 'rounded-md p-[1px] overflow-hidden bg-gradient-to-b from-border-muted to-border-muted/20'
|
|
: 'tracking-[0.1rem]',
|
|
isLarge && 'text-lg'
|
|
)}
|
|
>
|
|
<div
|
|
className={cn(
|
|
showCard
|
|
? 'py-1 px-2 rounded-md w-11 leading-4 flex items-center justify-center bg-black backdrop-blur-md'
|
|
: cn('flex items-center justify-center w-7 py-1 px-1', isLarge && 'w-9')
|
|
)}
|
|
>
|
|
<span className="m-0">{valueWithZero}</span>
|
|
<span>{unit}</span>
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default CountdownStep
|