From d3f073b3d29df83cc288ea6bb4ec0e24e22c87b3 Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Fri, 5 Jun 2026 16:35:06 +0300 Subject: [PATCH] [Chat] Request screen tweaks (#10747) --- src/screens/Messages/Inbox.tsx | 45 ++----------------- .../Messages/components/ChatListItem.tsx | 18 ++++---- 2 files changed, 12 insertions(+), 51 deletions(-) diff --git a/src/screens/Messages/Inbox.tsx b/src/screens/Messages/Inbox.tsx index 55d3b0f4d7..59ca05bdba 100644 --- a/src/screens/Messages/Inbox.tsx +++ b/src/screens/Messages/Inbox.tsx @@ -26,10 +26,9 @@ import {useLeftConvos} from '#/state/queries/messages/leave-conversation' import {useListConvosQuery} from '#/state/queries/messages/list-conversations' import {useUpdateAllRead} from '#/state/queries/messages/update-all-read' import {EmptyState} from '#/view/com/util/EmptyState' -import {FAB} from '#/view/com/util/fab/FAB' import {List} from '#/view/com/util/List' import {ChatListLoadingPlaceholder} from '#/view/com/util/LoadingPlaceholder' -import {atoms as a, useBreakpoints, useTheme, web} from '#/alf' +import {atoms as a, useTheme, web} from '#/alf' import {AgeRestrictedScreen} from '#/components/ageAssurance/AgeRestrictedScreen' import {useAgeAssuranceCopy} from '#/components/ageAssurance/useAgeAssuranceCopy' import {Button, ButtonIcon, ButtonText} from '#/components/Button' @@ -62,8 +61,6 @@ export function MessagesInboxScreen(props: Props) { } export function MessagesInboxScreenInner({}: Props) { - const {gtTablet} = useBreakpoints() - const listConvosQuery = useListConvosQuery({status: 'request'}) const {data} = listConvosQuery @@ -94,21 +91,16 @@ export function MessagesInboxScreenInner({}: Props) { - + Chat requests - {hasUnreadConvos && gtTablet ? ( - - ) : ( - - )} + {hasUnreadConvos ? : } ) @@ -117,14 +109,12 @@ export function MessagesInboxScreenInner({}: Props) { function RequestList({ listConvosQuery, conversations, - hasUnreadConvos, }: { listConvosQuery: UseInfiniteQueryResult< InfiniteData, Error > conversations: ChatBskyConvoDefs.ConvoView[] - hasUnreadConvos: boolean }) { const {t: l} = useLingui() const t = useTheme() @@ -285,7 +275,6 @@ function RequestList({ desktopFixedHeight sideBorders={false} /> - {hasUnreadConvos && } ) } @@ -298,34 +287,6 @@ function renderItem({item}: {item: ChatBskyConvoDefs.ConvoView}) { return } -function MarkAllReadFAB() { - const {t: l} = useLingui() - const t = useTheme() - const {mutate: markAllRead} = useUpdateAllRead('request', { - onMutate: () => { - Toast.show(l`Marked all as read`, { - type: 'success', - }) - }, - onError: () => { - Toast.show(l`Failed to mark all requests as read`, { - type: 'error', - }) - }, - }) - - return ( - markAllRead()} - icon={} - accessibilityRole="button" - accessibilityLabel={l`Mark all as read`} - accessibilityHint="" - /> - ) -} - function MarkAsReadHeaderButton() { const {t: l} = useLingui() const {mutate: markAllRead} = useUpdateAllRead('request', { diff --git a/src/screens/Messages/components/ChatListItem.tsx b/src/screens/Messages/components/ChatListItem.tsx index e8c0b9cc68..142ca4a971 100644 --- a/src/screens/Messages/components/ChatListItem.tsx +++ b/src/screens/Messages/components/ChatListItem.tsx @@ -122,7 +122,7 @@ function DirectChatItem({ }) { const {t: l} = useLingui() const profile = useProfileShadow(convo.primaryMember) - const {isWithinSplitView} = useIsWithinSplitView() + const {isWithinLeftPanel} = useIsWithinSplitView() const moderation = useMemo( () => moderateProfile(profile, moderationOpts), @@ -140,7 +140,7 @@ function DirectChatItem({ avatar={ } @@ -161,7 +161,7 @@ function DirectChatItem({ isBlockedAccount={moderation.blocked} showProfileBadges postAlerts={ - isWithinSplitView ? null : ( + isWithinLeftPanel ? null : ( @@ -205,7 +205,7 @@ function GroupChatItem({ avatar={ } @@ -278,7 +278,7 @@ function BaseChatItem({ const leaveConvoControl = useDialogControl() const {mutate: markAsRead} = useMarkAsReadMutation() const {gtMobile} = useBreakpoints() - const {isWithinSplitView} = useIsWithinSplitView() + const {isWithinLeftPanel} = useIsWithinSplitView() const playHaptic = useHaptics() const queryClient = useQueryClient() @@ -458,7 +458,7 @@ function BaseChatItem({ leftFirst: deleteAction, } - const avatarSize = isWithinSplitView ? 48 : 52 + const avatarSize = isWithinLeftPanel ? 48 : 52 return ( @@ -469,7 +469,7 @@ function BaseChatItem({ // @ts-expect-error web only onFocus={onFocus} onBlur={onMouseLeave} - style={[a.relative, t.atoms.bg, isWithinSplitView && a.mx_sm]}> + style={[a.relative, t.atoms.bg, isWithinLeftPanel && a.mx_sm]}>