mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 17:35:10 +03:00
1 parent
e4b0dc0871
commit
02cbf3ddf9
6 files changed
+7
-106
No files matched your search
@@ -3,7 +3,7 @@ import { type PropsWithChildren } from 'react'
|
||||
import { ThemeProvider } from 'common'
|
||||
import { SonnerToaster } from 'ui'
|
||||
import { CommandProvider } from 'ui-patterns/CommandMenu'
|
||||
import { PromoToast } from 'ui-patterns/PromoToast'
|
||||
// import { PromoToast } from 'ui-patterns/PromoToast'
|
||||
import SiteLayout from '~/layouts/SiteLayout'
|
||||
import { AuthContainer } from './auth/auth.client'
|
||||
import { DocsCommandMenu } from './command'
|
||||
@@ -25,7 +25,7 @@ function GlobalProviders({ children }: PropsWithChildren) {
|
||||
<CommandProvider>
|
||||
<div className="flex flex-col">
|
||||
<SiteLayout>
|
||||
<PromoToast />
|
||||
{/* <PromoToast /> */}
|
||||
{children}
|
||||
<DocsCommandMenu />
|
||||
</SiteLayout>
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useRouter } from 'next/router'
|
||||
import { useTheme } from 'next-themes'
|
||||
import { useWindowSize } from 'react-use'
|
||||
|
||||
import { Announcement, Button, buttonVariants, cn } from 'ui'
|
||||
import { Button, buttonVariants, cn } from 'ui'
|
||||
import {
|
||||
NavigationMenu,
|
||||
NavigationMenuContent,
|
||||
@@ -20,7 +20,6 @@ import HamburgerButton from './HamburgerMenu'
|
||||
import MobileMenu from './MobileMenu'
|
||||
import MenuItem from './MenuItem'
|
||||
import RightClickBrandLogo from './RightClickBrandLogo'
|
||||
import LW12CountdownBanner from 'ui/src/layout/banners/LW12CountdownBanner/LW12CountdownBanner'
|
||||
import { allBlogPosts } from 'contentlayer/generated'
|
||||
import { getMenu } from '~/data/nav'
|
||||
import { sortDates } from '~/lib/helpers'
|
||||
@@ -68,9 +67,9 @@ const Nav = (props: Props) => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<Announcement>
|
||||
<LW12CountdownBanner />
|
||||
</Announcement>
|
||||
{/* <Announcement>
|
||||
Uncomment to show announcement banner
|
||||
</Announcement> */}
|
||||
<div
|
||||
className={cn('sticky top-0 z-40 transform', hasStickySubnav && 'relative')}
|
||||
style={{ transform: 'translate3d(0,0,999px)' }}
|
||||
|
||||
@@ -44,11 +44,8 @@ const PromoToast = () => {
|
||||
visible && 'opacity-100 translate-y-0'
|
||||
)}
|
||||
>
|
||||
<p className="relative z-10 text-foreground flex flex-col text-xl w-full leading-7">
|
||||
Launch Week 12
|
||||
</p>
|
||||
<p className="relative z-10 text-foreground flex flex-col text-xl w-full leading-7"></p>
|
||||
<div className="relative z-10 text-foreground-lighter flex flex-col text-sm w-full mb-2">
|
||||
Explore what we shipped
|
||||
{/* <CountdownComponent date={new Date(announcement.launchDate)} showCard={false} /> */}
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
import Countdown from 'react-countdown'
|
||||
import { CountdownWidget } from 'ui-patterns'
|
||||
|
||||
const CountdownComponent = ({
|
||||
date,
|
||||
showCard = true,
|
||||
}: {
|
||||
date: string | number | Date
|
||||
showCard?: boolean
|
||||
}) => {
|
||||
if (!date) return null
|
||||
|
||||
const renderer = ({ days, hours, minutes, seconds, completed }: any) => {
|
||||
if (completed) {
|
||||
// Render a completed state
|
||||
return null
|
||||
} else {
|
||||
// Render countdown
|
||||
return (
|
||||
<CountdownWidget
|
||||
days={days}
|
||||
hours={hours}
|
||||
minutes={minutes}
|
||||
seconds={seconds}
|
||||
showCard={showCard}
|
||||
/>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
return <Countdown date={new Date(date)} renderer={renderer} />
|
||||
}
|
||||
|
||||
export default CountdownComponent
|
||||
@@ -1,39 +0,0 @@
|
||||
'use client'
|
||||
|
||||
import Link from 'next/link'
|
||||
import { usePathname } from 'next/navigation'
|
||||
import { Button } from '../../../components/Button/Button'
|
||||
import { cn } from '../../../lib/utils/cn'
|
||||
import announcement from '../data/Announcement.json'
|
||||
// import Countdown from './Countdown'
|
||||
|
||||
export function LW12CountdownBanner() {
|
||||
const pathname = usePathname()
|
||||
const isHomePage = pathname === '/'
|
||||
const isLaunchWeekPage =
|
||||
pathname === '/launch-week' || pathname?.includes('/launch-week/tickets/')
|
||||
const isLaunchWeekSection =
|
||||
(pathname?.includes('/launch-week') || pathname?.includes('/launch-week')) ?? false
|
||||
|
||||
if (isLaunchWeekPage || isHomePage) 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={cn(
|
||||
'w-full flex gap-5 md:gap-10 items-center md:justify-center text-sm',
|
||||
isLaunchWeekSection && '!justify-center'
|
||||
)}
|
||||
>
|
||||
<p className="flex gap-1.5 items-center">{announcement.text}</p>
|
||||
<Button size="tiny" type="default" className="px-2 !leading-none text-xs" asChild>
|
||||
<Link href={`https://supabase.com${announcement.link}`}>{announcement.cta}</Link>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default LW12CountdownBanner
|
||||
@@ -1,22 +0,0 @@
|
||||
import Image from 'next/image'
|
||||
|
||||
const VideoPreview = () => (
|
||||
<div className="relative h-8 !aspect-video flex items-center justify-center rounded overflow-hidden border transition-colors">
|
||||
<div className="absolute z-10 w-2.5 h-2.5 text-white opacity-100">
|
||||
<svg viewBox="0 0 81 91" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M76.5621 37.998C82.3369 41.3321 82.3369 49.6673 76.5621 53.0014L13.2198 89.5721C7.44504 92.9062 0.226562 88.7386 0.226562 82.0704L0.226566 8.92901C0.226566 2.26085 7.44506 -1.90673 13.2199 1.42735L76.5621 37.998Z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
<Image
|
||||
src="https://obuldanrptloktxcffvn.supabase.co/storage/v1/object/public/images/lw8/assets/yt_d5.jpg?t=2023-08-11T09%3A31%3A39.412Z"
|
||||
alt="Video thumbnail"
|
||||
layout="fill"
|
||||
objectFit="cover"
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
|
||||
export default VideoPreview
|
||||
Reference in new issue
Block a user