Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix native post meta (#4530)

authored by

Hailey and committed by
GitHub
d0bb97e8 eaef1446

+45 -47
+14 -1
src/components/ProfileHoverCard/index.web.tsx
··· 51 51 ] 52 52 53 53 export function ProfileHoverCard(props: ProfileHoverCardProps) { 54 + const prefetchProfileQuery = usePrefetchProfileQuery() 55 + const prefetchedProfile = React.useRef(false) 56 + const onPointerMove = () => { 57 + if (!prefetchedProfile.current) { 58 + prefetchedProfile.current = true 59 + prefetchProfileQuery(props.did) 60 + } 61 + } 62 + 54 63 if (props.disable || isTouchDevice) { 55 64 return props.children 56 65 } else { 57 - return <ProfileHoverCardInner {...props} /> 66 + return ( 67 + <View onPointerMove={onPointerMove}> 68 + <ProfileHoverCardInner {...props} /> 69 + </View> 70 + ) 58 71 } 59 72 } 60 73
+31 -46
src/view/com/util/PostMeta.tsx
··· 3 3 import {AppBskyActorDefs, ModerationDecision, ModerationUI} from '@atproto/api' 4 4 import {useQueryClient} from '@tanstack/react-query' 5 5 6 - import {precacheProfile, usePrefetchProfileQuery} from '#/state/queries/profile' 6 + import {precacheProfile} from '#/state/queries/profile' 7 7 import {usePalette} from 'lib/hooks/usePalette' 8 8 import {makeProfileLink} from 'lib/routes/links' 9 9 import {sanitizeDisplayName} from 'lib/strings/display-names' 10 10 import {sanitizeHandle} from 'lib/strings/handles' 11 11 import {niceDate} from 'lib/strings/time' 12 12 import {TypographyVariant} from 'lib/ThemeContext' 13 - import {isAndroid, isWeb} from 'platform/detection' 14 - import {atoms as a} from '#/alf' 13 + import {isAndroid} from 'platform/detection' 15 14 import {ProfileHoverCard} from '#/components/ProfileHoverCard' 16 15 import {TextLinkOnWebOnly} from './Link' 17 16 import {Text} from './text/Text' ··· 37 36 const pal = usePalette('default') 38 37 const displayName = opts.author.displayName || opts.author.handle 39 38 const handle = opts.author.handle 40 - const prefetchProfileQuery = usePrefetchProfileQuery() 41 - 42 39 const profileLink = makeProfileLink(opts.author) 43 - const prefetchedProfile = React.useRef(false) 44 - const onPointerMove = React.useCallback(() => { 45 - if (!prefetchedProfile.current) { 46 - prefetchedProfile.current = true 47 - prefetchProfileQuery(opts.author.did) 48 - } 49 - }, [opts.author.did, prefetchProfileQuery]) 50 - 51 40 const queryClient = useQueryClient() 52 41 const onOpenAuthor = opts.onOpenAuthor 53 42 const onBeforePressAuthor = useCallback(() => { ··· 71 60 </View> 72 61 )} 73 62 <ProfileHoverCard inline did={opts.author.did}> 74 - <View 75 - onPointerMove={isWeb ? onPointerMove : undefined} 76 - style={[a.flex_1]}> 77 - <Text 78 - numberOfLines={1} 79 - style={[styles.maxWidth, pal.textLight, opts.displayNameStyle]}> 80 - <TextLinkOnWebOnly 81 - type={opts.displayNameType || 'lg-bold'} 82 - style={[pal.text]} 83 - lineHeight={1.2} 84 - disableMismatchWarning 85 - text={ 86 - <> 87 - {sanitizeDisplayName( 88 - displayName, 89 - opts.moderation?.ui('displayName'), 90 - )} 91 - </> 92 - } 93 - href={profileLink} 94 - onBeforePress={onBeforePressAuthor} 95 - /> 96 - <TextLinkOnWebOnly 97 - type="md" 98 - disableMismatchWarning 99 - style={[pal.textLight, {flexShrink: 4}]} 100 - text={'\xa0' + sanitizeHandle(handle, '@')} 101 - href={profileLink} 102 - onBeforePress={onBeforePressAuthor} 103 - anchorNoUnderline 104 - /> 105 - </Text> 106 - </View> 63 + <Text 64 + numberOfLines={1} 65 + style={[styles.maxWidth, pal.textLight, opts.displayNameStyle]}> 66 + <TextLinkOnWebOnly 67 + type={opts.displayNameType || 'lg-bold'} 68 + style={[pal.text]} 69 + lineHeight={1.2} 70 + disableMismatchWarning 71 + text={ 72 + <> 73 + {sanitizeDisplayName( 74 + displayName, 75 + opts.moderation?.ui('displayName'), 76 + )} 77 + </> 78 + } 79 + href={profileLink} 80 + onBeforePress={onBeforePressAuthor} 81 + /> 82 + <TextLinkOnWebOnly 83 + type="md" 84 + disableMismatchWarning 85 + style={[pal.textLight, {flexShrink: 4}]} 86 + text={'\xa0' + sanitizeHandle(handle, '@')} 87 + href={profileLink} 88 + onBeforePress={onBeforePressAuthor} 89 + anchorNoUnderline 90 + /> 91 + </Text> 107 92 </ProfileHoverCard> 108 93 {!isAndroid && ( 109 94 <Text