[🐴] Add labels to chats (#4293)
* Add labels to chat list * Add to convo header * Prevent click through on PostAlert buttons * Fix space * Fix alignment
This commit is contained in:
parent
cd3b502b34
commit
2bb3694819
3 changed files with 74 additions and 44 deletions
|
@ -22,6 +22,7 @@ import {atoms as a, useBreakpoints, useTheme, web} from '#/alf'
|
||||||
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'
|
||||||
|
import {PostAlerts} from '#/components/moderation/PostAlerts'
|
||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
|
|
||||||
const PFP_SIZE = isWeb ? 40 : 34
|
const PFP_SIZE = isWeb ? 40 : 34
|
||||||
|
@ -58,7 +59,7 @@ export let MessagesListHeader = ({
|
||||||
t.atoms.border_contrast_low,
|
t.atoms.border_contrast_low,
|
||||||
a.border_b,
|
a.border_b,
|
||||||
a.flex_row,
|
a.flex_row,
|
||||||
a.align_center,
|
a.align_start,
|
||||||
a.gap_sm,
|
a.gap_sm,
|
||||||
gtTablet ? a.pl_lg : a.pl_xl,
|
gtTablet ? a.pl_lg : a.pl_xl,
|
||||||
a.pr_lg,
|
a.pr_lg,
|
||||||
|
@ -69,7 +70,7 @@ export let MessagesListHeader = ({
|
||||||
testID="conversationHeaderBackBtn"
|
testID="conversationHeaderBackBtn"
|
||||||
onPress={onPressBack}
|
onPress={onPressBack}
|
||||||
hitSlop={BACK_HITSLOP}
|
hitSlop={BACK_HITSLOP}
|
||||||
style={{width: 30, height: 30}}
|
style={{width: 30, height: 30, marginTop: isWeb ? 6 : 4}}
|
||||||
accessibilityRole="button"
|
accessibilityRole="button"
|
||||||
accessibilityLabel={_(msg`Back`)}
|
accessibilityLabel={_(msg`Back`)}
|
||||||
accessibilityHint="">
|
accessibilityHint="">
|
||||||
|
@ -152,51 +153,71 @@ function HeaderReady({
|
||||||
)
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<View style={[a.flex_1]}>
|
||||||
<Link
|
<View style={[a.w_full, a.flex_row, a.align_center, a.justify_between]}>
|
||||||
style={[a.flex_row, a.align_center, a.gap_md, a.flex_1, a.pr_md]}
|
<Link
|
||||||
to={makeProfileLink(profile)}>
|
style={[a.flex_row, a.align_start, a.gap_md, a.flex_1, a.pr_md]}
|
||||||
<PreviewableUserAvatar
|
to={makeProfileLink(profile)}>
|
||||||
size={PFP_SIZE}
|
<View style={[a.pt_2xs]}>
|
||||||
profile={profile}
|
<PreviewableUserAvatar
|
||||||
moderation={moderation.ui('avatar')}
|
size={PFP_SIZE}
|
||||||
disableHoverCard={moderation.blocked}
|
profile={profile}
|
||||||
/>
|
moderation={moderation.ui('avatar')}
|
||||||
<View style={a.flex_1}>
|
disableHoverCard={moderation.blocked}
|
||||||
<Text
|
/>
|
||||||
style={[a.text_md, a.font_bold, web(a.leading_normal)]}
|
</View>
|
||||||
numberOfLines={1}>
|
<View style={a.flex_1}>
|
||||||
{displayName}
|
|
||||||
</Text>
|
|
||||||
{!isDeletedAccount && (
|
|
||||||
<Text
|
<Text
|
||||||
style={[
|
style={[a.text_md, a.font_bold, web(a.leading_normal)]}
|
||||||
t.atoms.text_contrast_medium,
|
|
||||||
a.text_sm,
|
|
||||||
web([a.leading_normal, {marginTop: -2}]),
|
|
||||||
]}
|
|
||||||
numberOfLines={1}>
|
numberOfLines={1}>
|
||||||
@{profile.handle}
|
{displayName}
|
||||||
{convoState.convo?.muted && (
|
|
||||||
<>
|
|
||||||
{' '}
|
|
||||||
·{' '}
|
|
||||||
<BellStroke size="xs" style={t.atoms.text_contrast_medium} />
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</Text>
|
</Text>
|
||||||
)}
|
{!isDeletedAccount && (
|
||||||
</View>
|
<Text
|
||||||
</Link>
|
style={[
|
||||||
|
t.atoms.text_contrast_medium,
|
||||||
|
a.text_sm,
|
||||||
|
web([a.leading_normal, {marginTop: -2}]),
|
||||||
|
]}
|
||||||
|
numberOfLines={1}>
|
||||||
|
@{profile.handle}
|
||||||
|
{convoState.convo?.muted && (
|
||||||
|
<>
|
||||||
|
{' '}
|
||||||
|
·{' '}
|
||||||
|
<BellStroke
|
||||||
|
size="xs"
|
||||||
|
style={t.atoms.text_contrast_medium}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</Text>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
</Link>
|
||||||
|
|
||||||
{isConvoActive(convoState) && (
|
{isConvoActive(convoState) && (
|
||||||
<ConvoMenu
|
<ConvoMenu
|
||||||
convo={convoState.convo}
|
convo={convoState.convo}
|
||||||
profile={profile}
|
profile={profile}
|
||||||
currentScreen="conversation"
|
currentScreen="conversation"
|
||||||
blockInfo={blockInfo}
|
blockInfo={blockInfo}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View
|
||||||
|
style={[
|
||||||
|
{
|
||||||
|
paddingLeft: PFP_SIZE + a.gap_md.gap,
|
||||||
|
},
|
||||||
|
]}>
|
||||||
|
<PostAlerts
|
||||||
|
modui={moderation.ui('contentList')}
|
||||||
|
size="large"
|
||||||
|
style={[a.pt_xs]}
|
||||||
/>
|
/>
|
||||||
)}
|
</View>
|
||||||
</>
|
</View>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,7 +64,9 @@ function PostLabel({
|
||||||
<>
|
<>
|
||||||
<Button
|
<Button
|
||||||
label={desc.name}
|
label={desc.name}
|
||||||
onPress={() => {
|
onPress={e => {
|
||||||
|
e.preventDefault()
|
||||||
|
e.stopPropagation()
|
||||||
control.open()
|
control.open()
|
||||||
}}>
|
}}>
|
||||||
{({hovered, pressed}) => (
|
{({hovered, pressed}) => (
|
||||||
|
|
|
@ -23,6 +23,7 @@ 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'
|
||||||
import {useMenuControl} from '#/components/Menu'
|
import {useMenuControl} from '#/components/Menu'
|
||||||
|
import {PostAlerts} from '#/components/moderation/PostAlerts'
|
||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
|
|
||||||
export let ChatListItem = ({
|
export let ChatListItem = ({
|
||||||
|
@ -264,6 +265,12 @@ function ChatListItemReady({
|
||||||
]}>
|
]}>
|
||||||
{lastMessage}
|
{lastMessage}
|
||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
|
<PostAlerts
|
||||||
|
modui={moderation.ui('contentList')}
|
||||||
|
size="large"
|
||||||
|
style={[a.pt_xs]}
|
||||||
|
/>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
{convo.unreadCount > 0 && (
|
{convo.unreadCount > 0 && (
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue