mirror of https://github.com/waku-org/js-waku.git
Add network info in toolbar
This commit is contained in:
parent
53412e2fb4
commit
5c790a41c9
|
@ -160,6 +160,7 @@ export default function App() {
|
|||
nick={nick}
|
||||
newMessages={newMessages}
|
||||
archivedMessages={archivedMessages}
|
||||
fleetEnv={fleetEnv}
|
||||
commandHandler={(input: string) => {
|
||||
const { command, response } = handleCommand(
|
||||
input,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { ChatMessage, WakuMessage } from 'js-waku';
|
||||
import { ChatMessage, Environment, WakuMessage } from 'js-waku';
|
||||
import { ChatContentTopic } from './App';
|
||||
import ChatList from './ChatList';
|
||||
import MessageInput from './MessageInput';
|
||||
|
@ -11,17 +11,28 @@ interface Props {
|
|||
archivedMessages: Message[];
|
||||
commandHandler: (cmd: string) => void;
|
||||
nick: string;
|
||||
fleetEnv: Environment;
|
||||
}
|
||||
|
||||
export default function Room(props: Props) {
|
||||
const { waku } = useWaku();
|
||||
|
||||
let relayPeers = 0;
|
||||
let storePeers = 0;
|
||||
if (waku) {
|
||||
relayPeers = waku.relay.getPeers().size;
|
||||
storePeers = waku.store.peers.length;
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
className="chat-container"
|
||||
style={{ height: '98vh', display: 'flex', flexDirection: 'column' }}
|
||||
>
|
||||
<TitleBar title="Waku v2 chat app" />
|
||||
<TitleBar
|
||||
leftIcons={`Peers: ${relayPeers} relay, ${storePeers} store. Fleet: ${props.fleetEnv}`}
|
||||
title="Waku v2 chat app"
|
||||
/>
|
||||
<ChatList
|
||||
newMessages={props.newMessages}
|
||||
archivedMessages={props.archivedMessages}
|
||||
|
|
Loading…
Reference in New Issue