Skip to content

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

fix mobile consent toast (#29505)

Francesco Sansalvadore62959ab0c98e
diff --git a/apps/www/next-env.d.ts b/apps/www/next-env.d.ts
index fd36f9494e2..725dd6f2451 100644
--- a/apps/www/next-env.d.ts
+++ b/apps/www/next-env.d.ts
@@ -3,4 +3,4 @@
/// <reference types="next/navigation-types/compat/navigation" />
// NOTE: This file should not be edited
-// see https://nextjs.org/docs/basic-features/typescript for more information.
+// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
diff --git a/package-lock.json b/package-lock.json
index 9628c27a44d..49e0916374b 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -21,8 +21,7 @@
"prettier-plugin-sql-cst": "^0.11.0",
"sass": "^1.72.0",
"supabase": "^1.151.1",
- "turbo": "2.0.4",
- "vite": "5.2.14"
+ "turbo": "2.0.4"
},
"engines": {
"node": "^20.0.0",
diff --git a/packages/ui-patterns/ConsentToast/index.tsx b/packages/ui-patterns/ConsentToast/index.tsx
index 1fd48f23c3e..64011845e3d 100644
--- a/packages/ui-patterns/ConsentToast/index.tsx
+++ b/packages/ui-patterns/ConsentToast/index.tsx
@@ -11,7 +11,7 @@ import { noop } from 'lodash'
import Link from 'next/link'
import { useCallback, useEffect, useRef, useState } from 'react'
import { toast } from 'sonner'
-import { Button } from 'ui'
+import { Button, cn } from 'ui'
interface ConsentToastProps {
onAccept: () => void
@@ -92,7 +92,12 @@ export const useConsent = () => {
id: 'consent-toast',
position: 'bottom-right',
duration: Infinity,
- closeButton: true,
+ closeButton: false,
+ dismissible: false,
+ className: cn(
+ '!w-screen !fixed !border-t !h-auto !left-0 !bottom-0 !top-auto !right-0 !rounded-none !max-w-none !bg-overlay !text',
+ 'sm:!w-full sm:!max-w-[356px] sm:!left-auto sm:!right-8 sm:!bottom-8 sm:!rounded-lg sm:border'
+ ),
}
)
}
@@ -110,7 +115,9 @@ export const useConsent = () => {
}, [])
useEffect(() => {
- triggerConsentToast()
+ setTimeout(() => {
+ consentValue === null && triggerConsentToast()
+ }, 300)
}, [consentValue])
return {