diff --git a/functions/src/create-user.ts b/functions/src/create-user.ts index 216a7eb4..fe8b7d77 100644 --- a/functions/src/create-user.ts +++ b/functions/src/create-user.ts @@ -144,24 +144,5 @@ const addUserToDefaultGroups = async (user: User) => { .update({ memberIds: uniq(group.memberIds.concat(user.id)), }) - const manifoldAccount = isProd() - ? HOUSE_LIQUIDITY_PROVIDER_ID - : DEV_HOUSE_LIQUIDITY_PROVIDER_ID - - if (slug === 'welcome') { - const welcomeCommentDoc = firestore - .collection(`groups/${group.id}/comments`) - .doc() - await welcomeCommentDoc.create({ - id: welcomeCommentDoc.id, - groupId: group.id, - userId: manifoldAccount, - text: `Welcome, @${user.username} aka ${user.name}!`, - createdTime: Date.now(), - userName: 'Manifold Markets', - userUsername: MANIFOLD_USERNAME, - userAvatarUrl: MANIFOLD_AVATAR_URL, - }) - } } } diff --git a/web/components/nav/sidebar.tsx b/web/components/nav/sidebar.tsx index 056ab78a..e982cb0e 100644 --- a/web/components/nav/sidebar.tsx +++ b/web/components/nav/sidebar.tsx @@ -18,15 +18,14 @@ 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, { 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' import { groupPath } from 'web/lib/firebase/groups' import { trackCallback, withTracking } from 'web/lib/service/analytics' -import { Group, GROUP_CHAT_SLUG } from 'common/group' +import { Group } 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' @@ -313,29 +312,29 @@ function GroupsList(props: { memberItems: Item[] privateUser: PrivateUser }) { - const { currentPage, memberItems, privateUser } = props - const preferredNotifications = useUnseenPreferredNotifications( - privateUser, - { - customHref: '/group/', - }, - memberItems.length > 0 ? memberItems.length : undefined - ) + const { currentPage, memberItems } = props const { height } = useWindowSize() const [containerRef, setContainerRef] = useState(null) const remainingHeight = (height ?? 0) - (containerRef?.offsetTop ?? 0) - const notifIsForThisItem = useMemo( - () => (itemHref: string) => - preferredNotifications.some( - (n) => - !n.isSeen && - (n.isSeenOnHref === itemHref || - n.isSeenOnHref?.replace('/chat', '') === itemHref) - ), - [preferredNotifications] - ) + // const preferredNotifications = useUnseenPreferredNotifications( + // privateUser, + // { + // customHref: '/group/', + // }, + // memberItems.length > 0 ? memberItems.length : undefined + // ) + // const notifIsForThisItem = useMemo( + // () => (itemHref: string) => + // preferredNotifications.some( + // (n) => + // !n.isSeen && + // (n.isSeenOnHref === itemHref || + // n.isSeenOnHref?.replace('/chat', '') === itemHref) + // ), + // [preferredNotifications] + // ) return ( <> @@ -351,16 +350,12 @@ function GroupsList(props: { > {memberItems.map((item) => ( {item.name} diff --git a/web/pages/group/[...slugs]/index.tsx b/web/pages/group/[...slugs]/index.tsx index 8926d0ab..6ce3e7c3 100644 --- a/web/pages/group/[...slugs]/index.tsx +++ b/web/pages/group/[...slugs]/index.tsx @@ -33,11 +33,9 @@ import { LoadingIndicator } from 'web/components/loading-indicator' import { Modal } from 'web/components/layout/modal' import { ChoicesToggleGroup } from 'web/components/choices-toggle-group' import { toast } from 'react-hot-toast' -import { useCommentsOnGroup } from 'web/hooks/use-comments' import { ContractSearch } from 'web/components/contract-search' import { FollowList } from 'web/components/follow-list' import { SearchIcon } from '@heroicons/react/outline' -import { useTipTxns } from 'web/hooks/use-tip-txns' import { JoinOrLeaveGroupButton } from 'web/components/groups/groups-button' import { searchInAny } from 'common/util/parse' import { CopyLinkButton } from 'web/components/copy-link-button' @@ -46,7 +44,6 @@ import { useSaveReferral } from 'web/hooks/use-save-referral' import { Button } from 'web/components/button' import { listAllCommentsOnGroup } from 'web/lib/firebase/comments' import { GroupComment } from 'common/comment' -import { GroupChat } from 'web/components/groups/group-chat' import { REFERRAL_AMOUNT } from 'common/economy' export const getStaticProps = fromPropz(getStaticPropz) @@ -149,9 +146,6 @@ export default function GroupPage(props: { const page = slugs?.[1] as typeof groupSubpages[number] const group = useGroup(props.group?.id) ?? props.group - const tips = useTipTxns({ groupId: group?.id }) - - const messages = useCommentsOnGroup(group?.id) ?? props.messages const user = useUser() @@ -201,21 +195,12 @@ export default function GroupPage(props: { /> ) - const chatTab = ( - - ) - const tabs = [ { title: 'Markets', content: questionsTab, href: groupPath(group.slug, 'markets'), }, - { - title: 'Chat', - content: chatTab, - href: groupPath(group.slug, 'chat'), - }, { title: 'Leaderboards', content: leaderboard,