diff --git a/apps/docs/pages/_app.tsx b/apps/docs/pages/_app.tsx index 2307197f240..20224f4d0ee 100644 --- a/apps/docs/pages/_app.tsx +++ b/apps/docs/pages/_app.tsx @@ -10,14 +10,12 @@ import { AuthProvider, ThemeProvider, useTelemetryProps, useThemeSandbox } from import { useRouter } from 'next/router' import { useCallback, useEffect, useState } from 'react' import { AppPropsWithLayout } from 'types' -import { CommandMenuProvider, useConsent } from 'ui' +import { CommandMenuProvider, PortalToast, PromoToast, useConsent } from 'ui' import { TabsProvider } from 'ui/src/components/Tabs' -import PortalToast from 'ui/src/layout/PortalToast' import Favicons from '~/components/Favicons' import SiteLayout from '~/layouts/SiteLayout' import { API_URL, IS_PLATFORM } from '~/lib/constants' import { post } from '~/lib/fetchWrappers' -import PromoToast from 'ui/src/components/PromoToast' function MyApp({ Component, pageProps }: AppPropsWithLayout) { const router = useRouter() diff --git a/apps/www/components/Sections/FunctionsUsecases.tsx b/apps/www/components/Sections/FunctionsUsecases.tsx index 1313daca921..3b591bbc66d 100644 --- a/apps/www/components/Sections/FunctionsUsecases.tsx +++ b/apps/www/components/Sections/FunctionsUsecases.tsx @@ -36,7 +36,7 @@ function FunctionsUsecases(props: Props) {

{props.title}

-

{props.text}

+
{props.text}
{props.content.map((feat, i) => { diff --git a/apps/www/pages/edge-functions/edge-functions.tsx b/apps/www/pages/edge-functions/edge-functions.tsx index 531f5f7f03a..88a8c04835a 100644 --- a/apps/www/pages/edge-functions/edge-functions.tsx +++ b/apps/www/pages/edge-functions/edge-functions.tsx @@ -139,7 +139,7 @@ function Database() {

{item.title}

-

{item.description}

+
{item.description}
) @@ -260,9 +260,7 @@ serve(async (req) => { footer={[
-

-

Libraries coming soon:

-

+

Libraries coming soon:

Python Dart diff --git a/apps/www/supabase/functions/lwx-og/handler.tsx b/apps/www/supabase/functions/lwx-og/handler.tsx index df5466ab1b3..579322d5083 100644 --- a/apps/www/supabase/functions/lwx-og/handler.tsx +++ b/apps/www/supabase/functions/lwx-og/handler.tsx @@ -17,6 +17,7 @@ const mono_font = fetch(new URL(MONO_FONT_URL, import.meta.url)).then((res) => r const BUCKET_FOLDER_VERSION = 'v1' const LW_TABLE = 'lwx_tickets' +const LW_MATERIALIZED_VIEW = 'lwx_tickets_golden' const STYLING_CONGIF = { REG: { @@ -66,7 +67,7 @@ export async function handler(req: Request) { // Get ticket data const { data, error } = await supabaseAdminClient - .from(LW_TABLE) + .from(LW_MATERIALIZED_VIEW) .select('name, ticketNumber, sharedOnTwitter, sharedOnLinkedIn, metadata') .eq('username', username) .maybeSingle() diff --git a/apps/www/supabase/functions/lwx-ticket/handler.tsx b/apps/www/supabase/functions/lwx-ticket/handler.tsx index 66ad408ae42..3c4d59dbea7 100644 --- a/apps/www/supabase/functions/lwx-ticket/handler.tsx +++ b/apps/www/supabase/functions/lwx-ticket/handler.tsx @@ -16,6 +16,7 @@ const font = fetch(new URL(FONT_URL, import.meta.url)).then((res) => res.arrayBu const mono_font = fetch(new URL(MONO_FONT_URL, import.meta.url)).then((res) => res.arrayBuffer()) const LW_TABLE = 'lwx_tickets' +const LW_MATERIALIZED_VIEW = 'lwx_tickets_golden' const STYLING_CONGIF = { REG: { @@ -63,7 +64,7 @@ export async function handler(req: Request) { // Get ticket data const { data, error } = await supabaseAdminClient - .from(LW_TABLE) + .from(LW_MATERIALIZED_VIEW) .select('name, ticketNumber, sharedOnTwitter, sharedOnLinkedIn, metadata') .eq('username', username) .maybeSingle() diff --git a/packages/common/constants/local-storage.ts b/packages/common/constants/local-storage.ts index fcd9162b4e8..8826de33cae 100644 --- a/packages/common/constants/local-storage.ts +++ b/packages/common/constants/local-storage.ts @@ -1,3 +1,4 @@ export const LOCAL_STORAGE_KEYS = { TELEMETRY_CONSENT: 'supabase-consent', + HIDE_PROMO_TOAST: 'supabase-hide-promo-toast', } diff --git a/packages/ui/src/components/PromoToast/PromoBg.tsx b/packages/ui/src/components/PromoToast/PromoBg.tsx index 9a4e40f2d8e..6d91bbc4da3 100644 --- a/packages/ui/src/components/PromoToast/PromoBg.tsx +++ b/packages/ui/src/components/PromoToast/PromoBg.tsx @@ -8,155 +8,94 @@ const PromoBg = ({ className }: Props) => { return ( - - - - - - - - - - - - + + + + + - {/* - - - - - - - - - */} - - - - + + - - - - + + - - - - + + - - + + - + - - - ) diff --git a/packages/ui/src/components/PromoToast/PromoToast.tsx b/packages/ui/src/components/PromoToast/PromoToast.tsx index 17dde8ef60a..db54db34d79 100644 --- a/packages/ui/src/components/PromoToast/PromoToast.tsx +++ b/packages/ui/src/components/PromoToast/PromoToast.tsx @@ -1,18 +1,23 @@ import Image from 'next/image' import Link from 'next/link' import { useEffect, useState } from 'react' -import { Button } from 'ui' +import { Button, cn } from 'ui' +import { LOCAL_STORAGE_KEYS } from 'common' import announcement from '../../layout/banners/data/Announcement.json' import CountdownComponent from '../CountdownWidget/Countdown' import PromoBg from './PromoBg' +const LWXLogo = + 'https://obuldanrptloktxcffvn.supabase.co/storage/v1/object/public/images/lwx/assets/lwx_logo.svg?t=2023-11-22T17%3A45%3A52.077Z' + const PromoToast = () => { const [visible, setVisible] = useState(false) - const LWXLogo = - 'https://obuldanrptloktxcffvn.supabase.co/storage/v1/object/public/images/lwx/assets/lwx_logo.svg?t=2023-11-22T17%3A45%3A52.077Z' useEffect(() => { - const shouldHide = localStorage?.getItem('supabase-hide-promo-toast') === 'true' + const shouldHide = + !localStorage?.getItem(LOCAL_STORAGE_KEYS.TELEMETRY_CONSENT) || + localStorage?.getItem(LOCAL_STORAGE_KEYS.HIDE_PROMO_TOAST) === 'true' + if (!shouldHide) { setVisible(true) } @@ -20,7 +25,7 @@ const PromoToast = () => { const handleHide = () => { setVisible(false) - localStorage?.setItem('supabase-hide-promo-toast', 'true') + localStorage?.setItem(LOCAL_STORAGE_KEYS.HIDE_PROMO_TOAST, 'true') } if (!visible) { @@ -28,7 +33,12 @@ const PromoToast = () => { } return ( -
+

Launch Week

@@ -48,7 +58,7 @@ const PromoToast = () => { Dismiss
- +
) } diff --git a/packages/ui/src/components/PromoToast/index.ts b/packages/ui/src/components/PromoToast/index.ts index 13665ac5eea..07cfed33dca 100644 --- a/packages/ui/src/components/PromoToast/index.ts +++ b/packages/ui/src/components/PromoToast/index.ts @@ -1,3 +1,5 @@ import PromoToast from './PromoToast' +export { PromoToast } + export default PromoToast diff --git a/packages/ui/src/layout/PortalToast/PortalToast.tsx b/packages/ui/src/layout/PortalToast/PortalToast.tsx index 3bed1fc393f..70093dcec78 100644 --- a/packages/ui/src/layout/PortalToast/PortalToast.tsx +++ b/packages/ui/src/layout/PortalToast/PortalToast.tsx @@ -20,6 +20,7 @@ const PortalToast = () => ( paddingLeft: '16px', paddingRight: '16px', fontSize: '0.875rem', + opacity: '1', }, error: { duration: 8000,