diff --git a/packages/react-chat-example/src/index.tsx b/packages/react-chat-example/src/index.tsx index b63fd3b4..142d1c9d 100644 --- a/packages/react-chat-example/src/index.tsx +++ b/packages/react-chat-example/src/index.tsx @@ -1,4 +1,8 @@ -import { darkTheme, lightTheme, ReactChat } from "@waku/react-chat-sdk"; +import { + DappConnectCommunityChat, + darkTheme, + lightTheme, +} from "@waku/react-chat-sdk"; import React, { useRef, useState } from "react"; import ReactDOM from "react-dom"; import styled from "styled-components"; @@ -73,10 +77,10 @@ function DragDiv() { }} /> - (narrow ? "narrow" : ""), [narrow]); @@ -106,11 +106,11 @@ export function ChatBody({ } }, [narrow]); - if (messenger && communityData && activeChannel) { + if (!loadingMessenger && activeChannel) { return ( - {editGroup && communityData ? ( + {editGroup ? ( - {messenger && communityData ? ( + {!loadingMessenger ? ( <> {narrow && ( @@ -110,7 +110,7 @@ export function ChatTopbar({ {!narrow && } - {!messenger && !communityData && } + {loadingMessenger && } {showChannelMenu && ( - + diff --git a/packages/react-chat/src/components/ReactChat.tsx b/packages/react-chat/src/components/DappConnectCommunityChat.tsx similarity index 87% rename from packages/react-chat/src/components/ReactChat.tsx rename to packages/react-chat/src/components/DappConnectCommunityChat.tsx index 2cac6e07..ec648ca1 100644 --- a/packages/react-chat/src/components/ReactChat.tsx +++ b/packages/react-chat/src/components/DappConnectCommunityChat.tsx @@ -16,13 +16,19 @@ import { Theme } from "../styles/themes"; import { ChatLoader } from "./ChatLoader"; -interface ReactChatProps { +interface DappConnectCommunityChatProps { theme: Theme; + communityKey: string; config: ConfigType; fetchMetadata?: (url: string) => Promise; } -export function ReactChat({ theme, config, fetchMetadata }: ReactChatProps) { +export function DappConnectCommunityChat({ + theme, + config, + fetchMetadata, + communityKey, +}: DappConnectCommunityChatProps) { const ref = useRef(null); return ( @@ -35,7 +41,7 @@ export function ReactChat({ theme, config, fetchMetadata }: ReactChatProps) { - +