Messages list - make avatars link to profile (#5484)
This commit is contained in:
@@ -24,8 +24,9 @@ import {useProfileShadow} from '#/state/cache/profile-shadow'
|
|||||||
import {useModerationOpts} from '#/state/preferences/moderation-opts'
|
import {useModerationOpts} from '#/state/preferences/moderation-opts'
|
||||||
import {useSession} from '#/state/session'
|
import {useSession} from '#/state/session'
|
||||||
import {TimeElapsed} from '#/view/com/util/TimeElapsed'
|
import {TimeElapsed} from '#/view/com/util/TimeElapsed'
|
||||||
import {UserAvatar} from '#/view/com/util/UserAvatar'
|
import {PreviewableUserAvatar} from '#/view/com/util/UserAvatar'
|
||||||
import {atoms as a, useBreakpoints, useTheme, web} from '#/alf'
|
import {atoms as a, useBreakpoints, useTheme, web} from '#/alf'
|
||||||
|
import * as tokens from '#/alf/tokens'
|
||||||
import {ConvoMenu} from '#/components/dms/ConvoMenu'
|
import {ConvoMenu} from '#/components/dms/ConvoMenu'
|
||||||
import {Bell2Off_Filled_Corner0_Rounded as BellStroke} from '#/components/icons/Bell2'
|
import {Bell2Off_Filled_Corner0_Rounded as BellStroke} from '#/components/icons/Bell2'
|
||||||
import {Link} from '#/components/Link'
|
import {Link} from '#/components/Link'
|
||||||
@@ -203,6 +204,19 @@ function ChatListItemReady({
|
|||||||
onFocus={onFocus}
|
onFocus={onFocus}
|
||||||
onBlur={onMouseLeave}
|
onBlur={onMouseLeave}
|
||||||
style={[a.relative]}>
|
style={[a.relative]}>
|
||||||
|
<View
|
||||||
|
style={[
|
||||||
|
a.z_10,
|
||||||
|
a.absolute,
|
||||||
|
{top: tokens.space.md, left: tokens.space.lg},
|
||||||
|
]}>
|
||||||
|
<PreviewableUserAvatar
|
||||||
|
profile={profile}
|
||||||
|
size={52}
|
||||||
|
moderation={moderation.ui('avatar')}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
|
||||||
<Link
|
<Link
|
||||||
to={`/messages/${convo.id}`}
|
to={`/messages/${convo.id}`}
|
||||||
label={displayName}
|
label={displayName}
|
||||||
@@ -236,11 +250,8 @@ function ChatListItemReady({
|
|||||||
(hovered || pressed || focused) && t.atoms.bg_contrast_25,
|
(hovered || pressed || focused) && t.atoms.bg_contrast_25,
|
||||||
t.atoms.border_contrast_low,
|
t.atoms.border_contrast_low,
|
||||||
]}>
|
]}>
|
||||||
<UserAvatar
|
{/* Avatar goes here */}
|
||||||
avatar={profile.avatar}
|
<View style={{width: 52, height: 52}} />
|
||||||
size={52}
|
|
||||||
moderation={moderation.ui('avatar')}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<View style={[a.flex_1, a.justify_center, web({paddingRight: 45})]}>
|
<View style={[a.flex_1, a.justify_center, web({paddingRight: 45})]}>
|
||||||
<View style={[a.w_full, a.flex_row, a.align_end, a.pb_2xs]}>
|
<View style={[a.w_full, a.flex_row, a.align_end, a.pb_2xs]}>
|
||||||
@@ -357,7 +368,7 @@ function ChatListItemReady({
|
|||||||
a.self_end,
|
a.self_end,
|
||||||
a.justify_center,
|
a.justify_center,
|
||||||
{
|
{
|
||||||
right: a.px_lg.paddingRight,
|
right: tokens.space.lg,
|
||||||
opacity: !gtMobile || showActions || menuControl.isOpen ? 1 : 0,
|
opacity: !gtMobile || showActions || menuControl.isOpen ? 1 : 0,
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
|
|||||||
Reference in New Issue
Block a user