From 69f8eaf5f4ab0bd68d9af9f94408502af1a8f0f0 Mon Sep 17 00:00:00 2001 From: HoonBaek Date: Thu, 1 Jun 2023 18:04:45 +0900 Subject: [PATCH 1/2] Notice disabled message input becaused of muted state --- .../components/OpenChannelInput/index.tsx | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/modules/OpenChannel/components/OpenChannelInput/index.tsx b/src/modules/OpenChannel/components/OpenChannelInput/index.tsx index 036e879a1..a1a25beba 100644 --- a/src/modules/OpenChannel/components/OpenChannelInput/index.tsx +++ b/src/modules/OpenChannel/components/OpenChannelInput/index.tsx @@ -7,22 +7,33 @@ export type MessageInputWrapperProps = { value?: string; }; -const MessageInputWrapper = (props: MessageInputWrapperProps, ref: React.RefObject): JSX.Element => { +const MessageInputWrapper = (props: MessageInputWrapperProps, ref: React.RefObject): React.ReactNode => { const { currentOpenChannel, disabled, handleSendMessage, handleFileUpload, + amIMuted, } = useOpenChannelContext(); const channel = currentOpenChannel; if (!channel) { - return; + return null; } const { stringSet } = useContext(LocalizationContext); const { value } = props; + function getPlaceHolderString() { + if (amIMuted) { + return stringSet.MESSAGE_INPUT__PLACE_HOLDER__MUTED; + } + if (disabled) { + return stringSet.MESSAGE_INPUT__PLACE_HOLDER__DISABLED; + } + return ''; + } + return (
); From a7a12610ac5febc26bbe0c93888f7826f35d0eb9 Mon Sep 17 00:00:00 2001 From: HoonBaek Date: Fri, 2 Jun 2023 10:57:37 +0900 Subject: [PATCH 2/2] Replace return to the bottom of component --- .../OpenChannel/components/OpenChannelInput/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/OpenChannel/components/OpenChannelInput/index.tsx b/src/modules/OpenChannel/components/OpenChannelInput/index.tsx index a1a25beba..e374f6d24 100644 --- a/src/modules/OpenChannel/components/OpenChannelInput/index.tsx +++ b/src/modules/OpenChannel/components/OpenChannelInput/index.tsx @@ -17,9 +17,6 @@ const MessageInputWrapper = (props: MessageInputWrapperProps, ref: React.RefObje } = useOpenChannelContext(); const channel = currentOpenChannel; - if (!channel) { - return null; - } const { stringSet } = useContext(LocalizationContext); const { value } = props; @@ -34,6 +31,9 @@ const MessageInputWrapper = (props: MessageInputWrapperProps, ref: React.RefObje return ''; } + if (!channel) { + return null; + } return (