From 85ef837ec6915d8184391c0daa14115519534d46 Mon Sep 17 00:00:00 2001 From: Arjun Patel Date: Wed, 9 Feb 2022 22:41:36 -0800 Subject: [PATCH] fix undefined and other build errors --- .../Conversations/ConversationFullRow.tsx | 30 +++++++++++-------- .../components/Layouts/DynamicMeLayout.tsx | 21 ------------- 2 files changed, 17 insertions(+), 34 deletions(-) delete mode 100644 packages/web/components/Layouts/DynamicMeLayout.tsx diff --git a/packages/web/components/Conversations/ConversationFullRow.tsx b/packages/web/components/Conversations/ConversationFullRow.tsx index 1125649..4a035d5 100644 --- a/packages/web/components/Conversations/ConversationFullRow.tsx +++ b/packages/web/components/Conversations/ConversationFullRow.tsx @@ -28,8 +28,8 @@ import { Routes } from "@nirvana/common/helpers/routes"; export default function ConversationFullRow(props: { conversation: Conversation; - handleJoinLive: (conversationId: string) => Promise; - handleLeaveLive: (conversationId: string) => Promise; + handleJoinLive?: (conversationId: string) => Promise; + handleLeaveLive?: (conversationId: string) => Promise; }) { const { currUser } = useAuth(); const usersConvosMap = useRecoilValue(allUsersConversationsAtom); @@ -128,17 +128,21 @@ export default function ConversationFullRow(props: { className="ml-2 flex flex-row items-center group-hover:visible invisible text-slate-400" > - - { - e.stopPropagation(); - props.handleJoinLive(props.conversation.id); - }} - className="p-2 rounded-full hover:cursor-pointer hover:bg-slate-200" - > - - - + {props.handleJoinLive && ( + + { + e.stopPropagation(); + if (props.handleJoinLive) { + props.handleJoinLive(props.conversation.id); + } + }} + className="p-2 rounded-full hover:cursor-pointer hover:bg-slate-200" + > + + + + )} -
- -
- - -
- {page} -
-
- - ); -}