From d2ed985f2a44d599c0ca50d923ffa27f8da81ecd Mon Sep 17 00:00:00 2001 From: Ian Philips Date: Wed, 3 Aug 2022 15:00:14 -0600 Subject: [PATCH] Show chat on help/welcome/updates/features groups --- web/components/groups/group-chat.tsx | 19 +++++++++++++++---- web/pages/group/[...slugs]/index.tsx | 2 +- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/web/components/groups/group-chat.tsx b/web/components/groups/group-chat.tsx index 5eedd79a..5f36e3b7 100644 --- a/web/components/groups/group-chat.tsx +++ b/web/components/groups/group-chat.tsx @@ -189,13 +189,24 @@ export function GroupChatInBubble(props: { const router = useRouter() useEffect(() => { - if (router.asPath.includes('/chat')) { + const groupsWithChatEmphasis = [ + 'welcome', + 'bugs', + 'manifold-features-25bad7c7792e', + 'updates', + ] + if ( + router.asPath.includes('/chat') || + groupsWithChatEmphasis.includes( + router.asPath.split('/group/')[1].split('/')[0] + ) + ) { setShouldShowChat(true) } // Leave chat open between groups if user is using chat? - // else { - // setShouldShowChat(false) - // } + else { + setShouldShowChat(false) + } }, [router.asPath]) return ( diff --git a/web/pages/group/[...slugs]/index.tsx b/web/pages/group/[...slugs]/index.tsx index acee69ad..642a2afd 100644 --- a/web/pages/group/[...slugs]/index.tsx +++ b/web/pages/group/[...slugs]/index.tsx @@ -30,7 +30,7 @@ import { fromPropz, usePropz } from 'web/hooks/use-propz' import { Tabs } from 'web/components/layout/tabs' import { CreateQuestionButton } from 'web/components/create-question-button' import React, { useState } from 'react' -import { GroupChat, GroupChatInBubble } from 'web/components/groups/group-chat' +import { GroupChatInBubble } from 'web/components/groups/group-chat' import { LoadingIndicator } from 'web/components/loading-indicator' import { Modal } from 'web/components/layout/modal' import { getSavedSort } from 'web/hooks/use-sort-and-query-params'