Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

lw15 ticketing (#36916)

Francesco Sansalvadore2afa8ba4f645
diff --git a/apps/docs/features/app.providers.tsx b/apps/docs/features/app.providers.tsx
index f5c4b77b007..63b3ace9bab 100644
--- a/apps/docs/features/app.providers.tsx
+++ b/apps/docs/features/app.providers.tsx
@@ -11,7 +11,7 @@ import { QueryClientProvider } from './data/queryClient.client'
import { PageTelemetry } from './telemetry/telemetry.client'
import { ScrollRestoration } from './ui/helpers.scroll.client'
import { ThemeSandbox } from './ui/theme.client'
-// import { PromoToast } from 'ui-patterns'
+import { PromoToast } from 'ui-patterns'
/**
* Global providers that wrap the entire app
@@ -28,7 +28,7 @@ function GlobalProviders({ children }: PropsWithChildren) {
<CommandProvider>
<div className="flex flex-col">
<SiteLayout>
- {/* <PromoToast /> */}
+ <PromoToast />
{children}
<DocsCommandMenu />
</SiteLayout>
diff --git a/apps/www/app/api-v2/opt-out/[ref]/route.ts b/apps/www/app/api-v2/opt-out/[ref]/route.ts
deleted file mode 100644
index 9028a6934b2..00000000000
--- a/apps/www/app/api-v2/opt-out/[ref]/route.ts
+++ /dev/null
@@ -1,102 +0,0 @@
-import { NextRequest, NextResponse } from 'next/server'
-import { createClient } from '@supabase/supabase-js'
-
-const supabaseUrl = process.env.NEXT_PUBLIC_EMAIL_ABUSE_URL as string
-const supabaseServiceKey = process.env.EMAIL_ABUSE_SERVICE_KEY as string
-const hcaptchaSecret = process.env.HCAPTCHA_SECRET_KEY as string
-
-// Function to verify hCaptcha token
-async function verifyCaptcha(token: string): Promise<boolean> {
- try {
- const response = await fetch('https://api.hcaptcha.com/siteverify', {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/x-www-form-urlencoded',
- },
- body: new URLSearchParams({
- secret: hcaptchaSecret,
- response: token,
- }),
- })
-
- const data = await response.json()
- return data.success === true
- } catch (error) {
- console.error('Error verifying captcha:', error)
- return false
- }
-}
-
-export async function POST(req: NextRequest, props: { params: Promise<{ ref: string }> }) {
- const params = await props.params
- const ref = params.ref
- const { reason, email, captchaToken } = await req.json()
-
- // Validate reason
- const allowedReasons = ['phishing', 'advertisement', 'malware', 'scam', 'other']
- if (!allowedReasons.includes(reason)) {
- return NextResponse.json({ error: 'Bad Request: Invalid reason provided.' }, { status: 400 })
- }
-
- const supabase = createClient(supabaseUrl, supabaseServiceKey)
-
- if (!ref) {
- return NextResponse.json(
- { error: 'Bad Request: Missing or invalid project reference.' },
- { status: 400 }
- )
- }
-
- const refPattern = /^[a-zA-Z]{20}$/
- const refIsInvalid = !refPattern.test(ref)
-
- if (refIsInvalid) {
- return NextResponse.json(
- { error: 'Bad Request: Missing or invalid project reference.' },
- { status: 400 }
- )
- }
-
- // Verify captcha token
- if (!captchaToken) {
- return NextResponse.json(
- { error: 'Bad Request: Missing captcha verification.' },
- { status: 400 }
- )
- }
-
- const isValidCaptcha = await verifyCaptcha(captchaToken)
- if (!isValidCaptcha) {
- return NextResponse.json(
- { error: 'Bad Request: Invalid captcha verification.' },
- { status: 400 }
- )
- }
-
- try {
- const { error: supabaseError } = await supabase
- .from('manual_reports')
- .insert([{ project_ref: ref, reason, email }])
-
- if (supabaseError) throw new Error(`Supabase error: ${supabaseError.message}`)
-
- const response = await fetch(process.env.EMAIL_REPORT_SLACK_WEBHOOK as string, {
- method: 'POST',
- headers: { 'Content-Type': 'application/json' },
- body: JSON.stringify({ text: `New report from: ${ref} \n\n ${reason}` }),
- })
-
- if (!response.ok) throw new Error('Failed to send to Slack')
-
- return NextResponse.json(
- { message: 'Thank you! We have received your report.' },
- { status: 200 }
- )
- } catch (error) {
- const errorMessage = (error as Error).message
- return NextResponse.json(
- { error: `Failure: Could not send post to Slack. Error: ${errorMessage}` },
- { status: 500 }
- )
- }
-}
diff --git a/apps/www/app/api-v2/submit-form-contact-sales/route.tsx b/apps/www/app/api-v2/submit-form-contact-sales/route.tsx
deleted file mode 100644
index 4f2e1aed08e..00000000000
--- a/apps/www/app/api-v2/submit-form-contact-sales/route.tsx
+++ /dev/null
@@ -1,111 +0,0 @@
-const corsHeaders = {
- 'Access-Control-Allow-Origin': '*',
- 'Access-Control-Allow-Headers': 'authorization, x-client-info, apikey, content-type',
-}
-
-const personalEmailDomains = [
- '@gmail.com',
- '@yahoo.com',
- '@hotmail.',
- '@outlook.com',
- '@aol.com',
- '@icloud.com',
- '@live.com',
- '@protonmail.com',
- '@mail.com',
- '@example.com',
-]
-
-const isValidEmail = (email: string): boolean => {
- const emailPattern = /^[\w-\.+]+@([\w-]+\.)+[\w-]{2,8}$/
- return emailPattern.test(email)
-}
-
-const isCompanyEmail = (email: string): boolean => {
- for (const domain of personalEmailDomains) {
- if (email.includes(domain)) {
- return false
- }
- }
-
- return true
-}
-
-export async function POST(req: Request) {
- const HUBSPOT_PORTAL_ID = process.env.HUBSPOT_PORTAL_ID
- const HUBSPOT_FORM_GUID = process.env.HUBSPOT_ENTERPRISE_FORM_GUID
-
- const body = await req.json()
- const { firstName, secondName, companyEmail, message } = body
-
- if (!firstName || !secondName || !companyEmail || !message) {
- return new Response(JSON.stringify({ message: 'All fields are required' }), {
- headers: { ...corsHeaders, 'Content-Type': 'application/json' },
- status: 422,
- })
- }
-
- // Validate email
- if (companyEmail && !isValidEmail(companyEmail)) {
- return new Response(JSON.stringify({ message: 'Invalid email address' }), {
- headers: { ...corsHeaders, 'Content-Type': 'application/json' },
- status: 422,
- })
- }
-
- // Validate company email
- if (companyEmail && !isCompanyEmail(companyEmail)) {
- return new Response(JSON.stringify({ message: 'Please use a company email address' }), {
- headers: { ...corsHeaders, 'Content-Type': 'application/json' },
- status: 422,
- })
- }
-
- try {
- const response = await fetch(
- `https://api.hsforms.com/submissions/v3/integration/submit/${HUBSPOT_PORTAL_ID}/${HUBSPOT_FORM_GUID}`,
- {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json',
- },
- body: JSON.stringify({
- fields: [
- { objectTypeId: '0-1', name: 'firstname', value: firstName },
- { objectTypeId: '0-1', name: 'lastname', value: secondName },
- { objectTypeId: '0-1', name: 'email', value: companyEmail },
- { objectTypeId: '0-1', name: 'message', value: message },
- ],
- context: {
- pageUri: 'https://supabase.com/contact/sales',
- pageName: 'Enterprise Demo Request Form',
- },
- legalConsentOptions: {
- consent: {
- consentToProcess: true,
- text: 'By submitting this form, I confirm that I have read and understood the Privacy Policy.',
- },
- },
- }),
- }
- )
-
- if (!response.ok) {
- const errorData = await response.json()
- return new Response(JSON.stringify({ message: errorData.message }), {
- headers: { ...corsHeaders, 'Content-Type': 'application/json' },
- status: response.status,
- })
- }
-
- return new Response(JSON.stringify({ message: 'Submission successful' }), {
- headers: { ...corsHeaders, 'Content-Type': 'application/json' },
- status: 200,
- })
- } catch (error: any) {
- return new Response(JSON.stringify({ error: error.message }), {
- headers: { ...corsHeaders, 'Content-Type': 'application/json' },
- status: 500,
- })
- }
-}
diff --git a/apps/www/app/api-v2/submit-form-sos2025-newsletter/route.tsx b/apps/www/app/api-v2/submit-form-sos2025-newsletter/route.tsx
deleted file mode 100644
index 856845ad620..00000000000
--- a/apps/www/app/api-v2/submit-form-sos2025-newsletter/route.tsx
+++ /dev/null
@@ -1,75 +0,0 @@
-const corsHeaders = {
- 'Access-Control-Allow-Origin': '*',
- 'Access-Control-Allow-Headers': 'authorization, x-client-info, apikey, content-type',
-}
-
-const isValidEmail = (email: string): boolean => {
- const emailPattern = /^[\w-\.+]+@([\w-]+\.)+[\w-]{2,8}$/
- return emailPattern.test(email)
-}
-
-export async function POST(req: Request) {
- const HUBSPOT_PORTAL_ID = process.env.HUBSPOT_PORTAL_ID
- const HUBSPOT_FORM_GUID = '721fc4aa-13eb-4c25-91be-4fe9b530bed1'
-
- const body = await req.json()
- const { email } = body
-
- if (!email) {
- return new Response(JSON.stringify({ message: 'All fields are required' }), {
- headers: { ...corsHeaders, 'Content-Type': 'application/json' },
- status: 422,
- })
- }
-
- // Validate email
- if (email && !isValidEmail(email)) {
- return new Response(JSON.stringify({ message: 'Invalid email address' }), {
- headers: { ...corsHeaders, 'Content-Type': 'application/json' },
- status: 422,
- })
- }
-
- try {
- const response = await fetch(
- `https://api.hsforms.com/submissions/v3/integration/submit/${HUBSPOT_PORTAL_ID}/${HUBSPOT_FORM_GUID}`,
- {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json',
- },
- body: JSON.stringify({
- fields: [{ objectTypeId: '0-1', name: 'email', value: email }],
- context: {
- pageUri: 'https://supabase.com/state-of-startups',
- pageName: 'State of Startups 2025',
- },
- legalConsentOptions: {
- consent: {
- consentToProcess: true,
- text: 'By submitting this form, I confirm that I have read and understood the Privacy Policy.',
- },
- },
- }),
- }
- )
-
- if (!response.ok) {
- const errorData = await response.json()
- return new Response(JSON.stringify({ message: errorData.message }), {
- headers: { ...corsHeaders, 'Content-Type': 'application/json' },
- status: response.status,
- })
- }
-
- return new Response(JSON.stringify({ message: 'Submission successful' }), {
- headers: { ...corsHeaders, 'Content-Type': 'application/json' },
- status: 200,
- })
- } catch (error: any) {
- return new Response(JSON.stringify({ error: error.message }), {
- headers: { ...corsHeaders, 'Content-Type': 'application/json' },
- status: 500,
- })
- }
-}
diff --git a/apps/www/app/api-v2/submit-form-talk-to-partnership/route.tsx b/apps/www/app/api-v2/submit-form-talk-to-partnership/route.tsx
deleted file mode 100644
index b41b9064300..00000000000
--- a/apps/www/app/api-v2/submit-form-talk-to-partnership/route.tsx
+++ /dev/null
@@ -1,110 +0,0 @@
-const corsHeaders = {
- 'Access-Control-Allow-Origin': '*',
- 'Access-Control-Allow-Headers': 'authorization, x-client-info, apikey, content-type',
-}
-
-const personalEmailDomains = [
- '@gmail.com',
- '@yahoo.com',
- '@hotmail.',
- '@outlook.com',
- '@aol.com',
- '@icloud.com',
- '@live.com',
- '@protonmail.com',
- '@mail.com',
- '@example.com',
-]
-
-const isValidEmail = (email: string): boolean => {
- const emailPattern = /^[\w-\.+]+@([\w-]+\.)+[\w-]{2,8}$/
- return emailPattern.test(email)
-}
-
-const isCompanyEmail = (email: string): boolean => {
- for (const domain of personalEmailDomains) {
- if (email.includes(domain)) {
- return false
- }
- }
-
- return true
-}
-
-export async function POST(req: Request) {
- const HUBSPOT_PORTAL_ID = process.env.HUBSPOT_PORTAL_ID
- const HUBSPOT_FORM_GUID = process.env.HUBSPOT_PARTNERSHIP_FORM_GUID
-
- const body = await req.json()
- const { firstName, secondName, companyEmail } = body
-
- if (!firstName || !secondName || !companyEmail) {
- return new Response(JSON.stringify({ message: 'All fields are required' }), {
- headers: { ...corsHeaders, 'Content-Type': 'application/json' },
- status: 422,
- })
- }
-
- // Validate email
- if (companyEmail && !isValidEmail(companyEmail)) {
- return new Response(JSON.stringify({ message: 'Invalid email address' }), {
- headers: { ...corsHeaders, 'Content-Type': 'application/json' },
- status: 422,
- })
- }
-
- // Validate company email
- if (companyEmail && !isCompanyEmail(companyEmail)) {
- return new Response(JSON.stringify({ message: 'Please use a company email address' }), {
- headers: { ...corsHeaders, 'Content-Type': 'application/json' },
- status: 422,
- })
- }
-
- try {
- const response = await fetch(
- `https://api.hsforms.com/submissions/v3/integration/submit/${HUBSPOT_PORTAL_ID}/${HUBSPOT_FORM_GUID}`,
- {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json',
- },
- body: JSON.stringify({
- fields: [
- { objectTypeId: '0-1', name: 'firstname', value: firstName },
- { objectTypeId: '0-1', name: 'lastname', value: secondName },
- { objectTypeId: '0-1', name: 'email', value: companyEmail },
- ],
- context: {
- pageUri: 'https://supabase.com/solutions/ai-builders',
- pageName: 'Solutions / AI Builders',
- },
- legalConsentOptions: {
- consent: {
- consentToProcess: true,
- text: 'By submitting this form, I confirm that I have read and understood the Privacy Policy.',
- },
- },
- }),
- }
- )
-
- if (!response.ok) {
- const errorData = await response.json()
- return new Response(JSON.stringify({ message: errorData.message }), {
- headers: { ...corsHeaders, 'Content-Type': 'application/json' },
- status: response.status,
- })
- }
-
- return new Response(JSON.stringify({ message: 'Submission successful' }), {
- headers: { ...corsHeaders, 'Content-Type': 'application/json' },
- status: 200,
- })
- } catch (error: any) {
- return new Response(JSON.stringify({ error: error.message }), {
- headers: { ...corsHeaders, 'Content-Type': 'application/json' },
- status: 500,
- })
- }
-}
diff --git a/apps/www/app/api-v2/ticket-og/route.tsx b/apps/www/app/api-v2/ticket-og/route.tsx
new file mode 100644
index 00000000000..61f4cc0fdeb
--- /dev/null
+++ b/apps/www/app/api-v2/ticket-og/route.tsx
@@ -0,0 +1,509 @@
+import React from 'react'
+import { ImageResponse } from '@vercel/og'
+import { createClient } from '@supabase/supabase-js'
+import useTicketBg from 'components/LaunchWeek/15/hooks/use-ticket-bg'
+
+export const runtime = 'edge' // 'nodejs' is the default
+export const dynamic = 'force-dynamic' // defaults to auto
+export const fetchCache = 'force-no-store'
+export const revalidate = 0
+
+const corsHeaders = {
+ 'Access-Control-Allow-Origin': '*',
+ 'Access-Control-Allow-Headers': 'authorization, x-client-info, apikey, content-type',
+}
+
+const SUPABASE_URL = process.env.NEXT_PUBLIC_SUPABASE_URL
+
+const STORAGE_URL = `${SUPABASE_URL}/storage/v1/object/public/images/launch-week/lw15`
+// Load custom fonts
+const FONT_URLS = {
+ SANS: 'https://xguihxuzqibwxjnimxev.supabase.co/storage/v1/object/public/fonts/CircularStd-Book.otf',
+}
+
+const LW_TABLE = 'tickets'
+const LW_MATERIALIZED_VIEW = 'tickets_view'
+
+export async function GET(req: Request, res: Response) {
+ const url = new URL(req.url)
+
+ // Just here to silence snyk false positives
+ // Verify that req.url is from an allowed domain
+ const username = url.searchParams.get('username') ?? url.searchParams.get('amp;username')
+ const userAgent = req.headers.get('user-agent')
+
+ try {
+ if (!username) throw new Error('missing username param')
+
+ const supabaseAdminClient = createClient(
+ process.env.NEXT_PUBLIC_SUPABASE_URL as string,
+ process.env.LIVE_SUPABASE_COM_SERVICE_ROLE_KEY as string
+ )
+
+ // Track social shares
+ if (userAgent?.toLocaleLowerCase().includes('twitter')) {
+ await supabaseAdminClient
+ .from(LW_TABLE)
+ .update({ shared_on_twitter: 'now' })
+ .eq('launch_week', 'lw15')
+ .eq('username', username)
+ .is('shared_on_twitter', null)
+ } else if (userAgent?.toLocaleLowerCase().includes('linkedin')) {
+ await supabaseAdminClient
+ .from(LW_TABLE)
+ .update({ shared_on_linkedin: 'now' })
+ .eq('launch_week', 'lw15')
+ .eq('username', username)
+ .is('shared_on_linkedin', null)
+ }
+
+ // Get ticket data
+ const { data: user, error } = await supabaseAdminClient
+ .from(LW_MATERIALIZED_VIEW)
+ .select(
+ 'id, name, metadata, shared_on_twitter, shared_on_linkedin, role, company, location, ticket_number'
+ )
+ .eq('launch_week', 'lw15')
+ .eq('username', username)
+ .maybeSingle()
+
+ if (error) console.log('Failed to fetch user. Inner error:', error.message)
+ if (!user) throw new Error(error?.message ?? 'user not found')
+
+ const FONT_SANS = fetch(new URL(FONT_URLS['SANS'], import.meta.url)).then((res) =>
+ res.arrayBuffer()
+ )
+ const FONT_DATA = await FONT_SANS
+
+ const { metadata, ticket_number } = user
+
+ const ticketBg = useTicketBg(ticket_number)
+
+ // Generate image and upload to storage.
+ const ticketType = 'regular'
+
+ const STYLING_CONFIG = {
+ TICKET_FOREGROUND: metadata.colors?.foreground ?? '#ffffff',
+ TICKET_BACKGROUND: metadata.colors?.background ?? '#000000',
+ IMG: ticketBg,
+ }
+
+ const OG_WIDTH = 1200
+ const OG_HEIGHT = 628
+ const OG_PADDING_Y = 100
+ const OG_PADDING_X = 60
+ const TICKET_RATIO = 940 / 1500
+ const TICKET_WIDTH = 480
+ const TICKET_HEIGHT = TICKET_WIDTH / TICKET_RATIO
+ const SUPABASE_LOGO_IMG = `${STORAGE_URL}/assets/supabase-white.png`
+ const SUPABASE_LOGO_RATIO = 541 / 103
+ const SUPABASE_LOGO_HEIGHT = 24
+ const DATE_FONT_SIZE = 75
+ const LW15_LOGO_HEIGHT = 70
+ const LW15_LEFT = `${STORAGE_URL}/assets/LW15_LEFT.png`
+ const LW15_LEFT_RATIO = 215 / 116
+ const LW15_RIGHT = `${STORAGE_URL}/assets/LW15_RIGHT.png`
+ const LW15_RIGHT_RATIO = 145 / 116
+ const LW15_TEXT_LOGO_FONT_SIZE = 90
+ const USERNAME_FONT_SIZE = 40
+ const TICKET_BOTTOM_TEXT_FONT_SIZE = 20
+
+ const generatedTicketImage = new ImageResponse(
+ (
+ <>
+ <div
+ style={{
+ width: '1200px',
+ height: '628px',
+ position: 'relative',
+ fontFamily: 'Circular',
+ overflow: 'hidden',
+ color: STYLING_CONFIG.TICKET_BACKGROUND,
+ backgroundColor: '#000',
+ display: 'flex',
+ flexDirection: 'column',
+ justifyContent: 'space-between',
+ }}
+ >
+ {/* Background */}
+ <img
+ width="1204"
+ height="634"
+ style={{
+ position: 'relative',
+ width: '1204px',
+ height: '634px',
+ top: '-2px',
+ left: '-2px',
+ bottom: '-2px',
+ right: '-2px',
+ backgroundSize: 'cover',
+ opacity: 0.25,
+ }}
+ src={STYLING_CONFIG.IMG}
+ />
+
+ {/* LINEAR GRADIENT */}
+ <div
+ style={{
+ position: 'absolute',
+ width: '100%',
+ height: '100%',
+ left: '0px',
+ top: '0px',
+ bottom: '0px',
+ right: '0px',
+ background: 'linear-gradient(to top, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0))',
+ zIndex: 1,
+ }}
+ />
+
+ {/* LEFT */}
+ <div
+ style={{
+ position: 'absolute',
+ width: `${OG_WIDTH - OG_PADDING_X * 2 - TICKET_WIDTH}px`,
+ height: '100%',
+ top: '0px',
+ left: '0px',
+ padding: `${OG_PADDING_Y}px 0 ${OG_PADDING_Y}px ${OG_PADDING_X}px`,
+ display: 'flex',
+ flexDirection: 'column',
+ justifyContent: 'space-between',
+ color: '#fff',
+ }}
+ >
+ <div
+ style={{
+ position: 'relative',
+ width: '100%',
+ height: '40px',
+ top: '0px',
+ left: '0px',
+ display: 'flex',
+ justifyContent: 'space-between',
+ }}
+ >
+ <p
+ style={{
+ fontSize: `28px`,
+ lineHeight: '110%',
+ margin: '0',
+ }}
+ >
+ Launch Week 15
+ </p>
+ {/* <img
+ src={LW15_LEFT}
+ width="100%"
+ height="100%"
+ style={{
+ position: 'relative',
+ width: `${LW15_LOGO_HEIGHT * LW15_LEFT_RATIO}px`,
+ height: `${LW15_LOGO_HEIGHT}`,
+ backgroundSize: 'contain',
+ }}
+ />
+ <img
+ src={LW15_RIGHT}
+ width="100%"
+ height="100%"
+ style={{
+ position: 'relative',
+ width: `${LW15_LOGO_HEIGHT * LW15_RIGHT_RATIO}px`,
+ height: `${LW15_LOGO_HEIGHT}`,
+ backgroundSize: 'contain',
+ }}
+ /> */}
+ </div>
+ <div
+ style={{
+ position: 'relative',
+ width: '100%',
+ display: 'flex',
+ flexDirection: 'column',
+ gap: '30px',
+ }}
+ >
+ <p
+ style={{
+ fontSize: `${DATE_FONT_SIZE}px`,
+ lineHeight: '110%',
+ margin: '0',
+ }}
+ >
+ July 14—18
+ </p>
+ <img
+ src={SUPABASE_LOGO_IMG}
+ width="100%"
+ height="40px"
+ style={{
+ position: 'relative',
+ backgroundSize: 'contain',
+ height: `${SUPABASE_LOGO_HEIGHT}px`,
+ width: `${SUPABASE_LOGO_RATIO * SUPABASE_LOGO_HEIGHT}px`,
+ marginBottom: '20px',
+ }}
+ />
+ </div>
+ </div>
+
+ {/* TICKET */}
+ <div
+ style={{
+ position: 'absolute',
+ width: `${TICKET_WIDTH}px`,
+ height: `${TICKET_HEIGHT}px`,
+ top: `${OG_PADDING_Y - 40}px`,
+ right: `${OG_PADDING_X}px`,
+ backgroundColor: STYLING_CONFIG.TICKET_BACKGROUND,
+ color: STYLING_CONFIG.TICKET_FOREGROUND,
+ borderRadius: '12px',
+ display: 'flex',
+ flexDirection: 'column',
+ border: '1px solid #ffffff40',
+ overflow: 'hidden',
+ boxShadow: '0 0 60px 0 rgba(0, 0, 0, 0.5)',
+ }}
+ >
+ <div
+ style={{
+ position: 'relative',
+ width: '100%',
+ height: '50%',
+ display: 'flex',
+ }}
+ >
+ <div
+ style={{
+ display: 'flex',
+ justifyContent: 'center',
+ position: 'absolute',
+ width: '100%',
+ height: '100%',
+ backgroundSize: 'cover',
+ left: 0,
+ top: 0,
+ bottom: 0,
+ right: 0,
+ }}
+ >
+ <img
+ width="600"
+ height="600"
+ src={STYLING_CONFIG.IMG}
+ style={{
+ position: 'absolute',
+ width: '100%',
+ height: '100%',
+ backgroundSize: 'cover',
+ left: 0,
+ mixBlendMode: 'screen',
+ opacity: 0.7,
+ }}
+ />
+ <div
+ style={{
+ display: 'flex',
+ position: 'absolute',
+ background: STYLING_CONFIG.TICKET_BACKGROUND,
+ width: '100%',
+ height: '100%',
+ right: 0,
+ bottom: 0,
+ top: 0,
+ left: 0,
+ mixBlendMode: 'color',
+ opacity: 0.2,
+ }}
+ />
+ <span
+ className="absolute top-5 mx-auto inset-x-0 h-[15px] w-[50px] rounded-lg shadow-inner"
+ style={{
+ position: 'absolute',
+ top: '30px',
+ margin: '0 auto',
+ width: '70px',
+ height: '20px',
+ backgroundColor: '#000',
+ border: '1px solid #ffffff40',
+ borderRadius: '10px',
+ }}
+ />
+ <div
+ style={{
+ position: 'relative',
+ width: '100%',
+ display: 'flex',
+ flexDirection: 'column',
+ zIndex: 2,
+ padding: '0px 18px',
+ gap: '10px',
+ }}
+ >
+ <div
+ style={{
+ position: 'relative',
+ width: '100%',
+ display: 'flex',
+ justifyContent: 'space-between',
+ margin: '0',
+ padding: '0',
+ }}
+ >
+ <p
+ style={{
+ fontSize: `${LW15_TEXT_LOGO_FONT_SIZE}px`,
+ padding: '0',
+ margin: '0',
+ }}
+ >
+ LW
+ </p>
+ <p
+ style={{
+ fontSize: `${LW15_TEXT_LOGO_FONT_SIZE}px`,
+ padding: '0',
+ margin: '0',
+ }}
+ >
+ 15
+ </p>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div
+ style={{
+ position: 'relative',
+ width: '100%',
+ height: '50%',
+ display: 'flex',
+ flexDirection: 'column',
+ justifyContent: 'flex-start',
+ padding: '10px 20px',
+ gap: '0px',
+ }}
+ >
+ <p
+ style={{
+ display: 'flex',
+ position: 'relative',
+ width: '100%',
+ backgroundSize: 'cover',
+ fontSize: `${USERNAME_FONT_SIZE}px`,
+ lineHeight: '110%',
+ }}
+ >
+ @{username}
+ </p>
+ <div
+ style={{
+ display: 'flex',
+ position: 'relative',
+ width: '100%',
+ marginTop: '10px',
+ }}
+ >
+ <p
+ style={{
+ fontSize: `${TICKET_BOTTOM_TEXT_FONT_SIZE}px`,
+ lineHeight: '110%',
+ width: '35%',
+ padding: '0',
+ margin: '0',
+ }}
+ >
+ Company
+ </p>
+ <p
+ style={{
+ fontSize: `${TICKET_BOTTOM_TEXT_FONT_SIZE}px`,
+ lineHeight: '110%',
+ padding: '0',
+ margin: '0',
+ }}
+ >
+ {metadata.company ?? '—'}
+ </p>
+ </div>
+ {/* <div
+ style={{
+ display: 'flex',
+ position: 'relative',
+ width: '100%',
+ marginTop: '8px',
+ }}
+ >
+ <p
+ style={{
+ fontSize: `${TICKET_BOTTOM_TEXT_FONT_SIZE}px`,
+ lineHeight: '110%',
+ width: '35%',
+ padding: '0',
+ margin: '0',
+ }}
+ >
+ Location
+ </p>
+ <p
+ style={{
+ fontSize: `${TICKET_BOTTOM_TEXT_FONT_SIZE}px`,
+ lineHeight: '110%',
+ padding: '0',
+ margin: '0',
+ }}
+ >
+ {metadata.location ?? '—'}
+ </p>
+ </div> */}
+ </div>
+ </div>
+ </div>
+ </>
+ ),
+ {
+ width: OG_WIDTH,
+ height: OG_HEIGHT,
+ fonts: [
+ {
+ name: 'CircularStd-Book',
+ data: FONT_DATA,
+ style: 'normal',
+ },
+ ],
+ headers: {
+ 'content-type': 'image/png',
+ 'cache-control': 'public, max-age=31536000, s-maxage=31536000, no-transform, immutable',
+ 'cdn-cache-control': 'max-age=31536000',
+ },
+ }
+ )
+
+ // [Note] Uncomment only for local testing to return the image directly and skip storage upload.
+ // return generatedTicketImage
+
+ // Upload image to storage.
+ const { error: storageError } = await supabaseAdminClient.storage
+ .from('images')
+ .upload(`launch-week/lw15/og/${ticketType}/${username}.png`, generatedTicketImage.body!, {
+ contentType: 'image/png',
+ // cacheControl: `${60 * 60 * 24 * 7}`,
+ cacheControl: `0`,
+ // Update cached og image, people might need to update info
+ upsert: true,
+ })
+
+ if (storageError) throw new Error(`storageError: ${storageError.message}`)
+
+ const NEW_TIMESTAMP = new Date()
+
+ return await fetch(`${STORAGE_URL}/og/${ticketType}/${username}.png?t=${NEW_TIMESTAMP}`)
+ } catch (error: any) {
+ return new Response(JSON.stringify({ error: error.message }), {
+ headers: { ...corsHeaders, 'Content-Type': 'application/json' },
+ status: 400,
+ })
+ }
+}
diff --git a/apps/www/components/Announcement/Badge.tsx b/apps/www/components/Announcement/Badge.tsx
index 1a15308adc3..d4d67accbf7 100644
--- a/apps/www/components/Announcement/Badge.tsx
+++ b/apps/www/components/Announcement/Badge.tsx
@@ -61,7 +61,7 @@ const AnnouncementBadge = ({
<ArrowNarrowRightIcon className="announcement-icon h-4 ml-2 -translate-x-1 text-foreground transition-transform group-hover/announcement:translate-x-0" />
)}
<div
- className="absolute inset-0 -z-10 bg-gradient-to-br
+ className="announcement-overlay absolute inset-0 -z-10 bg-gradient-to-br
opacity-70
group-hover/announcement:opacity-100
transition-opacity
diff --git a/apps/www/components/Hero/Hero.tsx b/apps/www/components/Hero/Hero.tsx
index 94d27bf0582..eaae6be309b 100644
--- a/apps/www/components/Hero/Hero.tsx
+++ b/apps/www/components/Hero/Hero.tsx
@@ -3,6 +3,7 @@ import Link from 'next/link'
import { Button } from 'ui'
import SectionContainer from '~/components/Layouts/SectionContainer'
import { useSendTelemetryEvent } from '~/lib/telemetry'
+import AnnouncementBadge from '../Announcement/Badge'
const Hero = () => {
const sendTelemetryEvent = useSendTelemetryEvent()
@@ -14,6 +15,21 @@ const Hero = () => {
<div className="mx-auto">
<div className="mx-auto max-w-2xl lg:col-span-6 lg:flex lg:items-center justify-center text-center">
<div className="relative z-10 lg:h-auto pt-[90px] lg:pt-[90px] lg:min-h-[300px] flex flex-col items-center justify-center sm:mx-auto md:w-3/4 lg:mx-0 lg:w-full gap-4 lg:gap-8">
+ <AnnouncementBadge
+ url="/launch-week"
+ badge="LW15"
+ announcement="Claim your ticket"
+ className="-mt-8
+ [&_.announcement-overlay]:bg-[url(/images/launchweek/15/lw15-galaxy.png)]
+ [&_.announcement-overlay]:bg-cover
+ [&_.announcement-overlay]:bg-center
+ [&_.announcement-overlay]:bg-no-repeat
+ [&_.announcement-overlay]:mix-blend-screen
+ [&_.announcement-overlay]:!opacity-5
+ [&_.announcement-overlay]:dark:!opacity-10
+ [&_.announcement-overlay]:group-hover/announcement:!opacity-20"
+ hasArrow
+ />
<div className="flex flex-col items-center">
<h1 className="text-foreground text-4xl sm:text-5xl sm:leading-none lg:text-7xl">
<span className="block text-foreground">Build in a weekend</span>
diff --git a/apps/www/components/LaunchWeek/15/ActionButton.tsx b/apps/www/components/LaunchWeek/15/ActionButton.tsx
new file mode 100644
index 00000000000..f5619699d8f
--- /dev/null
+++ b/apps/www/components/LaunchWeek/15/ActionButton.tsx
@@ -0,0 +1,101 @@
+import { cva, type VariantProps } from 'class-variance-authority'
+import { KeyboardEvent, ReactNode, useRef } from 'react'
+import { useKey } from 'react-use'
+import { cn } from 'ui'
+import { useCommandMenuOpen } from 'ui-patterns'
+
+const actionButtonVariants = cva(
+ 'pl-1.5 pr-3 py-1.5 rounded shadow flex justify-center items-center gap-2 outline outline-1 outline-offset-[-1px] cursor-pointer flex-nowrap',
+ {
+ variants: {
+ variant: {
+ primary:
+ 'dark:bg-gradient-to-b from-emerald-400/0 via-emerald-400/30 to-emerald-400/0 dark:shadow-[0px_0px_6px_0px_rgba(44,244,148,0.40)] outline-emerald-400/60',
+ secondary:
+ 'dark:bg-gradient-to-b from-neutral-600/0 via-neutral-600/30 to-neutral-600/0 dark:shadow-[0px_0px_6px_0px_rgba(255,255,255,0.10)] outline-white/10',
+ },
+ },
+ defaultVariants: {
+ variant: 'primary',
+ },
+ }
+)
+
+const iconVariants = cva(
+ 'w-5 h-5 px-2 rounded-sm outline outline-1 outline-offset-[-1px] inline-flex flex-col justify-center items-center gap-2',
+ {
+ variants: {
+ variant: {
+ primary: 'bg-emerald-950 outline-emerald-400/50',
+ secondary: 'bg-neutral-800 outline-stone-500/50',
+ },
+ },
+ defaultVariants: {
+ variant: 'primary',
+ },
+ }
+)
+
+const textVariants = cva(
+ 'justify-center text-foreground text-xs leading-[20px] font-normal min-w-[108.25px] [@media(pointer:coarse)]:pl-2 text-nowrap',
+ {
+ variants: {
+ variant: {
+ primary: 'dark:[text-shadow:_0px_0px_10px_rgb(255_255_255_/_1.00)]',
+ secondary: 'dark:[text-shadow:_0px_0px_4px_rgb(255_255_255_/_0.44)]',
+ },
+ },
+ defaultVariants: {
+ variant: 'primary',
+ },
+ }
+)
+
+export interface ActionButtonProps extends VariantProps<typeof actionButtonVariants> {
+ variant: 'primary' | 'secondary' | null | undefined
+ icon: string
+ children: ReactNode
+ onClick?: () => void
+ className?: string
+}
+
+export const ActionButton = ({
+ variant,
+ icon,
+ children,
+ className,
+ onClick,
+}: ActionButtonProps) => {
+ const buttonRef = useRef<HTMLDivElement>(null)
+
+ const handleKeyPress = (e: KeyboardEvent) => {
+ if (e.key === 'Enter' || e.key === ' ') {
+ onClick?.()
+ }
+ }
+
+ const isCommandMenuOpen = useCommandMenuOpen()
+ useKey(icon.toLowerCase(), () => !isCommandMenuOpen && onClick?.(), { event: 'keydown' }, [
+ isCommandMenuOpen,
+ onClick,
+ ])
+
+ return (
+ <div
+ className={cn(actionButtonVariants({ variant }), className)}
+ onClick={onClick}
+ onKeyDown={handleKeyPress}
+ tabIndex={0}
+ role="button"
+ aria-label={typeof children === 'string' ? children : undefined}
+ ref={buttonRef}
+ >
+ <div className={cn(iconVariants({ variant }), '[@media(pointer:coarse)]:hidden')}>
+ <div className="text-center justify-center text-neutral-50 text-xs font-normal leading-none dark:[text-shadow:_0px_0px_4px_rgb(255_255_255_/_0.25)]">
+ {icon}
+ </div>
+ </div>
+ <div className={textVariants({ variant })}>{children}</div>
+ </div>
+ )
+}
diff --git a/apps/www/components/LaunchWeek/15/Header.tsx b/apps/www/components/LaunchWeek/15/Header.tsx
new file mode 100644
index 00000000000..85668e0330b
--- /dev/null
+++ b/apps/www/components/LaunchWeek/15/Header.tsx
@@ -0,0 +1,131 @@
+import { ReactNode, useEffect, useState } from 'react'
+import { cn } from 'ui'
+import SectionContainerWithCn from '~/components/Layouts/SectionContainerWithCn'
+
+export const TicketHeader = ({ children, hidden }: { children: ReactNode; hidden?: boolean }) => {
+ if (hidden) return null
+
+ return (
+ <SectionContainerWithCn
+ height="none"
+ className="grid lg:grid-cols-[127px_1fr_127px] grid-cols-[1fr_1fr] w-full justify-between gap-6 md:gap-8 px-0"
+ >
+ {children}
+ </SectionContainerWithCn>
+ )
+}
+
+const SingleTick = ({ className }: { className?: string }) => {
+ return (
+ <div
+ className={cn(
+ 'w-px h-2.5 bg-neutral-500 shadow-[0px_0px_4px_0px_rgba(255,255,255,0.25)]',
+ className
+ )}
+ />
+ )
+}
+
+export const TicketHeaderClaim = () => {
+ return (
+ <div className="inline-flex justify-start items-center gap-8 w-full order-1 col-span-2 lg:col-auto lg:order-2">
+ <div className="hidden gap-4 flex-wrap w-full h-2.5 overflow-hidden justify-end flex-shrink flex-1 md:flex">
+ {Array.from({ length: 7 }).map((_, i) => (
+ <SingleTick key={i} />
+ ))}
+ </div>
+ <div className="text-start md:text-center justify-center text-neutral-500 text-sm font-normal uppercase [text-shadow:_0px_0px_4px_rgb(255_255_255_/_0.25)] lg:text-nowrap flex-grow max-w-[220px] md:max-w-none">
+ Launch Week is coming. Stay tuned!
+ </div>
+ <div className="hidden gap-4 flex-wrap w-full h-2.5 overflow-hidden flex-shrink flex-1 md:flex">
+ {Array.from({ length: 7 }).map((_, i) => (
+ <SingleTick key={i} />
+ ))}
+ </div>
+ </div>
+ )
+}
+
+interface TicketHeaderRemainingTimeProps {
+ targetDate: string | Date
+}
+
+export const TicketHeaderRemainingTime = ({
+ targetDate: extTargetDate,
+}: TicketHeaderRemainingTimeProps) => {
+ const [timeLeft, setTimeLeft] = useState<string>('---------------')
+
+ useEffect(() => {
+ const calculateTimeLeft = () => {
+ const targetDate = new Date(extTargetDate)
+ const now = new Date()
+
+ // Calculate the time difference in milliseconds
+ const difference = targetDate.getTime() - now.getTime()
+
+ if (difference <= 0) {
+ setTimeLeft('00D:00H:00M:00S')
+ return
+ }
+
+ const days = Math.floor(difference / (1000 * 60 * 60 * 24))
+ const hours = Math.floor((difference % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))
+ const minutes = Math.floor((difference % (1000 * 60 * 60)) / (1000 * 60))
+ const seconds = Math.floor((difference % (1000 * 60)) / 1000)
+
+ // Format the time left
+ setTimeLeft(
+ `${days.toString().padStart(2, '0')}D:${hours.toString().padStart(2, '0')}H:${minutes
+ .toString()
+ .padStart(2, '0')}M:${seconds.toString().padStart(2, '0')}S`
+ )
+ }
+
+ calculateTimeLeft()
+ const interval = setInterval(calculateTimeLeft, 1000)
+
+ return () => clearInterval(interval)
+ }, [extTargetDate])
+
+ return (
+ <div className="flex-1 order-2 lg:order-1">
+ <div className="text-justify justify-center text-emerald-400 text-sm font-normal uppercase">
+ {timeLeft}
+ </div>
+ <div className="text-neutral-500 text-justify justify-center text-xs font-normal uppercase">
+ TIME LEFT
+ </div>
+ </div>
+ )
+}
+
+export const TicketHeaderDate = () => {
+ const [time, setTime] = useState<string>('')
+
+ useEffect(() => {
+ const updateTime = () => {
+ const now = new Date()
+ const hours = now.getHours().toString().padStart(2, '0')
+ const minutes = now.getMinutes().toString().padStart(2, '0')
+ const seconds = now.getSeconds().toString().padStart(2, '0')
+ setTime(`${hours}:${minutes}:${seconds}`)
+ }
+
+ updateTime()
+ const interval = setInterval(updateTime, 1000)
+
+ return () => clearInterval(interval)
+ }, [])
+
+ return (
+ <div className="flex-1 order-3 lg:order-3">
+ <div className="text-end text-neutral-500 text-sm font-normal uppercase [text-shadow:_0px_0px_4px_rgb(255_255_255_/_0.25)]">
+ {time}
+ </div>
+
+ <div className="text-end text-neutral-500 text-xs font-normal uppercase [text-shadow:_0px_0px_4px_rgb(255_255_255_/_0.25)] text-nowrap">
+ LOCAL TIME
+ </div>
+ </div>
+ )
+}
diff --git a/apps/www/components/LaunchWeek/15/Ticketing/LW15LandingPage.tsx b/apps/www/components/LaunchWeek/15/Ticketing/LW15LandingPage.tsx
new file mode 100644
index 00000000000..ef1589eca7e
--- /dev/null
+++ b/apps/www/components/LaunchWeek/15/Ticketing/LW15LandingPage.tsx
@@ -0,0 +1,285 @@
+import React, { useEffect, useRef, useState } from 'react'
+import Link from 'next/link'
+import { LoaderCircle } from 'lucide-react'
+import { Button, cn, Tooltip, TooltipContent, TooltipTrigger } from 'ui'
+import { useRegistration } from '../hooks/use-registration'
+import useUserPresence from '../hooks/useUserPresence'
+import { createTimeline } from 'animejs'
+
+import SectionContainer from 'components/Layouts/SectionContainer'
+import useLw15ConfData from 'components/LaunchWeek/15/hooks/use-conf-data'
+import { FifteenSVG, LW15ThemeSwitcher, LWSVG } from '../lw15.components'
+
+const LW15LandingPage = () => {
+ const onlineUsers = useUserPresence()
+ const videoRef = useRef<HTMLVideoElement>(null)
+ const register = useRegistration()
+ const [state] = useLw15ConfData()
+ const user = state.userTicketData
+ const isLoading = !state.sessionLoaded
+
+ const [detectedTimezone, setDetectedTimezone] = useState('')
+ const [currentTime, setCurrentTime] = useState('')
+ const year = '2025'
+
+ const centerColClassNames = cn(
+ 'md:col-start-6 md:col-span-6',
+ 'xl:col-start-7 xl:col-span-5',
+ '2xl:col-start-8 2xl:col-span-4'
+ )
+
+ const handleClaimTicket = () => register.signIn()
+
+ // Detect user's timezone
+ useEffect(() => {
+ try {
+ const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone
+ const now = new Date()
+
+ const offsetString = now
+ .toLocaleString('en', {
+ timeZoneName: 'short',
+ })
+ .split(' ')
+ .pop()
+
+ setDetectedTimezone(`${offsetString}`)
+ } catch (error) {
+ setDetectedTimezone('Unknown')
+ }
+ }, [])
+
+ useEffect(() => {
+ const updateTime = () => {
+ const now = new Date()
+ const hours = now.getHours().toString().padStart(2, '0')
+ const minutes = now.getMinutes().toString().padStart(2, '0')
+ const seconds = now.getSeconds().toString().padStart(2, '0')
+ setCurrentTime(`${hours}:${minutes}:${seconds}`)
+ }
+
+ updateTime()
+
+ const interval = setInterval(updateTime, 1000)
+
+ return () => clearInterval(interval)
+ }, [])
+
+ // Force play video
+ useEffect(() => {
+ if (!videoRef || !videoRef.current) return
+
+ //open bug since 2017 that you cannot set muted in video element https://github.com/facebook/react/issues/10389
+ videoRef.current.defaultMuted = true
+ videoRef.current.muted = true
+
+ if (!!videoRef && !!videoRef.current) {
+ const promise = videoRef.current.play()
+ videoRef.current.play()
+ if (promise !== undefined) {
+ promise.then(() => {
+ // Auto-play started
+ videoRef.current?.play()
+ })
+ }
+ }
+ }, [videoRef])
+
+ useEffect(() => {
+ const tl = createTimeline({ defaults: { duration: 750 } })
+
+ tl.add('.lw15-logo', {
+ opacity: [0, 1],
+ scale: [0.9, 1],
+ translateY: [20, 0],
+ easing: 'outQuad',
+ duration: 1500,
+ })
+ .add('.lw15-galaxy', {
+ width: ['0%', '100%'],
+ flex: [0, 1],
+ scale: [0.9, 1],
+ opacity: [0, 1],
+ easing: 'cubicBezier(0.25, 0.1, 0.25, 1)',
+ duration: 500,
+ })
+ .add(
+ '.anim-last',
+ {
+ opacity: [0, 1],
+ translateY: ['100%', 0],
+ easing: 'cubicBezier(0.25, 0.1, 0.25, 1)',
+ duration: 600,
+ },
+ '+=300'
+ )
+ .add(
+ '.animate-line',
+ {
+ width: [0, '100%'],
+ easing: 'inOutCubic',
+ duration: 400,
+ },
+ '-=600'
+ )
+ .add(
+ '.animate-cta',
+ {
+ opacity: [0, 1],
+ translateY: [10, 0],
+ easing: 'cubicBezier(.1,0,1,1)',
+ duration: 1000,
+ },
+ '-=100'
+ )
+
+ const elements = document.querySelectorAll('[data-animate]')
+ elements.forEach((element) => {
+ if (element.getAttribute('data-animate-processed')) return
+ element.setAttribute('data-animate-processed', 'true')
+
+ const originalContent = element.innerHTML || ''
+ element.classList.add('overflow-hidden')
+
+ const span = document.createElement('span')
+ span.innerHTML = originalContent
+ span.style.display = 'inline-block'
+ span.style.transform = 'translateY(100%)'
+ span.style.transition = 'transform ease-[.25,.25,0,1]'
+
+ element.innerHTML = ''
+ element.appendChild(span)
+
+ const delay = parseInt(element.getAttribute('data-animate-delay') || '100')
+ const duration = parseInt(element.getAttribute('data-animate-duration') || '900')
+
+ setTimeout(() => {
+ setTimeout(() => {
+ element.classList.add('opacity-100')
+ span.style.transitionDuration = `${duration}ms`
+ span.style.transform = 'translateY(0)'
+ }, delay)
+ // Delay after initial animejs animation
+ }, 1500)
+ })
+ }, [])
+
+ return (
+ <SectionContainer className="flex flex-col justify-between gap-12 !py-10 h-full">
+ <div className="flex justify-between items-start text-xs">
+ <div className="flex flex-col">
+ <div className="overflow-hidden">
+ <span className="opacity-0 anim-last inline-block">
+ Detected timezone: {detectedTimezone}
+ </span>
+ </div>
+ <div className="overflow-hidden">
+ <span className="opacity-0 anim-last inline-block">Time: {currentTime}</span>
+ </div>
+ </div>
+ <div className="overflow-hidden">
+ <LW15ThemeSwitcher className="opacity-0 anim-last" />
+ </div>
+ </div>
+ <div className="flex flex-col gap-4">
+ <div className="w-full flex items-center justify-center h-[60px] md:h-[100px] lg:h-[120px] xl:h-[145px] gap-4">
+ <h1 className="sr-only">Supabase Launch Week 15</h1>
+ <LWSVG className="opacity-0 lw15-logo lw15-logo-left h-full w-auto" />
+ <div className="lw15-galaxy opacity-0 relative h-full w-0 flex-0 dark:mix-blend-screen overflow-hidden">
+ <video
+ ref={videoRef}
+ src="/images/launchweek/15/lw15-galaxy.mp4"
+ poster="/images/launchweek/15/lw15-galaxy.png"
+ autoPlay
+ muted
+ loop
+ playsInline
+ controls={false}
+ className="h-full w-full object-cover"
+ />
+ </div>
+ <FifteenSVG className="opacity-0 lw15-logo lw15-logo-right h-full w-auto mr-0.5" />
+ </div>
+ <div className="grid md:grid-cols-12 gap-4 delay-100">
+ <div
+ data-animate
+ data-animate-delay={300}
+ className="hidden md:inline-block opacity-0 md:col-span-4 text-xs overflow-hidden h-fit"
+ >
+ Celebrate our launch week with exciting new features designed to take your development
+ skills to the next level.
+ </div>
+ <div className={cn('flex flex-col items-start gap-4', centerColClassNames)}>
+ <h2
+ data-animate
+ data-animate-delay={400}
+ data-animate-duration={800}
+ className="text-3xl lg:text-4xl opacity-0 tracking-[-0.25px]"
+ >
+ Five days of launches
+ <br /> to supercharge
+ <br /> your development.
+ </h2>
+ <div className="opacity-0 animate-cta">
+ {user.id ? (
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <Button className="h-auto py-1 px-2" type="secondary" size="medium" asChild>
+ <Link href="/launch-week/ticket">
+ {isLoading ? (
+ <LoaderCircle className="w-4 h-4 animate-spinner" />
+ ) : (
+ 'View your ticket'
+ )}
+ </Link>
+ </Button>
+ </TooltipTrigger>
+ <TooltipContent side="right">
+ You claimed a ticket as @{user.username}
+ </TooltipContent>
+ </Tooltip>
+ ) : (
+ <Button
+ className="h-auto py-1 px-2 min-w-[125px] min-h-[28px]"
+ type="secondary"
+ size="medium"
+ onClick={handleClaimTicket}
+ >
+ {isLoading ? (
+ <LoaderCircle className="w-4 h-4 animate-spinner" />
+ ) : (
+ 'Claim your ticket'
+ )}
+ </Button>
+ )}
+ </div>
+ </div>
+ <div
+ data-animate
+ data-animate-delay={300}
+ className="md:col-start-12 text-right hidden md:block h-fit opacity-0"
+ >
+ {year}
+ </div>
+ </div>
+ </div>
+ <div className="grid grid-cols-2 md:grid-cols-12 gap-4 text-xs items-end">
+ <div className="md:col-span-4 hidden md:block">
+ <div className="w-0 h-px bg-foreground animate-line" />
+ </div>
+ <div className={cn(centerColClassNames)}>
+ <p data-animate data-animate-delay={1200} className="opacity-0">
+ {user.id
+ ? `Nice to see you back, ${user.name?.split(' ')[0]}`
+ : 'Claim your ticket to enter LW15'}
+ </p>
+ </div>
+ <div className="md:col-start-12 text-right text-nowrap items-end overflow-hidden">
+ <span className="opacity-0 anim-last inline-block">Online: {onlineUsers}</span>
+ </div>
+ </div>
+ </SectionContainer>
+ )
+}
+
+export default LW15LandingPage
diff --git a/apps/www/components/LaunchWeek/15/Ticketing/LW15Ticket.tsx b/apps/www/components/LaunchWeek/15/Ticketing/LW15Ticket.tsx
new file mode 100644
index 00000000000..6c7cf6d179b
--- /dev/null
+++ b/apps/www/components/LaunchWeek/15/Ticketing/LW15Ticket.tsx
@@ -0,0 +1,121 @@
+import React, { useEffect, useRef } from 'react'
+import { cn } from 'ui'
+import useLw15ConfData, { UserTicketData } from '../hooks/use-conf-data'
+import { FifteenSVG, LWSVG } from '../lw15.components'
+import Image from 'next/image'
+import { TYPO_COLORS, BG_COLORS } from './colors'
+import useTicketBg from '../hooks/use-ticket-bg'
+import VanillaTilt from 'vanilla-tilt'
+import useUserPresence from '../hooks/useUserPresence'
+
+const LW15Ticket = ({
+ user: userFromProps,
+ className,
+ ...props
+}: React.HTMLAttributes<HTMLDivElement> & { user?: UserTicketData }) => {
+ useUserPresence()
+ const [state] = useLw15ConfData()
+
+ const user = userFromProps || state.userTicketData
+ const fg = user?.metadata?.colors?.foreground || TYPO_COLORS[0]
+ const bg = user?.metadata?.colors?.background || BG_COLORS[0]
+
+ const ticketBg = useTicketBg(user?.ticket_number!)
+
+ const tilt = useRef(null)
+
+ const options = {
+ scale: 1,
+ speed: 1000,
+ max: 10,
+ glare: true,
+ 'max-glare': 0.2,
+ 'glare-prerender': false,
+ }
+
+ useEffect(() => {
+ if (!tilt.current) return
+ VanillaTilt.init(tilt.current, options)
+ }, [options])
+
+ return (
+ <div
+ ref={tilt}
+ className={cn(
+ 'min-h-[400px] transition-colors border duration-300 [&_*]:transition-colors [&_*]:duration-300 max-h-[500px] h-[70%] w-auto aspect-[278/443] flex flex-col shadow-2xl rounded-md overflow-hidden',
+ className
+ )}
+ style={{ background: bg, color: fg }}
+ {...props}
+ >
+ <div className="relative w-full h-1/2">
+ <div className="absolute w-full h-full inset-0 bg-cover">
+ <Image
+ alt=""
+ src={ticketBg}
+ blurDataURL="/images/launchweek/15/lw15-galaxy.png"
+ placeholder="blur"
+ quality={100}
+ width={600}
+ height={600}
+ className="absolute w-full h-full inset-0 bg-cover mix-blend-screen"
+ />
+ <div
+ className="absolute w-full h-full inset-0 mix-blend-color"
+ style={{ background: bg }}
+ />
+ </div>
+ <div
+ className="relative z-10 flex flex-col p-4 gap-4 w-full h-full"
+ style={{ backgroundColor: `${bg}30` }}
+ >
+ <div className="absolute top-5 bg-background dark:bg-black mx-auto inset-x-0 h-[15px] w-[50px] rounded-lg z-30 overflow-hidden">
+ <span className="absolute inset-0 w-full h-full" style={{ background: `${fg}07` }} />
+ </div>
+ <div className="w-full h-[50px] flex items-center justify-between">
+ <LWSVG className="h-full w-auto" />
+ <FifteenSVG className="h-full w-auto" />
+ </div>
+ </div>
+ </div>
+ <div className="relative flex flex-col p-4 w-full flex-1 justify-between">
+ <div className="flex flex-col gap-4 w-full">
+ <div className="text-2xl lg:text-3xl">@{user?.username}</div>
+ <div className="w-full grid grid-cols-3 gap-4 text-sm">
+ <div className="flex flex-col">
+ <p>Company</p>
+ {/* <p>Location</p> */}
+ </div>
+ <div className="col-span-2 flex flex-col">
+ <p>{user?.metadata?.company || '—'}</p>
+ {/* <p>{user?.metadata?.location || '—'}</p> */}
+ </div>
+ </div>
+ </div>
+ <div className="flex flex-col gap-4 w-full">
+ <div className="w-full grid grid-cols-3 gap-4 text-sm mt-8">
+ <div className="flex flex-col">
+ <p>Date</p>
+ </div>
+ <div className="col-span-2 flex flex-col">
+ <p>
+ Monday / 14th July <br />
+ US West Coast. 8AM
+ </p>
+ </div>
+ </div>
+ <div className="w-full grid grid-cols-3 gap-4 text-sm">
+ <div className="flex flex-col">
+ <p>Meetups</p>
+ </div>
+ <div className="col-span-2 flex flex-col">
+ <p>Supabase Meetups happening in +80 cities</p>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ )
+}
+
+export default LW15Ticket
diff --git a/apps/www/components/LaunchWeek/15/Ticketing/LW15TicketPage.tsx b/apps/www/components/LaunchWeek/15/Ticketing/LW15TicketPage.tsx
new file mode 100644
index 00000000000..af0d2e62d28
--- /dev/null
+++ b/apps/www/components/LaunchWeek/15/Ticketing/LW15TicketPage.tsx
@@ -0,0 +1,181 @@
+import { useState } from 'react'
+import dayjs from 'dayjs'
+import { Button, cn } from 'ui'
+import SectionContainer from 'components/Layouts/SectionContainer'
+import useLw15ConfData, { UserTicketData } from 'components/LaunchWeek/15/hooks/use-conf-data'
+import { useRegistration } from '../hooks/use-registration'
+import { LWSVG, FifteenSVG, LW15ThemeSwitcher } from '../lw15.components'
+import LW15Ticket from './LW15Ticket'
+import LW15TicketShare from './LW15TicketShare'
+import TicketURLCopy from './TicketURLCopy'
+import { TYPO_COLORS, BG_COLORS } from './colors'
+import { updateTicketColors } from '../hooks/use-registration'
+import Link from 'next/link'
+
+const LW15TicketPage = ({
+ user: userFromProps,
+ isSharePage,
+}: {
+ user?: UserTicketData
+ isSharePage?: boolean
+}) => {
+ const register = useRegistration()
+ const [state, setState] = useState({ saving: false })
+ const [confState] = useLw15ConfData()
+ const user = isSharePage ? userFromProps : confState.userTicketData
+ const isLoggedTicketOwner = user?.username === confState.userTicketData?.username
+
+ const selectedFg = user?.metadata?.colors?.foreground || TYPO_COLORS[0]
+ const selectedBg = user?.metadata?.colors?.background || BG_COLORS[0]
+
+ const handleColorChange = async (type: 'foreground' | 'background', color: string) => {
+ if (!user?.username) return
+ const newColors = {
+ background: type === 'background' ? color : selectedBg,
+ foreground: type === 'foreground' ? color : selectedFg,
+ }
+ setState({ saving: true })
+ try {
+ await updateTicketColors({
+ username: user?.username!,
+ userMetadata: user?.metadata,
+ background: newColors.background,
+ foreground: newColors.foreground,
+ })
+ } finally {
+ setState({ saving: false })
+ }
+ }
+
+ const TicketCustomizationSection = ({ className }: { className?: string }) => (
+ <div
+ className={cn(
+ 'flex flex-col gap-12 pt-4 w-full border-t',
+ isSharePage && 'border-t-0 lg:border-t pt-0 lg:pt-4',
+ className
+ )}
+ >
+ {!isSharePage && (
+ <div className="grid grid-cols-6 w-full gap-4">
+ <p className="col-span-full xl:col-span-3 lg:text-xs xl:max-w-[230px]">
+ Customize your ticket
+ </p>
+ <div className="col-span-full xl:col-span-3 xl:col-start-4 flex flex-col gap-4">
+ <div className="w-full grid grid-cols-3">
+ <p>Typo color</p>
+ <div className="flex flex-col col-span-2">
+ <div className="flex gap-2 flex-wrap justify-end">
+ {TYPO_COLORS.map((color) => (
+ <button
+ key={color}
+ className={cn(
+ 'flex-1 max-w-5 aspect-square rounded-full border flex items-center justify-center transition-all',
+ selectedFg === color && 'border-background ring-1 ring-foreground scale-110'
+ )}
+ style={{ background: color }}
+ aria-label={color}
+ onClick={() => handleColorChange('foreground', color)}
+ disabled={state.saving}
+ />
+ ))}
+ </div>
+ </div>
+ </div>
+ <div className="w-full grid grid-cols-3">
+ <p>Bg color</p>
+ <div className="flex flex-col col-span-2">
+ <div className="flex gap-2 flex-wrap justify-end">
+ {BG_COLORS.map((color) => (
+ <button
+ key={color}
+ className={cn(
+ 'flex-1 max-w-5 aspect-square rounded-full border flex items-center justify-center transition-all',
+ selectedBg === color && 'border-background ring-1 ring-foreground scale-110'
+ )}
+ style={{ background: color }}
+ aria-label={color}
+ onClick={() => handleColorChange('background', color)}
+ disabled={state.saving}
+ />
+ ))}
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ )}
+ <div className="hidden lg:flex justify-between items-end gap-4 text-xs">
+ <div className="flex flex-col">
+ <p>Ticket ID: #{user?.ticket_number}</p>
+ <p>Claimed at: {dayjs(user?.created_at).format('DD MMM / HH:mm')}</p>
+ </div>
+ <LW15ThemeSwitcher />
+ </div>
+ </div>
+ )
+
+ const handleClaimTicket = () => register.signIn()
+
+ return (
+ <SectionContainer className="flex flex-col lg:grid lg:grid-cols-2 gap-6 !py-8 md:!py-10 h-full !min-h-[calc(100dvh-66px)]">
+ <div className="flex flex-col h-full justify-between gap-6 lg:gap-20">
+ <div className="grid grid-cols-6 gap-4">
+ <div className="col-span-full w-full hidden lg:flex items-center justify-between h-[60px] md:h-[90px] lg:h-[120px] gap-4">
+ <h1 className="sr-only">Supabase Launch Week 15</h1>
+ <LWSVG className="h-full w-auto" />
+ <FifteenSVG className="h-full w-auto" />
+ </div>
+ <div className="col-span-5 text-2xl lg:text-4xl">
+ {isSharePage ? (
+ <>
+ {user?.name?.split(' ')[0]}'s Ticket
+ <br />
+ Want your own?
+ </>
+ ) : (
+ <>
+ Hey @{user?.username}, <br />
+ customize your <br className="hidden lg:block" />
+ Launch Week ticket
+ </>
+ )}
+ </div>
+ {isSharePage && !isLoggedTicketOwner && (
+ <div className="col-span-full">
+ <Button
+ className="h-auto py-1 px-2 min-w-[125px] min-h-[28px]"
+ type="secondary"
+ size="medium"
+ onClick={handleClaimTicket}
+ >
+ Claim your ticket
+ </Button>
+ </div>
+ )}
+ {isSharePage && isLoggedTicketOwner && (
+ <div className="col-span-full">
+ <Button className="h-auto py-1 px-2" type="secondary" size="medium" asChild>
+ <Link href="/launch-week/ticket">Customize your ticket</Link>
+ </Button>
+ </div>
+ )}
+ </div>
+ <TicketCustomizationSection />
+ </div>
+ <div
+ className="w-full border border-muted h-full bg-surface-300 flex items-center justify-center p-8 transition-colors duration-300"
+ style={{ background: `${selectedFg}07` }}
+ >
+ <div className="flex flex-col justify-center gap-8 h-fit">
+ <LW15Ticket user={user} />
+ <div className="flex flex-col gap-1">
+ <TicketURLCopy user={user} />
+ {!isSharePage && <LW15TicketShare />}
+ </div>
+ </div>
+ </div>
+ </SectionContainer>
+ )
+}
+
+export default LW15TicketPage
diff --git a/apps/www/components/LaunchWeek/15/Ticketing/LW15TicketPageProxy.tsx b/apps/www/components/LaunchWeek/15/Ticketing/LW15TicketPageProxy.tsx
new file mode 100644
index 00000000000..36d1bc58874
--- /dev/null
+++ b/apps/www/components/LaunchWeek/15/Ticketing/LW15TicketPageProxy.tsx
@@ -0,0 +1,37 @@
+import { useEffect } from 'react'
+import { useRouter } from 'next/router'
+
+import useLw15ConfData from 'components/LaunchWeek/15/hooks/use-conf-data'
+import { useRegistration } from 'components/LaunchWeek/15/hooks/use-registration'
+import LW15TicketPage from './LW15TicketPage'
+
+const LW15TicketRedirect = () => {
+ useRegistration()
+ const [confState] = useLw15ConfData()
+ const user = confState.userTicketData
+ const router = useRouter()
+
+ useEffect(() => {
+ if (confState.sessionLoaded && confState.session === null) {
+ router.replace('/launch-week')
+ }
+ }, [confState.sessionLoaded, confState.session, router, user.username])
+
+ if (!confState.sessionLoaded)
+ return (
+ <div className="h-full min-h-[calc(100dvh-66px)] w-full flex items-center justify-center opacity-0 animate-fade-in">
+ Loading...
+ </div>
+ )
+
+ if (!user.id)
+ return (
+ <div className="h-full min-h-[calc(100dvh-66px)] w-full flex items-center justify-center opacity-0 animate-fade-in">
+ Loading...
+ </div>
+ )
+
+ return <LW15TicketPage />
+}
+
+export default LW15TicketRedirect
diff --git a/apps/www/components/LaunchWeek/15/Ticketing/LW15TicketShare.tsx b/apps/www/components/LaunchWeek/15/Ticketing/LW15TicketShare.tsx
new file mode 100644
index 00000000000..7209d908ae4
--- /dev/null
+++ b/apps/www/components/LaunchWeek/15/Ticketing/LW15TicketShare.tsx
@@ -0,0 +1,102 @@
+import { useBreakpoint } from 'common'
+import dayjs from 'dayjs'
+import { Check } from 'lucide-react'
+import { useTheme } from 'next-themes'
+import Link from 'next/link'
+import { useEffect, useRef, useState } from 'react'
+import { Button } from 'ui'
+import useConfData from '../hooks/use-conf-data'
+import { LW15_TWEET_TEXT, LW15_URL } from '~/lib/constants'
+import supabase from '../supabase'
+
+export default function LW15TicketShare() {
+ const { resolvedTheme } = useTheme()
+ const [state] = useConfData()
+ const userData = state.userTicketData
+ const { username, metadata } = userData
+ const [_imgReady, setImgReady] = useState(false)
+ const [_loading, setLoading] = useState(false)
+ const isLessThanMd = useBreakpoint()
+ const downloadLink = useRef<HTMLAnchorElement>()
+ const link = `${LW15_URL}/tickets/${username}?lw=15&t=${dayjs(new Date()).format('DHHmmss')}`
+ const permalink = encodeURIComponent(link)
+ const text = LW15_TWEET_TEXT
+ const encodedText = encodeURIComponent(text)
+ const tweetUrl = `https://twitter.com/intent/tweet?url=${permalink}&text=${encodedText}`
+ const linkedInUrl = `https://www.linkedin.com/sharing/share-offsite/?url=${permalink}&text=${encodedText}`
+ const downloadUrl = `/api-v2/ticket-og?username=${encodeURIComponent(username ?? '')}`
+ const TICKETS_TABLE = 'tickets'
+
+ useEffect(() => {
+ setImgReady(false)
+
+ const img = new Image()
+
+ img.src = downloadUrl
+ img.onload = () => {
+ setImgReady(true)
+ setLoading(false)
+ if (downloadLink.current) {
+ downloadLink.current.click()
+ downloadLink.current = undefined
+ }
+ }
+ }, [downloadUrl])
+
+ const handleShare = async (social: 'twitter' | 'linkedin') => {
+ setTimeout(async () => {
+ if (social === 'twitter') {
+ await supabase
+ .from(TICKETS_TABLE)
+ .update({
+ shared_on_twitter: 'now',
+ metadata: { ...metadata, theme: resolvedTheme },
+ })
+ .eq('launch_week', 'lw15')
+ .eq('username', username)
+ } else if (social === 'linkedin') {
+ await supabase
+ .from(TICKETS_TABLE)
+ .update({
+ shared_on_linkedin: 'now',
+ metadata: { ...metadata, theme: resolvedTheme },
+ })
+ .eq('launch_week', 'lw15')
+ .eq('username', username)
+ }
+
+ if (userData.shared_on_linkedin && userData.shared_on_twitter) {
+ await fetch(`/api-v2/ticket-og?username=${username}&platinum=true`)
+ }
+ })
+ }
+
+ return (
+ <div className="flex flex-row flex-wrap justify-stretch w-full gap-1 pointer-events-auto">
+ <Button
+ onClick={() => handleShare('twitter')}
+ type={userData.shared_on_twitter ? 'secondary' : 'default'}
+ icon={userData.shared_on_twitter && <Check strokeWidth={2} />}
+ size={isLessThanMd ? 'tiny' : 'small'}
+ className="px-2 lg:px-3.5 h-[28px] lg:h-[34px] flex-1 w-full"
+ asChild
+ >
+ <Link href={tweetUrl} target="_blank">
+ {userData.shared_on_twitter ? 'Shared on Twitter' : 'Share on Twitter'}
+ </Link>
+ </Button>
+ <Button
+ onClick={() => handleShare('linkedin')}
+ type={userData.shared_on_linkedin ? 'secondary' : 'default'}
+ icon={userData.shared_on_linkedin && <Check strokeWidth={2} />}
+ size={isLessThanMd ? 'tiny' : 'small'}
+ className="px-2 lg:px-3.5 h-[28px] lg:h-[34px] flex-1 w-full"
+ asChild
+ >
+ <Link href={linkedInUrl} target="_blank">
+ {userData.shared_on_linkedin ? 'Shared on Linkedin' : 'Share on Linkedin'}
+ </Link>
+ </Button>
+ </div>
+ )
+}
diff --git a/apps/www/components/LaunchWeek/15/Ticketing/TicketURLCopy.tsx b/apps/www/components/LaunchWeek/15/Ticketing/TicketURLCopy.tsx
new file mode 100644
index 00000000000..0fe2ec4a8f6
--- /dev/null
+++ b/apps/www/components/LaunchWeek/15/Ticketing/TicketURLCopy.tsx
@@ -0,0 +1,44 @@
+import { useState, useRef } from 'react'
+import { LW14_URL } from 'lib/constants'
+import { Check, Copy } from 'lucide-react'
+import { UserTicketData } from '../hooks/use-conf-data'
+import { cn } from 'ui'
+
+export default function TicketURLCopy({
+ user,
+ className,
+}: {
+ user?: UserTicketData
+ className?: string
+}) {
+ const [copied, setCopied] = useState(false)
+ const username = user?.username
+ const buttonRef = useRef<HTMLButtonElement>(null)
+ const displayUrl = `.../launch-week/tickets/${username}`
+ const link = `${LW14_URL}/tickets/${username}`
+
+ return (
+ <button
+ type="button"
+ name="Copy"
+ ref={buttonRef}
+ onClick={() => {
+ navigator.clipboard.writeText(link).then(() => {
+ setCopied(true)
+ setTimeout(() => {
+ setCopied(false)
+ }, 2000)
+ })
+ }}
+ className={cn(
+ 'font-mono w-full px-2 lg:px-3.5 !pr-1 py-1 rounded-md bg-alternative-200 border flex gap-2 relative text-foreground-light hover:text-foreground text-xs pointer-events-auto justify-between items-center hover:border-stronger transition-all',
+ className
+ )}
+ >
+ <span className="truncate">{displayUrl}</span>
+ <div className="w-6 min-w-6 h-6 flex items-center justify-center flex-shrink-0 border border-strong rounded bg-muted hover:bg-selection hover:border-stronger">
+ {copied ? <Check size={14} strokeWidth={3} /> : <Copy size={14} strokeWidth={1.5} />}
+ </div>
+ </button>
+ )
+}
diff --git a/apps/www/components/LaunchWeek/15/Ticketing/colors.ts b/apps/www/components/LaunchWeek/15/Ticketing/colors.ts
new file mode 100644
index 00000000000..42152d58983
--- /dev/null
+++ b/apps/www/components/LaunchWeek/15/Ticketing/colors.ts
@@ -0,0 +1,23 @@
+// Typography color options
+export const TYPO_COLORS = [
+ '#FFFFFF',
+ '#90EBFE',
+ '#FF8BFD',
+ '#A6B1FF',
+ // '#FF7023',
+ '#FFD794',
+ '#D0D0D0',
+ '#FBED00',
+]
+
+// Background color options
+export const BG_COLORS = [
+ '#000000',
+ '#000D64',
+ '#4F1C09',
+ '#982E00',
+ '#32056E',
+ // '#434343',
+ '#604F41',
+ '#012AE2',
+]
diff --git a/apps/www/components/LaunchWeek/15/assets/logo.png b/apps/www/components/LaunchWeek/15/assets/logo.png
new file mode 100644
index 00000000000..64993ba156f
Binary files /dev/null and b/apps/www/components/LaunchWeek/15/assets/logo.png differ
diff --git a/apps/www/components/LaunchWeek/15/assets/tunnel-bg.png b/apps/www/components/LaunchWeek/15/assets/tunnel-bg.png
new file mode 100644
index 00000000000..358d6b768f8
Binary files /dev/null and b/apps/www/components/LaunchWeek/15/assets/tunnel-bg.png differ
diff --git a/apps/www/components/LaunchWeek/15/hooks/use-conf-data.tsx b/apps/www/components/LaunchWeek/15/hooks/use-conf-data.tsx
new file mode 100644
index 00000000000..19f040423f9
--- /dev/null
+++ b/apps/www/components/LaunchWeek/15/hooks/use-conf-data.tsx
@@ -0,0 +1,246 @@
+import { useRouter } from 'next/router'
+import { createContext, Dispatch, useContext, useEffect, useReducer } from 'react'
+import type { RealtimeChannel, Session } from '@supabase/supabase-js'
+
+/**
+ * This is copy of shared use-conf-data.ts. For launch week 15 we need different ticket states.
+ * To not break the existing functionality, we are creating a new context and hook.
+ */
+
+export type TicketState = 'registration' | 'ticket-visible' | 'loading' | 'ticket-loading'
+
+export type UserTicketData = {
+ id?: string
+ email?: string
+ username?: string
+ name?: string
+ ticket_number?: number
+ platinum?: boolean
+ golden?: boolean
+ referrals?: number
+ bg_image_id?: number
+ role?: string
+ company?: string
+ location?: string
+ created_at?: string
+ metadata?: {
+ role?: string
+ company?: string
+ location?: string
+ hasSecretTicket?: boolean
+ hasSharedSecret?: boolean
+ hideAvatar?: boolean
+ hideMetadata?: boolean
+ theme?: string
+ colors?: {
+ background: string
+ foreground: string
+ }
+ }
+ shared_on_twitter?: string
+ shared_on_linkedin?: string
+ secret?: boolean
+}
+
+type LwAction =
+ | { type: 'USER_TICKET_FETCH_STARTED' }
+ | { type: 'USER_TICKET_FETCH_SUCCESS'; payload: UserTicketData }
+ | { type: 'USER_TICKET_FETCH_ERROR'; payload: Error }
+ | { type: 'USER_TICKET_UPDATED'; payload: UserTicketData }
+ | { type: 'SESSION_UPDATED'; payload: Session | null }
+ | { type: 'SESSION_LOADED' }
+ | { type: 'TICKET_LOADING_START' }
+ | { type: 'TICKET_LOADING_SUCCESS' }
+ | { type: 'TICKET_LOADING_ERROR'; payload?: Error }
+ | { type: 'PARTYMODE_ENABLE'; payload: RealtimeChannel }
+ | { type: 'PARTYMODE_DISABLE' }
+ | { type: 'URL_PARAMS_LOADED'; payload: { referal?: string } }
+ | {
+ type: 'GAUGES_DATA_FETCHED'
+ payload: {
+ payloadSaturation?: number
+ payloadFill?: number
+ meetupsAmount?: number
+ peopleOnline?: number
+ }
+ }
+
+// Define state interface
+interface LwState {
+ userTicketData: UserTicketData
+ ticketState: TicketState
+ session: Session | null
+ sessionLoaded: boolean
+ userTicketDataState: 'unloaded' | 'loading' | 'error' | 'loaded'
+ userTicketDataError: Error | null
+ ticketLoadingState: 'unloaded' | 'loading' | 'error' | 'loaded'
+ ticketVisibility: boolean
+ claimFormState: 'initial' | 'visible' | 'hidden'
+ partymodeStatus: 'on' | 'off'
+ realtimeGaugesChannel: RealtimeChannel | null
+ referal?: string
+ gaugesData: {
+ payloadSaturation: number | null
+ payloadFill: number | null
+ meetupsAmount: number | null
+ peopleOnline: number | null
+ } | null
+ urlParamsLoaded: boolean
+}
+
+export const lwReducer = (state: LwState, action: LwAction): LwState => {
+ switch (action.type) {
+ case 'SESSION_UPDATED':
+ return {
+ ...state,
+ session: action.payload,
+ // Show claim form if session is not available. Form triggers authentication flow.
+ claimFormState: !action.payload ? 'visible' : 'hidden',
+ }
+ case 'SESSION_LOADED':
+ return {
+ ...state,
+ sessionLoaded: true,
+ }
+ case 'USER_TICKET_FETCH_STARTED':
+ return { ...state, userTicketDataState: 'loading', userTicketDataError: null }
+ case 'USER_TICKET_FETCH_SUCCESS':
+ return {
+ ...state,
+ userTicketData: action.payload,
+ ticketVisibility: action.payload !== null && state.ticketLoadingState === 'loaded',
+ }
+ case 'USER_TICKET_FETCH_ERROR':
+ return {
+ ...state,
+ session: null,
+ ticketState: 'registration',
+ userTicketDataState: 'error',
+ userTicketDataError: action.payload,
+ }
+ case 'USER_TICKET_UPDATED':
+ return {
+ ...state,
+ userTicketData: action.payload,
+ userTicketDataState: Boolean(action.payload.id) ? 'loaded' : 'unloaded',
+ userTicketDataError: null,
+ }
+ case 'TICKET_LOADING_START':
+ return {
+ ...state,
+ ticketLoadingState: 'loading',
+ ticketVisibility: false,
+ }
+ case 'TICKET_LOADING_SUCCESS':
+ return {
+ ...state,
+ ticketLoadingState: 'loaded',
+ ticketVisibility: Boolean(state.userTicketData.id),
+ }
+ case 'TICKET_LOADING_ERROR':
+ return {
+ ...state,
+ ticketLoadingState: 'error',
+ ticketVisibility: false,
+ claimFormState: 'visible',
+ }
+ case 'PARTYMODE_ENABLE': {
+ return {
+ ...state,
+ realtimeGaugesChannel: action.payload,
+ partymodeStatus: 'on',
+ }
+ }
+ case 'PARTYMODE_DISABLE': {
+ return {
+ ...state,
+ realtimeGaugesChannel: null,
+ partymodeStatus: 'off',
+ }
+ }
+ case 'GAUGES_DATA_FETCHED': {
+ const nonNullableKeys = Object.fromEntries(
+ Object.entries(action.payload).filter(([_, v]) => v !== undefined)
+ ) as typeof action.payload
+ const newGaugeData = state.gaugesData
+ ? { ...state.gaugesData, ...nonNullableKeys }
+ : {
+ payloadSaturation: null,
+ payloadFill: null,
+ meetupsAmount: null,
+ peopleOnline: null,
+ ...nonNullableKeys,
+ }
+
+ return {
+ ...state,
+ gaugesData: newGaugeData,
+ }
+ }
+ case 'URL_PARAMS_LOADED': {
+ return { ...state, urlParamsLoaded: true, referal: action.payload.referal }
+ }
+ default:
+ action satisfies never
+ return state
+ }
+}
+
+export const Lw15ConfDataContext = createContext<[LwState, Dispatch<LwAction>] | null>(null)
+
+function takeFirst(param: string | string[] | undefined): string | undefined {
+ if (Array.isArray(param)) {
+ return param[0]
+ }
+
+ return param ?? undefined
+}
+
+export const Lw15ConfDataProvider = ({
+ children,
+ initState,
+}: {
+ children: React.ReactNode
+ initState?: Partial<LwState>
+}) => {
+ const { query, isReady } = useRouter()
+
+ const providerValue = useReducer(lwReducer, {
+ userTicketData: {},
+ ticketState: 'loading',
+ session: null,
+ sessionLoaded: false,
+ ticketLoadingState: 'unloaded',
+ ticketVisibility: false,
+ userTicketDataState: 'unloaded',
+ userTicketDataError: null,
+ claimFormState: 'initial',
+ realtimeGaugesChannel: null,
+ partymodeStatus: 'off',
+ gaugesData: null,
+ urlParamsLoaded: false,
+ ...initState,
+ })
+ const [, dispatch] = providerValue
+
+ useEffect(() => {
+ if (isReady) {
+ dispatch({
+ type: 'URL_PARAMS_LOADED',
+ payload: { referal: takeFirst(query.referal) ?? takeFirst(query.username) },
+ })
+ }
+ }, [dispatch, isReady, query.referal, query.username])
+
+ return (
+ <Lw15ConfDataContext.Provider value={providerValue}>{children}</Lw15ConfDataContext.Provider>
+ )
+}
+
+export default function useLw15ConfData() {
+ const result = useContext(Lw15ConfDataContext)
+ if (!result) {
+ throw new Error('useLw15ConfData must be used within a Lw15ConfDataProvider')
+ }
+ return result
+}
diff --git a/apps/www/components/LaunchWeek/15/hooks/use-partymode.ts b/apps/www/components/LaunchWeek/15/hooks/use-partymode.ts
new file mode 100644
index 00000000000..b924cddd1e6
--- /dev/null
+++ b/apps/www/components/LaunchWeek/15/hooks/use-partymode.ts
@@ -0,0 +1,119 @@
+import { useCallback, useEffect, useState } from 'react'
+import useLw14ConfData from './use-conf-data'
+import supabase from '../supabase'
+import { REALTIME_CHANNEL_STATES, REALTIME_SUBSCRIBE_STATES } from '@supabase/supabase-js'
+
+const LW14_TOPIC = 'lw14'
+const GAUGES_UPDATES_EVENT = 'gauges-update'
+
+export const usePartymode = () => {
+ const [state, dispatch] = useLw14ConfData()
+ const [shouldInitialize, setShouldInitialize] = useState(
+ state.partymodeStatus === 'on' && !state.realtimeGaugesChannel
+ )
+
+ const createChannelAndSubscribe = useCallback(() => {
+ const channel = supabase.channel(LW14_TOPIC, {
+ config: {
+ broadcast: {
+ self: true,
+ ack: true,
+ },
+ },
+ })
+
+ const userStatus = {}
+
+ return channel
+ .on('broadcast', { event: GAUGES_UPDATES_EVENT }, (data) => {
+ const { payload } = data
+
+ dispatch({
+ type: 'GAUGES_DATA_FETCHED',
+ payload: {
+ payloadFill: payload.payload_fill,
+ payloadSaturation: payload.payload_saturation,
+ meetupsAmount: payload.meetups_amount,
+ },
+ })
+ })
+ .on('presence', { event: 'sync' }, () => {
+ const newState = channel.presenceState()
+ const uniqueUsers = new Set([
+ ...Object.entries(newState).map(([_, value]) => value[0].presence_ref),
+ ])
+
+ dispatch({
+ type: 'GAUGES_DATA_FETCHED',
+ payload: { peopleOnline: uniqueUsers.size },
+ })
+ })
+ .subscribe(async (status, error) => {
+ // console.log('Channel status', status, error)
+ await channel.track(userStatus)
+
+ if (status === REALTIME_SUBSCRIBE_STATES.SUBSCRIBED) {
+ dispatch({ type: 'PARTYMODE_ENABLE', payload: channel })
+ }
+ })
+ }, [dispatch])
+
+ const toggle = useCallback(async () => {
+ if (state.partymodeStatus === 'on') {
+ await state.realtimeGaugesChannel?.unsubscribe()
+ dispatch({ type: 'PARTYMODE_DISABLE' })
+ } else {
+ createChannelAndSubscribe()
+ }
+ }, [createChannelAndSubscribe, dispatch, state.partymodeStatus, state.realtimeGaugesChannel])
+
+ const fetchGaugesData = useCallback(async () => {
+ const [{ data: payloadData, error: payloadError }, { data: meetupsData, error: meetupsError }] =
+ await Promise.all([
+ supabase.rpc('get_payload_data_for_lw14'),
+ supabase.rpc('get_meetups_data_for_lw14'),
+ ])
+
+ if (payloadError || meetupsError) {
+ console.error('Error fetching gauges data', payloadError, meetupsError)
+ return
+ }
+
+ dispatch({
+ type: 'GAUGES_DATA_FETCHED',
+ payload: {
+ payloadFill: payloadData.payload_fill,
+ payloadSaturation: payloadData.payload_saturation,
+ meetupsAmount: meetupsData.meetups_amount,
+ },
+ })
+ }, [dispatch])
+
+ useEffect(() => {
+ if (
+ state.partymodeStatus === 'on' &&
+ (!state.realtimeGaugesChannel ||
+ state.realtimeGaugesChannel.state === REALTIME_CHANNEL_STATES.closed)
+ ) {
+ const channel = createChannelAndSubscribe()
+ void fetchGaugesData()
+ return () => {
+ if (
+ state.partymodeStatus === 'off' &&
+ state.realtimeGaugesChannel?.state === REALTIME_CHANNEL_STATES.joined
+ )
+ channel.unsubscribe()
+ }
+ }
+ }, [
+ createChannelAndSubscribe,
+ fetchGaugesData,
+ shouldInitialize,
+ state.partymodeStatus,
+ state.realtimeGaugesChannel,
+ ])
+
+ return {
+ toggle,
+ }
+}
diff --git a/apps/www/components/LaunchWeek/15/hooks/use-registration.ts b/apps/www/components/LaunchWeek/15/hooks/use-registration.ts
new file mode 100644
index 00000000000..74aec7b3598
--- /dev/null
+++ b/apps/www/components/LaunchWeek/15/hooks/use-registration.ts
@@ -0,0 +1,269 @@
+import { useCallback, useEffect, useRef } from 'react'
+import { RealtimeChannel } from '@supabase/supabase-js'
+
+import useConfData, { type UserTicketData } from './use-conf-data'
+import { LW15_URL } from 'lib/constants'
+import supabase from '../supabase'
+import { BG_COLORS, TYPO_COLORS } from '../Ticketing/colors'
+import { fetchGitHubUser } from '../utils/github-api'
+
+function subscribeToTicketChanges(
+ username: string,
+ onChange: (payload: any) => void
+): RealtimeChannel {
+ return supabase
+ .channel('changes')
+ .on(
+ 'postgres_changes',
+ {
+ event: 'UPDATE',
+ schema: 'public',
+ table: 'tickets',
+ filter: `username=eq.${username}`,
+ },
+ onChange
+ )
+ .subscribe()
+}
+
+interface RegistrationProps {
+ onRegister?: () => void
+ onError?: (error: any) => void
+}
+
+export const useRegistration = ({ onError, onRegister }: RegistrationProps = {}) => {
+ const [
+ { userTicketData: userData, session, userTicketDataState, urlParamsLoaded, referal },
+ dispatch,
+ ] = useConfData()
+ const sessionUser = session?.user
+ const callbacksRef = useRef({ onError, onRegister })
+
+ // Triggered on session
+ const fetchOrCreateUser = useCallback(async () => {
+ if (['loading', 'loaded'].includes(userTicketDataState)) return
+ if (!urlParamsLoaded) return
+
+ if (!sessionUser) {
+ console.warn('Cannot fetch user without session. Skipping...')
+ return
+ }
+
+ const username = sessionUser.user_metadata?.user_name as string | undefined
+ const name = sessionUser.user_metadata.full_name
+ const email = sessionUser.email
+ const userId = sessionUser.id
+ const defaultColors = {
+ background: BG_COLORS[0],
+ foreground: TYPO_COLORS[0],
+ }
+
+ if (!username) {
+ throw new Error('Username is required')
+ }
+
+ if (!userData.id) {
+ dispatch({ type: 'USER_TICKET_FETCH_STARTED' })
+
+ // Fetch GitHub user data
+ let githubUserData = null
+ try {
+ githubUserData = await fetchGitHubUser(username)
+ } catch (error) {
+ console.warn('Failed to fetch GitHub user data:', error)
+ }
+
+ const metadata = {
+ colors: defaultColors,
+ ...(githubUserData && {
+ company: githubUserData.company,
+ location: githubUserData.location,
+ }),
+ }
+
+ const { error: ticketInsertError } = await supabase
+ .from('tickets')
+ .insert({
+ user_id: userId,
+ launch_week: 'lw15',
+ email,
+ name,
+ username,
+ referred_by: referal ?? null,
+ metadata,
+ })
+ .select()
+ .single()
+
+ // If error because of duplicate email, ignore and proceed, otherwise sign out.
+ if (ticketInsertError && ticketInsertError?.code !== '23505') {
+ dispatch({ type: 'USER_TICKET_FETCH_ERROR', payload: ticketInsertError })
+ callbacksRef.current.onError?.(ticketInsertError)
+ return supabase.auth.signOut()
+ }
+
+ const { data, error: ticketsViewError } = await supabase
+ .from('tickets_view')
+ .select('*')
+ .eq('launch_week', 'lw15')
+ .eq('username', username)
+ .single()
+
+ if (ticketsViewError) {
+ dispatch({ type: 'USER_TICKET_FETCH_ERROR', payload: ticketsViewError })
+ callbacksRef.current.onError?.(ticketsViewError)
+ return
+ }
+
+ dispatch({ type: 'USER_TICKET_FETCH_SUCCESS', payload: data })
+
+ await prefetchData(username)
+ }
+
+ callbacksRef.current.onRegister?.()
+ }, [dispatch, referal, sessionUser, urlParamsLoaded, userData.id, userTicketDataState])
+
+ async function prefetchData(username: string) {
+ // Prefetch GitHub avatar
+ // new Image().src = `https://github.com/${username}.png`
+
+ // Prefetch the twitter share URL to eagerly generate the page
+ await fetch(`/api-v2/ticket-og?username=${username}`)
+ }
+
+ const handleGithubSignIn = useCallback(async () => {
+ let redirectTo = `${LW15_URL}/ticket`
+
+ if (referal) {
+ redirectTo += `?referal=${referal}`
+ }
+
+ const response = await supabase?.auth.signInWithOAuth({
+ provider: 'github',
+ options: {
+ redirectTo,
+ },
+ })
+
+ if (response) {
+ if (response.error) {
+ callbacksRef.current?.onError?.(response.error)
+ return
+ }
+ }
+ }, [referal])
+
+ useEffect(() => {
+ fetchOrCreateUser()
+
+ const username = sessionUser?.user_metadata?.user_name as string | undefined
+
+ if (username) {
+ const channel = subscribeToTicketChanges(username, (payload) => {
+ const platinum = !!payload.new.shared_on_twitter && !!payload.new.shared_on_linkedin
+ const secret = !!payload.new.game_won_at
+
+ dispatch({
+ type: 'USER_TICKET_UPDATED',
+ payload: {
+ ...payload.new,
+ platinum,
+ secret,
+ },
+ })
+ })
+
+ return () => {
+ // Cleanup realtime subscription on unmount
+ channel?.unsubscribe()
+ }
+ }
+ }, [dispatch, fetchOrCreateUser, sessionUser?.user_metadata?.user_name])
+
+ useEffect(() => {
+ supabase.auth.getSession().then(({ data, error }) => {
+ if (error) console.error('Session error', error)
+ dispatch({ type: 'SESSION_UPDATED', payload: data.session })
+ dispatch({ type: 'SESSION_LOADED' })
+ })
+
+ const {
+ data: { subscription },
+ } = supabase.auth.onAuthStateChange((_event, session) => {
+ dispatch({ type: 'SESSION_UPDATED', payload: session })
+
+ if (session && window.location.hash.includes('access_token')) {
+ window.history.replaceState(null, '', window.location.pathname + window.location.search)
+ }
+ })
+
+ return () => subscription.unsubscribe()
+ }, [dispatch])
+
+ useEffect(() => {
+ callbacksRef.current = { onError, onRegister }
+ })
+
+ const upgradeTicket = async () => {
+ if (userData.id) {
+ if (userData.secret) {
+ // console.log('User already has a secret ticket')
+ return
+ }
+
+ const { error } = await supabase
+ .from('tickets')
+ .update({ game_won_at: new Date() })
+ .eq('launch_week', 'lw15')
+ .eq('username', userData.username)
+
+ if (error) {
+ return console.error('Failed to upgrade user ticket', error)
+ }
+
+ // Trigger og-image ticket generation
+ await fetch(`/api-v2/ticket-og?username=${userData.username}`)
+ } else {
+ console.warn('Cannot upgrade ticket without user data')
+ }
+ }
+
+ return {
+ signIn: handleGithubSignIn,
+ upgradeTicket,
+ }
+}
+
+// Update ticket colors in the database
+export async function updateTicketColors({
+ username,
+ userMetadata,
+ background,
+ foreground,
+}: {
+ username: string
+ userMetadata: UserTicketData['metadata']
+ background: string
+ foreground: string
+}) {
+ console.log('previous userMetadata', userMetadata)
+ const { error } = await supabase
+ .from('tickets')
+ .update({
+ metadata: {
+ ...userMetadata,
+ colors: {
+ background,
+ foreground,
+ },
+ },
+ })
+ .eq('launch_week', 'lw15')
+ .eq('username', username)
+
+ if (error) {
+ // eslint-disable-next-line no-console
+ console.error('Failed to update ticket colors', error)
+ throw error
+ }
+}
diff --git a/apps/www/components/LaunchWeek/15/hooks/use-ticket-bg.ts b/apps/www/components/LaunchWeek/15/hooks/use-ticket-bg.ts
new file mode 100644
index 00000000000..9f53c61c6b3
--- /dev/null
+++ b/apps/www/components/LaunchWeek/15/hooks/use-ticket-bg.ts
@@ -0,0 +1,10 @@
+const LIMIT = 7
+
+const useTicketBg = (ticketNumber: number = 0) => {
+ const ticketBg = ((ticketNumber || 0) % LIMIT) + 1
+ const formattedTicketBg = `00${ticketBg}`.slice(-3)
+
+ return `${process.env.NEXT_PUBLIC_SUPABASE_URL}/storage/v1/object/public/images/launch-week/lw15/assets/bg/${formattedTicketBg}.png`
+}
+
+export default useTicketBg
diff --git a/apps/www/components/LaunchWeek/15/hooks/useUserPresence.ts b/apps/www/components/LaunchWeek/15/hooks/useUserPresence.ts
new file mode 100644
index 00000000000..597eecb93bd
--- /dev/null
+++ b/apps/www/components/LaunchWeek/15/hooks/useUserPresence.ts
@@ -0,0 +1,48 @@
+import { useEffect, useState } from 'react'
+import { SupabaseClient } from '@supabase/supabase-js'
+import supabase from 'lib/supabase'
+
+const useUserPresence = () => {
+ const [realtimeChannel, setRealtimeChannel] = useState<ReturnType<
+ SupabaseClient['channel']
+ > | null>(null)
+ const [onlineUsers, setOnlineUsers] = useState<any[]>([])
+
+ useEffect(() => {
+ // Listen to realtime presence
+ if (!realtimeChannel && supabase) {
+ const lw15Room = supabase?.channel('lw15_online', {
+ config: { broadcast: { self: true, ack: true } },
+ })
+
+ setRealtimeChannel(lw15Room)
+ const userStatus = {}
+
+ lw15Room
+ ?.on('presence', { event: 'sync' }, () => {
+ const newState = lw15Room.presenceState()
+ const users = [...Object.entries(newState).map(([_, value]) => value[0])]
+ const uniqueUsrs = users.filter(onlyUnique)
+ setOnlineUsers(uniqueUsrs)
+ })
+ .subscribe(async (status) => {
+ if (status !== 'SUBSCRIBED') {
+ return null
+ }
+ await lw15Room.track(userStatus)
+ })
+ }
+
+ return () => {
+ realtimeChannel?.unsubscribe()
+ }
+ }, [])
+
+ return onlineUsers.length
+}
+
+function onlyUnique(value: any, index: number, array: any[]) {
+ return array.indexOf(value) === index
+}
+
+export default useUserPresence
diff --git a/apps/www/components/LaunchWeek/15/lw15.components.tsx b/apps/www/components/LaunchWeek/15/lw15.components.tsx
new file mode 100644
index 00000000000..af5aeabb2e8
--- /dev/null
+++ b/apps/www/components/LaunchWeek/15/lw15.components.tsx
@@ -0,0 +1,70 @@
+import { useTheme } from 'next-themes'
+import { cn } from 'ui'
+
+export const LWSVG = (props: React.SVGProps<SVGSVGElement>) => {
+ return (
+ <svg
+ width="270"
+ height="146"
+ viewBox="0 0 270 146"
+ className="h-full w-auto"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ >
+ <path d="M21.2516 0.5V127.9H97.8516V145.5H0.851562V0.5H21.2516Z" fill="currentColor" />
+ <path
+ d="M192.348 0.5L220.948 122.3L247.748 0.5H269.148L232.948 145.5H208.148L180.148 26.3L152.748 145.5H127.948L91.1484 0.5H113.548L141.548 122.3L168.348 0.5H192.348Z"
+ fill="currentColor"
+ />
+ </svg>
+ )
+}
+
+export const FifteenSVG = (props: React.SVGProps<SVGSVGElement>) => {
+ return (
+ <svg
+ width="185"
+ height="148"
+ viewBox="0 0 185 148"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ >
+ <path
+ d="M52.1653 145.393H33.8891V31.6856H0.148438V19.252C20.8347 18.6504 31.8807 15.6423 39.7134 0H52.1653V145.393Z"
+ fill="currentColor"
+ />
+ <path
+ d="M132.332 132.759C149.805 132.759 164.868 120.125 164.868 97.664C164.868 73.5989 147.998 63.1707 132.132 63.1707C117.069 63.1707 107.228 71.9946 104.014 79.2141L85.7381 78.2114L95.1775 0H178.726V17.0461H110.039L105.019 58.3577C112.851 50.9377 124.299 47.3279 136.349 47.3279C161.855 47.3279 184.148 65.3767 184.148 97.4634C184.148 130.753 159.445 148 132.332 148C98.7925 148 83.1272 126.743 80.5163 103.279H99.3951C102.408 121.729 112.048 132.759 132.332 132.759Z"
+ fill="currentColor"
+ />
+ </svg>
+ )
+}
+
+export const LW15ThemeSwitcher = ({
+ className,
+ ...props
+}: React.HTMLAttributes<HTMLDivElement>) => {
+ const { resolvedTheme, setTheme } = useTheme()
+ const isDarkMode = resolvedTheme?.includes('dark')
+
+ return (
+ <div className={cn('flex items-center justify-start gap-2', className)} {...props}>
+ <button
+ onClick={() => setTheme('dark')}
+ className={cn(isDarkMode ? 'text-foreground' : 'text-foreground-lighter')}
+ >
+ dark mode
+ </button>{' '}
+ /
+ <button
+ onClick={() => setTheme('light')}
+ className={cn(!isDarkMode ? 'text-foreground' : 'text-foreground-lighter')}
+ >
+ light mode
+ </button>
+ </div>
+ )
+}
diff --git a/apps/www/components/LaunchWeek/15/styles.css b/apps/www/components/LaunchWeek/15/styles.css
new file mode 100644
index 00000000000..0376973ecce
--- /dev/null
+++ b/apps/www/components/LaunchWeek/15/styles.css
@@ -0,0 +1,8 @@
+/* Font face definitions for Launch Week 15 */
+@font-face {
+ font-family: 'SuisseIntl';
+ src: url('/fonts/launchweek/15/SuisseIntl-Book.otf') format('otf');
+ font-weight: 400;
+ font-style: normal;
+ font-display: swap;
+}
diff --git a/apps/www/components/LaunchWeek/15/supabase.ts b/apps/www/components/LaunchWeek/15/supabase.ts
new file mode 100644
index 00000000000..2ed4e1935ef
--- /dev/null
+++ b/apps/www/components/LaunchWeek/15/supabase.ts
@@ -0,0 +1,9 @@
+import { SupabaseClient } from '@supabase/supabase-js'
+import supabase from '~/lib/supabase'
+
+/**
+ * Override supabase types similar to previous use-conf-data.ts.
+ * Current apps/www supabase instance uses old types.
+ * Since we don't know final db layout let's leave it as any.
+ */
+export default supabase as SupabaseClient
diff --git a/apps/www/components/LaunchWeek/15/utils/github-api.ts b/apps/www/components/LaunchWeek/15/utils/github-api.ts
new file mode 100644
index 00000000000..0b42cd02c0b
--- /dev/null
+++ b/apps/www/components/LaunchWeek/15/utils/github-api.ts
@@ -0,0 +1,29 @@
+export interface GitHubUser {
+ company: string | null
+ location: string | null
+}
+
+export async function fetchGitHubUser(username: string): Promise<GitHubUser | null> {
+ try {
+ const response = await fetch(`https://api.github.com/users/${username}`, {
+ headers: {
+ Accept: 'application/vnd.github+json',
+ 'X-GitHub-Api-Version': '2022-11-28',
+ },
+ })
+
+ if (!response.ok) {
+ if (response.status === 404) {
+ console.warn(`GitHub user ${username} not found`)
+ return null
+ }
+ throw new Error(`GitHub API error: ${response.status}`)
+ }
+
+ const userData = await response.json()
+ return userData
+ } catch (error) {
+ console.error('Error fetching GitHub user data:', error)
+ return null
+ }
+}
diff --git a/apps/www/components/Nav/index.tsx b/apps/www/components/Nav/index.tsx
index a1f59fb7928..5900e708122 100644
--- a/apps/www/components/Nav/index.tsx
+++ b/apps/www/components/Nav/index.tsx
@@ -24,7 +24,7 @@ import MobileMenu from './MobileMenu'
import RightClickBrandLogo from './RightClickBrandLogo'
import { useSendTelemetryEvent } from '~/lib/telemetry'
import useDropdownMenu from './useDropdownMenu'
-import { AuthenticatedDropdownMenu } from 'ui-patterns'
+import { AnnouncementBanner, AuthenticatedDropdownMenu } from 'ui-patterns'
interface Props {
hideNavbar: boolean
@@ -47,7 +47,7 @@ const Nav = ({ hideNavbar, stickyNavbar = true }: Props) => {
const isLaunchWeekXPage = router.pathname === '/launch-week/x'
const isGAWeekSection = router.pathname.startsWith('/ga-week')
const disableStickyNav = isLaunchWeekXPage || isGAWeekSection || isLaunchWeekPage || !stickyNavbar
- const showLaunchWeekNavMode = (isLaunchWeekPage || isGAWeekSection) && !open
+ const showLaunchWeekNavMode = !isLaunchWeekXPage && (isLaunchWeekPage || isGAWeekSection) && !open
React.useEffect(() => {
if (open) {
@@ -67,10 +67,11 @@ const Nav = ({ hideNavbar, stickyNavbar = true }: Props) => {
return null
}
- const showDarkLogo = isLaunchWeekPage || resolvedTheme?.includes('dark')! || isHomePage
+ // const showDarkLogo = isLaunchWeekPage || resolvedTheme?.includes('dark')! || isHomePage
return (
<>
+ <AnnouncementBanner />
<div
className={cn('sticky top-0 z-40 transform', disableStickyNav && 'relative')}
style={{ transform: 'translate3d(0,0,999px)' }}
@@ -79,14 +80,14 @@ const Nav = ({ hideNavbar, stickyNavbar = true }: Props) => {
className={cn(
'absolute inset-0 h-full w-full bg-background/90 dark:bg-background/95',
!showLaunchWeekNavMode && '!opacity-100 transition-opacity',
- showLaunchWeekNavMode && '!bg-transparent transition-all',
+ showLaunchWeekNavMode && '!bg-transparent dark:!bg-black transition-all',
isGAWeekSection && 'dark:!bg-alternative'
)}
/>
<nav
className={cn(
`relative z-40 border-default border-b backdrop-blur-sm transition-opacity`,
- showLaunchWeekNavMode && 'border-muted border-b bg-alternative/50'
+ showLaunchWeekNavMode && 'border-muted border-b bg-transparent'
)}
>
<div className="relative flex justify-between h-16 mx-auto lg:container lg:px-16 xl:px-20">
diff --git a/apps/www/lib/constants.ts b/apps/www/lib/constants.ts
index 2605273ff3c..2a4280f607c 100644
--- a/apps/www/lib/constants.ts
+++ b/apps/www/lib/constants.ts
@@ -58,7 +58,6 @@ export const TWEET_TEXT =
export const TWEET_TEXT_PLATINUM = `Just conquered a platinum @supabase Launch Week 13 ticket. Share twice to get one! \n#launchweek`
export const TWEET_TEXT_SECRET = `Found the secret golden ticket for @supabase's Launch Week 13. \nCan you find it? \n#launchweek`
-// todo: update dates
export const LW14_DATE = '31 March — 4 April / 7am PT'
export const LW14_LAUNCH_DATE = '2025-03-31T07:00:00.000-07:00'
export const LW14_LAUNCH_DATE_END = '2025-04-04T23:59:59.000-07:00'
@@ -70,4 +69,12 @@ export const LW14_TWEET_TEXT_PLATINUM =
export const LW14_TWEET_TEXT_SECRET = `Found the secret golden ticket for @supabase's Launch Week 14. \nCan you find it? \n#launchweek`
export const LW14_URL = `${SITE_ORIGIN}/launch-week`
+export const LW15_DATE = '14 — 18 Jul / 8am PT'
+export const LW15_LAUNCH_DATE = '2025-07-14T08:00:00.000-07:00'
+export const LW15_LAUNCH_DATE_END = '2025-07-14T23:59:59.000-07:00'
+export const LW15_TITLE = 'Launch Week 15'
+export const LW15_TWEET_TEXT =
+ 'Launch Week 15 is just around the corner at @supabase. \nClaim your ticket and stay tuned for all the announcements! \n#launchweek'
+export const LW15_URL = `${SITE_ORIGIN}/launch-week`
+
export const SITE_NAME = 'Supabase'
diff --git a/apps/www/lib/remotePatterns.js b/apps/www/lib/remotePatterns.js
index 2ee99063db2..17a174cdbdd 100644
--- a/apps/www/lib/remotePatterns.js
+++ b/apps/www/lib/remotePatterns.js
@@ -59,6 +59,12 @@ module.exports = [
port: '',
pathname: '**',
},
+ {
+ protocol: 'http',
+ hostname: '127.0.0.1',
+ port: '54321',
+ pathname: '**',
+ },
{
protocol: 'https',
hostname: 'xguihxuzqibwxjnimxev.supabase.co',
diff --git a/apps/www/pages/launch-week/14/index.tsx b/apps/www/pages/launch-week/14/index.tsx
new file mode 100644
index 00000000000..16267f9a608
--- /dev/null
+++ b/apps/www/pages/launch-week/14/index.tsx
@@ -0,0 +1,61 @@
+import { NextSeo } from 'next-seo'
+import { LW14_DATE, LW14_TITLE, LW14_URL, SITE_ORIGIN } from 'lib/constants'
+import { useRouter } from 'next/router'
+import { Lw14ConfDataProvider } from 'components/LaunchWeek/14/hooks/use-conf-data'
+import DefaultLayout from 'components/Layouts/Default'
+import LWStickyNav from 'components/LaunchWeek/14/Releases/LWStickyNav'
+import LWHeader from 'components/LaunchWeek/14/Releases/LWHeader'
+import MainStage from 'components/LaunchWeek/14/Releases/MainStage'
+import BuildStage from 'components/LaunchWeek/14/Releases/BuildStage'
+
+const Lw14Page = () => {
+ const TITLE = `${LW14_TITLE} | ${LW14_DATE}`
+ const DESCRIPTION = 'Join us for a week of announcing new features, every day at 7 AM PT.'
+ const OG_IMAGE = `${SITE_ORIGIN}/images/launchweek/14/lw14-og.png?lw=14`
+
+ const { query } = useRouter()
+ const ticketNumber = query.ticketNumber?.toString()
+ const defaultUserData = {
+ id: query.id?.toString(),
+ ticket_number: ticketNumber ? parseInt(ticketNumber, 10) : undefined,
+ name: query.name?.toString(),
+ username: query.username?.toString(),
+ platinum: !!query.platinum,
+ }
+
+ return (
+ <>
+ <NextSeo
+ title={TITLE}
+ description={DESCRIPTION}
+ openGraph={{
+ title: TITLE,
+ description: DESCRIPTION,
+ url: LW14_URL,
+ images: [
+ {
+ url: OG_IMAGE,
+ },
+ ],
+ }}
+ />
+
+ <Lw14ConfDataProvider initState={{ userTicketData: defaultUserData, partymodeStatus: 'on' }}>
+ <DefaultLayout>
+ <div
+ style={{
+ fontFamily: 'Departure Mono, Source Code Pro, Office Code Pro, Menlo, monospace',
+ }}
+ >
+ <LWStickyNav />
+ <LWHeader />
+ <MainStage className="relative z-10" />
+ <BuildStage />
+ </div>
+ </DefaultLayout>
+ </Lw14ConfDataProvider>
+ </>
+ )
+}
+
+export default Lw14Page
diff --git a/apps/www/pages/launch-week/index.tsx b/apps/www/pages/launch-week/index.tsx
index 26376aa5640..57cc60d26e7 100644
--- a/apps/www/pages/launch-week/index.tsx
+++ b/apps/www/pages/launch-week/index.tsx
@@ -1,17 +1,15 @@
import { NextSeo } from 'next-seo'
-import { LW14_DATE, LW14_TITLE, LW14_URL, SITE_ORIGIN } from '~/lib/constants'
+import { LW15_DATE, LW15_TITLE, LW15_URL, SITE_ORIGIN } from 'lib/constants'
import { useRouter } from 'next/router'
-import { Lw14ConfDataProvider } from '~/components/LaunchWeek/14/hooks/use-conf-data'
-import DefaultLayout from '~/components/Layouts/Default'
-import LWStickyNav from '~/components/LaunchWeek/14/Releases/LWStickyNav'
-import LWHeader from '~/components/LaunchWeek/14/Releases/LWHeader'
-import MainStage from '~/components/LaunchWeek/14/Releases/MainStage'
-import BuildStage from '~/components/LaunchWeek/14/Releases/BuildStage'
-const Lw14Page = () => {
- const TITLE = `${LW14_TITLE} | ${LW14_DATE}`
- const DESCRIPTION = 'Join us for a week of announcing new features, every day at 7 AM PT.'
- const OG_IMAGE = `${SITE_ORIGIN}/images/launchweek/14/lw14-og.png?lw=14`
+import { Lw15ConfDataProvider } from 'components/LaunchWeek/15/hooks/use-conf-data'
+import DefaultLayout from 'components/Layouts/Default'
+import LW15LandingPage from 'components/LaunchWeek/15/Ticketing/LW15LandingPage'
+
+const Lw15Page = () => {
+ const TITLE = `${LW15_TITLE} | ${LW15_DATE}`
+ const DESCRIPTION = 'Join us for a week of announcing new features, every day at 8AM PT.'
+ const OG_IMAGE = `${SITE_ORIGIN}/images/launchweek/15/lw15-og.png?lw=15`
const { query } = useRouter()
const ticketNumber = query.ticketNumber?.toString()
@@ -31,7 +29,7 @@ const Lw14Page = () => {
openGraph={{
title: TITLE,
description: DESCRIPTION,
- url: LW14_URL,
+ url: LW15_URL,
images: [
{
url: OG_IMAGE,
@@ -40,22 +38,21 @@ const Lw14Page = () => {
}}
/>
- <Lw14ConfDataProvider initState={{ userTicketData: defaultUserData, partymodeStatus: 'on' }}>
- <DefaultLayout>
+ <Lw15ConfDataProvider initState={{ userTicketData: defaultUserData }}>
+ <DefaultLayout className="!min-h-[calc(100dvh-66px)] h-[calc(100dvh-66px)] dark:bg-black">
<div
style={{
- fontFamily: 'Departure Mono, Source Code Pro, Office Code Pro, Menlo, monospace',
+ fontFamily:
+ "SuisseIntl-Book, custom-font, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",
}}
+ className="h-full"
>
- <LWStickyNav />
- <LWHeader />
- <MainStage className="relative z-10" />
- <BuildStage />
+ <LW15LandingPage />
</div>
</DefaultLayout>
- </Lw14ConfDataProvider>
+ </Lw15ConfDataProvider>
</>
)
}
-export default Lw14Page
+export default Lw15Page
diff --git a/apps/www/pages/launch-week/ticket.tsx b/apps/www/pages/launch-week/ticket.tsx
new file mode 100644
index 00000000000..5e5dfbf98df
--- /dev/null
+++ b/apps/www/pages/launch-week/ticket.tsx
@@ -0,0 +1,35 @@
+import LW15TicketPageProxy from '~/components/LaunchWeek/15/Ticketing/LW15TicketPageProxy'
+import { useRouter } from 'next/router'
+
+import { Lw15ConfDataProvider } from 'components/LaunchWeek/15/hooks/use-conf-data'
+import DefaultLayout from '../../components/Layouts/Default'
+
+const Lw15Page = () => {
+ const { query } = useRouter()
+ const ticketNumber = query.ticketNumber?.toString()
+ const defaultUserData = {
+ id: query.id?.toString(),
+ ticket_number: ticketNumber ? parseInt(ticketNumber, 10) : undefined,
+ name: query.name?.toString(),
+ username: query.username?.toString(),
+ platinum: !!query.platinum,
+ }
+
+ return (
+ <Lw15ConfDataProvider initState={{ userTicketData: defaultUserData }}>
+ <DefaultLayout className="!min-h-fit !h-fit lg:!min-h-[calc(100dvh-66px)] lg:!h-full dark:bg-black">
+ <div
+ style={{
+ fontFamily:
+ "SuisseIntl-Book, custom-font, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",
+ }}
+ className="h-full"
+ >
+ <LW15TicketPageProxy />
+ </div>
+ </DefaultLayout>
+ </Lw15ConfDataProvider>
+ )
+}
+
+export default Lw15Page
diff --git a/apps/www/pages/launch-week/tickets/[username].tsx b/apps/www/pages/launch-week/tickets/[username].tsx
new file mode 100644
index 00000000000..d1b04fc7557
--- /dev/null
+++ b/apps/www/pages/launch-week/tickets/[username].tsx
@@ -0,0 +1,120 @@
+import { NextSeo } from 'next-seo'
+import dayjs from 'dayjs'
+import Error from 'next/error'
+import { GetStaticPaths, GetStaticProps } from 'next'
+import { LW15_DATE, LW15_TITLE, LW15_URL, SITE_ORIGIN } from 'lib/constants'
+import { Lw15ConfDataProvider, UserTicketData } from 'components/LaunchWeek/15/hooks/use-conf-data'
+import { createClient } from '@supabase/supabase-js'
+import DefaultLayout from 'components/Layouts/Default'
+import LW15TicketPage from 'components/LaunchWeek/15/Ticketing/LW15TicketPage'
+import { useRouter } from 'next/router'
+
+interface Props {
+ user: UserTicketData
+ ogImageUrl: string
+}
+
+const Lw15Page = ({ user, ogImageUrl }: Props) => {
+ const username = user?.username
+ const TITLE = `${LW15_TITLE} | ${LW15_DATE}`
+ const DESCRIPTION = 'Join us for a week of announcing new features, every day at 8AM PT.'
+ const PAGE_URL = `${LW15_URL}/tickets/${username}`
+ const { query } = useRouter()
+ const ticketNumber = query.ticketNumber?.toString()
+ const defaultUserData = {
+ id: query.id?.toString(),
+ ticket_number: ticketNumber ? parseInt(ticketNumber, 10) : undefined,
+ name: query.name?.toString(),
+ username: query.username?.toString(),
+ platinum: !!query.platinum,
+ }
+
+ if (!username) {
+ return <Error statusCode={404} />
+ }
+
+ return (
+ <>
+ <NextSeo
+ title={TITLE}
+ description={DESCRIPTION}
+ openGraph={{
+ title: TITLE,
+ description: DESCRIPTION,
+ url: PAGE_URL,
+ images: [
+ {
+ url: ogImageUrl,
+ width: 1200,
+ height: 628,
+ },
+ ],
+ }}
+ />
+
+ <Lw15ConfDataProvider initState={{ userTicketData: defaultUserData }}>
+ <DefaultLayout className="!min-h-fit !h-fit lg:!min-h-[calc(100dvh-66px)] lg:!h-full dark:bg-black">
+ <div
+ style={{
+ fontFamily:
+ "SuisseIntl-Book, custom-font, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",
+ }}
+ className="h-full"
+ >
+ <LW15TicketPage user={user} isSharePage />
+ </div>
+ </DefaultLayout>
+ </Lw15ConfDataProvider>
+ </>
+ )
+}
+
+export default Lw15Page
+
+export const getStaticProps: GetStaticProps = async ({ params }) => {
+ const username = params?.username?.toString() || null
+ let user
+
+ const supabaseAdmin = createClient(
+ process.env.NEXT_PUBLIC_SUPABASE_URL!,
+ process.env.LIVE_SUPABASE_COM_SERVICE_ROLE_KEY!
+ )
+
+ // fetch the normal ticket
+ // stores the og images in supabase storage
+ fetch(
+ // @ts-ignore
+ `${SITE_ORIGIN}/api-v2/ticket-og?username=${encodeURIComponent(username ?? '')}`
+ )
+
+ // fetch a specific user
+ if (username) {
+ const { data, error } = await supabaseAdmin!
+ .from('tickets_view')
+ .select('name, username, ticket_number, metadata, role, company, location')
+ .eq('launch_week', 'lw15')
+ .eq('username', username)
+ .single()
+
+ user = data
+ }
+
+ const ticketType = 'regular'
+ const ogImageUrl = `${process.env.NEXT_PUBLIC_SUPABASE_URL}/storage/v1/object/public/images/launch-week/lw15/og/${ticketType}/${username}.png?t=${dayjs(new Date()).format('DHHmmss')}`
+
+ return {
+ props: {
+ user,
+ ogImageUrl,
+ key: username,
+ },
+ revalidate: 5,
+ }
+}
+
+export const getStaticPaths: GetStaticPaths = async () => {
+ return Promise.resolve({
+ paths: [],
+ fallback: 'blocking',
+ })
+}
diff --git a/apps/www/public/fonts/launchweek/15/SuisseIntl-Book.otf b/apps/www/public/fonts/launchweek/15/SuisseIntl-Book.otf
new file mode 100755
index 00000000000..686304ce142
Binary files /dev/null and b/apps/www/public/fonts/launchweek/15/SuisseIntl-Book.otf differ
diff --git a/apps/www/public/images/launchweek/15/logo-pixel-small-dark.png b/apps/www/public/images/launchweek/15/logo-pixel-small-dark.png
new file mode 100644
index 00000000000..33b9acba9c2
Binary files /dev/null and b/apps/www/public/images/launchweek/15/logo-pixel-small-dark.png differ
diff --git a/apps/www/public/images/launchweek/15/logo-pixel-small-light.png b/apps/www/public/images/launchweek/15/logo-pixel-small-light.png
new file mode 100644
index 00000000000..7a94438979e
Binary files /dev/null and b/apps/www/public/images/launchweek/15/logo-pixel-small-light.png differ
diff --git a/apps/www/public/images/launchweek/15/lw15-galaxy.mp4 b/apps/www/public/images/launchweek/15/lw15-galaxy.mp4
new file mode 100644
index 00000000000..fa671105720
Binary files /dev/null and b/apps/www/public/images/launchweek/15/lw15-galaxy.mp4 differ
diff --git a/apps/www/public/images/launchweek/15/lw15-galaxy.png b/apps/www/public/images/launchweek/15/lw15-galaxy.png
new file mode 100644
index 00000000000..78298bb5946
Binary files /dev/null and b/apps/www/public/images/launchweek/15/lw15-galaxy.png differ
diff --git a/apps/www/public/images/launchweek/15/lw15-og.png b/apps/www/public/images/launchweek/15/lw15-og.png
new file mode 100644
index 00000000000..d1d8f10f3ca
Binary files /dev/null and b/apps/www/public/images/launchweek/15/lw15-og.png differ
diff --git a/packages/common/constants/local-storage.ts b/packages/common/constants/local-storage.ts
index 962a22990dc..036160859d9 100644
--- a/packages/common/constants/local-storage.ts
+++ b/packages/common/constants/local-storage.ts
@@ -79,7 +79,7 @@ export const LOCAL_STORAGE_KEYS = {
SAVED_PROJECT: 'docs.ui.user.selected.project',
SAVED_BRANCH: 'docs.ui.user.selected.branch',
- HIDE_PROMO_TOAST: 'supabase-hide-promo-toast-lw13-d1',
+ HIDE_PROMO_TOAST: 'supabase-hide-promo-toast-lw15-ticket',
/**
* WWW
diff --git a/packages/ui-patterns/Banners/AnnouncementBanner.tsx b/packages/ui-patterns/Banners/AnnouncementBanner.tsx
index 00e08ce0982..af0275e408e 100644
--- a/packages/ui-patterns/Banners/AnnouncementBanner.tsx
+++ b/packages/ui-patterns/Banners/AnnouncementBanner.tsx
@@ -1,10 +1,10 @@
import { Announcement } from 'ui/src/layout/banners'
-import SOSBanner from './SOSBanner'
+import LW15Banner from './LW15Banner'
export const AnnouncementBanner = () => {
return (
<Announcement show={true} announcementKey="announcement_sos25">
- <SOSBanner />
+ <LW15Banner />
</Announcement>
)
}
diff --git a/packages/ui-patterns/Banners/LW15Banner.tsx b/packages/ui-patterns/Banners/LW15Banner.tsx
new file mode 100644
index 00000000000..b9c07a1e2bd
--- /dev/null
+++ b/packages/ui-patterns/Banners/LW15Banner.tsx
@@ -0,0 +1,42 @@
+'use client'
+
+import Link from 'next/link'
+import { usePathname } from 'next/navigation'
+import { Button } from 'ui/src/components/Button'
+
+export function LW15Banner() {
+ const pathname = usePathname()
+ const isHomePage = pathname === '/'
+ const isLWPage = pathname?.includes('/launch-week')
+
+ if (isHomePage || isLWPage) return null
+
+ return (
+ <div className="relative w-full p-2 flex items-center group justify-center text-foreground bg-alternative border-b border-muted transition-colors overflow-hidden">
+ <video
+ src={`${process.env.NEXT_PUBLIC_SUPABASE_URL}/storage/v1/object/public/images/launch-week/lw15/assets/lw15-galaxy.mp4`}
+ autoPlay
+ loop
+ muted
+ className="absolute w-full h-full inset-0 object-cover z-0"
+ style={{
+ opacity: 0.05,
+ }}
+ poster={`${process.env.NEXT_PUBLIC_SUPABASE_URL}/storage/v1/object/public/images/launch-week/lw15/assets/lw15-galaxy.png`}
+ />
+ <div className="relative z-10 flex items-center justify-center">
+ <div className="w-full flex gap-5 md:gap-10 items-center md:justify-center text-sm">
+ <p className="flex gap-1.5 items-center font-mono uppercase tracking-widest text-sm">
+ <span className="hidden sm:inline">Launch Week</span>
+ <span className="inline sm:hidden">LW</span> 15 / July 14—18
+ </p>
+ <Button size="tiny" type="default" className="px-2 !leading-none text-xs" asChild>
+ <Link href="/launch-week">Claim your ticket</Link>
+ </Button>
+ </div>
+ </div>
+ </div>
+ )
+}
+
+export default LW15Banner
diff --git a/packages/ui-patterns/Banners/SOSBanner.tsx b/packages/ui-patterns/Banners/SOSBanner.tsx
deleted file mode 100644
index 411d58f72a7..00000000000
--- a/packages/ui-patterns/Banners/SOSBanner.tsx
+++ /dev/null
@@ -1,30 +0,0 @@
-'use client'
-
-import Link from 'next/link'
-import { usePathname } from 'next/navigation'
-import { Button } from 'ui/src/components/Button'
-
-export function SOSBanner() {
- const pathname = usePathname()
- const isHomePage = pathname === '/'
- const isSurveyPage = pathname === '/state-of-startups'
-
- if (isHomePage || isSurveyPage) return null
-
- return (
- <div className="relative w-full p-2 flex items-center group justify-center text-foreground bg-alternative border-b border-muted transition-colors overflow-hidden">
- <div className="relative z-10 flex items-center justify-center">
- <div className="w-full flex gap-5 md:gap-10 items-center md:justify-center text-sm">
- <p className="flex gap-1.5 items-center text-brand font-mono uppercase tracking-widest text-sm">
- State of Startups 2025
- </p>
- <Button size="tiny" type="default" className="px-2 !leading-none text-xs" asChild>
- <Link href="/state-of-startups">Take the survey</Link>
- </Button>
- </div>
- </div>
- </div>
- )
-}
-
-export default SOSBanner
diff --git a/packages/ui-patterns/index.tsx b/packages/ui-patterns/index.tsx
index 1ad8f4895f6..1e91aa70c0a 100644
--- a/packages/ui-patterns/index.tsx
+++ b/packages/ui-patterns/index.tsx
@@ -15,3 +15,4 @@ export * from './PopupFrame'
export * from './src/ShimmeringLoader'
export * from './src/TimestampInfo'
export * from './src/Toc'
+export * from './src/PromoToast'
diff --git a/packages/ui-patterns/src/Banners/data.json b/packages/ui-patterns/src/Banners/data.json
index 50597deff8c..3d14c3cbe25 100644
--- a/packages/ui-patterns/src/Banners/data.json
+++ b/packages/ui-patterns/src/Banners/data.json
@@ -1,6 +1,6 @@
{
- "text": "Launch Week 14",
- "launchDate": "2025-03-31T07:00:00.000-07:00",
- "link": "/blog/launch-week-14-top-10",
- "cta": "Learn more"
+ "text": "Launch Week 15",
+ "launchDate": "2025-07-14T08:00:00.000-07:00",
+ "link": "/launch-week",
+ "cta": "Claim your ticket"
}
diff --git a/packages/ui-patterns/src/PromoToast/PromoToast.tsx b/packages/ui-patterns/src/PromoToast/PromoToast.tsx
index a49a173f79c..c25af133aef 100644
--- a/packages/ui-patterns/src/PromoToast/PromoToast.tsx
+++ b/packages/ui-patterns/src/PromoToast/PromoToast.tsx
@@ -1,18 +1,15 @@
'use client'
-// import Image from 'next/image'
import { hasConsented, LOCAL_STORAGE_KEYS } from 'common'
import Link from 'next/link'
import { useEffect, useState } from 'react'
import { Button } from 'ui/src/components/Button/Button'
import { cn } from 'ui/src/lib/utils/cn'
-// import { useTheme } from 'next-themes'
import announcement from '../Banners/data.json'
import './styles.css'
const PromoToast = () => {
const [visible, setVisible] = useState(false)
- // const { resolvedTheme } = useTheme()
useEffect(() => {
const shouldHide =
@@ -37,20 +34,28 @@ const PromoToast = () => {
visible && 'opacity-100 translate-y-0'
)}
>
- <div className="relative z-10 text-foreground-lighter uppercase flex flex-col text-sm w-full font-mono mb-2">
+ <video
+ src={`${process.env.NEXT_PUBLIC_SUPABASE_URL}/storage/v1/object/public/images/launch-week/lw15/assets/lw15-galaxy.mp4`}
+ autoPlay
+ loop
+ muted
+ className="absolute w-full h-full inset-0 object-cover z-0"
+ style={{
+ opacity: 0.05,
+ }}
+ poster={`${process.env.NEXT_PUBLIC_SUPABASE_URL}/storage/v1/object/public/images/launch-week/lw15/assets/lw15-galaxy.png`}
+ />
+ <div className="relative z-10 text-foreground-lighter uppercase flex flex-col text-sm w-full mb-2">
<span className="mb-1">{announcement.text}</span>
- <p
- style={{
- fontFamily: 'Departure Mono, Source Code Pro, Office Code Pro, Menlo, monospace',
- }}
- className="relative z-10 text-foreground flex flex-col text-xl w-full leading-7"
- ></p>
+ <p className="relative z-10 text-foreground flex flex-col text-xl w-full leading-7">
+ July 14—18
+ </p>
</div>
<div className="relative z-10 flex items-center space-x-2">
<Button asChild type="secondary">
<Link target="_blank" rel="noreferrer" href={`https://supabase.com${announcement.link}`}>
- Learn more
+ Claim your ticket
</Link>
</Button>
<Button type="default" onClick={handleHide}>
diff --git a/supabase/config.toml b/supabase/config.toml
index c698fcad1ad..62b1c81341a 100644
--- a/supabase/config.toml
+++ b/supabase/config.toml
@@ -73,7 +73,7 @@ enable_confirmations = false
# Uncomment the following to use gh oAuth app locally with your own test app
# to use env vars locally, run > `source ./supabase/.env && supabase [command...]`
[auth.external.github]
-enabled = false
+enabled = true
client_id = "env(GITHUB_CLIENT_ID)"
secret = "env(GITHUB_SECRET)"
# Overrides the default auth redirectUrl.