From 199aa42789cae9654f30bbae46b28293c565886f Mon Sep 17 00:00:00 2001 From: Felicio Mununga Date: Thu, 30 Jun 2022 15:13:39 +0200 Subject: [PATCH] Resolve unsupported UI elements (#289) * fix button ref * comment out unsopported ui elements * hide chat input if no account * comment out avatar dropdown menu --- .../community-info/community-dialog.tsx | 12 +++++++- .../chat/components/chat-input/index.tsx | 18 ++++++------ .../chat/components/chat-message/index.tsx | 28 +++++++++---------- .../routes/chat/components/navbar/index.tsx | 21 ++++++++------ .../status-react/src/routes/chat/index.tsx | 5 ++-- 5 files changed, 49 insertions(+), 35 deletions(-) diff --git a/packages/status-react/src/components/main-sidebar/components/community-info/community-dialog.tsx b/packages/status-react/src/components/main-sidebar/components/community-info/community-dialog.tsx index da312ace..078f9f3c 100644 --- a/packages/status-react/src/components/main-sidebar/components/community-info/community-dialog.tsx +++ b/packages/status-react/src/components/main-sidebar/components/community-info/community-dialog.tsx @@ -56,7 +56,17 @@ export const CommunityDialog = () => { fill="currentColor" /> - + diff --git a/packages/status-react/src/routes/chat/components/chat-input/index.tsx b/packages/status-react/src/routes/chat/components/chat-input/index.tsx index 92bcd7d7..48f79491 100644 --- a/packages/status-react/src/routes/chat/components/chat-input/index.tsx +++ b/packages/status-react/src/routes/chat/components/chat-input/index.tsx @@ -1,13 +1,13 @@ import React, { useEffect, useRef, useState } from 'react' import { useChatContext } from '~/src/contexts/chat-context' -import { EmojiIcon } from '~/src/icons/emoji-icon' -import { GifIcon } from '~/src/icons/gif-icon' -import { ImageIcon } from '~/src/icons/image-icon' -import { StickerIcon } from '~/src/icons/sticker-icon' +// import { EmojiIcon } from '~/src/icons/emoji-icon' +// import { GifIcon } from '~/src/icons/gif-icon' +// import { ImageIcon } from '~/src/icons/image-icon' +// import { StickerIcon } from '~/src/icons/sticker-icon' import { styled } from '~/src/styles/config' -import { Box, Flex, IconButton } from '~/src/system' +// import { Box, Flex, IconButton } from '~/src/system' import { InputReply } from './input-reply' interface Props { @@ -47,11 +47,11 @@ export const ChatInput = (props: Props) => { return ( - + {/* - + */} {state.message && ( @@ -64,7 +64,7 @@ export const ChatInput = (props: Props) => { onChange={handleChange} onKeyDown={handleKeyDown} /> - + {/* @@ -74,7 +74,7 @@ export const ChatInput = (props: Props) => { - + */} diff --git a/packages/status-react/src/routes/chat/components/chat-message/index.tsx b/packages/status-react/src/routes/chat/components/chat-message/index.tsx index d0a87438..c05fbe5a 100644 --- a/packages/status-react/src/routes/chat/components/chat-message/index.tsx +++ b/packages/status-react/src/routes/chat/components/chat-message/index.tsx @@ -4,7 +4,7 @@ import { useMatch } from 'react-router-dom' import { UserProfileDialog } from '~/src/components/user-profile-dialog' import { useChatContext } from '~/src/contexts/chat-context' -import { BellIcon } from '~/src/icons/bell-icon' +// import { BellIcon } from '~/src/icons/bell-icon' // import { PinIcon } from '~/src/icons/pin-icon' import { useProtocol } from '~/src/protocol' import { styled } from '~/src/styles/config' @@ -14,9 +14,9 @@ import { Button, ContextMenu, ContextMenuTrigger, - DropdownMenu, - DropdownMenuTrigger, - EmojiHash, + // DropdownMenu, + // DropdownMenuTrigger, + // EmojiHash, Flex, Image, Text, @@ -176,15 +176,15 @@ export const ChatMessage = (props: Props) => { {responseTo && } - - - + {/* + */} + {/* {member.username} @@ -211,7 +211,7 @@ export const ChatMessage = (props: Props) => { Mark as Untrustworthy - + */} diff --git a/packages/status-react/src/routes/chat/components/navbar/index.tsx b/packages/status-react/src/routes/chat/components/navbar/index.tsx index ae53eb25..7b45d6d3 100644 --- a/packages/status-react/src/routes/chat/components/navbar/index.tsx +++ b/packages/status-react/src/routes/chat/components/navbar/index.tsx @@ -2,14 +2,17 @@ import React from 'react' import { useMatch } from 'react-router-dom' -import { ChatMenu } from '~/src/components/chat-menu' +// import { ChatMenu } from '~/src/components/chat-menu' import { useAppState } from '~/src/contexts/app-context' -import { BellIcon } from '~/src/icons/bell-icon' -import { DotsIcon } from '~/src/icons/dots-icon' +// import { BellIcon } from '~/src/icons/bell-icon' +// import { DotsIcon } from '~/src/icons/dots-icon' import { GroupIcon } from '~/src/icons/group-icon' import { useChat } from '~/src/protocol' import { styled } from '~/src/styles/config' -import { DropdownMenuTrigger, Flex, IconButton, Separator } from '~/src/system' +import { + /*DropdownMenuTrigger,*/ Flex, + IconButton /*,Separator*/, +} from '~/src/system' import { ChatInfo } from '../chat-info' @@ -40,18 +43,18 @@ export const Navbar = (props: Props) => { )} - + {/* - + */} - + {/* */} - + {/* - + */} ) diff --git a/packages/status-react/src/routes/chat/index.tsx b/packages/status-react/src/routes/chat/index.tsx index c68ac9b6..f0d93d75 100644 --- a/packages/status-react/src/routes/chat/index.tsx +++ b/packages/status-react/src/routes/chat/index.tsx @@ -7,7 +7,7 @@ import { useMatch } from 'react-router-dom' import { MemberSidebar } from '~/src/components/member-sidebar' import { useAppState } from '~/src/contexts/app-context' import { ChatProvider, useChatContext } from '~/src/contexts/chat-context' -import { useChat, useMessages, useProtocol } from '~/src/protocol' +import { useAccount, useChat, useMessages, useProtocol } from '~/src/protocol' import { styled } from '~/src/styles/config' import { Avatar, Flex, Heading, Text } from '~/src/system' @@ -38,6 +38,7 @@ const ChatStart = (props: ChatStartProps) => { const Body = () => { const { client } = useProtocol() const { state } = useChatContext() + const { account } = useAccount() const { params } = useMatch(':id')! // eslint-disable-line @typescript-eslint/no-non-null-assertion const chatId = params.id! @@ -63,7 +64,7 @@ const Body = () => { ))} - + {account && } ) }