mirror of
https://github.com/logos-messaging/examples.waku.org.git
synced 2026-01-02 21:03:12 +00:00
rename prop
This commit is contained in:
parent
5ff08636a0
commit
4e586e81f7
@ -11,12 +11,12 @@ import {
|
||||
} from "@livechat/ui-kit";
|
||||
|
||||
interface Props {
|
||||
hasPeers: boolean;
|
||||
hasLightPushPeers: boolean;
|
||||
sendMessage: ((msg: string) => Promise<void>) | undefined;
|
||||
}
|
||||
|
||||
export default function MessageInput(props: Props) {
|
||||
const { hasPeers } = props;
|
||||
const { hasLightPushPeers } = props;
|
||||
const { node } = useWaku<LightNode>();
|
||||
|
||||
const [inputText, setInputText] = useState<string>("");
|
||||
@ -46,12 +46,12 @@ export default function MessageInput(props: Props) {
|
||||
|
||||
// Enable the button if there are peers available or the user is sending a command
|
||||
useEffect(() => {
|
||||
if (inputText.startsWith("/") || hasPeers) {
|
||||
if (inputText.startsWith("/") || hasLightPushPeers) {
|
||||
setActiveButton(true);
|
||||
} else if (node) {
|
||||
setActiveButton(false);
|
||||
}
|
||||
}, [inputText, hasPeers]);
|
||||
}, [inputText, hasLightPushPeers]);
|
||||
|
||||
return (
|
||||
<TextComposer
|
||||
|
||||
@ -59,7 +59,7 @@ export default function Room(props: Props) {
|
||||
title="Waku v2 chat app"
|
||||
/>
|
||||
<ChatList messages={props.messages} />
|
||||
<MessageInput hasPeers={!!lightPushPeers} sendMessage={onSend} />
|
||||
<MessageInput hasLightPushPeers={!!lightPushPeers} sendMessage={onSend} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user