diff --git a/web/components/groups/group-chat.tsx b/web/components/groups/group-chat.tsx index 4a7e9e90..c98f1af1 100644 --- a/web/components/groups/group-chat.tsx +++ b/web/components/groups/group-chat.tsx @@ -22,6 +22,7 @@ import { CommentTipMap, CommentTips } from 'web/hooks/use-tip-txns' import { Tipper } from 'web/components/tipper' import { sum } from 'lodash' import { formatMoney } from 'common/util/format' +import { useWindowSize } from 'web/hooks/use-window-size' export function GroupChat(props: { messages: Comment[] @@ -101,11 +102,20 @@ export function GroupChat(props: { inputRef?.focus() } + const { width, height } = useWindowSize() + const [containerRef, setContainerRef] = useState(null) + // Subtract bottom bar when it's showing (less than lg screen) + const bottomBarHeight = (width ?? 0) < 1024 ? 58 : 0 + const remainingHeight = + (height ?? window.innerHeight) - + (containerRef?.offsetTop ?? 0) - + bottomBarHeight + return ( - + @@ -138,7 +148,7 @@ export function GroupChat(props: { )} {user && group.memberIds.includes(user.id) && ( -
+
-
+
-
+
diff --git a/web/components/nav/sidebar.tsx b/web/components/nav/sidebar.tsx index 6ab095ef..253a58be 100644 --- a/web/components/nav/sidebar.tsx +++ b/web/components/nav/sidebar.tsx @@ -18,7 +18,7 @@ import { ManifoldLogo } from './manifold-logo' import { MenuButton } from './menu' import { ProfileSummary } from './profile-menu' import NotificationsIcon from 'web/components/notifications-icon' -import React, { useEffect } from 'react' +import React, { useEffect, useState } from 'react' import { IS_PRIVATE_MANIFOLD } from 'common/envs/constants' import { CreateQuestionButton } from 'web/components/create-question-button' import { useMemberGroups } from 'web/hooks/use-group' @@ -29,6 +29,7 @@ import { Spacer } from '../layout/spacer' import { useUnseenPreferredNotifications } from 'web/hooks/use-notifications' import { setNotificationsAsSeen } from 'web/pages/notifications' import { PrivateUser } from 'common/user' +import { useWindowSize } from 'web/hooks/use-window-size' function getNavigation() { return [ @@ -199,7 +200,7 @@ export default function Sidebar(props: { className?: string }) { return (