From fa85d9febdd5c53892150f832ddea50b04596f13 Mon Sep 17 00:00:00 2001 From: Francesco Sansalvadore Date: Tue, 28 Nov 2023 17:32:04 +0100 Subject: [PATCH] Chore x (#19282) update share copy --- .../components/LaunchWeek/X/LWXBackground.tsx | 2 +- .../components/LaunchWeek/X/TicketsGrid.tsx | 2 -- apps/www/lib/constants.ts | 4 ++-- .../www/supabase/functions/lwx-og/handler.tsx | 11 --------- .../functions/lwx-ticket-og/handler.tsx | 8 ------- .../supabase/functions/lwx-ticket/handler.tsx | 23 +------------------ 6 files changed, 4 insertions(+), 46 deletions(-) diff --git a/apps/www/components/LaunchWeek/X/LWXBackground.tsx b/apps/www/components/LaunchWeek/X/LWXBackground.tsx index 782ed6eb522..dbdc207fcad 100644 --- a/apps/www/components/LaunchWeek/X/LWXBackground.tsx +++ b/apps/www/components/LaunchWeek/X/LWXBackground.tsx @@ -43,7 +43,7 @@ const LWXBackground = ({ className }: Props) => { const { x: svgX, y: svgY } = svgElement.getBoundingClientRect() const x = event.clientX - svgX - 50 const y = event.clientY - svgY - 50 - console.log(x, y) + setGradientPos({ x, y }) } diff --git a/apps/www/components/LaunchWeek/X/TicketsGrid.tsx b/apps/www/components/LaunchWeek/X/TicketsGrid.tsx index fb8388687fe..614720c7743 100644 --- a/apps/www/components/LaunchWeek/X/TicketsGrid.tsx +++ b/apps/www/components/LaunchWeek/X/TicketsGrid.tsx @@ -33,8 +33,6 @@ export default function TicketsGrid({ loadedUsers, isLoading, pageCount, offset getTicketImageUrl(user.username!, !!user.golden) ?? '/images/launchweek/lwx/tickets/placeholder.png' - console.log(imgUrl) - return ( @@ -291,8 +285,6 @@ export async function handler(req: Request) { } ) - console.log('generatedTicketImage', generatedTicketImage) - // Upload image to storage. const { error: storageError } = await supabaseAdminClient.storage .from('images') @@ -308,11 +300,8 @@ export async function handler(req: Request) { } ) - console.log('storageError?', storageError) if (storageError) throw new Error(`storageError: ${storageError.message}`) - console.log('lwx-ticket username', username) - console.log('lwx-ticket platinum?', platinum) // Generate og image fetch('https://obuldanrptloktxcffvn.supabase.co/functions/v1/lwx-ticket-og', { method: 'POST', diff --git a/apps/www/supabase/functions/lwx-ticket-og/handler.tsx b/apps/www/supabase/functions/lwx-ticket-og/handler.tsx index f53369e85c5..2a53663cd2a 100644 --- a/apps/www/supabase/functions/lwx-ticket-og/handler.tsx +++ b/apps/www/supabase/functions/lwx-ticket-og/handler.tsx @@ -21,16 +21,11 @@ export async function handler(req: Request) { platinum?: boolean } = await req.json() - console.log('lwx-ticket-og username', username) - console.log('lwx-ticket-og platinum?', platinum) - const timestamp = encodeURI(new Date().toISOString()) const ticketImg = `${STORAGE_URL}/tickets/${ platinum ? 'platinum' : 'regular' }/${BUCKET_FOLDER_VERSION}/${username}.png?t=${timestamp}` - console.log('ticketImg', ticketImg) - const ticketWidth = 1100 const ticketHeight = ticketWidth / 2 const BG = { @@ -79,8 +74,6 @@ export async function handler(req: Request) { } ) - console.log('geneartedOGImage', geneartedOGImage) - // Upload image to storage. const supabaseAdminClient = createClient( // Supabase API URL - env var exported by default when deployed. @@ -102,7 +95,6 @@ export async function handler(req: Request) { } ) - console.log('storageError?', storageError) if (storageError) throw new Error(`storageError: ${storageError.message}`) return new Response(JSON.stringify({ success: true }), { diff --git a/apps/www/supabase/functions/lwx-ticket/handler.tsx b/apps/www/supabase/functions/lwx-ticket/handler.tsx index 82a15b2a152..66ad408ae42 100644 --- a/apps/www/supabase/functions/lwx-ticket/handler.tsx +++ b/apps/www/supabase/functions/lwx-ticket/handler.tsx @@ -14,7 +14,6 @@ const FONT_URL = `${STORAGE_URL}/font/CircularStd-Book.otf` const MONO_FONT_URL = `${STORAGE_URL}/font/SourceCodePro-Regular.ttf?t=2023-07-18T13%3A03%3A29.474Z` const font = fetch(new URL(FONT_URL, import.meta.url)).then((res) => res.arrayBuffer()) const mono_font = fetch(new URL(MONO_FONT_URL, import.meta.url)).then((res) => res.arrayBuffer()) -const BUCKET_FOLDER_VERSION = 'v1' const LW_TABLE = 'lwx_tickets' @@ -71,14 +70,11 @@ export async function handler(req: Request) { if (error) console.log('fetch error', error.message) if (!data) throw new Error(error?.message ?? 'user not found') - console.log('ticket data', data) + const { name, ticketNumber, metadata } = data const platinum = (!!data?.sharedOnTwitter && !!data?.sharedOnLinkedIn) ?? false - console.log('assumePlatinum??', assumePlatinum) - console.log('platinum??', platinum) if (assumePlatinum && !platinum) return await fetch(`${STORAGE_URL}/assets/golden_no_meme.png`) - console.log('no meme??') // Else, generate image and upload to storage. const BACKGROUND = { @@ -274,25 +270,8 @@ export async function handler(req: Request) { } ) - console.log('storageError?', storageError) if (storageError) throw new Error(`storageError: ${storageError.message}`) - console.log('lwx-ticket username', username) - console.log('lwx-ticket platinum?', platinum) - // Generate og image - // fetch('https://obuldanrptloktxcffvn.supabase.co/functions/v1/lwx-ticket-og', { - // method: 'POST', - // headers: { - // 'Content-Type': 'application/json', - // Authorization: - // 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im9idWxkYW5ycHRsb2t0eGNmZnZuIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTIyNjkzMjYsImV4cCI6MjAwNzg0NTMyNn0.1S6qpBbHtEmGuMsIx5UOhRiFd4YbVv-yLTrLk6tVGmM', - // }, - // body: JSON.stringify({ - // username, - // platinum, - // }), - // }).catch((err) => console.log('generate og err', err)) - const NEW_TIMESTAMP = new Date() return await fetch(