From c28e741497d7eac47bc2e062efea3de34ee58c7b Mon Sep 17 00:00:00 2001 From: Marshall Polaris Date: Tue, 16 Aug 2022 13:38:39 -0700 Subject: [PATCH] Kill weird group rendering height hack --- web/components/nav/sidebar.tsx | 15 +++------------ web/components/page.tsx | 2 +- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/web/components/nav/sidebar.tsx b/web/components/nav/sidebar.tsx index dfb7805e..69bad413 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, { useMemo, useState } from 'react' +import React, { useMemo } 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' @@ -28,7 +28,6 @@ import { Group, GROUP_CHAT_SLUG } from 'common/group' import { Spacer } from '../layout/spacer' import { useUnseenPreferredNotifications } from 'web/hooks/use-notifications' import { PrivateUser } from 'common/user' -import { useWindowSize } from 'web/hooks/use-window-size' import { CHALLENGES_ENABLED } from 'common/challenge' import { buildArray } from 'common/util/array' @@ -278,7 +277,7 @@ export default function Sidebar(props: { className?: string }) { {/* Desktop navigation */} -
+
{navigationOptions.map((item) => ( ))} @@ -315,10 +314,6 @@ function GroupsList(props: { memberItems.length > 0 ? memberItems.length : undefined ) - const { height } = useWindowSize() - const [containerRef, setContainerRef] = useState(null) - const remainingHeight = (height ?? 0) - (containerRef?.offsetTop ?? 0) - const notifIsForThisItem = useMemo( () => (itemHref: string) => preferredNotifications.some( @@ -337,11 +332,7 @@ function GroupsList(props: { currentPage={currentPage} /> -
+
{memberItems.map((item) => ( - +