diff --git a/apps/postgres-new/.env.example b/apps/postgres-new/.env.example index 461b9bc6..b8560b13 100644 --- a/apps/postgres-new/.env.example +++ b/apps/postgres-new/.env.example @@ -1,6 +1,5 @@ NEXT_PUBLIC_SUPABASE_ANON_KEY="" NEXT_PUBLIC_SUPABASE_URL="" -NEXT_PUBLIC_IS_PREVIEW=true NEXT_PUBLIC_BROWSER_PROXY_DOMAIN="" OPENAI_API_KEY="" diff --git a/apps/postgres-new/components/app-provider.tsx b/apps/postgres-new/components/app-provider.tsx index ec4c60ed..df9358d8 100644 --- a/apps/postgres-new/components/app-provider.tsx +++ b/apps/postgres-new/components/app-provider.tsx @@ -100,7 +100,6 @@ export default function AppProvider({ children }: AppProps) { setUser(undefined) }, [supabase]) - const isPreview = process.env.NEXT_PUBLIC_IS_PREVIEW === 'true' const pgliteVersion = process.env.NEXT_PUBLIC_PGLITE_VERSION const { value: pgVersion } = useAsyncMemo(async () => { if (!dbManager) { @@ -237,7 +236,6 @@ export default function AppProvider({ children }: AppProps) { isRateLimited, setIsRateLimited, focusRef, - isPreview, dbManager, pgliteVersion, pgVersion, @@ -266,7 +264,6 @@ export type AppContextValues = { isRateLimited: boolean setIsRateLimited: (limited: boolean) => void focusRef: RefObject - isPreview: boolean dbManager?: DbManager pgliteVersion?: string pgVersion?: string diff --git a/apps/postgres-new/components/layout.tsx b/apps/postgres-new/components/layout.tsx index 94a0ecd6..2a61702f 100644 --- a/apps/postgres-new/components/layout.tsx +++ b/apps/postgres-new/components/layout.tsx @@ -3,10 +3,11 @@ import 'chart.js/auto' import 'chartjs-adapter-date-fns' +import { DialogTrigger } from '@radix-ui/react-dialog' import { LazyMotion, m } from 'framer-motion' -import { Loader } from 'lucide-react' +import { Loader, MoreVertical } from 'lucide-react' import Link from 'next/link' -import { PropsWithChildren } from 'react' +import { PropsWithChildren, useState } from 'react' import { TooltipProvider } from '~/components/ui/tooltip' import { useDatabasesQuery } from '~/data/databases/databases-query' import { useBreakpoint } from '~/lib/use-breakpoint' @@ -17,6 +18,7 @@ import { legacyDomainUrl, } from '~/lib/util' import { useApp } from './app-provider' +import { LiveShareIcon } from './live-share-icon' import Sidebar from './sidebar' import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from './ui/accordion' import { Dialog, DialogContent, DialogHeader, DialogTitle } from './ui/dialog' @@ -26,15 +28,14 @@ const loadFramerFeatures = () => import('./framer-features').then((res) => res.d export type LayoutProps = PropsWithChildren export default function Layout({ children }: LayoutProps) { - const { isPreview, isLegacyDomain, isLegacyDomainRedirect } = useApp() + const { isLegacyDomain, isLegacyDomainRedirect } = useApp() const isSmallBreakpoint = useBreakpoint('lg') return (
- {isPreview && } - {/* TODO: re-enable rename banner when ready */} + {!isLegacyDomain && } {(isLegacyDomain || isLegacyDomainRedirect) && }
{/* TODO: make sidebar available on mobile */} @@ -50,11 +51,82 @@ export default function Layout({ children }: LayoutProps) { ) } -function PreviewBanner() { +function LiveShareBanner() { + const [videoLoaded, setVideoLoaded] = useState(false) + return ( -
- Heads up! This is a preview version of {currentDomainHostname}, so expect some changes here - and there. +
+ New: Connect to your in-browser databases from outside the browser. + setVideoLoaded(false)}> + + Learn more. + + + + Introducing Live Share +
+ + +
+

+ With Live Share, you can connect directly to your in-browser PGlite databases from{' '} + outside the browser. +

+
+ {!videoLoaded && ( +
+ +
+ )} + setVideoLoaded(true)} + > + + +
+ + +

How does it work?

+ +
    +
  1. + Click on the {' '} + menu next your database and tap{' '} + + Live Share + +
  2. +
  3. A unique connection string will appear for your database
  4. +
  5. + Copy-paste the connection string into any Postgres client (like psql) + and begin querying! +
  6. +
+
+
+ +
) }