diff options
author | Hailey <me@haileyok.com> | 2024-04-17 19:09:10 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-18 03:09:10 +0100 |
commit | 086dc93a7a6e69b0df2ed084ee68bb4e26c13f88 (patch) | |
tree | 5031e973abdad4e6c17881ccfd51e31bc5e0c337 /src/view/com/util/PostMeta.tsx | |
parent | 7e16276c04e8e26e41c3d43c741cb006c79212c9 (diff) | |
download | voidsky-086dc93a7a6e69b0df2ed084ee68bb4e26c13f88.tar.zst |
don't underline handle in post meta (#3591)
* alignment remove the unnecessary styles now seriously? flex-end everything flex shrink test test rm unneeded flex flex the text don't underline handle in post meta * use `paddingLeft` * use `paddingLeft` but with `4` * Fix overflow color * Use nbsp to make mobile work --------- Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
Diffstat (limited to 'src/view/com/util/PostMeta.tsx')
-rw-r--r-- | src/view/com/util/PostMeta.tsx | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/src/view/com/util/PostMeta.tsx b/src/view/com/util/PostMeta.tsx index b37c69448..a9b9a97cf 100644 --- a/src/view/com/util/PostMeta.tsx +++ b/src/view/com/util/PostMeta.tsx @@ -35,6 +35,11 @@ let PostMeta = (opts: PostMetaOpts): React.ReactNode => { const handle = opts.author.handle const prefetchProfileQuery = usePrefetchProfileQuery() + const profileLink = makeProfileLink(opts.author) + const onPointerEnter = isWeb + ? () => prefetchProfileQuery(opts.author.did) + : undefined + return ( <View style={[styles.container, opts.style]}> {opts.showAvatar && ( @@ -49,11 +54,10 @@ let PostMeta = (opts: PostMetaOpts): React.ReactNode => { /> </View> )} - <View style={styles.maxWidth}> + <Text numberOfLines={1} style={[styles.maxWidth, pal.textLight]}> <TextLinkOnWebOnly type={opts.displayNameType || 'lg-bold'} style={[pal.text, opts.displayNameStyle]} - numberOfLines={1} lineHeight={1.2} disableMismatchWarning text={ @@ -62,22 +66,21 @@ let PostMeta = (opts: PostMetaOpts): React.ReactNode => { displayName, opts.moderation?.ui('displayName'), )} - - <Text - type="md" - numberOfLines={1} - lineHeight={1.2} - style={pal.textLight}> - {sanitizeHandle(handle, '@')} - </Text> </> } - href={makeProfileLink(opts.author)} - onPointerEnter={ - isWeb ? () => prefetchProfileQuery(opts.author.did) : undefined - } + href={profileLink} + onPointerEnter={onPointerEnter} + /> + <TextLinkOnWebOnly + type="md" + disableMismatchWarning + style={[pal.textLight, {flexShrink: 4}]} + text={'\xa0' + sanitizeHandle(handle, '@')} + href={profileLink} + onPointerEnter={onPointerEnter} + anchorNoUnderline /> - </View> + </Text> {!isAndroid && ( <Text type="md" @@ -110,7 +113,7 @@ export {PostMeta} const styles = StyleSheet.create({ container: { flexDirection: 'row', - alignItems: 'center', + alignItems: 'flex-end', paddingBottom: 2, gap: 4, zIndex: 1, |