Skip to content

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

fix pricing page tooltips (#21385)

Francesco Sansalvadore80b4d1e2e15d
diff --git a/apps/www/components/Hero/HeroFrameworks.tsx b/apps/www/components/Hero/HeroFrameworks.tsx
index 1e59ced0741..84ebedf606a 100644
--- a/apps/www/components/Hero/HeroFrameworks.tsx
+++ b/apps/www/components/Hero/HeroFrameworks.tsx
@@ -1,6 +1,5 @@
import React from 'react'
import Link from 'next/link'
-import ReactTooltip from 'react-tooltip'
import Telemetry from '~/lib/telemetry'
import { useTelemetryProps } from 'common/hooks/useTelemetryProps'
import { useRouter } from 'next/router'
@@ -86,13 +85,6 @@ const HeroFrameworks = ({ className }: { className?: string }) => {
</svg>
</Link>
))}
- <ReactTooltip
- effect={'solid'}
- place="bottom"
- backgroundColor="#2e2e2e"
- textColor="white"
- className="!py-2 !px-4"
- />
</div>
</div>
)
diff --git a/apps/www/pages/index.tsx b/apps/www/pages/index.tsx
index 35181e14181..f963a3a6704 100644
--- a/apps/www/pages/index.tsx
+++ b/apps/www/pages/index.tsx
@@ -1,13 +1,11 @@
+// Import Swiper styles if swiper used on page
+import 'swiper/swiper.min.css'
+
import dynamic from 'next/dynamic'
-import PostTypes from '~/types/post'
-import { getSortedPosts } from '~/lib/posts'
import content from '~/data/home/content'
import Layout from '~/components/Layouts/Default'
import Hero from '~/components/Hero/Hero'
-// Import Swiper styles if swiper used on page
-import 'swiper/swiper.min.css'
-
const Products = dynamic(() => import('~/components/Products/index'))
const BuiltExamples = dynamic(() => import('components/BuiltWithSupabase/index'))
const MadeForDevelopers = dynamic(() => import('components/MadeForDevelopers/index'))
@@ -15,6 +13,7 @@ const AdminAccess = dynamic(() => import('components/AdminAccess/index'))
const CTABanner = dynamic(() => import('components/CTABanner/index'))
const CustomerStories = dynamic(() => import('components/CustomerStories'))
const TwitterSocialSection = dynamic(() => import('~/components/TwitterSocialSection'))
+const ReactTooltip = dynamic(() => import('react-tooltip'), { ssr: false })
const Index = () => {
return (
@@ -27,6 +26,14 @@ const Index = () => {
<AdminAccess />
<CustomerStories />
<CTABanner />
+ <ReactTooltip
+ effect="solid"
+ place="bottom"
+ backgroundColor="hsl(var(--background-alternative-default))"
+ textColor="hsl(var(--foreground-light))"
+ className="!max-w-[320px] !px-3 whitespace-pre-line"
+ uuid="homepage-tt"
+ />
</Layout>
)
}
diff --git a/apps/www/pages/pricing/index.tsx b/apps/www/pages/pricing/index.tsx
index 6caecd0c160..00004899a79 100644
--- a/apps/www/pages/pricing/index.tsx
+++ b/apps/www/pages/pricing/index.tsx
@@ -1,4 +1,4 @@
-import React, { useEffect } from 'react'
+import React, { useEffect, useState } from 'react'
import dynamic from 'next/dynamic'
import { useRouter } from 'next/router'
import { NextSeo } from 'next-seo'
@@ -18,11 +18,18 @@ const CTABanner = dynamic(() => import('~/components/CTABanner'))
export default function IndexPage() {
const router = useRouter()
const { asPath } = useRouter()
+ const [mounted, setMounted] = useState(false)
const meta_title = 'Pricing & Fees | Supabase'
const meta_description =
'Explore Supabase fees and pricing information. Find our competitive pricing plans, with no hidden pricing. We have a generous free plan for those getting started, and Pay As You Go for those scaling up.'
+ useEffect(() => {
+ setTimeout(() => {
+ setMounted(true)
+ }, 200)
+ }, [])
+
// Ability to scroll into pricing sections like storage
useEffect(() => {
/**
@@ -118,14 +125,16 @@ export default function IndexPage() {
<PricingFAQs />
</div>
<CTABanner />
- <ReactTooltip
- wrapper="span"
- effect="solid"
- backgroundColor="hsl(var(--background-alternative-default))"
- textColor="hsl(var(--foreground-light))"
- className="!max-w-[320px] !px-3 whitespace-pre-line"
- uuid="pricingtt"
- />
+ {mounted && (
+ <ReactTooltip
+ wrapper="span"
+ effect="solid"
+ backgroundColor="hsl(var(--background-alternative-default))"
+ textColor="hsl(var(--foreground-light))"
+ className="!max-w-[320px] !px-3 whitespace-pre-line"
+ uuid="pricing-tt"
+ />
+ )}
</DefaultLayout>
)
}