Skip to content

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

Address feedvacj

Joshen Lim998138862abf
diff --git a/studio/components/ui/ConsentToast.tsx b/studio/components/ui/ConsentToast.tsx
deleted file mode 100644
index 271821592da..00000000000
--- a/studio/components/ui/ConsentToast.tsx
+++ /dev/null
@@ -1,38 +0,0 @@
-import { noop } from 'lodash'
-import Link from 'next/link'
-import { Button } from 'ui'
-
-interface ConsentToastProps {
- onAccept: () => void
- onOptOut: () => void
-}
-
-const ConsentToast = ({ onAccept = noop, onOptOut = noop }: ConsentToastProps) => {
- return (
- <div className="space-y-3">
- <div className="text-sm">
- <p>
- <span className="underline font-medium">No cookies.</span> 🍪
- </p>
- <p>
- We only collect analytics essential to ensuring smooth operation of our services.
- </p>
- </div>
- <div className="flex items-center space-x-2">
- <Button type="default" onClick={onAccept}>
- Accept
- </Button>
- <Button type="text" onClick={onOptOut}>
- Opt out
- </Button>
- <Link href="https://supabase.com/privacy">
- <a target="_blank" rel="noreferrer">
- <Button type="text">Learn more</Button>
- </a>
- </Link>
- </div>
- </div>
- )
-}
-
-export default ConsentToast
diff --git a/studio/components/ui/PageTelemetry.tsx b/studio/components/ui/PageTelemetry.tsx
index 967103ae7be..6b5b011ff45 100644
--- a/studio/components/ui/PageTelemetry.tsx
+++ b/studio/components/ui/PageTelemetry.tsx
@@ -20,7 +20,7 @@ const PageTelemetry = ({ children }: PropsWithChildren<{}>) => {
typeof window !== 'undefined'
? localStorage.getItem(LOCAL_STORAGE_KEYS.TELEMETRY_CONSENT)
: null
- snap.setIsOptedInTelemetry(consent === 'true')
+ if (consent !== null) snap.setIsOptedInTelemetry(consent === 'true')
}, [])
const isLoggedIn = useIsLoggedIn()
diff --git a/studio/pages/_app.tsx b/studio/pages/_app.tsx
index 9c5ff10e135..1e438bceafd 100644
--- a/studio/pages/_app.tsx
+++ b/studio/pages/_app.tsx
@@ -32,6 +32,7 @@ import { useEffect, useMemo, useRef, useState } from 'react'
import toast from 'react-hot-toast'
// @ts-ignore
import Prism from 'prism-react-renderer/prism'
+import ConsentToast from 'ui/src/components/ConsentToast'
import Favicons from 'components/head/Favicons'
import {
@@ -40,7 +41,6 @@ import {
PortalToast,
RouteValidationWrapper,
} from 'components/interfaces/App'
-import ConsentToast from 'components/ui/ConsentToast'
import FlagProvider from 'components/ui/Flag/FlagProvider'
import PageTelemetry from 'components/ui/PageTelemetry'
import { useRootQueryClient } from 'data/query-client'