about summary refs log tree commit diff
path: root/src/components/Link.tsx
diff options
context:
space:
mode:
authorSamuel Newman <mozzius@protonmail.com>2025-01-23 22:33:28 +0000
committerGitHub <noreply@github.com>2025-01-23 22:33:28 +0000
commitf1d120d416bc262b5fd63e3407f9e0b09b13cd74 (patch)
tree5191aec11ef4367e7be299e3711cad2dcad29697 /src/components/Link.tsx
parent084d11c63aebd0afc516931a11bddac9b24b3b18 (diff)
downloadvoidsky-f1d120d416bc262b5fd63e3407f9e0b09b13cd74.tar.zst
Takendown state + in-app takedown appeals (#7566)
* takendown screen

* add form, move button inline

* expect type error

* display error

* disable submit if too long

* move around all the ctas

* typos, rm layoutanimation, fix link

* use REASONAPPEAL
Diffstat (limited to 'src/components/Link.tsx')
-rw-r--r--src/components/Link.tsx20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/components/Link.tsx b/src/components/Link.tsx
index 50e741ea7..26cea5968 100644
--- a/src/components/Link.tsx
+++ b/src/components/Link.tsx
@@ -79,8 +79,10 @@ export function useLink({
   onPress: outerOnPress,
   onLongPress: outerOnLongPress,
   shareOnLongPress,
+  overridePresentation,
 }: BaseLinkProps & {
   displayText: string
+  overridePresentation?: boolean
 }) {
   const navigation = useNavigationDeduped()
   const {href} = useLinkProps<AllNavigatorParams>({
@@ -116,7 +118,7 @@ export function useLink({
         })
       } else {
         if (isExternal) {
-          openLink(href)
+          openLink(href, overridePresentation)
         } else {
           const shouldOpenInNewTab = shouldClickOpenNewTab(e)
 
@@ -158,6 +160,7 @@ export function useLink({
       closeModal,
       action,
       navigation,
+      overridePresentation,
     ],
   )
 
@@ -254,12 +257,13 @@ export function Link({
 export type InlineLinkProps = React.PropsWithChildren<
   BaseLinkProps &
     TextStyleProp &
-    Pick<TextProps, 'selectable' | 'numberOfLines'>
-> &
-  Pick<ButtonProps, 'label' | 'accessibilityHint'> & {
-    disableUnderline?: boolean
-    title?: TextProps['title']
-  }
+    Pick<TextProps, 'selectable' | 'numberOfLines'> &
+    Pick<ButtonProps, 'label' | 'accessibilityHint'> & {
+      disableUnderline?: boolean
+      title?: TextProps['title']
+      overridePresentation?: boolean
+    }
+>
 
 export function InlineLinkText({
   children,
@@ -274,6 +278,7 @@ export function InlineLinkText({
   label,
   shareOnLongPress,
   disableUnderline,
+  overridePresentation,
   ...rest
 }: InlineLinkProps) {
   const t = useTheme()
@@ -286,6 +291,7 @@ export function InlineLinkText({
     onPress: outerOnPress,
     onLongPress: outerOnLongPress,
     shareOnLongPress,
+    overridePresentation,
   })
   const {
     state: hovered,