about summary refs log tree commit diff
path: root/src/components/dialogs/Context.tsx
diff options
context:
space:
mode:
authorSamuel Newman <mozzius@protonmail.com>2025-06-18 16:17:54 +0300
committerGitHub <noreply@github.com>2025-06-18 06:17:54 -0700
commit4da86e5864e10b14880900b78cb94d33c199b7da (patch)
tree2ace2cc361d2c84a145b9e163c06733f0b6ef241 /src/components/dialogs/Context.tsx
parentdd86402763518ae94ced8274dda886f92ec7b51e (diff)
downloadvoidsky-4da86e5864e10b14880900b78cb94d33c199b7da.tar.zst
Modernise link warning dialog (#8243)
* add link warning dialog

* add copy for if sharing

* delete old modal

* get web working
Diffstat (limited to 'src/components/dialogs/Context.tsx')
-rw-r--r--src/components/dialogs/Context.tsx12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/components/dialogs/Context.tsx b/src/components/dialogs/Context.tsx
index 728044325..1ee4d2739 100644
--- a/src/components/dialogs/Context.tsx
+++ b/src/components/dialogs/Context.tsx
@@ -17,6 +17,11 @@ type ControlsContext = {
   signinDialogControl: Control
   inAppBrowserConsentControl: StatefulControl<string>
   emailDialogControl: StatefulControl<Screen>
+  linkWarningDialogControl: StatefulControl<{
+    href: string
+    displayText: string
+    share?: boolean
+  }>
 }
 
 const ControlsContext = createContext<ControlsContext | null>(null)
@@ -36,6 +41,11 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
   const signinDialogControl = Dialog.useDialogControl()
   const inAppBrowserConsentControl = useStatefulDialogControl<string>()
   const emailDialogControl = useStatefulDialogControl<Screen>()
+  const linkWarningDialogControl = useStatefulDialogControl<{
+    href: string
+    displayText: string
+    share?: boolean
+  }>()
 
   const ctx = useMemo<ControlsContext>(
     () => ({
@@ -43,12 +53,14 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
       signinDialogControl,
       inAppBrowserConsentControl,
       emailDialogControl,
+      linkWarningDialogControl,
     }),
     [
       mutedWordsDialogControl,
       signinDialogControl,
       inAppBrowserConsentControl,
       emailDialogControl,
+      linkWarningDialogControl,
     ],
   )