about summary refs log tree commit diff
path: root/src/view
diff options
context:
space:
mode:
authorBryan Lee <38807139+liby@users.noreply.github.com>2023-10-01 21:17:18 +0800
committerBryan Lee <38807139+liby@users.noreply.github.com>2023-10-04 21:47:19 +0800
commit2ca673d7f524d618ff982001840e82d758624c39 (patch)
tree3fc63954fbbd3b9e3d790ddd557a3cdc32ca0380 /src/view
parenta76fb78d532e436b6b84efd09d70088410a2bb20 (diff)
downloadvoidsky-2ca673d7f524d618ff982001840e82d758624c39.tar.zst
Replace `isDesktop` with `isWeb` in `DesktopWebTextLink` component
- Replaced `useWebMediaQueries().isDesktop` with `isWeb` in `DesktopWebTextLink` component to fix inconsistent behavior due to media query changes.
- `isWeb` doesn't rely on media queries, offering stable judgement and avoiding fluctuation when adjusting the browser window.
Diffstat (limited to 'src/view')
-rw-r--r--src/view/com/util/Link.tsx7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/view/com/util/Link.tsx b/src/view/com/util/Link.tsx
index 6915d3e08..472d943e1 100644
--- a/src/view/com/util/Link.tsx
+++ b/src/view/com/util/Link.tsx
@@ -28,11 +28,10 @@ import {
   isExternalUrl,
   linkRequiresWarning,
 } from 'lib/strings/url-helpers'
-import {isAndroid} from 'platform/detection'
+import {isAndroid, isWeb} from 'platform/detection'
 import {sanitizeUrl} from '@braintree/sanitize-url'
 import {PressableWithHover} from './PressableWithHover'
 import FixedTouchableHighlight from '../pager/FixedTouchableHighlight'
-import {useWebMediaQueries} from 'lib/hooks/useWebMediaQueries'
 
 type Event =
   | React.MouseEvent<HTMLAnchorElement, MouseEvent>
@@ -246,9 +245,7 @@ export const DesktopWebTextLink = observer(function DesktopWebTextLink({
   lineHeight,
   ...props
 }: DesktopWebTextLinkProps) {
-  const {isDesktop} = useWebMediaQueries()
-
-  if (isDesktop) {
+  if (isWeb) {
     return (
       <TextLink
         testID={testID}