ChatPage: fix height on mobile (where ThumbNavigation is present)

chats-router
Alex Gleason 2022-09-22 17:38:00 -05:00
rodzic 3c9ffd30b1
commit c8adde735f
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
2 zmienionych plików z 5 dodań i 2 usunięć

Wyświetl plik

@ -21,7 +21,10 @@ const ChatPage = () => {
const { top } = containerRef.current.getBoundingClientRect();
const fullHeight = document.body.offsetHeight;
setHeight(fullHeight - top);
// On mobile, account for bottom navigation.
const offset = document.body.clientWidth < 976 ? -61 : 0;
setHeight(fullHeight - top + offset);
};
useEffect(() => {

Wyświetl plik

@ -3,7 +3,7 @@ import React from 'react';
/** Custom layout for chats on desktop. */
const ChatsPage: React.FC = ({ children }) => {
return (
<div className='md:col-span-12 lg:col-span-9 pb-16 sm:pb-0'>
<div className='md:col-span-12 lg:col-span-9'>
{children}
</div>
);