From 31868b255f7be001821e03033b3bdd1070ea28cf Mon Sep 17 00:00:00 2001 From: Hailey Date: Wed, 15 May 2024 09:50:16 -0700 Subject: [PATCH] =?UTF-8?q?[=F0=9F=90=B4]=20Tweak=20list=20on=20mobile=20w?= =?UTF-8?q?eb=20(#3958)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * mobile web tweaks chat screen * revert a change * remove unnecessary prop * Spacing tweaks --------- Co-authored-by: Eric Bailey --- src/components/dms/ActionsWrapper.tsx | 2 +- src/components/dms/MessageMenu.tsx | 1 - .../Messages/Conversation/MessageInput.tsx | 2 +- .../Messages/Conversation/MessagesList.tsx | 5 ++--- src/screens/Messages/Conversation/index.tsx | 22 ++++++++++++++----- 5 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/components/dms/ActionsWrapper.tsx b/src/components/dms/ActionsWrapper.tsx index 9c58b621..3b9a56bd 100644 --- a/src/components/dms/ActionsWrapper.tsx +++ b/src/components/dms/ActionsWrapper.tsx @@ -79,7 +79,7 @@ export function ActionsWrapper({ hitSlop={HITSLOP_10}> {children} - + ) } diff --git a/src/components/dms/MessageMenu.tsx b/src/components/dms/MessageMenu.tsx index 55c3ac21..f4645f28 100644 --- a/src/components/dms/MessageMenu.tsx +++ b/src/components/dms/MessageMenu.tsx @@ -25,7 +25,6 @@ export let MessageMenu = ({ control, triggerOpacity, }: { - hideTrigger?: boolean triggerOpacity?: number message: ChatBskyConvoDefs.MessageView control: Menu.MenuControlProps diff --git a/src/screens/Messages/Conversation/MessageInput.tsx b/src/screens/Messages/Conversation/MessageInput.tsx index d05d6109..2b3ee45d 100644 --- a/src/screens/Messages/Conversation/MessageInput.tsx +++ b/src/screens/Messages/Conversation/MessageInput.tsx @@ -78,7 +78,7 @@ export function MessageInput({ useSaveMessageDraft(message) return ( - + export function MessagesConversationScreen({route}: Props) { const gate = useGate() + const setMinimalShellMode = useSetMinimalShellMode() + const {gtMobile} = useBreakpoints() + const convoId = route.params.conversation const {setCurrentConvoId} = useCurrentConvoId() useFocusEffect( useCallback(() => { setCurrentConvoId(convoId) + + if (isWeb && !gtMobile) { + setMinimalShellMode(true) + } + return () => { setCurrentConvoId(undefined) + setMinimalShellMode(false) } - }, [convoId, setCurrentConvoId]), + }, [convoId, gtMobile, setCurrentConvoId, setMinimalShellMode]), ) if (!gate('dms')) return @@ -67,8 +77,7 @@ function Inner() { const [hasInitiallyRendered, setHasInitiallyRendered] = React.useState(false) const {bottom: bottomInset, top: topInset} = useSafeAreaInsets() - const {gtMobile} = useBreakpoints() - const bottomBarHeight = gtMobile ? 0 : isIOS ? 40 : 60 + const nativeBottomBarHeight = isIOS ? 42 : 60 // HACK: Because we need to scroll to the bottom of the list once initial items are added to the list, we also have // to take into account that scrolling to the end of the list on native will happen asynchronously. This will cause @@ -106,7 +115,10 @@ function Inner() { return (