···330330}
331331332332/**
333333+ * Utility to create a static `onPress` handler for a `Link` that would otherwise link to a URI
334334+ *
335335+ * Example:
336336+ * `<Link {...createStaticClick(e => {...})} />`
337337+ */
338338+export function createStaticClick(
339339+ onPressHandler: Exclude<BaseLinkProps['onPress'], undefined>,
340340+): Pick<BaseLinkProps, 'to' | 'onPress'> {
341341+ return {
342342+ to: '#',
343343+ onPress(e: GestureResponderEvent) {
344344+ e.preventDefault()
345345+ onPressHandler(e)
346346+ return false
347347+ },
348348+ }
349349+}
350350+351351+/**
333352 * A Pressable that uses useLink to handle navigation. It is unstyled, so can be used in cases where the Button styles
334353 * in Link are not desired.
335354 * @param displayText
+7-21
src/components/TagMenu/index.tsx
···44import {useLingui} from '@lingui/react'
55import {useNavigation} from '@react-navigation/native'
6677-import {makeSearchLink} from '#/lib/routes/links'
87import {NavigationProp} from '#/lib/routes/types'
98import {isInvalidHandle} from '#/lib/strings/handles'
109import {
···1918import {MagnifyingGlass2_Stroke2_Corner0_Rounded as Search} from '#/components/icons/MagnifyingGlass2'
2019import {Mute_Stroke2_Corner0_Rounded as Mute} from '#/components/icons/Mute'
2120import {Person_Stroke2_Corner0_Rounded as Person} from '#/components/icons/Person'
2222-import {Link} from '#/components/Link'
2121+import {createStaticClick, Link} from '#/components/Link'
2322import {Loader} from '#/components/Loader'
2423import {Text} from '#/components/Typography'
2524···101100 t.atoms.bg_contrast_25,
102101 ]}>
103102 <Link
104104- label={_(msg`Search for all posts with tag ${displayTag}`)}
105105- to={makeSearchLink({query: displayTag})}
106106- onPress={e => {
107107- e.preventDefault()
108108-103103+ label={_(msg`View all posts with tag ${displayTag}`)}
104104+ {...createStaticClick(() => {
109105 control.close(() => {
110106 navigation.push('Hashtag', {
111107 tag: encodeURIComponent(tag),
112108 })
113109 })
114114-115115- return false
116116- }}>
110110+ })}>
117111 <View
118112 style={[
119113 a.w_full,
···152146153147 <Link
154148 label={_(
155155- msg`Search for all posts by @${authorHandle} with tag ${displayTag}`,
149149+ msg`View all posts by @${authorHandle} with tag ${displayTag}`,
156150 )}
157157- to={makeSearchLink({
158158- query: displayTag,
159159- from: authorHandle,
160160- })}
161161- onPress={e => {
162162- e.preventDefault()
163163-151151+ {...createStaticClick(() => {
164152 control.close(() => {
165153 navigation.push('Hashtag', {
166154 tag: encodeURIComponent(tag),
167155 author: authorHandle,
168156 })
169157 })
170170-171171- return false
172172- }}>
158158+ })}>
173159 <View
174160 style={[
175161 a.w_full,