diff --git a/packages/react-chat/src/components/Chat/ChatBody.tsx b/packages/react-chat/src/components/Chat/ChatBody.tsx index 0ca2ba63..03b05d46 100644 --- a/packages/react-chat/src/components/Chat/ChatBody.tsx +++ b/packages/react-chat/src/components/Chat/ChatBody.tsx @@ -1,6 +1,7 @@ import React, { useCallback, useEffect, useMemo, useState } from "react"; import styled from "styled-components"; +import { useIdentity } from "../../contexts/identityProvider"; import { useMessengerContext } from "../../contexts/messengerProvider"; import { useNarrow } from "../../contexts/narrowProvider"; import { Reply } from "../../hooks/useReply"; @@ -29,7 +30,7 @@ interface ChatBodyProps { export function ChatBody({ onClick, showMembers, permission }: ChatBodyProps) { const { messenger, activeChannel, communityData } = useMessengerContext(); const narrow = useNarrow(); - + const identity = useIdentity(); const [editGroup, setEditGroup] = useState(false); const className = useMemo(() => (narrow ? "narrow" : ""), [narrow]); @@ -78,7 +79,11 @@ export function ChatBody({ onClick, showMembers, permission }: ChatBodyProps) { ) : ( )} - + )} @@ -98,7 +103,7 @@ export function ChatBody({ onClick, showMembers, permission }: ChatBodyProps) { ) : ( <> - + )} diff --git a/packages/react-chat/src/components/Chat/ChatInput.tsx b/packages/react-chat/src/components/Chat/ChatInput.tsx index 63f3d513..689364ea 100644 --- a/packages/react-chat/src/components/Chat/ChatInput.tsx +++ b/packages/react-chat/src/components/Chat/ChatInput.tsx @@ -28,9 +28,10 @@ import { textMediumStyles, textSmallStyles } from "../Text"; interface ChatInputProps { reply: Reply | undefined; setReply: (val: Reply | undefined) => void; + disabled: boolean; } -export function ChatInput({ reply, setReply }: ChatInputProps) { +export function ChatInput({ reply, setReply, disabled }: ChatInputProps) { const { sendMessage, contacts } = useMessengerContext(); const theme = useTheme() as Theme; const [content, setContent] = useState(""); @@ -228,6 +229,7 @@ export function ChatInput({ reply, setReply }: ChatInputProps) { )} { e.stopPropagation(); - setShowEmoji(!showEmoji); + if (!disabled) { + setShowEmoji(!showEmoji); + } }} >