diff options
author | Eric Bailey <git@esb.lol> | 2024-10-14 10:44:04 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-14 10:44:04 -0500 |
commit | 0b4dc64c63e7fecb82d2be6fe4cd9267c55ee444 (patch) | |
tree | 20a0d6ed824e48352fc66197006ee67c67609cfd /src/components/TagMenu/index.tsx | |
parent | a445489b53725f3c87f6fa43b904015e910dbfea (diff) | |
download | voidsky-0b4dc64c63e7fecb82d2be6fe4cd9267c55ee444.tar.zst |
Add util for link static clicks (#5683)
* Add util for link static clicks * Format * Update copy
Diffstat (limited to 'src/components/TagMenu/index.tsx')
-rw-r--r-- | src/components/TagMenu/index.tsx | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/src/components/TagMenu/index.tsx b/src/components/TagMenu/index.tsx index 917624a03..ae9fcdae2 100644 --- a/src/components/TagMenu/index.tsx +++ b/src/components/TagMenu/index.tsx @@ -4,7 +4,6 @@ import {msg, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' import {useNavigation} from '@react-navigation/native' -import {makeSearchLink} from '#/lib/routes/links' import {NavigationProp} from '#/lib/routes/types' import {isInvalidHandle} from '#/lib/strings/handles' import { @@ -19,7 +18,7 @@ import {Divider} from '#/components/Divider' import {MagnifyingGlass2_Stroke2_Corner0_Rounded as Search} from '#/components/icons/MagnifyingGlass2' import {Mute_Stroke2_Corner0_Rounded as Mute} from '#/components/icons/Mute' import {Person_Stroke2_Corner0_Rounded as Person} from '#/components/icons/Person' -import {Link} from '#/components/Link' +import {createStaticClick, Link} from '#/components/Link' import {Loader} from '#/components/Loader' import {Text} from '#/components/Typography' @@ -101,19 +100,14 @@ export function TagMenu({ t.atoms.bg_contrast_25, ]}> <Link - label={_(msg`Search for all posts with tag ${displayTag}`)} - to={makeSearchLink({query: displayTag})} - onPress={e => { - e.preventDefault() - + label={_(msg`View all posts with tag ${displayTag}`)} + {...createStaticClick(() => { control.close(() => { navigation.push('Hashtag', { tag: encodeURIComponent(tag), }) }) - - return false - }}> + })}> <View style={[ a.w_full, @@ -152,24 +146,16 @@ export function TagMenu({ <Link label={_( - msg`Search for all posts by @${authorHandle} with tag ${displayTag}`, + msg`View all posts by @${authorHandle} with tag ${displayTag}`, )} - to={makeSearchLink({ - query: displayTag, - from: authorHandle, - })} - onPress={e => { - e.preventDefault() - + {...createStaticClick(() => { control.close(() => { navigation.push('Hashtag', { tag: encodeURIComponent(tag), author: authorHandle, }) }) - - return false - }}> + })}> <View style={[ a.w_full, |