change chatlistitem splitview version to only change in left panel
This commit is contained in:
@@ -122,7 +122,7 @@ function DirectChatItem({
|
|||||||
}) {
|
}) {
|
||||||
const {t: l} = useLingui()
|
const {t: l} = useLingui()
|
||||||
const profile = useProfileShadow(convo.primaryMember)
|
const profile = useProfileShadow(convo.primaryMember)
|
||||||
const {isWithinSplitView} = useIsWithinSplitView()
|
const {isWithinLeftPanel} = useIsWithinSplitView()
|
||||||
|
|
||||||
const moderation = useMemo(
|
const moderation = useMemo(
|
||||||
() => moderateProfile(profile, moderationOpts),
|
() => moderateProfile(profile, moderationOpts),
|
||||||
@@ -140,7 +140,7 @@ function DirectChatItem({
|
|||||||
avatar={
|
avatar={
|
||||||
<PreviewableUserAvatar
|
<PreviewableUserAvatar
|
||||||
profile={profile}
|
profile={profile}
|
||||||
size={isWithinSplitView ? 48 : 52}
|
size={isWithinLeftPanel ? 48 : 52}
|
||||||
moderation={moderation.ui('avatar')}
|
moderation={moderation.ui('avatar')}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
@@ -161,7 +161,7 @@ function DirectChatItem({
|
|||||||
isBlockedAccount={moderation.blocked}
|
isBlockedAccount={moderation.blocked}
|
||||||
showProfileBadges
|
showProfileBadges
|
||||||
postAlerts={
|
postAlerts={
|
||||||
isWithinSplitView ? null : (
|
isWithinLeftPanel ? null : (
|
||||||
<PostAlerts
|
<PostAlerts
|
||||||
modui={moderation.ui('contentList')}
|
modui={moderation.ui('contentList')}
|
||||||
size="sm"
|
size="sm"
|
||||||
@@ -189,7 +189,7 @@ function GroupChatItem({
|
|||||||
}) {
|
}) {
|
||||||
const {t: l} = useLingui()
|
const {t: l} = useLingui()
|
||||||
const groupOwner = useMaybeProfileShadow(convo.primaryMember)
|
const groupOwner = useMaybeProfileShadow(convo.primaryMember)
|
||||||
const {isWithinSplitView} = useIsWithinSplitView()
|
const {isWithinLeftPanel} = useIsWithinSplitView()
|
||||||
|
|
||||||
const moderation = useMemo(
|
const moderation = useMemo(
|
||||||
() =>
|
() =>
|
||||||
@@ -205,7 +205,7 @@ function GroupChatItem({
|
|||||||
avatar={
|
avatar={
|
||||||
<AvatarBubbles
|
<AvatarBubbles
|
||||||
profiles={convo.members}
|
profiles={convo.members}
|
||||||
size={isWithinSplitView ? 48 : 52}
|
size={isWithinLeftPanel ? 48 : 52}
|
||||||
moderationOpts={moderationOpts}
|
moderationOpts={moderationOpts}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
@@ -278,7 +278,7 @@ function BaseChatItem({
|
|||||||
const leaveConvoControl = useDialogControl()
|
const leaveConvoControl = useDialogControl()
|
||||||
const {mutate: markAsRead} = useMarkAsReadMutation()
|
const {mutate: markAsRead} = useMarkAsReadMutation()
|
||||||
const {gtMobile} = useBreakpoints()
|
const {gtMobile} = useBreakpoints()
|
||||||
const {isWithinSplitView} = useIsWithinSplitView()
|
const {isWithinLeftPanel} = useIsWithinSplitView()
|
||||||
|
|
||||||
const playHaptic = useHaptics()
|
const playHaptic = useHaptics()
|
||||||
const queryClient = useQueryClient()
|
const queryClient = useQueryClient()
|
||||||
@@ -458,7 +458,7 @@ function BaseChatItem({
|
|||||||
leftFirst: deleteAction,
|
leftFirst: deleteAction,
|
||||||
}
|
}
|
||||||
|
|
||||||
const avatarSize = isWithinSplitView ? 48 : 52
|
const avatarSize = isWithinLeftPanel ? 48 : 52
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ChatListItemPortal.Provider>
|
<ChatListItemPortal.Provider>
|
||||||
@@ -469,7 +469,7 @@ function BaseChatItem({
|
|||||||
// @ts-expect-error web only
|
// @ts-expect-error web only
|
||||||
onFocus={onFocus}
|
onFocus={onFocus}
|
||||||
onBlur={onMouseLeave}
|
onBlur={onMouseLeave}
|
||||||
style={[a.relative, t.atoms.bg, isWithinSplitView && a.mx_sm]}>
|
style={[a.relative, t.atoms.bg, isWithinLeftPanel && a.mx_sm]}>
|
||||||
<View
|
<View
|
||||||
style={[
|
style={[
|
||||||
a.z_10,
|
a.z_10,
|
||||||
@@ -512,7 +512,7 @@ function BaseChatItem({
|
|||||||
a.px_lg,
|
a.px_lg,
|
||||||
a.py_md,
|
a.py_md,
|
||||||
a.gap_md,
|
a.gap_md,
|
||||||
isWithinSplitView && a.rounded_sm,
|
isWithinLeftPanel && a.rounded_sm,
|
||||||
{
|
{
|
||||||
backgroundColor: hasUnread
|
backgroundColor: hasUnread
|
||||||
? t.palette.primary_25
|
? t.palette.primary_25
|
||||||
|
|||||||
Reference in New Issue
Block a user