The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
make navbar sticky and FlyOut menu full width
Florian LEFEBVRE4528961a6028
diff --git a/www/components/Nav/index.tsx b/www/components/Nav/index.tsxindex 81486fd3134..bd83a53ceff 100644--- a/www/components/Nav/index.tsx+++ b/www/components/Nav/index.tsx@@ -1,4 +1,4 @@-import React, { useState } from 'react'+import React, { useState, Fragment } from 'react'import Link from 'next/link'import { useRouter } from 'next/router'@@ -183,167 +183,165 @@ const Nav = (props: Props) => {)return (- <nav className="bg-white dark:bg-gray-800 border-b dark:border-gray-600 z-50 sticky">- {/* <div className="lg:container mx-auto relative flex justify-between h-16 lg:px-10 xl:px-0"> */}- <div className="lg:container mx-auto relative flex justify-between h-16 lg:px-16 xl:px-20">- <HamburgerButton toggleFlyOut={() => setOpen(true)} />-- <div className="flex-1 flex items-center justify-center sm:items-stretch lg:justify-between">- <div className="flex items-center">- <div className="flex-shrink-0 flex items-center">- <Link href="/" as="/">- <img- className="block h-6 w-auto"- src={- darkMode- ? `${basePath}/images/logo-dark.png`- : `${basePath}/images/logo-light.png`- }- alt="Logo"- />- </Link>- </div>- <div className="pl-4 hidden sm:ml-6 lg:flex sm:space-x-4">- <FlyOutNavButton- title={'Product'}- onClick={() => handleToggle(() => setOpenProduct(!openProduct))}- active={openProduct}- />- <FlyOutNavButton- title={'Developers'}- onClick={() => handleToggle(() => setOpenDevelopers(!openDevelopers))}- active={openDevelopers}- />- <FlyOut open={openProduct} handleCancel={handleCancel}>- <Solutions />- </FlyOut>- <FlyOut open={openDevelopers} handleCancel={handleCancel}>- <Developers />- </FlyOut>- <a- href="/beta"- className={`- inline-flex items-center px-1 border-b-2 border-transparent text-sm font-medium- text-gray-500 hover:text-gray-700 hover:border-gray-500 p-5- dark:text-dark-100 dark:hover:border-dark-100- `}- >- Beta- </a>- <a- href="/pricing"- className={`- inline-flex items-center px-1 border-b-2 border-transparent text-sm font-medium- text-gray-500 hover:text-gray-700 hover:border-gray-500 p-5- dark:text-dark-100 dark:hover:border-dark-100+ <Fragment>+ {/* Announcement Nav */}+ <div className="sticky top-0 z-50">+ <nav className="bg-white dark:bg-gray-800 border-b dark:border-gray-600">+ {/* <div className="lg:container mx-auto relative flex justify-between h-16 lg:px-10 xl:px-0"> */}+ <div className="lg:container mx-auto relative flex justify-between h-16 lg:px-16 xl:px-20">+ <HamburgerButton toggleFlyOut={() => setOpen(true)} />+ <div className="flex-1 flex items-center justify-center sm:items-stretch lg:justify-between">+ <div className="flex items-center">+ <div className="flex-shrink-0 flex items-center">+ <Link href="/" as="/">+ <img+ className="block h-6 w-auto"+ src={darkMode ? `/images/logo-dark.png` : `/images/logo-light.png`}+ alt="Logo"+ />+ </Link>+ </div>+ <div className="pl-4 hidden sm:ml-6 lg:flex sm:space-x-4">+ <FlyOutNavButton+ title={'Product'}+ onClick={() => handleToggle(() => setOpenProduct(!openProduct))}+ active={openProduct}+ />+ <FlyOutNavButton+ title={'Developers'}+ onClick={() => handleToggle(() => setOpenDevelopers(!openDevelopers))}+ active={openDevelopers}+ />+ <a+ href="/beta"+ className={`+ inline-flex items-center px-1 border-b-2 border-transparent text-sm font-medium+ text-gray-500 hover:text-gray-700 hover:border-gray-500 p-5+ dark:text-dark-100 dark:hover:border-dark-100+ `}+ >+ Beta+ </a>+ <a+ href="/pricing"+ className={`+ inline-flex items-center px-1 border-b-2 border-transparent text-sm font-medium+ text-gray-500 hover:text-gray-700 hover:border-gray-500 p-5+ dark:text-dark-100 dark:hover:border-dark-100+ `}+ >+ Pricing+ </a>+ </div>+ </div>+ <div className="hidden lg:flex items-center sm:space-x-4">+ <a href="https://app.supabase.io/api/login">+ <Button>Start your project</Button>+ </a>+ <a+ href="https://app.supabase.io/api/login"+ className={`+ items-center px-1 border-b-2 border-transparent text-sm font-medium+ text-gray-500 hover:text-gray-700 hidden lg:block dark:text-dark-100 dark:hover:text-white`}- >- Pricing- </a>- </div>- </div>- <div className="hidden lg:flex items-center sm:space-x-4">- <a href="https://app.supabase.io/api/login">- <Button>Start your project</Button>- </a>- <a- href="https://app.supabase.io/api/login"- className={`- items-center px-1 border-b-2 border-transparent text-sm font-medium- text-gray-500 hover:text-gray-700 hidden lg:block dark:text-dark-100 dark:hover:text-white- `}- >- Sign in- </a>- </div>- </div>- {/* <div className="absolute inset-y-0 right-0 flex items-center pr-2 sm:static sm:inset-auto sm:ml-6 sm:pr-0"></div> */}- </div>- {/* </div> */}-- {/* Mobile Nav Menu */}- <Transition- appear={true}- show={open}- enter="transition ease-out duration-200"- enterFrom="opacity-0 translate-y-1"- enterTo="opacity-100 translate-y-0"- leave="transition ease-in duration-150"- leaveFrom="opacity-100 translate-y-0"- leaveTo="opacity-0 translate-y-1"- >- <div className="p-4 md:p-8 h-screen w-screen fixed bg-white transform overflow-y-scroll -inset-y-0 z-50 dark:bg-dark-700">- <div className="absolute right-4 top-4 items-center justify-between">- <div className="-mr-2">- <button- onClick={() => setOpen(false)}- type="button"- className="bg-white rounded-md p-2 inline-flex items-center justify-center text-gray-400 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-brand-500 dark:bg-dark-800"- >- <span className="sr-only">Close menu</span>-- <svg- className="h-6 w-6"- xmlns="http://www.w3.org/2000/svg"- fill="none"- viewBox="0 0 24 24"- stroke="currentColor"- aria-hidden="true">- <path- strokeLinecap="round"- strokeLinejoin="round"- strokeWidth="2"- d="M6 18L18 6M6 6l12 12"- />- </svg>- </button>+ Sign in+ </a>+ </div></div>+ {/* <div className="absolute inset-y-0 right-0 flex items-center pr-2 sm:static sm:inset-auto sm:ml-6 sm:pr-0"></div> */}</div>{/* </div> */}- <div className="mt-6 mb-12">- <div className="pt-2 pb-4 space-y-1">- <a- href="https://app.supabase.io/api/login"- className="block pl-3 pr-4 text-base font-medium text-gray-600 dark:text-white"- >- Sign in- </a>+ {/* Mobile Nav Menu */}+ <Transition+ appear={true}+ show={open}+ enter="transition ease-out duration-200"+ enterFrom="opacity-0 translate-y-1"+ enterTo="opacity-100 translate-y-0"+ leave="transition ease-in duration-150"+ leaveFrom="opacity-100 translate-y-0"+ leaveTo="opacity-0 translate-y-1"+ >+ <div className="p-4 md:p-8 h-screen w-screen fixed bg-white transform overflow-y-scroll -inset-y-0 z-50 dark:bg-dark-700">+ <div className="absolute right-4 top-4 items-center justify-between">+ <div className="-mr-2">+ <button+ onClick={() => setOpen(false)}+ type="button"+ className="bg-white rounded-md p-2 inline-flex items-center justify-center text-gray-400 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-brand-500 dark:bg-dark-800"+ >+ <span className="sr-only">Close menu</span>+ <svg+ className="h-6 w-6"+ xmlns="http://www.w3.org/2000/svg"+ fill="none"+ viewBox="0 0 24 24"+ stroke="currentColor"+ aria-hidden="true"+ >+ <path+ strokeLinecap="round"+ strokeLinejoin="round"+ strokeWidth="2"+ d="M6 18L18 6M6 6l12 12"+ />+ </svg>+ </button>+ </div>+ </div>+ {/* </div> */}+ <div className="mt-6 mb-12">+ <div className="pt-2 pb-4 space-y-1">+ <a+ href="https://app.supabase.io/api/login"+ className="block pl-3 pr-4 text-base font-medium text-gray-600 dark:text-white"+ >+ Sign in+ </a>+ </div>+ <div className="pt-2 pb-4 space-y-1">+ <a+ href="/docs"+ className="block pl-3 pr-4 py-2 text-base font-medium text-gray-600 hover:text-gray-800 hover:bg-gray-50 dark:hover:bg-dark-600 hover:border-gray-300 dark:text-white"+ >+ Product+ </a>+ <a+ href="/docs"+ className="block pl-3 pr-4 py-2 text-base font-medium text-gray-600 hover:text-gray-800 hover:bg-gray-50 dark:hover:bg-dark-600 hover:border-gray-300 dark:text-white"+ >+ Developers+ </a>+ <a+ href="/docs"+ className="block pl-3 pr-4 py-2 text-base font-medium text-gray-600 hover:text-gray-800 hover:bg-gray-50 dark:hover:bg-dark-600 hover:border-gray-300 dark:text-white"+ >+ Company+ </a>+ <a+ href="/pricing"+ className="block pl-3 pr-4 py-2 text-base font-medium text-gray-600 hover:text-gray-800 hover:bg-gray-50 dark:hover:bg-dark-600 hover:border-gray-300 dark:text-white"+ >+ Pricing+ </a>+ </div>+ <div className="p-3">+ <p className="mb-6 text-sm text-gray-400">Products available:</p>+ {iconSections}+ </div>+ </div></div>- <div className="pt-2 pb-4 space-y-1">- <a- href="/docs"- className="block pl-3 pr-4 py-2 text-base font-medium text-gray-600 hover:text-gray-800 hover:bg-gray-50 dark:hover:bg-dark-600 hover:border-gray-300 dark:text-white"- >- Product- </a>- <a- href="/docs"- className="block pl-3 pr-4 py-2 text-base font-medium text-gray-600 hover:text-gray-800 hover:bg-gray-50 dark:hover:bg-dark-600 hover:border-gray-300 dark:text-white"- >- Developers- </a>- <a- href="/docs"- className="block pl-3 pr-4 py-2 text-base font-medium text-gray-600 hover:text-gray-800 hover:bg-gray-50 dark:hover:bg-dark-600 hover:border-gray-300 dark:text-white"- >- Company- </a>- <a- href="/pricing"- className="block pl-3 pr-4 py-2 text-base font-medium text-gray-600 hover:text-gray-800 hover:bg-gray-50 dark:hover:bg-dark-600 hover:border-gray-300 dark:text-white"- >- Pricing- </a>- </div>- <div className="p-3">- <p className="mb-6 text-sm text-gray-400">Products available:</p>- {iconSections}- </div>- </div>- </div>- </Transition>- </nav>+ </Transition>+ </nav>+ <FlyOut open={openProduct} handleCancel={handleCancel}>+ <Solutions />+ </FlyOut>+ <FlyOut open={openDevelopers} handleCancel={handleCancel}>+ <Developers />+ </FlyOut>+ </div>+ </Fragment>)}diff --git a/www/components/UI/FlyOut.tsx b/www/components/UI/FlyOut.tsxindex 96ab8350c31..72c5777241d 100644--- a/www/components/UI/FlyOut.tsx+++ b/www/components/UI/FlyOut.tsx@@ -1,4 +1,4 @@-import React, { useState, useEffect, useImperativeHandle, forwardRef } from 'react'+import React, { useEffect } from 'react'import Transition from 'lib/Transition'type Props = {@@ -12,7 +12,6 @@ type Props = {const FlyOut = (props: Props) => {const { title = '', children, className = '', singleBgColor = false, handleCancel } = props- const [show, setShow] = useState(false)useEffect(() => {function handleScroll() {@@ -20,31 +19,7 @@ const FlyOut = (props: Props) => {}window.addEventListener('scroll', handleScroll)return () => window.removeEventListener('scroll', handleScroll)- })-- // function handleToggle() {- // setShow(!show)- // props.handleClick()- // }-- // useImperativeHandle(- // ref,- // () => ({- // close() {- // setShow(false)- // }- // }),- // )-- // useEffect(() => {- // // window is accessible here.- // window.addEventListener('scroll', function (e) {- // // close Fly Out window if user scrolls past 96px from top- // if (window.pageYOffset > 96) {- // setShow(false)- // }- // })- // }, [])+ }, [])return (<>@@ -59,19 +34,7 @@ const FlyOut = (props: Props) => {leaveTo="opacity-0 translate-y-1"><>- <div- className="absolute inset-x-0 transform shadow-lg border-gray-100 dark:border-dark-500"- style={{- zIndex: 999,- position: 'absolute',- width: '100%',- margin: '0 auto',- marginTop: '63px',- left: '-50vw',- right: '-50vw',- top: 0,- }}- >+ <div className="absolute inset-x-0 transform shadow-lg border-gray-100 dark:border-dark-500 w-full hidden lg:block bg-white dark:bg-gray-600"><divclassName="border-b dark:border-gray-600 absolute inset-0 flex sm:flex-col lg:flex-row"aria-hidden="true"@@ -83,23 +46,16 @@ const FlyOut = (props: Props) => {} sm:w-full sm:h-1/2 lg:w-1/2 lg:h-full`}/></div>- <div- className={`container relative mx-auto lg:grid-cols-2 px-6 lg:px-10 xl:px-14 py-2`}- >+ <div className="container relative mx-auto lg:grid-cols-2 px-6 lg:px-10 xl:px-14 py-2">{children}</div>- </div>- <div- className="fixed inset-0 t-63 transition-opacity bg-red"- style={{- zIndex: 100,- top: '63px',- marginLeft: 0,- pointerEvents: 'visiblePainted',- }}- onClick={() => props.handleCancel()}- >- <div className="absolute inset-0 opacity-0"></div>+ <div+ className="z-50 w-full h-screen absolute opacity-0"+ style={{+ pointerEvents: 'visiblePainted',+ }}+ onClick={() => props.handleCancel()}+ ></div></div></></Transition>diff --git a/www/pages/beta.tsx b/www/pages/beta.tsxindex 740f009735e..3b5f9aa28eb 100644--- a/www/pages/beta.tsx+++ b/www/pages/beta.tsx@@ -663,9 +663,7 @@ const BetaPricing = () => (<div className="col-span-12 grid grid-cols-12 gap-x-2 lg:gap-x-8 mb-10"><div className="col-span-12 sm:col-span-9 xl:col-span-7 text-base">- <p className="mb-10">- For up to date pricing info see: https://supabase.io/pricing- </p>+ <p className="mb-10">For up to date pricing info see: https://supabase.io/pricing</p><p className="mb-10">We're working closely with many open source projects, infrastructure providers, and ofcourse our Alpha Users, to provide a predictable and sustainable pricing model.@@ -685,9 +683,7 @@ const BetaPricing = () => (them to create value for their customers</li></ul>- <p className="mb-10">- We are committing to the following initiatives:- </p>+ <p className="mb-10">We are committing to the following initiatives:</p><ul className="list-decimal list-outside ml-6 mb-10"><li className="mb-5">All Alpha Users will receive credits equivalent of 2 years of base tier usage. These@@ -716,7 +712,8 @@ const BetaPricing = () => (</li></ul><p>- The Supabase Base Tier is now called the Supabase Pro tier as per the pricing page: https://supabase.io/pricing+ The Supabase Base Tier is now called the Supabase Pro tier as per the pricing page:+ https://supabase.io/pricing</p></div></div>@@ -990,11 +987,13 @@ const Beta = () => {}}/><Container>- <div className="shadow-lg py-5 px-5 xl:px-20 sticky inset-0 bg-dark-800 z-50 flex items-center justify-between">- <a href="/">- <img className="h-5" src={`${basePath}/images/logo-dark.png`} />- </a>- <HamburgerMenu openMenu={() => setMenuOpen(!menuOpen)} />+ <div className="sticky inset-0 z-50">+ <div className="shadow-lg py-5 px-5 xl:px-20 bg-dark-800 flex items-center justify-between">+ <a href="/">+ <img className="h-5" src={`/images/logo-dark.png`} />+ </a>+ <HamburgerMenu openMenu={() => setMenuOpen(!menuOpen)} />+ </div><FlyOutopen={menuOpen}handleCancel={() => setMenuOpen(false)}