mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 09:25:06 +03:00
1 parent
d5340a94a8
commit
fa85d9febd
6 files changed
+4
-46
No files matched your search
@@ -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 })
|
||||
}
|
||||
|
||||
|
||||
@@ -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 (
|
||||
<Link
|
||||
href={`/launch-week/tickets/${user.username}`}
|
||||
|
||||
@@ -41,6 +41,6 @@ export const LW8_LAUNCH_DATE = '2023-08-07T09:00:00.000-07:00'
|
||||
export const LWX_DATE = 'Dec 11-15 / 8am PT'
|
||||
export const LWX_LAUNCH_DATE = '2023-12-11T08:00:00.000-08:00'
|
||||
export const TWEET_TEXT =
|
||||
'#SupaLaunchWeek 𝗫 is coming December 11-15 🚀\n\nClaim your ticket for a chance to win @supabase swag: \n\n🔗'
|
||||
export const TWEET_TEXT_GOLDEN = `I turned my #SupaLaunchWeek X ticket Platinum! 🩶😎\n\nClaim your own ticket: \n\n🔗`
|
||||
'#SupaLaunchWeek 🆇 is coming December 11-15 🚀\n\nClaim your ticket for a chance to win @supabase swag:\n'
|
||||
export const TWEET_TEXT_GOLDEN = `I turned my #SupaLaunchWeek 🆇 ticket Platinum! 🩶😎\n\nClaim your own ticket to win @supabase swag:\n`
|
||||
export const SITE_NAME = 'Supabase'
|
||||
@@ -73,14 +73,10 @@ 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 = {
|
||||
@@ -115,8 +111,6 @@ export async function handler(req: Request) {
|
||||
const OG_PADDING_X = (OG_WIDTH - TICKET_WIDTH) / 2
|
||||
const OG_PADDING_Y = (OG_HEIGHT - TICKET_HEIGHT) / 2
|
||||
|
||||
console.log(BACKGROUND)
|
||||
|
||||
const generatedTicketImage = new ImageResponse(
|
||||
(
|
||||
<>
|
||||
@@ -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',
|
||||
|
||||
@@ -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 }), {
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in new issue
Block a user