mirror of
https://github.com/supabase/supabase.git
synced 2026-10-16 14:49:10 +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>
42 lines
902 B
TypeScript
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
|