The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
lw7: sync tickets styling all across
Francesco Sansalvadore0542bb052202
diff --git a/apps/www/components/LaunchWeek/LaunchSection/TicketBrickWallRow.tsx b/apps/www/components/LaunchWeek/LaunchSection/TicketBrickWallRow.tsxindex da51778338e..89b98734f9d 100644--- a/apps/www/components/LaunchWeek/LaunchSection/TicketBrickWallRow.tsx+++ b/apps/www/components/LaunchWeek/LaunchSection/TicketBrickWallRow.tsx@@ -19,8 +19,11 @@ export function TicketBrickWallRow({ users, reverse, xOffset = 250 }: Props) {offset: ['start end', 'end start'],})const STORAGE_URL = 'https://obuldanrptloktxcffvn.supabase.co/storage/v1/object/public/images/lw7'+ const BUCKET_FOLDER_VERSION = 'v3'const getOgUrl = (username: string, isGold: boolean) =>- `${STORAGE_URL}/tickets/gallery/${isGold ? 'golden' : 'regular'}/v1/${username}.png`+ `${STORAGE_URL}/tickets/gallery/${+ isGold ? 'golden' : 'regular'+ }/${BUCKET_FOLDER_VERSION}/${username}.png`const x = useTransform(scrollYProgress, [0, 1], reverse ? [-xOffset, 0] : [0, -xOffset])return (diff --git a/apps/www/components/LaunchWeek/LaunchSection/TicketBrickWallSlider.tsx b/apps/www/components/LaunchWeek/LaunchSection/TicketBrickWallSlider.tsxindex 877e8f14c6e..cadf3639515 100644--- a/apps/www/components/LaunchWeek/LaunchSection/TicketBrickWallSlider.tsx+++ b/apps/www/components/LaunchWeek/LaunchSection/TicketBrickWallSlider.tsx@@ -22,8 +22,11 @@ export function TicketBrickWallSlider({ users, reverse, xOffset = 250, speed = 1const [swiperInstace, setSwiperInstance] = useState<SwiperCore | any | null>(null)const { width } = useWindowSize()const STORAGE_URL = 'https://obuldanrptloktxcffvn.supabase.co/storage/v1/object/public/images/lw7'+ const BUCKET_FOLDER_VERSION = 'v3'const getOgUrl = (username: string, isGold: boolean) =>- `${STORAGE_URL}/tickets/gallery/${isGold ? 'golden' : 'regular'}/v1/${username}.png`+ `${STORAGE_URL}/tickets/gallery/${+ isGold ? 'golden' : 'regular'+ }/${BUCKET_FOLDER_VERSION}/${username}.png`useEffect(() => {if (swiperInstace) swiperInstace?.autoplay?.run()diff --git a/apps/www/components/LaunchWeek/Ticket/TicketActions.tsx b/apps/www/components/LaunchWeek/Ticket/TicketActions.tsxindex ef29c82d5c5..124314d07be 100644--- a/apps/www/components/LaunchWeek/Ticket/TicketActions.tsx+++ b/apps/www/components/LaunchWeek/Ticket/TicketActions.tsx@@ -29,8 +29,10 @@ export default function TicketActions({const { userData } = useConfData()const tweetUrl = `https://twitter.com/intent/tweet?url=${permalink('twitter'- )}&via=supabase&text=${text}`- const linkedInUrl = `https://www.linkedin.com/sharing/share-offsite/?url=${permalink('linkedin')}`+ )}&via=supabase&text=${text}&lw=7`+ const linkedInUrl = `https://www.linkedin.com/sharing/share-offsite/?url=${permalink(+ 'linkedin'+ )}&text=${text}&lw=7`const downloadUrl = `https://obuldanrptloktxcffvn.functions.supabase.in/lw7-ticket-og?username=${encodeURIComponent(username)}`diff --git a/apps/www/components/LaunchWeek/Ticket/TicketHeader.tsx b/apps/www/components/LaunchWeek/Ticket/TicketHeader.tsxindex 13c190544f9..c31bf6e010c 100644--- a/apps/www/components/LaunchWeek/Ticket/TicketHeader.tsx+++ b/apps/www/components/LaunchWeek/Ticket/TicketHeader.tsx@@ -6,21 +6,13 @@ interface Props {}export default function TicketHeader({ size }: Props) {return (- <div className="flex w-full justify-center pt-4" id="wayfinding--ticket-header">+ <div className="flex w-full justify-center pt-4 md:pt-6" id="wayfinding--ticket-header"><div className="flex flex-col md:flex-row gap-1 justify-center items-center md:gap-5"><imgclassName={size === 'small' ? 'w-[165px]' : 'w-[224px]'}src={`/images/launchweek/ticket-header-logo.png`}/><span className="text-white text-xs">{DATE}</span>- {/*<div id="wayfinding--TicketInfo-container">- <TicketInfoFooter- golden={golden}- logoTextSecondaryColor={- ticketNumber ? (golden ? '#F2C94C' : 'var(--brand)') : undefined- }- />- </div>*/}</div></div>)diff --git a/apps/www/components/LaunchWeek/Ticket/TicketVisual.tsx b/apps/www/components/LaunchWeek/Ticket/TicketVisual.tsxindex 3226c1058df..24d927d2ae8 100644--- a/apps/www/components/LaunchWeek/Ticket/TicketVisual.tsx+++ b/apps/www/components/LaunchWeek/Ticket/TicketVisual.tsx@@ -120,8 +120,8 @@ export default function TicketVisual({placeholder="blur"blurDataURL="/images/blur.png"className={[- 'duration-700 ease-in-out transform scale-110',- imageIsLoading ? 'grayscale blur-xl scale-110' : 'grayscale-0 blur-0',+ 'duration-700 ease-in-out transform transition-all',+ imageIsLoading ? 'grayscale blur-xl scale-110' : 'scale-100 grayscale-0 blur-0',].join(' ')}onLoadingComplete={() => setImageIsLoading(false)}/>diff --git a/apps/www/components/LaunchWeek/Ticket/TicketsGrid.tsx b/apps/www/components/LaunchWeek/Ticket/TicketsGrid.tsxindex 984be166a95..569a72222d3 100644--- a/apps/www/components/LaunchWeek/Ticket/TicketsGrid.tsx+++ b/apps/www/components/LaunchWeek/Ticket/TicketsGrid.tsx@@ -12,8 +12,11 @@ interface Props {export default function TicketsGrid({ loadedUsers, isLoading, pageCount }: Props) {const STORAGE_URL = 'https://obuldanrptloktxcffvn.supabase.co/storage/v1/object/public/images/lw7'+ const BUCKET_FOLDER_VERSION = 'v3'const getOgUrl = (username: string, isGold: boolean) =>- `${STORAGE_URL}/tickets/gallery/${isGold ? 'golden' : 'regular'}/v1/${username}.png`+ `${STORAGE_URL}/tickets/gallery/${+ isGold ? 'golden' : 'regular'+ }/${BUCKET_FOLDER_VERSION}/${username}.png`const isMobile = useMobileViewport(768)const isTablet = useMobileViewport(1024)@@ -31,7 +34,7 @@ export default function TicketsGrid({ loadedUsers, isLoading, pageCount }: Propsreturn (<Link href={`/launch-week/tickets/${user.username}`} key={`${user.username}-000${i}`}><motion.a- className="relative w-full rounded-lg overflow-hidden hover:cursor-pointer"+ className="relative w-full rounded-lg sm:rounded-xl overflow-hidden hover:cursor-pointer"initial={{ opacity: 0, y: 20, x: isOddRow ? 30 : -30 }}animate={{opacity: !isTablet && (i === 0 || i === 4) ? 0 : 1,@@ -50,8 +53,8 @@ export default function TicketsGrid({ loadedUsers, isLoading, pageCount }: Propsalt={user.username}layout="fill"objectFit="cover"- quality={50}objectPosition="center"+ quality={50}placeholder="blur"blurDataURL="/images/blur.png"/>@@ -60,12 +63,10 @@ export default function TicketsGrid({ loadedUsers, isLoading, pageCount }: Props</Link>)})}- {/* TODO: Add PAGE_COUNT length skeleton loaders when loading */}- {/* {isLoading && <IconLoader />} */}{isLoading &&Array.from({ length: pageCount }, (_, i) => (<motion.div- className="relative rounded-lg bg-scale-500 h-0 w-full pt-[50%] shimmering-loader"+ className="relative rounded-xl bg-scale-500 h-0 w-full pt-[50%] shimmering-loader"initial={{ opacity: 0, y: 20 }}animate={{opacity: 1,diff --git a/apps/www/pages/launch-week/tickets/index.tsx b/apps/www/pages/launch-week/tickets/index.tsxindex 906f7fe0d97..8fd30e324b0 100644--- a/apps/www/pages/launch-week/tickets/index.tsx+++ b/apps/www/pages/launch-week/tickets/index.tsx@@ -26,6 +26,15 @@ const supabaseAdmin = createClient('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im9idWxkYW5ycHRsb2t0eGNmZnZuIiwicm9sZSI6ImFub24iLCJpYXQiOjE2Njk3MjcwMTIsImV4cCI6MTk4NTMwMzAxMn0.SZLqryz_-stF8dgzeVXmzZWPOqdOrBwqJROlFES8v3I')+const generateOgs = async (users: UserData[]) => {+ users?.map(async (user) => {+ const ogImageUrl = `https://obuldanrptloktxcffvn.functions.supabase.in/lw7-ticket-og?username=${encodeURIComponent(+ user.username ?? ''+ )}${!!user.golden ? '&golden=true' : ''}`+ return await fetch(ogImageUrl)+ })+}+export default function TicketsPage({ users }: Props) {const ref = useRef(null)const PAGE_COUNT = 20@@ -164,6 +173,9 @@ export const getServerSideProps: GetServerSideProps = async ({ req, res }) => {.order('createdAt', { ascending: false }).limit(20)+ // Generate og images of not present+ generateOgs(users as any[])+return {props: {users,diff --git a/apps/www/supabase/functions/lw7-ticket-gallery/handler.tsx b/apps/www/supabase/functions/lw7-ticket-gallery/handler.tsxindex 72890c3675a..853372d34f4 100644--- a/apps/www/supabase/functions/lw7-ticket-gallery/handler.tsx+++ b/apps/www/supabase/functions/lw7-ticket-gallery/handler.tsx@@ -8,6 +8,7 @@ const STORAGE_URL = 'https://obuldanrptloktxcffvn.supabase.co/storage/v1/object/// Load custom fontconst FONT_URL = `${STORAGE_URL}/CircularStd-Book.otf`const font = fetch(new URL(FONT_URL, import.meta.url)).then((res) => res.arrayBuffer())+const BUCKET_FOLDER_VERSION = 'v3'export async function handler(req: Request) {try {@@ -66,6 +67,7 @@ export async function handler(req: Request) {position: 'absolute',top: '0',left: '0',+ objectFit: 'cover',zIndex: '-8000',}}src={golden ? BACKGROUND['GOLD']['AI'] : BACKGROUND['REG']['AI']}@@ -116,7 +118,7 @@ export async function handler(req: Request) {display: 'flex',color: 'transparent',backgroundImage:- 'linear-gradient(180deg, rgba(248, 249, 250, 0.66) -31.69%, #F8F9FA 22.14%, rgba(248, 249, 250, 0.5) 122.78%)',+ 'linear-gradient(90deg, rgba(248, 249, 250, 0.66) -31.69%, #F8F9FA 22.14%, rgba(248, 249, 250, 0.5) 122.78%)',backgroundClip: 'text',}}>@@ -199,7 +201,9 @@ export async function handler(req: Request) {const { error: storageError } = await supabaseAdminClient.storage.from('images').upload(- `lw7/tickets/gallery/${golden ? 'golden' : 'regular'}/v1/${username}.png`,+ `lw7/tickets/gallery/${+ golden ? 'golden' : 'regular'+ }/${BUCKET_FOLDER_VERSION}/${username}.png`,generatedImage.body!,{contentType: 'image/png',diff --git a/apps/www/supabase/functions/lw7-ticket-og/handler.tsx b/apps/www/supabase/functions/lw7-ticket-og/handler.tsxindex 3d2b32a4df7..494a1e6aea1 100644--- a/apps/www/supabase/functions/lw7-ticket-og/handler.tsx+++ b/apps/www/supabase/functions/lw7-ticket-og/handler.tsx@@ -8,6 +8,7 @@ const STORAGE_URL = 'https://obuldanrptloktxcffvn.supabase.co/storage/v1/object/// Load custom fontconst FONT_URL = `${STORAGE_URL}/CircularStd-Book.otf`const font = fetch(new URL(FONT_URL, import.meta.url)).then((res) => res.arrayBuffer())+const BUCKET_FOLDER_VERSION = 'v3'export async function handler(req: Request) {const url = new URL(req.url)@@ -42,9 +43,13 @@ export async function handler(req: Request) {// Try to get image from Supabase Storage CDN.let storageResponse: Response- storageResponse = await fetch(`${STORAGE_URL}/tickets/golden/v1/${username}.png`)+ storageResponse = await fetch(+ `${STORAGE_URL}/tickets/golden/${BUCKET_FOLDER_VERSION}/${username}.png`+ )if (storageResponse.ok) return storageResponse- storageResponse = await fetch(`${STORAGE_URL}/tickets/regular/v1/${username}.png`)+ storageResponse = await fetch(+ `${STORAGE_URL}/tickets/regular/${BUCKET_FOLDER_VERSION}/${username}.png`+ )if (!assumeGolden && storageResponse.ok) return storageResponse// Get ticket data@@ -111,8 +116,9 @@ export async function handler(req: Request) {width="1027"height="524"style={{- borderRadius: '8px',+ borderRadius: '24px',position: 'absolute',+ objectFit: 'cover',top: '53',left: '87',zIndex: '-8000',@@ -165,7 +171,7 @@ export async function handler(req: Request) {display: 'flex',color: 'transparent',backgroundImage:- 'linear-gradient(180deg, rgba(248, 249, 250, 0.66) -31.69%, #F8F9FA 22.14%, rgba(248, 249, 250, 0.5) 122.78%)',+ 'linear-gradient(90deg, rgba(248, 249, 250, 0.66) -31.69%, #F8F9FA 22.14%, rgba(248, 249, 250, 0.5) 122.78%)',backgroundClip: 'text',}}>@@ -242,7 +248,7 @@ export async function handler(req: Request) {const { error: storageError } = await supabaseAdminClient.storage.from('images').upload(- `lw7/tickets/${golden ? 'golden' : 'regular'}/v1/${username}.png`,+ `lw7/tickets/${golden ? 'golden' : 'regular'}/${BUCKET_FOLDER_VERSION}/${username}.png`,generatedImage.body!,{contentType: 'image/png',@@ -268,7 +274,11 @@ export async function handler(req: Request) {}),})- return await fetch(`${STORAGE_URL}/tickets/${golden ? 'golden' : 'regular'}/v1/${username}.png`)+ return await fetch(+ `${STORAGE_URL}/tickets/${+ golden ? 'golden' : 'regular'+ }/${BUCKET_FOLDER_VERSION}/${username}.png`+ )} catch (error) {return new Response(JSON.stringify({ error: error.message }), {headers: { ...corsHeaders, 'Content-Type': 'application/json' },