Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

revises the link in announcement banner to navigate to the relative /launch-week path

Mikael Mantis70ed46dec8b1
diff --git a/packages/ui/src/layout/banners/Announcement.Countdown.tsx b/packages/ui/src/layout/banners/Announcement.Countdown.tsx
index 2cb4dada4d3..ea38a87ede2 100644
--- a/packages/ui/src/layout/banners/Announcement.Countdown.tsx
+++ b/packages/ui/src/layout/banners/Announcement.Countdown.tsx
@@ -1,5 +1,3 @@
-import React from 'react'
-import Link from 'next/link'
import Countdown from 'react-countdown'
import _announcement from './data/Announcement.json'
import { AnnouncementProps } from './Announcement'
@@ -10,6 +8,11 @@ interface CountdownStepProps {
unit: string
}
+interface CountdownButtonProps {
+ dest: string
+ text: string
+}
+
const announcement = _announcement as AnnouncementProps
function CountdownStep({ value, unit }: CountdownStepProps) {
@@ -23,6 +26,14 @@ function CountdownStep({ value, unit }: CountdownStepProps) {
)
}
+function CountdownButton({ dest, text }: CountdownButtonProps) {
+ return (
+ <a onClick={(e) => e.stopPropagation()} href={dest} className="bg-white text-xs px-1.5 md:px-2.5 py-1 rounded-full text-[#9E44EF] shadow-none hover:shadow-mg cursor-pointer">
+ {text}
+ </a>
+ );
+}
+
function CountdownBanner() {
const { pathname } = useRouter()
const isLaunchWeekPage = pathname === '/launch-week'
@@ -35,11 +46,7 @@ function CountdownBanner() {
<div className="w-full flex gap-3 md:gap-6 items-center justify-center">
<p>Supabase Launch Week 7</p>
<div>
- <Link href="/launch-week">
- <a className="bg-white text-xs px-1.5 md:px-2.5 py-1 rounded-full text-[#9E44EF] shadow-none hover:shadow-mg cursor-pointer">
- Explore
- </a>
- </Link>
+ <CountdownButton dest="/launch-week" text="Explore" />
</div>
</div>
)
@@ -63,11 +70,7 @@ function CountdownBanner() {
</div>
{!isLaunchWeekPage && (
<div className="hidden md:block">
- <Link href="/launch-week">
- <a className="bg-white text-xs px-1.5 md:px-2.5 py-1 rounded-full text-[#9E44EF] shadow-none hover:shadow-mg cursor-pointer">
- Get your ticket
- </a>
- </Link>
+ <CountdownButton dest="/launch-week" text="Get your ticket" />
</div>
)}
</div>
diff --git a/packages/ui/src/layout/banners/Announcement.tsx b/packages/ui/src/layout/banners/Announcement.tsx
index e9d3de270b1..7e6b68ba622 100644
--- a/packages/ui/src/layout/banners/Announcement.tsx
+++ b/packages/ui/src/layout/banners/Announcement.tsx
@@ -1,4 +1,4 @@
-import React, { useEffect, useState } from 'react'
+import { useEffect, useState } from 'react'
import _announcement from './data/Announcement.json'
import { IconX } from 'ui'
@@ -52,7 +52,7 @@ const Announcement = ({
}
function handleLink() {
- router.push(announcement.link)
+ window.location.assign(announcement.link)
}
// Always show if on LW section
@@ -60,7 +60,7 @@ const Announcement = ({
return null
} else {
return (
- <div onClick={handleLink} className={['relative w-full cursor-pointer', className].join(' ')}>
+ <div onClick={handleLink} className={['relative w-full cursor-pointer', className].join(' ')} role="link" tabIndex={0}>
{!isLaunchWeekSection && (
<div
className="absolute right-4 flex h-full items-center opacity-50 transition-opacity hover:opacity-100"