Add hovercards to "Reply To" (#3587)

* Add hovercard for Reply To

* Tweak durations
zio/stable
dan 2024-04-16 23:44:41 +01:00 committed by GitHub
parent 1e26654a9b
commit 480fa10e0b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 20 additions and 15 deletions

View File

@ -72,10 +72,10 @@ type Action =
| 'unhovered-long-enough' | 'unhovered-long-enough'
| 'finished-animating-hide' | 'finished-animating-hide'
const SHOW_DELAY = 350 const SHOW_DELAY = 400
const SHOW_DURATION = 300 const SHOW_DURATION = 300
const HIDE_DELAY = 200 const HIDE_DELAY = 150
const HIDE_DURATION = 200 const HIDE_DURATION = 150
export function ProfileHoverCardInner(props: ProfileHoverCardProps) { export function ProfileHoverCardInner(props: ProfileHoverCardProps) {
const {refs, floatingStyles} = useFloating({ const {refs, floatingStyles} = useFloating({

View File

@ -23,6 +23,7 @@ import {countLines} from 'lib/strings/helpers'
import {colors, s} from 'lib/styles' import {colors, s} from 'lib/styles'
import {RQKEY as RQKEY_URI} from 'state/queries/resolve-uri' import {RQKEY as RQKEY_URI} from 'state/queries/resolve-uri'
import {atoms as a} from '#/alf' import {atoms as a} from '#/alf'
import {ProfileHoverCard} from '#/components/ProfileHoverCard'
import {RichText} from '#/components/RichText' import {RichText} from '#/components/RichText'
import {ContentHider} from '../../../components/moderation/ContentHider' import {ContentHider} from '../../../components/moderation/ContentHider'
import {LabelsOnMyPost} from '../../../components/moderation/LabelsOnMe' import {LabelsOnMyPost} from '../../../components/moderation/LabelsOnMe'
@ -176,12 +177,14 @@ function PostInner({
numberOfLines={1}> numberOfLines={1}>
<Trans context="description"> <Trans context="description">
Reply to{' '} Reply to{' '}
<ProfileHoverCard inline did={replyAuthorDid}>
<UserInfoText <UserInfoText
type="sm" type="sm"
did={replyAuthorDid} did={replyAuthorDid}
attr="displayName" attr="displayName"
style={[pal.textLight]} style={[pal.textLight]}
/> />
</ProfileHoverCard>
</Trans> </Trans>
</Text> </Text>
</View> </View>

View File

@ -284,12 +284,14 @@ let FeedItemInner = ({
numberOfLines={1}> numberOfLines={1}>
<Trans context="description"> <Trans context="description">
Reply to{' '} Reply to{' '}
<ProfileHoverCard inline did={replyAuthorDid}>
<UserInfoText <UserInfoText
type="md" type="md"
did={replyAuthorDid} did={replyAuthorDid}
attr="displayName" attr="displayName"
style={[pal.textLight]} style={[pal.textLight]}
/> />
</ProfileHoverCard>
</Trans> </Trans>
</Text> </Text>
</View> </View>