-
-
-
+
-
-
+
+
>
)
}
diff --git a/packages/ui-patterns/src/PopupFrame/index.tsx b/packages/ui-patterns/src/PopupFrame/index.tsx
index d858e584e57..30090848bc3 100644
--- a/packages/ui-patterns/src/PopupFrame/index.tsx
+++ b/packages/ui-patterns/src/PopupFrame/index.tsx
@@ -1,6 +1,6 @@
import { useBreakpoint } from 'common'
import React, { ReactNode } from 'react'
-import { cn, Modal } from 'ui'
+import { cn, Dialog, DialogContent, DialogTrigger } from 'ui'
interface PopupFrameProps {
triggerContainerClassName?: string
@@ -20,48 +20,24 @@ export function PopupFrame({
const [open, setOpen] = React.useState(false)
const isMobile = useBreakpoint(768)
- React.useEffect(() => {
- function onKeyDown(e: KeyboardEvent) {
- switch (e.key) {
- case 'Escape':
- return setOpen(false)
- default:
- return
- }
- }
-
- window.addEventListener('keydown', onKeyDown)
- return () => {
- window.removeEventListener('keydown', onKeyDown)
- }
- }, [])
-
React.useEffect(() => {
if (isMobile) setOpen(false)
}, [isMobile])
return (
- <>
-
{
- // Only hide menu when clicking outside, not focusing outside
- // Prevents Firefox dropdown issue that immediately closes menu after opening
- if (e.type === 'dismissableLayer.pointerDownOutside') {
- setOpen(!open)
- }
- }}
- size="xxlarge"
- >
+
-
- >
+
+
)
}
diff --git a/packages/ui-patterns/src/PrivacySettings/index.tsx b/packages/ui-patterns/src/PrivacySettings/index.tsx
index 5db3e471bf9..09ae65a0250 100644
--- a/packages/ui-patterns/src/PrivacySettings/index.tsx
+++ b/packages/ui-patterns/src/PrivacySettings/index.tsx
@@ -3,7 +3,19 @@
import { useConsentState } from 'common'
import Link from 'next/link'
import { PropsWithChildren, useState } from 'react'
-import { Label, Modal, Switch } from 'ui'
+import {
+ Button,
+ Dialog,
+ DialogContent,
+ DialogFooter,
+ DialogHeader,
+ DialogSection,
+ DialogSectionSeparator,
+ DialogTitle,
+ DialogTrigger,
+ Label,
+ Switch,
+} from 'ui'
import { Admonition } from '../admonition'
@@ -38,36 +50,21 @@ export const PrivacySettings = ({
setIsOpen(false)
}
- const handleCancel = () => {
- setIsOpen(false)
- }
-
return (
- <>
-
-
-
{
- // Only hide menu when clicking outside, not focusing outside
- // Prevents Firefox dropdown issue that immediately closes menu after opening
- if (e.type === 'dismissableLayer.pointerDownOutside') {
- setIsOpen(!isOpen)
- }
- }}
- className="max-w-[calc(100vw-4rem)]"
- size="medium"
- >
-
- {categories === null ? (
-
+
+
+
+
+
+
+
+
)
}
@@ -134,32 +135,30 @@ function Category({
}
return (
-
-
-
-
-
- {category.description}
-
-
- Learn more
-
-
+
+
+
+
+ {category.description}
+
+
+ Learn more
+
-
-
+
+
)
}