Files
Jonathan Summers-MuirandFrancesco Sansalvadore 1f1f8a5fa4 Feat/whale init (#28243)
* duplicate page

* whale init

* table background

* prepare

* sync undocumented remote schema from master

* revert remote schema sync

* add lw12 tickets migration file

* ticket init

* set up lw12 ticket layout

* finish ticket layout and customization form

* lw12 ticket og

* ticket styling

* code highlight border

* launch week migrations

* local dev progress

* keep local gh config

* comment section

* comment section

* comment out username.tsx

* remove lw/ticekts temp

* update copy

* fix migration view

* redirect to try

* use misc

* lw12 og

* share

* share correct

* env var

* username page

* update example env

* push new db schema

* trigger deploy

* update ticket og

* ticket themes

* bypass browser

* change env var name

* fix

* fix

* process env

* create client server side

* lw announcements

* promoToast

* animated bg

* update ticket og bg

* minor details

* secret ticket

* social share text

* social share textgst

* flow text

* update og

* update og handler

* Update index.ts

* use functions.invoke and use generic supabase URL

* Update index.ts

* Update handler.tsx

* Update package-lock.json

* Update handler.tsx

* add next api route

* moved to vercel edge function

* set revalidate

* Update route.tsx

* Delete lw-ticket-og.tsx

* Update route.tsx

* Update [username].tsx

* Update [username].tsx

* add more fetches

* Update turbo.json

* ticket themes updated

* copy and layout updated

* Update index.tsx

* Update Ticket.tsx

* Update TicketingFlow.tsx

* update countdown

* updated bg

* small updates

* moat

* Update [username].tsx

* Update 20240723155310_add_lw12_ticketing_schema.sql

* optimistic ticket stuff og generation

* Update index.tsx

* updated layout

* update themes in og

* Update constants.ts

* attr renamed

* Update TicketingFlow.tsx

* Update TicketActions.tsx

* grammar

* moar updates

* Update TicketActions.tsx

* Update TicketActions2.tsx

* Update TicketActions.tsx

* Update Hero.tsx

* Update TicketingFlow.tsx

* remove console logs

---------

Co-authored-by: Francesco Sansalvadore <f.sansalvadore@gmail.com>
2024-08-01 01:59:01 +08:00

94 lines
3.0 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { GetServerSideProps } from 'next'
import { NextSeo } from 'next-seo'
import { useEffect } from 'react'
import dynamic from 'next/dynamic'
import { createClient } from '@supabase/supabase-js'
import { SITE_ORIGIN, SITE_URL } from '~/lib/constants'
import DefaultLayout from '~/components/Layouts/Default'
import SectionContainer from '~/components/Layouts/SectionContainer'
import { LaunchWeekLogoHeader } from '~/components/LaunchWeek/7/LaunchSection/LaunchWeekLogoHeader'
import { UserData } from '~/components/LaunchWeek/hooks/use-conf-data'
import LW7BgGraphic from '~/components/LaunchWeek/7/LW7BgGraphic'
import { useTheme } from 'next-themes'
const LW7Releases = dynamic(() => import('~/components/LaunchWeek/7/Releases'))
const LaunchWeekPrizeSection = dynamic(
() => import('~/components/LaunchWeek/7/LaunchWeekPrizeSection')
)
const TicketBrickWall = dynamic(
() => import('~/components/LaunchWeek/7/LaunchSection/TicketBrickWall')
)
const CTABanner = dynamic(() => import('~/components/CTABanner'))
interface Props {
users: UserData[]
}
const supabaseAdmin = createClient(
process.env.NEXT_PUBLIC_MISC_USE_URL ?? 'http://localhost:54321',
// ANON KEY
process.env.NEXT_PUBLIC_MISC_USE_ANON_KEY!
)
export default function TicketHome({ users }: Props) {
const { theme, setTheme } = useTheme()
const TITLE = 'Supabase LaunchWeek 7'
const DESCRIPTION = 'Supabase Launch Week 7 | 10–14 April 2023'
const OG_IMAGE = `${SITE_ORIGIN}/images/launchweek/seven/launch-week-7-teaser.jpg`
return (
<>
<NextSeo
title={TITLE}
description={DESCRIPTION}
openGraph={{
title: TITLE,
description: DESCRIPTION,
url: SITE_URL,
images: [
{
url: OG_IMAGE,
},
],
}}
/>
<DefaultLayout>
<div className="bg-[#1C1C1C] -mt-[65px]">
<div className="relative bg-[#9e44ef] pt-16">
<div className="relative z-10">
<SectionContainer className="flex flex-col justify-around items-center !py-4 md:!py-8 gap-2 md:gap-4 !px-2 !mx-auto">
<LaunchWeekLogoHeader />
</SectionContainer>
<LW7BgGraphic />
</div>
</div>
<div className="relative !w-full max-w-[100vw] !px-4 sm:max-w-xl md:max-w-4xl lg:max-w-7xl -mt-48 md:mt-[-460px] z-20 flex flex-col justify-around items-center !py-4 md:!py-8 gap-2 md:gap-4 !mx-auto">
<LW7Releases />
<LaunchWeekPrizeSection className="pt-10" />
</div>
{users && <TicketBrickWall users={users} />}
</div>
<CTABanner />
</DefaultLayout>
</>
)
}
export const getServerSideProps: GetServerSideProps = async ({ req, res }) => {
// fetch users for the TicketBrickWall
const { data: users } = await supabaseAdmin!
.from('lw7_tickets_golden')
.select('*')
.order('createdAt', { ascending: false })
.limit(17)
return {
props: {
users,
},
}
}