From 180b2be276b51bce8d7cb3ffd46b5d91fc167216 Mon Sep 17 00:00:00 2001
From: Szymon Szlachtowicz <38212223+Szymx95@users.noreply.github.com>
Date: Mon, 31 Jan 2022 09:10:19 +0100
Subject: [PATCH] Add no community chat (#209)
---
.../src/components/Chat/ChatCreation.tsx | 15 +-
.../react-chat/src/components/ChatLoader.tsx | 36 ----
.../components/DappConnectCommunityChat.tsx | 28 +--
.../src/components/Form/IdentityLoader.tsx | 133 -------------
.../src/components/Members/MembersList.tsx | 48 ++---
.../src/contexts/messengerProvider.tsx | 3 +-
.../contexts/userCreationStateProvider.tsx | 29 ---
.../DappConnectGroupChat.tsx | 65 +++++++
.../src/groupChatComponents/GroupChat.tsx | 90 +++++++++
.../GroupChat/GroupChatBody.tsx | 182 ++++++++++++++++++
.../GroupMembers/GroupMembers.tsx | 49 +++++
.../src/hooks/messenger/useGroupChats.ts | 9 +-
.../src/hooks/messenger/useLoadPrevDay.ts | 6 +-
.../src/hooks/messenger/useMessenger.ts | 28 ++-
.../src/hooks/useChatScrollHandle.ts | 6 +-
packages/react-chat/src/index.ts | 10 +-
.../react-group-chat-example/.eslintrc.json | 41 ++++
.../react-group-chat-example/.mocharc.json | 6 +
.../react-group-chat-example/.prettierignore | 2 +
packages/react-group-chat-example/README.md | 1 +
.../react-group-chat-example/package.json | 71 +++++++
.../react-group-chat-example/src/_redirects | 1 +
.../react-group-chat-example/src/index.html | 14 ++
.../react-group-chat-example/src/index.tsx | 139 +++++++++++++
.../react-group-chat-example/tsconfig.json | 47 +++++
.../tsconfig.tsbuildinfo | 1 +
.../webpack.config.js | 88 +++++++++
yarn.lock | 54 ++++++
28 files changed, 949 insertions(+), 253 deletions(-)
delete mode 100644 packages/react-chat/src/components/ChatLoader.tsx
delete mode 100644 packages/react-chat/src/components/Form/IdentityLoader.tsx
delete mode 100644 packages/react-chat/src/contexts/userCreationStateProvider.tsx
create mode 100644 packages/react-chat/src/groupChatComponents/DappConnectGroupChat.tsx
create mode 100644 packages/react-chat/src/groupChatComponents/GroupChat.tsx
create mode 100644 packages/react-chat/src/groupChatComponents/GroupChat/GroupChatBody.tsx
create mode 100644 packages/react-chat/src/groupChatComponents/GroupMembers/GroupMembers.tsx
create mode 100644 packages/react-group-chat-example/.eslintrc.json
create mode 100644 packages/react-group-chat-example/.mocharc.json
create mode 100644 packages/react-group-chat-example/.prettierignore
create mode 100644 packages/react-group-chat-example/README.md
create mode 100644 packages/react-group-chat-example/package.json
create mode 100644 packages/react-group-chat-example/src/_redirects
create mode 100644 packages/react-group-chat-example/src/index.html
create mode 100644 packages/react-group-chat-example/src/index.tsx
create mode 100644 packages/react-group-chat-example/tsconfig.json
create mode 100644 packages/react-group-chat-example/tsconfig.tsbuildinfo
create mode 100644 packages/react-group-chat-example/webpack.config.js
diff --git a/packages/react-chat/src/components/Chat/ChatCreation.tsx b/packages/react-chat/src/components/Chat/ChatCreation.tsx
index e80e16d..5a2bc9a 100644
--- a/packages/react-chat/src/components/Chat/ChatCreation.tsx
+++ b/packages/react-chat/src/components/Chat/ChatCreation.tsx
@@ -103,11 +103,6 @@ export function ChatCreation({
value={query}
onInput={(e) => setQuery(e.currentTarget.value)}
/>
-
)}
{!narrow && styledGroup.length === 5 && (
@@ -132,12 +127,18 @@ export function ChatCreation({
Confirm
{!narrow && }
+
- {!setEditGroup && !query && (
+ {!setEditGroup && (
Contacts
{identity &&
+ !query &&
Object.values(contacts)
.filter(
(e) =>
@@ -181,7 +182,7 @@ const CreationBar = styled.div`
display: flex;
align-items: center;
margin-bottom: 32px;
-
+ position: relative;
&.limit {
align-items: flex-start;
}
diff --git a/packages/react-chat/src/components/ChatLoader.tsx b/packages/react-chat/src/components/ChatLoader.tsx
deleted file mode 100644
index cd1a307..0000000
--- a/packages/react-chat/src/components/ChatLoader.tsx
+++ /dev/null
@@ -1,36 +0,0 @@
-import React from "react";
-
-import { ChatStateProvider } from "../contexts/chatStateProvider";
-import { IdentityProvider } from "../contexts/identityProvider";
-import { MessengerProvider } from "../contexts/messengerProvider";
-import {
- UserCreationState,
- useUserCreationState,
-} from "../contexts/userCreationStateProvider";
-
-import { Chat } from "./Chat";
-import { IdentityLoader } from "./Form/IdentityLoader";
-
-type ChatLoaderProps = {
- communityKey: string;
-};
-
-export function ChatLoader({ communityKey }: ChatLoaderProps) {
- const [userCreationState] = useUserCreationState();
-
- if (userCreationState === UserCreationState.NotCreating)
- return (
-
-
-
-
-
-
-
- );
- if (userCreationState === UserCreationState.Creating) {
- return ;
- }
-
- return null;
-}
diff --git a/packages/react-chat/src/components/DappConnectCommunityChat.tsx b/packages/react-chat/src/components/DappConnectCommunityChat.tsx
index ec648ca..a80bf4e 100644
--- a/packages/react-chat/src/components/DappConnectCommunityChat.tsx
+++ b/packages/react-chat/src/components/DappConnectCommunityChat.tsx
@@ -4,17 +4,19 @@ import styled from "styled-components";
import { ConfigType } from "..";
import { ActivityProvider } from "../contexts/activityProvider";
+import { ChatStateProvider } from "../contexts/chatStateProvider";
import { ConfigProvider } from "../contexts/configProvider";
import { FetchMetadataProvider } from "../contexts/fetchMetadataProvider";
+import { IdentityProvider } from "../contexts/identityProvider";
+import { MessengerProvider } from "../contexts/messengerProvider";
import { ModalProvider } from "../contexts/modalProvider";
import { NarrowProvider } from "../contexts/narrowProvider";
import { ToastProvider } from "../contexts/toastProvider";
-import { UserCreationStateProvider } from "../contexts/userCreationStateProvider";
import { Metadata } from "../models/Metadata";
import { GlobalStyle } from "../styles/GlobalStyle";
import { Theme } from "../styles/themes";
-import { ChatLoader } from "./ChatLoader";
+import { Chat } from "./Chat";
interface DappConnectCommunityChatProps {
theme: Theme;
@@ -37,15 +39,19 @@ export function DappConnectCommunityChat({
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/react-chat/src/components/Form/IdentityLoader.tsx b/packages/react-chat/src/components/Form/IdentityLoader.tsx
deleted file mode 100644
index 71488a8..0000000
--- a/packages/react-chat/src/components/Form/IdentityLoader.tsx
+++ /dev/null
@@ -1,133 +0,0 @@
-import { Identity } from "@waku/status-communities/dist/cjs";
-import React, { useCallback, useEffect, useState } from "react";
-import styled from "styled-components";
-
-import { useSetIdentity } from "../../contexts/identityProvider";
-import {
- UserCreationState,
- useUserCreationState,
-} from "../../contexts/userCreationStateProvider";
-import {
- decryptIdentity,
- loadEncryptedIdentity,
- saveIdentity,
-} from "../../utils";
-
-export function IdentityLoader() {
- const setIdentity = useSetIdentity();
- const [password, setPassword] = useState("");
- const state = useUserCreationState();
-
- const [encryptedIdentity, setEncryptedIdentity] = useState(
- loadEncryptedIdentity() ?? ""
- );
- const [identityInMemory, setIdentityInMemory] = useState(false);
- const [wrongPassword, setWrongPassword] = useState(false);
-
- useEffect(() => {
- if (encryptedIdentity) {
- setIdentityInMemory(true);
- }
- setWrongPassword(false);
- }, [encryptedIdentity]);
-
- const loadIdentity = useCallback(async () => {
- const identity = await decryptIdentity(encryptedIdentity, password);
- if (!identity) {
- setWrongPassword(true);
- } else {
- setIdentity(identity);
- state[1](UserCreationState.NotCreating);
- }
- }, [encryptedIdentity, password]);
-
- const createIdentity = useCallback(async () => {
- const identity = Identity.generate();
- await saveIdentity(identity, password);
- setIdentity(identity);
- state[1](UserCreationState.NotCreating);
- }, [encryptedIdentity, password]);
-
- return (
-
- {encryptedIdentity ? (
-
- Please provide password for your identity
- {wrongPassword && Wrong password
}
- setPassword(e.target.value)}
- onKeyPress={(e) => {
- if (e.key === "Enter") {
- loadIdentity();
- }
- }}
- />
-
-
-
- ) : (
-
- Please provide password for your identity
- setPassword(e.target.value)}
- onKeyPress={(e) => {
- if (e.key === "Enter") {
- createIdentity();
- }
- }}
- />
-
- {identityInMemory && (
-
- )}
-
- )}
-
- );
-}
-
-const Input = styled.input`
- border-radius: 5px;
- padding: 5px;
- margin: 5px;
-`;
-
-const Button = styled.button`
- padding: 5px;
- margin: 5px;
- box-shadow: 5px 5px 10px -4px rgba(197, 197, 255, 1);
- border-radius: 5px;
- background-color: ${({ theme }) => theme.buttonBg};
-`;
-
-const Wrapper = styled.div`
- height: 100%;
- width: 100%;
- display: flex;
-`;
-
-const FormWrappers = styled.div`
- margin: auto;
-`;
-
-const InfoDiv = styled.div`
- margin: 5px;
- font-weight: 500;
- font-size: 16px;
-`;
diff --git a/packages/react-chat/src/components/Members/MembersList.tsx b/packages/react-chat/src/components/Members/MembersList.tsx
index bb82099..567f761 100644
--- a/packages/react-chat/src/components/Members/MembersList.tsx
+++ b/packages/react-chat/src/components/Members/MembersList.tsx
@@ -1,4 +1,3 @@
-import { utils } from "@waku/status-communities/dist/cjs";
import { bufToHex } from "@waku/status-communities/dist/cjs/utils";
import React, { useMemo } from "react";
import styled from "styled-components";
@@ -6,6 +5,7 @@ import styled from "styled-components";
import { useIdentity } from "../../contexts/identityProvider";
import { useMessengerContext } from "../../contexts/messengerProvider";
import { useModal } from "../../contexts/modalProvider";
+import { Contact } from "../../models/Contact";
import { buttonStyles } from "../Buttons/buttonStyle";
import { LogoutIcon } from "../Icons/LogoutIcon";
import { LogoutModalName } from "../Modals/LogoutModal";
@@ -15,30 +15,32 @@ import { Member } from "./Member";
export function MembersList() {
const { contacts, nickname, activeChannel } = useMessengerContext();
const identity = useIdentity();
+ const userPK = useMemo(
+ () => (identity ? bufToHex(identity?.publicKey) : undefined),
+ [identity]
+ );
const { setModal } = useModal(LogoutModalName);
- const userContacts = useMemo(() => {
+ const members = useMemo(() => {
+ const contactsArray = Object.values(contacts);
if (identity) {
- return Object.values(contacts).filter(
- (e) => e.id != bufToHex(identity.publicKey)
- );
- } else {
- return Object.values(contacts);
+ if (
+ activeChannel &&
+ activeChannel.type === "group" &&
+ activeChannel.members
+ ) {
+ const returnContacts: Contact[] = [];
+ activeChannel.members.forEach((member) => {
+ if (contacts[member.id] && member.id != userPK) {
+ returnContacts.push(contacts[member.id]);
+ }
+ });
+ return returnContacts;
+ }
+ return contactsArray.filter((e) => e.id !== userPK);
}
- }, [contacts, identity]);
-
- const members = useMemo(
- () =>
- activeChannel &&
- activeChannel?.type === "group" &&
- activeChannel.members &&
- identity
- ? activeChannel.members.filter(
- (e) => e.id !== utils.bufToHex(identity.publicKey)
- )
- : userContacts,
- [activeChannel]
- );
+ return contactsArray;
+ }, [activeChannel, contacts, identity, userPK]);
const onlineContacts = useMemo(
() => members.filter((e) => e.online),
@@ -57,9 +59,9 @@ export function MembersList() {
diff --git a/packages/react-chat/src/contexts/messengerProvider.tsx b/packages/react-chat/src/contexts/messengerProvider.tsx
index cd632f2..2434527 100644
--- a/packages/react-chat/src/contexts/messengerProvider.tsx
+++ b/packages/react-chat/src/contexts/messengerProvider.tsx
@@ -18,6 +18,7 @@ const MessengerContext = createContext({
communityData: undefined,
contacts: {},
contactsDispatch: () => undefined,
+ addContact: () => undefined,
activeChannel: undefined,
channels: {},
channelsDispatch: () => undefined,
@@ -33,7 +34,7 @@ export function useMessengerContext() {
}
interface MessengerProviderProps {
- communityKey: string;
+ communityKey: string | undefined;
children: React.ReactNode;
}
diff --git a/packages/react-chat/src/contexts/userCreationStateProvider.tsx b/packages/react-chat/src/contexts/userCreationStateProvider.tsx
deleted file mode 100644
index 6d4aba2..0000000
--- a/packages/react-chat/src/contexts/userCreationStateProvider.tsx
+++ /dev/null
@@ -1,29 +0,0 @@
-import React, { createContext, useContext, useState } from "react";
-
-export enum UserCreationState {
- Creating,
- NotCreating,
-}
-
-type UserCreationContextType = [
- UserCreationState,
- React.Dispatch>
-];
-
-const ChatStateContext = createContext([
- UserCreationState.NotCreating,
- () => undefined,
-]);
-
-export function useUserCreationState() {
- return useContext(ChatStateContext);
-}
-
-export function UserCreationStateProvider({
- children,
-}: {
- children: React.ReactNode;
-}) {
- const state = useState(UserCreationState.NotCreating);
- return ;
-}
diff --git a/packages/react-chat/src/groupChatComponents/DappConnectGroupChat.tsx b/packages/react-chat/src/groupChatComponents/DappConnectGroupChat.tsx
new file mode 100644
index 0000000..613e7d7
--- /dev/null
+++ b/packages/react-chat/src/groupChatComponents/DappConnectGroupChat.tsx
@@ -0,0 +1,65 @@
+import React, { useRef } from "react";
+import { ThemeProvider } from "styled-components";
+import styled from "styled-components";
+
+import { ConfigType } from "..";
+import { ActivityProvider } from "../contexts/activityProvider";
+import { ChatStateProvider } from "../contexts/chatStateProvider";
+import { ConfigProvider } from "../contexts/configProvider";
+import { FetchMetadataProvider } from "../contexts/fetchMetadataProvider";
+import { IdentityProvider } from "../contexts/identityProvider";
+import { MessengerProvider } from "../contexts/messengerProvider";
+import { ModalProvider } from "../contexts/modalProvider";
+import { NarrowProvider } from "../contexts/narrowProvider";
+import { ToastProvider } from "../contexts/toastProvider";
+import { Metadata } from "../models/Metadata";
+import { GlobalStyle } from "../styles/GlobalStyle";
+import { Theme } from "../styles/themes";
+
+import { GroupChat } from "./GroupChat";
+
+interface DappConnectGroupChatProps {
+ theme: Theme;
+ config: ConfigType;
+ fetchMetadata?: (url: string) => Promise;
+}
+
+export function DappConnectGroupChat({
+ theme,
+ config,
+ fetchMetadata,
+}: DappConnectGroupChatProps) {
+ const ref = useRef(null);
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+}
+
+const Wrapper = styled.div`
+ height: 100%;
+ overflow: hidden;
+`;
diff --git a/packages/react-chat/src/groupChatComponents/GroupChat.tsx b/packages/react-chat/src/groupChatComponents/GroupChat.tsx
new file mode 100644
index 0000000..45afce2
--- /dev/null
+++ b/packages/react-chat/src/groupChatComponents/GroupChat.tsx
@@ -0,0 +1,90 @@
+import React, { useState } from "react";
+import styled from "styled-components";
+
+import { Channels } from "../components/Channels/Channels";
+import { ChatCreation } from "../components/Chat/ChatCreation";
+import { AgreementModal } from "../components/Modals/AgreementModal";
+import { CoinbaseModal } from "../components/Modals/CoinbaseModal";
+import { EditModal } from "../components/Modals/EditModal";
+import { LeavingModal } from "../components/Modals/LeavingModal";
+import { LogoutModal } from "../components/Modals/LogoutModal";
+import { ProfileFoundModal } from "../components/Modals/ProfileFoundModal";
+import { ProfileModal } from "../components/Modals/ProfileModal";
+import { StatusModal } from "../components/Modals/StatusModal";
+import { UserCreationModal } from "../components/Modals/UserCreationModal";
+import { UserCreationStartModal } from "../components/Modals/UserCreationStartModal";
+import { WalletConnectModal } from "../components/Modals/WalletConnectModal";
+import { WalletModal } from "../components/Modals/WalletModal";
+import { ToastMessageList } from "../components/ToastMessages/ToastMessageList";
+import { ChatState, useChatState } from "../contexts/chatStateProvider";
+import { useNarrow } from "../contexts/narrowProvider";
+
+import { GroupChatBody } from "./GroupChat/GroupChatBody";
+import { GroupMembers } from "./GroupMembers/GroupMembers";
+
+function Modals() {
+ return (
+ <>
+
+
+
+
+
+
+
+
+
+
+
+
+ >
+ );
+}
+
+export function GroupChat() {
+ const [state] = useChatState();
+ const [showMembers, setShowMembers] = useState(false);
+ const [editGroup, setEditGroup] = useState(false);
+ const narrow = useNarrow();
+ return (
+
+ {!narrow && (
+
+
+
+ )}
+ {state === ChatState.ChatBody && (
+ setShowMembers(!showMembers)}
+ showMembers={showMembers}
+ permission={true}
+ editGroup={editGroup}
+ setEditGroup={setEditGroup}
+ />
+ )}
+ {showMembers && !narrow && state === ChatState.ChatBody && (
+
+ )}
+ {state === ChatState.ChatCreation && }
+
+
+
+ );
+}
+
+const ChatWrapper = styled.div`
+ width: 100%;
+ height: 100%;
+ display: flex;
+ position: relative;
+`;
+
+const ChannelsWrapper = styled.div`
+ width: 21%;
+ height: 100%;
+ min-width: 250px;
+ background-color: ${({ theme }) => theme.sectionBackgroundColor};
+ padding: 10px 16px;
+ display: flex;
+ flex-direction: column;
+`;
diff --git a/packages/react-chat/src/groupChatComponents/GroupChat/GroupChatBody.tsx b/packages/react-chat/src/groupChatComponents/GroupChat/GroupChatBody.tsx
new file mode 100644
index 0000000..5d0cc3e
--- /dev/null
+++ b/packages/react-chat/src/groupChatComponents/GroupChat/GroupChatBody.tsx
@@ -0,0 +1,182 @@
+import React, { useCallback, useEffect, useMemo, useState } from "react";
+import styled from "styled-components";
+
+import { ChatCreation } from "../../components/Chat/ChatCreation";
+import { ChatInput } from "../../components/Chat/ChatInput";
+import {
+ ChatTopbar,
+ ChatTopbarLoading,
+} from "../../components/Chat/ChatTopbar";
+import { TokenRequirement } from "../../components/Form/TokenRequirement";
+import { MessagesList } from "../../components/Messages/MessagesList";
+import { NarrowChannels } from "../../components/NarrowMode/NarrowChannels";
+import { NarrowMembers } from "../../components/NarrowMode/NarrowMembers";
+import { LoadingSkeleton } from "../../components/Skeleton/LoadingSkeleton";
+import { useMessengerContext } from "../../contexts/messengerProvider";
+import { useNarrow } from "../../contexts/narrowProvider";
+import { Reply } from "../../hooks/useReply";
+import { ChannelData } from "../../models/ChannelData";
+
+export enum ChatBodyState {
+ Chat,
+ Channels,
+ Members,
+}
+
+function ChatBodyLoading() {
+ const narrow = useNarrow();
+ return (
+
+
+
+
+ undefined} />
+
+
+ );
+}
+
+type ChatBodyContentProps = {
+ showState: ChatBodyState;
+ switchShowState: (state: ChatBodyState) => void;
+ channel: ChannelData;
+};
+
+function ChatBodyContent({
+ showState,
+ switchShowState,
+ channel,
+}: ChatBodyContentProps) {
+ const [reply, setReply] = useState(undefined);
+
+ switch (showState) {
+ case ChatBodyState.Chat:
+ return (
+ <>
+
+
+ >
+ );
+ case ChatBodyState.Channels:
+ return (
+ switchShowState(ChatBodyState.Channels)}
+ />
+ );
+ case ChatBodyState.Members:
+ return (
+ switchShowState(ChatBodyState.Members)}
+ />
+ );
+ }
+}
+
+interface GroupChatBodyProps {
+ onClick: () => void;
+ showMembers: boolean;
+ permission: boolean;
+ editGroup: boolean;
+ setEditGroup: React.Dispatch>;
+}
+
+export function GroupChatBody({
+ onClick,
+ showMembers,
+ permission,
+ editGroup,
+ setEditGroup,
+}: GroupChatBodyProps) {
+ const { activeChannel, loadingMessenger } = useMessengerContext();
+
+ const narrow = useNarrow();
+ const className = useMemo(() => (narrow ? "narrow" : ""), [narrow]);
+
+ const [showState, setShowState] = useState(ChatBodyState.Chat);
+ const switchShowState = useCallback(
+ (state: ChatBodyState) => {
+ if (narrow) {
+ setShowState((prev) => (prev === state ? ChatBodyState.Chat : state));
+ }
+ },
+ [narrow]
+ );
+
+ useEffect(() => {
+ if (!narrow) {
+ setShowState(ChatBodyState.Chat);
+ }
+ }, [narrow]);
+
+ if (!loadingMessenger && activeChannel) {
+ return (
+
+
+ {editGroup ? (
+
+ ) : (
+
+ )}
+
+
+ {!permission && (
+
+
+
+ )}
+
+ );
+ }
+
+ return ;
+}
+
+export const Wrapper = styled.div`
+ width: 61%;
+ display: flex;
+ flex-direction: column;
+ flex: 1;
+ height: 100%;
+ background: ${({ theme }) => theme.bodyBackgroundColor};
+ position: relative;
+
+ &.narrow {
+ width: 100%;
+ }
+`;
+
+const ChatBodyWrapper = styled.div`
+ width: 100%;
+ height: 100%;
+ display: flex;
+ flex-direction: column;
+ flex: 1;
+ background: ${({ theme }) => theme.bodyBackgroundColor};
+`;
+
+const BluredWrapper = styled.div`
+ width: 100%;
+ height: 100%;
+ display: flex;
+ align-items: flex-end;
+ justify-content: center;
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ background: ${({ theme }) => theme.bodyBackgroundGradient};
+ backdrop-filter: blur(4px);
+ z-index: 2;
+`;
diff --git a/packages/react-chat/src/groupChatComponents/GroupMembers/GroupMembers.tsx b/packages/react-chat/src/groupChatComponents/GroupMembers/GroupMembers.tsx
new file mode 100644
index 0000000..dd4fd4a
--- /dev/null
+++ b/packages/react-chat/src/groupChatComponents/GroupMembers/GroupMembers.tsx
@@ -0,0 +1,49 @@
+import React, { useMemo, useState } from "react";
+import styled from "styled-components";
+
+import { MembersList } from "../../components/Members/MembersList";
+import { useMessengerContext } from "../../contexts/messengerProvider";
+
+export function GroupMembers() {
+ const { addContact, activeChannel } = useMessengerContext();
+ const heading = useMemo(
+ () =>
+ activeChannel && activeChannel?.type === "group"
+ ? "Group members"
+ : "Members",
+ [activeChannel]
+ );
+ const [newUserInput, setNewUserInput] = useState("");
+ return (
+ <>
+
+ {heading}
+
+ setNewUserInput(e.target.value)}
+ />
+
+
+ >
+ );
+}
+
+const MembersWrapper = styled.div`
+ width: 18%;
+ height: 100%;
+ min-width: 164px;
+ display: flex;
+ flex-direction: column;
+ background-color: ${({ theme }) => theme.sectionBackgroundColor};
+ padding: 16px;
+ overflow-y: scroll;
+`;
+
+const MemberHeading = styled.h2`
+ font-weight: 500;
+ font-size: 15px;
+ line-height: 22px;
+ color: ${({ theme }) => theme.primary};
+ margin-bottom: 16px;
+`;
diff --git a/packages/react-chat/src/hooks/messenger/useGroupChats.ts b/packages/react-chat/src/hooks/messenger/useGroupChats.ts
index 16c5297..1ae5216 100644
--- a/packages/react-chat/src/hooks/messenger/useGroupChats.ts
+++ b/packages/react-chat/src/hooks/messenger/useGroupChats.ts
@@ -1,4 +1,5 @@
import {
+ Contacts as ContactsClass,
GroupChat,
GroupChats,
Identity,
@@ -28,10 +29,11 @@ export function useGroupChats(
messenger: Messenger | undefined,
identity: Identity | undefined,
dispatch: (action: ChannelAction) => void,
- addChatMessage: (newMessage: ChatMessage | undefined, id: string) => void
+ addChatMessage: (newMessage: ChatMessage | undefined, id: string) => void,
+ contactsClass: ContactsClass | undefined
) {
const groupChat = useMemo(() => {
- if (messenger && identity) {
+ if (messenger && identity && contactsClass) {
const addChat = (chat: GroupChat) => {
const members = chat.members
.map((member) => member.id)
@@ -52,6 +54,7 @@ export function useGroupChats(
description: `Chatkey: ${chat.members[0].id}`,
members,
};
+ chat.members.forEach((member) => contactsClass.addContact(member.id));
dispatch({ type: "AddChannel", payload: channel });
};
const removeChat = (chat: GroupChat) => {
@@ -81,7 +84,7 @@ export function useGroupChats(
handleMessage
);
}
- }, [messenger, identity]);
+ }, [messenger, identity, contactsClass]);
const createGroupChat = useCallback(
(members: string[]) => {
diff --git a/packages/react-chat/src/hooks/messenger/useLoadPrevDay.ts b/packages/react-chat/src/hooks/messenger/useLoadPrevDay.ts
index bc4f4d0..3e77dbb 100644
--- a/packages/react-chat/src/hooks/messenger/useLoadPrevDay.ts
+++ b/packages/react-chat/src/hooks/messenger/useLoadPrevDay.ts
@@ -17,12 +17,14 @@ export function useLoadPrevDay(
const [loadingMessages, setLoadingMessages] = useState(false);
useEffect(() => {
- setLoadingMessages(loadingPreviousMessages.current[chatId]);
+ if (chatId) {
+ setLoadingMessages(loadingPreviousMessages.current[chatId]);
+ }
}, [chatId]);
const loadPrevDay = useCallback(
async (id: string, groupChat?: boolean) => {
- if (messenger) {
+ if (messenger && id) {
const endTime = lastLoadTime.current[id] ?? new Date();
const startTime = new Date(endTime.getTime() - _MS_PER_DAY * 5);
const timeDiff = Math.floor(
diff --git a/packages/react-chat/src/hooks/messenger/useMessenger.ts b/packages/react-chat/src/hooks/messenger/useMessenger.ts
index 45dba7b..6db032d 100644
--- a/packages/react-chat/src/hooks/messenger/useMessenger.ts
+++ b/packages/react-chat/src/hooks/messenger/useMessenger.ts
@@ -41,6 +41,7 @@ export type MessengerType = {
communityData: CommunityData | undefined;
contacts: Contacts;
contactsDispatch: (action: ContactsAction) => void;
+ addContact: (publicKey: string) => void;
channels: ChannelsData;
channelsDispatch: (action: ChannelAction) => void;
removeChannel: (channelId: string) => void;
@@ -105,7 +106,7 @@ function useCreateCommunity(
}
export function useMessenger(
- communityKey: string,
+ communityKey: string | undefined,
identity: Identity | undefined,
newNickname: string | undefined
) {
@@ -117,6 +118,15 @@ export function useMessenger(
newNickname
);
+ const addContact = useCallback(
+ (publicKey: string) => {
+ if (contactsClass) {
+ contactsClass.addContact(publicKey);
+ }
+ },
+ [contactsClass]
+ );
+
const {
addChatMessage,
addMessage,
@@ -176,7 +186,13 @@ export function useMessenger(
createGroupChat,
changeGroupChatName,
addMembers,
- } = useGroupChats(messenger, identity, channelsDispatch, addChatMessage);
+ } = useGroupChats(
+ messenger,
+ identity,
+ channelsDispatch,
+ addChatMessage,
+ contactsClass
+ );
const { loadPrevDay, loadingMessages } = useLoadPrevDay(
channelsState.activeChannel.id,
@@ -237,9 +253,12 @@ export function useMessenger(
}, [notifications, channelsState]);
const loadingMessenger = useMemo(() => {
- return !communityData || !messenger || !channelsState.activeChannel.id;
+ return Boolean(
+ (communityKey && !communityData) ||
+ !messenger ||
+ (communityKey && !channelsState.activeChannel.id)
+ );
}, [communityData, messenger, channelsState]);
-
return {
messenger,
messages,
@@ -252,6 +271,7 @@ export function useMessenger(
communityData,
contacts,
contactsDispatch,
+ addContact,
channels: channelsState.channels,
channelsDispatch,
removeChannel,
diff --git a/packages/react-chat/src/hooks/useChatScrollHandle.ts b/packages/react-chat/src/hooks/useChatScrollHandle.ts
index 71a7d8b..130c8c5 100644
--- a/packages/react-chat/src/hooks/useChatScrollHandle.ts
+++ b/packages/react-chat/src/hooks/useChatScrollHandle.ts
@@ -22,16 +22,16 @@ export function useChatScrollHandle(
(ref?.current?.clientHeight ?? 0) >= (ref?.current?.scrollHeight ?? 0)
) {
setScrollOnBot(true);
- loadPrevDay(activeChannel.id, activeChannel.type === "group");
+ loadPrevDay(activeChannel.id, activeChannel.type !== "channel");
}
}
- }, [messages.length, loadingMessages, activeChannel]);
+ }, [messages.length, activeChannel]);
useEffect(() => {
const setScroll = () => {
if (ref?.current && activeChannel) {
if (ref.current.scrollTop <= 0) {
- loadPrevDay(activeChannel.id, activeChannel.type === "group");
+ loadPrevDay(activeChannel.id, activeChannel.type !== "channel");
}
if (
ref.current.scrollTop + ref.current.clientHeight ==
diff --git a/packages/react-chat/src/index.ts b/packages/react-chat/src/index.ts
index 40f8908..c0539ce 100644
--- a/packages/react-chat/src/index.ts
+++ b/packages/react-chat/src/index.ts
@@ -1,4 +1,12 @@
import { DappConnectCommunityChat } from "./components/DappConnectCommunityChat";
import { ConfigType } from "./contexts/configProvider";
+import { DappConnectGroupChat } from "./groupChatComponents/DappConnectGroupChat";
import { darkTheme, lightTheme } from "./styles/themes";
-export { DappConnectCommunityChat, lightTheme, darkTheme, ConfigType };
+
+export {
+ DappConnectCommunityChat,
+ DappConnectGroupChat,
+ lightTheme,
+ darkTheme,
+ ConfigType,
+};
diff --git a/packages/react-group-chat-example/.eslintrc.json b/packages/react-group-chat-example/.eslintrc.json
new file mode 100644
index 0000000..b8a87ff
--- /dev/null
+++ b/packages/react-group-chat-example/.eslintrc.json
@@ -0,0 +1,41 @@
+{
+ "root": true,
+ "parser": "@typescript-eslint/parser",
+ "parserOptions": { "project": "./tsconfig.json" },
+ "env": { "es6": true },
+ "ignorePatterns": ["node_modules", "dist", "coverage", "proto"],
+ "plugins": ["import", "eslint-comments", "functional"],
+ "extends": [
+ "eslint:recommended",
+ "plugin:eslint-comments/recommended",
+ "plugin:@typescript-eslint/recommended",
+ "plugin:import/typescript",
+ "prettier"
+ ],
+ "globals": { "BigInt": true, "console": true, "WebAssembly": true },
+ "rules": {
+ "@typescript-eslint/explicit-module-boundary-types": "off",
+ "eslint-comments/disable-enable-pair": [
+ "error",
+ { "allowWholeFile": true }
+ ],
+ "eslint-comments/no-unused-disable": "error",
+ "import/order": [
+ "error",
+ { "newlines-between": "always", "alphabetize": { "order": "asc" } }
+ ],
+ "no-constant-condition": ["error", { "checkLoops": false }],
+ "sort-imports": [
+ "error",
+ { "ignoreDeclarationSort": true, "ignoreCase": true }
+ ]
+ },
+ "overrides": [
+ {
+ "files": ["*.spec.ts", "**/test_utils/*.ts"],
+ "rules": {
+ "@typescript-eslint/no-non-null-assertion": "off"
+ }
+ }
+ ]
+}
diff --git a/packages/react-group-chat-example/.mocharc.json b/packages/react-group-chat-example/.mocharc.json
new file mode 100644
index 0000000..b65763d
--- /dev/null
+++ b/packages/react-group-chat-example/.mocharc.json
@@ -0,0 +1,6 @@
+{
+ "extension": ["ts"],
+ "spec": "src/**/*.spec.ts",
+ "require": "ts-node/register",
+ "exit": true
+}
diff --git a/packages/react-group-chat-example/.prettierignore b/packages/react-group-chat-example/.prettierignore
new file mode 100644
index 0000000..996c3a3
--- /dev/null
+++ b/packages/react-group-chat-example/.prettierignore
@@ -0,0 +1,2 @@
+# package.json is formatted by package managers, so we ignore it here
+package.json
diff --git a/packages/react-group-chat-example/README.md b/packages/react-group-chat-example/README.md
new file mode 100644
index 0000000..539a169
--- /dev/null
+++ b/packages/react-group-chat-example/README.md
@@ -0,0 +1 @@
+#React chat example
\ No newline at end of file
diff --git a/packages/react-group-chat-example/package.json b/packages/react-group-chat-example/package.json
new file mode 100644
index 0000000..216b082
--- /dev/null
+++ b/packages/react-group-chat-example/package.json
@@ -0,0 +1,71 @@
+{
+ "name": "@waku/react-group-chat-sdk-example",
+ "main": "index.js",
+ "version": "0.1.0",
+ "repository": "https://github.com/status-im/dappconnect-chat-sdk/",
+ "license": "MIT OR Apache-2.0",
+ "packageManager": "yarn@3.0.1",
+ "scripts": {
+ "clean:all": "yarn clean && rimraf node_modules/",
+ "clean": "rimraf dist/",
+ "build": "rm -rf dist && webpack --mode=production --env ENV=production",
+ "start": "webpack serve --mode=development --env ENV=$ENV COMMUNITY_KEY=$COMMUNITY_KEY --https",
+ "fix": "run-s 'fix:*'",
+ "fix:prettier": "prettier './{src,test}/**/*.{ts,tsx}' \"./*.json\" --write",
+ "fix:lint": "eslint './{src,test}/**/*.{ts,tsx}' --fix",
+ "test": "run-s 'test:*'",
+ "test:lint": "eslint './{src,test}/**/*.{ts,tsx}'",
+ "test:prettier": "prettier './{src,test}/**/*.{ts,tsx}' \"./*.json\" --list-different"
+ },
+ "dependencies": {
+ "@waku/react-chat-sdk": "^0.1.0",
+ "assert": "^2.0.0",
+ "browserify-zlib": "^0.2.0",
+ "buffer": "^6.0.3",
+ "crypto-browserify": "^3.12.0",
+ "https-browserify": "^1.0.0",
+ "process": "^0.11.10",
+ "react": "^17.0.2",
+ "react-dom": "^17.0.2",
+ "react-router-dom": "^5.2.0",
+ "stream-browserify": "^3.0.0",
+ "stream-http": "^3.2.0",
+ "styled-components": "^5.3.1"
+ },
+ "devDependencies": {
+ "@testing-library/react-hooks": "^7.0.1",
+ "@types/chai": "^4.2.21",
+ "@types/mocha": "^9.0.0",
+ "@types/node": "^16.4.12",
+ "@types/react": "^17.0.15",
+ "@types/react-dom": "^17.0.9",
+ "@types/react-router": "^5.1.16",
+ "@types/react-router-dom": "^5.1.8",
+ "@types/styled-components": "^5.1.12",
+ "@typescript-eslint/eslint-plugin": "^4.29.0",
+ "@typescript-eslint/parser": "^4.29.0",
+ "chai": "^4.3.4",
+ "css-loader": "^6.3.0",
+ "esbuild-loader": "^2.15.1",
+ "eslint": "^7.32.0",
+ "eslint-plugin-hooks": "^0.2.0",
+ "eslint-plugin-react": "^7.24.0",
+ "file-loader": "^6.2.0",
+ "fork-ts-checker-webpack-plugin": "^6.3.1",
+ "html-webpack-plugin": "^5.3.2",
+ "jsdom": "^16.7.0",
+ "jsdom-global": "^3.0.2",
+ "mocha": "^9.0.3",
+ "npm-run-all": "^4.1.5",
+ "prettier": "^2.3.2",
+ "rimraf": "^3.0.2",
+ "source-map-loader": "^3.0.0",
+ "style-loader": "^3.3.0",
+ "ts-loader": "^9.2.5",
+ "ts-node": "^10.1.0",
+ "typescript": "^4.3.5",
+ "webpack": "^5.48.0",
+ "webpack-cli": "^4.7.2",
+ "webpack-dev-server": "^3.11.2"
+ }
+}
diff --git a/packages/react-group-chat-example/src/_redirects b/packages/react-group-chat-example/src/_redirects
new file mode 100644
index 0000000..ad37e2c
--- /dev/null
+++ b/packages/react-group-chat-example/src/_redirects
@@ -0,0 +1 @@
+/* /index.html 200
diff --git a/packages/react-group-chat-example/src/index.html b/packages/react-group-chat-example/src/index.html
new file mode 100644
index 0000000..4b07172
--- /dev/null
+++ b/packages/react-group-chat-example/src/index.html
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+ DAppconnect group chat
+
+
+
+
+
+
+
diff --git a/packages/react-group-chat-example/src/index.tsx b/packages/react-group-chat-example/src/index.tsx
new file mode 100644
index 0000000..6a0f363
--- /dev/null
+++ b/packages/react-group-chat-example/src/index.tsx
@@ -0,0 +1,139 @@
+import {
+ DappConnectGroupChat,
+ darkTheme,
+ lightTheme,
+} from "@waku/react-chat-sdk";
+import React, { useRef, useState } from "react";
+import ReactDOM from "react-dom";
+import styled from "styled-components";
+
+const fetchMetadata = async (link: string) => {
+ const response = await fetch("https://localhost:3000", {
+ method: "POST",
+ headers: {
+ "Content-Type": "application/json",
+ },
+ body: JSON.stringify({ site: link }),
+ });
+ const body = await response.text();
+ const parsedBody = JSON.parse(body);
+ if (
+ "og:image" in parsedBody &&
+ "og:site_name" in parsedBody &&
+ "og:title" in parsedBody
+ ) {
+ return JSON.parse(body);
+ }
+};
+
+function DragDiv() {
+ const [x, setX] = useState(0);
+ const [y, setY] = useState(0);
+ const [width, setWidth] = useState(window.innerWidth - 50);
+ const [height, setHeight] = useState(window.innerHeight - 50);
+ const [showChat, setShowChat] = useState(true);
+ const ref = useRef(null);
+ const moved = useRef(false);
+ const setting = useRef("");
+
+ const [theme, setTheme] = useState(true);
+
+ const onMouseMove = (e: MouseEvent) => {
+ if (setting.current === "position") {
+ e.preventDefault();
+ setX(e.x - 20);
+ setY(e.y - 20);
+ }
+ if (setting.current === "size") {
+ setWidth(e.x - x);
+ setHeight(e.y - y);
+ e.preventDefault();
+ }
+ moved.current = true;
+ };
+
+ const onMouseUp = () => {
+ document.removeEventListener("mousemove", onMouseMove);
+ document.removeEventListener("mouseup", onMouseUp);
+ if (!moved.current) [setShowChat((prev) => !prev)];
+ moved.current = false;
+ };
+
+ return (
+ <>
+
+
+ {
+ setting.current = "position";
+ document.addEventListener("mousemove", onMouseMove);
+ document.addEventListener("mouseup", onMouseUp);
+ }}
+ />
+
+
+
+ {showChat && (
+ {
+ setting.current = "size";
+ document.addEventListener("mousemove", onMouseMove);
+ document.addEventListener("mouseup", onMouseUp);
+ }}
+ >
+ )}
+
+ >
+ );
+}
+
+const FloatingDiv = styled.div`
+ height: calc(100% - 50px);
+ border: 1px solid black;
+
+ &.hide {
+ display: none;
+ }
+`;
+
+const SizeSet = styled.div`
+ margin-left: auto;
+ margin-right: 0px;
+ width: 10px;
+ height: 10px;
+ background-color: light-grey;
+ border: 1px solid;
+`;
+
+const Bubble = styled.div`
+ width: 50px;
+ height: 50px;
+ border-radius: 50%;
+ background-color: lightblue;
+ border: 1px solid;
+`;
+
+const Drag = styled.div`
+ position: absolute;
+ min-width: 375px;
+`;
+
+ReactDOM.render(
+
+
+
,
+ document.getElementById("root")
+);
diff --git a/packages/react-group-chat-example/tsconfig.json b/packages/react-group-chat-example/tsconfig.json
new file mode 100644
index 0000000..cee3d03
--- /dev/null
+++ b/packages/react-group-chat-example/tsconfig.json
@@ -0,0 +1,47 @@
+{
+ "compilerOptions": {
+ "target": "es6",
+ "outDir": "dist",
+ "jsx": "react",
+ "moduleResolution": "node",
+ "module": "commonjs",
+ "declaration": true,
+ "sourceMap": true,
+ "esModuleInterop": true,
+ "resolveJsonModule": true,
+ "composite": true,
+ "strict": true /* Enable all strict type-checking options. */,
+
+ /* Strict Type-Checking Options */
+ "noImplicitAny": true,
+ "strictNullChecks": true,
+ "strictFunctionTypes": true,
+ "strictPropertyInitialization": true,
+ "noImplicitThis": true,
+ "alwaysStrict": true,
+
+ /* Additional Checks */
+ "noUnusedLocals": true,
+ "noUnusedParameters": true,
+ "noImplicitReturns": false /* to set at a later stage */,
+ "noFallthroughCasesInSwitch": true,
+ "forceConsistentCasingInFileNames": true,
+
+ /* Debugging Options */
+ "traceResolution": false,
+ "listEmittedFiles": false,
+ "listFiles": false,
+ "pretty": true,
+
+ // Due to broken types in indirect dependencies
+ "skipLibCheck": true,
+ "typeRoots": [
+ "./node_modules/@types",
+ "./src/types",
+ "../../node_modules/@types"
+ ]
+ },
+ "include": ["src"],
+ "types": ["mocha"],
+ "compileOnSave": false
+}
diff --git a/packages/react-group-chat-example/tsconfig.tsbuildinfo b/packages/react-group-chat-example/tsconfig.tsbuildinfo
new file mode 100644
index 0000000..bf848bf
--- /dev/null
+++ b/packages/react-group-chat-example/tsconfig.tsbuildinfo
@@ -0,0 +1 @@
+{"program":{"fileNames":["../../node_modules/typescript/lib/lib.es6.d.ts","../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../../node_modules/typescript/lib/lib.scripthost.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/@types/react/global.d.ts","../../node_modules/csstype/index.d.ts","../../node_modules/@types/prop-types/index.d.ts","../../node_modules/@types/scheduler/tracing.d.ts","../../node_modules/@types/react/index.d.ts","../../node_modules/@types/react-dom/index.d.ts","./src/index.tsx","../../node_modules/@types/chai/index.d.ts","../../node_modules/@types/ms/index.d.ts","../../node_modules/@types/debug/index.d.ts","../../node_modules/@types/eslint/helpers.d.ts","../../node_modules/@types/eslint/lib/rules/index.d.ts","../../node_modules/@types/json-schema/index.d.ts","../../node_modules/@types/estree/index.d.ts","../../node_modules/@types/eslint/index.d.ts","../../node_modules/@types/eslint-scope/index.d.ts","../../node_modules/@types/node/assert.d.ts","../../node_modules/@types/node/assert/strict.d.ts","../../node_modules/@types/node/globals.d.ts","../../node_modules/@types/node/async_hooks.d.ts","../../node_modules/@types/node/buffer.d.ts","../../node_modules/@types/node/child_process.d.ts","../../node_modules/@types/node/cluster.d.ts","../../node_modules/@types/node/console.d.ts","../../node_modules/@types/node/constants.d.ts","../../node_modules/@types/node/crypto.d.ts","../../node_modules/@types/node/dgram.d.ts","../../node_modules/@types/node/diagnostics_channel.d.ts","../../node_modules/@types/node/dns.d.ts","../../node_modules/@types/node/dns/promises.d.ts","../../node_modules/@types/node/domain.d.ts","../../node_modules/@types/node/events.d.ts","../../node_modules/@types/node/fs.d.ts","../../node_modules/@types/node/fs/promises.d.ts","../../node_modules/@types/node/http.d.ts","../../node_modules/@types/node/http2.d.ts","../../node_modules/@types/node/https.d.ts","../../node_modules/@types/node/inspector.d.ts","../../node_modules/@types/node/module.d.ts","../../node_modules/@types/node/net.d.ts","../../node_modules/@types/node/os.d.ts","../../node_modules/@types/node/path.d.ts","../../node_modules/@types/node/perf_hooks.d.ts","../../node_modules/@types/node/process.d.ts","../../node_modules/@types/node/punycode.d.ts","../../node_modules/@types/node/querystring.d.ts","../../node_modules/@types/node/readline.d.ts","../../node_modules/@types/node/repl.d.ts","../../node_modules/@types/node/stream.d.ts","../../node_modules/@types/node/stream/promises.d.ts","../../node_modules/@types/node/stream/consumers.d.ts","../../node_modules/@types/node/stream/web.d.ts","../../node_modules/@types/node/string_decoder.d.ts","../../node_modules/@types/node/timers.d.ts","../../node_modules/@types/node/timers/promises.d.ts","../../node_modules/@types/node/tls.d.ts","../../node_modules/@types/node/trace_events.d.ts","../../node_modules/@types/node/tty.d.ts","../../node_modules/@types/node/url.d.ts","../../node_modules/@types/node/util.d.ts","../../node_modules/@types/node/v8.d.ts","../../node_modules/@types/node/vm.d.ts","../../node_modules/@types/node/wasi.d.ts","../../node_modules/@types/node/worker_threads.d.ts","../../node_modules/@types/node/zlib.d.ts","../../node_modules/@types/node/globals.global.d.ts","../../node_modules/@types/node/index.d.ts","../../node_modules/@types/minimatch/index.d.ts","../../node_modules/@types/glob/index.d.ts","../../node_modules/@types/history/DOMUtils.d.ts","../../node_modules/@types/history/createBrowserHistory.d.ts","../../node_modules/@types/history/createHashHistory.d.ts","../../node_modules/@types/history/createMemoryHistory.d.ts","../../node_modules/@types/history/LocationUtils.d.ts","../../node_modules/@types/history/PathUtils.d.ts","../../node_modules/@types/history/index.d.ts","../../node_modules/@types/hoist-non-react-statics/index.d.ts","../../node_modules/@types/html-minifier-terser/index.d.ts","../../node_modules/@types/istanbul-lib-coverage/index.d.ts","../../node_modules/@types/istanbul-lib-report/index.d.ts","../../node_modules/@types/istanbul-reports/index.d.ts","../../node_modules/@types/json5/index.d.ts","../../node_modules/@types/keyv/index.d.ts","../../node_modules/@types/long/index.d.ts","../../node_modules/@types/mocha/index.d.ts","../../node_modules/@types/object-hash/index.d.ts","../../node_modules/@types/parse-json/index.d.ts","../../node_modules/@types/prettier/index.d.ts","../../node_modules/@types/react-router/index.d.ts","../../node_modules/@types/react-router-dom/index.d.ts","../../node_modules/@types/react-test-renderer/index.d.ts","../../node_modules/@types/responselike/index.d.ts","../../node_modules/@types/retry/index.d.ts","../../node_modules/@types/scheduler/index.d.ts","../../node_modules/@types/secp256k1/index.d.ts","../../node_modules/@types/styled-components/index.d.ts","../../node_modules/@types/yargs-parser/index.d.ts","../../node_modules/@types/yargs/index.d.ts"],"fileInfos":["721cec59c3fef87aaf480047d821fb758b3ec9482c4129a54631e6e25e432a31",{"version":"aa9fb4c70f369237c2f45f9d969c9a59e0eae9a192962eb48581fe864aa609db","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","e21c071ca3e1b4a815d5f04a7475adcaeea5d64367e840dd0154096d705c3940",{"version":"e54c8715a4954cfdc66cd69489f2b725c09ebf37492dbd91cff0a1688b1159e8","affectsGlobalScope":true},{"version":"e34eb9339171ec45da2801c1967e4d378bd61a1dceaa1b1b4e1b6d28cb9ca962","affectsGlobalScope":true},{"version":"7fac8cb5fc820bc2a59ae11ef1c5b38d3832c6d0dfaec5acdb5569137d09a481","affectsGlobalScope":true},{"version":"097a57355ded99c68e6df1b738990448e0bf170e606707df5a7c0481ff2427cd","affectsGlobalScope":true},{"version":"51b8b27c21c066bf877646e320bf6a722b80d1ade65e686923cd9d4494aef1ca","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"2c8c5ee58f30e7c944e04ab1fb5506fdbb4dd507c9efa6972cf4b91cec90c503","affectsGlobalScope":true},{"version":"2bb4b3927299434052b37851a47bf5c39764f2ba88a888a107b32262e9292b7c","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"df9c8a72ca8b0ed62f5470b41208a0587f0f73f0a7db28e5a1272cf92537518e","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"93544ca2f26a48716c1b6c5091842cad63129daac422dfa4bc52460465f22bb1","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true},{"version":"7435b75fdf3509622e79622dbe5091cf4b09688410ee2034e4fc17d0c99d0862","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"9f1817f7c3f02f6d56e0f403b927e90bb133f371dcebc36fa7d6d208ef6899da","affectsGlobalScope":true},{"version":"4632665b87204bb1caa8b44d165bce0c50dfab177df5b561b345a567cabacf9a","affectsGlobalScope":true},{"version":"ecf78e637f710f340ec08d5d92b3f31b134a46a4fcf2e758690d8c46ce62cba6","affectsGlobalScope":true},"5b1d4ebd62d975c7d3826202f8fac290bac0bae6e04d9e84d1707d7047e108df","f7b46d22a307739c145e5fddf537818038fdfffd580d79ed717f4d4d37249380","f5a8b384f182b3851cec3596ccc96cb7464f8d3469f48c74bf2befb782a19de5",{"version":"7b4a3453c60663af7f58636bf4673bfcc540d83ce1c41b816a5cc2e924009880","affectsGlobalScope":true},"b4dfafe583b829a382edccbe32303535d0785f0c02ba7f04418e2a81de97af8a",{"version":"93a64c8d9db6a210880af441b80af0c05130faf026d293ffb6beb398e2693224","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"0c9d1fd5b43d5e88c277f7f53cffc87778190f2f9a1f57743559421f04fc730b","affectsGlobalScope":true},"6a9c5127096b35264eb7cd21b2417bfc1d42cceca9ba4ce2bb0c3410b7816042","78828b06c0d3b586954015e9ebde5480b009e166c71244763bda328ec0920f41",{"version":"64d4b35c5456adf258d2cf56c341e203a073253f229ef3208fc0d5020253b241","affectsGlobalScope":true},"0133ebdd17a823ae56861948870cde4dac18dd8818ab641039c85bbb720429e0","0359682c54e487c4cab2b53b2b4d35cc8dea4d9914bc6abcdb5701f8b8e745a4","7d7c8ef7d48a035142c07dae60545ecc0e4af4c337742760cb09726f2f8e31db","e300bf65972ac08167a72787e19d1b43c285c5424707194d0ba64422f6b02c77","82772e5d55062a042a2715a555d347275a663940926fc785705eb082010cb9f6","0d5a2ee1fdfa82740e0103389b9efd6bfe145a20018a2da3c02b89666181f4d9","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"92d63add669d18ebc349efbacd88966d6f2ccdddfb1b880b2db98ae3aa7bf7c4","affectsGlobalScope":true},"ccc94049a9841fe47abe5baef6be9a38fc6228807974ae675fb15dc22531b4be",{"version":"658a70ff0b4d8298739566835c4b324a9ecef1676a2cd1fabfb5660a821d38ef","affectsGlobalScope":true},"43978f18d1165eea81040bc9bfac1a551717f5cc9bd0f13b31bf490c5fcdc75f","afc6e96061af46bcff47246158caee7e056f5288783f2d83d6858cd25be1c565",{"version":"c3ad91d23259b68e10a9bef08c5f9fa1d19f27ef740ac9af98ed226b030c09c6","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","38643f040239c18923ef39b5e1fe2651eaa8a633d2e371d48ae7e951ec55a923","260aad3a6bd3fc510b7f97cfb05859bfc045ce185f8c2b4d73ddb9c43b0eb3c0","cb428529763c6c8e38e42db2a39f333ffcc6d3aab396b24ac84b22da752c1de0","ad4b60488fb1e562bf375dac9299815f7028bf667d9b5887b2d01d501b7d1ddd","246341c3a7a2638cf830d690e69de1e6085a102c6a30596435b050e6ac86c11a","6972fca26f6e9bd56197568d4379f99071a90766e06b4fcb5920a0130a9202be",{"version":"4a2628e95962c8ab756121faa3ac2ed348112ff7a87b5c286dd2cc3326546b4c","affectsGlobalScope":true},"ccded627c1c57aa9e021aea914c3197899e7335fdc65426a6d61a8e65e751c00","2fa7fb7be51fa9924ebef6bd61d290c91bfebb93de00fd4949d836e68668a9de","f2f0941f8d09218dfabd1b89ee9b4fb4a193568deb9b44c13a08ac5a386d81ae","b287b810b5035d5685f1df6e1e418f1ca452a3ed4f59fd5cc081dbf2045f0d9b","4b9a003b5c556c96784132945bb41c655ea11273b1917f5c8d0c154dd5fd20dd","62a00c9cc0c78d9f282dcd7b0a7776aefe220106c3bc327e259e5f6484c6f556",{"version":"e8b18c6385ff784228a6f369694fcf1a6b475355ba89090a88de13587a9391d5","affectsGlobalScope":true},"f3e8bcce378a26bc672fce0ec05affabbbbfa18493b76f24c39136dea87100d0","abc1c425b2ad6720433f40f1877abfa4223f0f3dd486c9c28c492179ca183cb6","cd4854d38f4eb5592afd98ab95ca17389a7dfe38013d9079e802d739bdbcc939","94eed4cc2f5f658d5e229ff1ccd38860bddf4233e347bf78edd2154dee1f2b99",{"version":"e51bee3200733b1f58818b5a9ea90fcd61c5b8afa3a0378391991f3696826a65","affectsGlobalScope":true},"9f1069b9e2c051737b1f9b4f1baf50e4a63385a6a89c32235549ae87fc3d5492","ee18f2da7a037c6ceeb112a084e485aead9ea166980bf433474559eac1b46553","e70339a3d63f806c43f24250c42aa0000093923457b0ed7dfc10e0ac910ebca9","0acbf26bf958f9e80c1ffa587b74749d2697b75b484062d36e103c137c562bc3","2c20a91799640fc6bf027056fd56e5b8db5c427c1cc016bdb04cde5c9a0603b9","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff",{"version":"806ef4cac3b3d9fa4a48d849c8e084d7c72fcd7b16d76e06049a9ed742ff79c0","affectsGlobalScope":true},"a279435e7813d1f061c0cab6ab77b1b9377e8d96851e5ed4a76a1ce6eb6e628f","c33a6ea7147af60d8e98f1ac127047f4b0d4e2ce28b8f08ff3de07ca7cc00637",{"version":"b42b47e17b8ece2424ae8039feb944c2e3ba4b262986aebd582e51efbdca93dc","affectsGlobalScope":true},"664d8f2d59164f2e08c543981453893bc7e003e4dfd29651ce09db13e9457980","2408611d9b4146e35d1dbd1f443ccd8e187c74614a54b80300728277529dbf11","998a3de5237518c0b3ac00a11b3b4417affb008aa20aedee52f3fdae3cb86151","3accc1301749459bba2d1ba0084fdf399e5471508300956a3a2a1a8f4bc35f2e","b810390059fc34122556c644f586e7a2b4598ded8afe5ba70bb82fc2e50577b1","ba9de5c5823e06ee3314f959c138cdaf4477d3a1a0769f0d24e62911020e8088","c3db860bcaaaeb3bbc23f353bbda1f8ab82756c8d5e973bebb3953cb09ea68f2","235a53595bd20b0b0eeb1a29cb2887c67c48375e92f03749b2488fbd46d0b1a0","bc09393cd4cd13f69cf1366d4236fbae5359bb550f0de4e15767e9a91d63dfb1","9c266243b01545e11d2733a55ad02b4c00ecdbda99c561cd1674f96e89cdc958","c71155c05fc76ff948a4759abc1cb9feec036509f500174bc18dad4c7827a60c",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"ba229259c8b01c6733dc6a3e7b2ae3e2b76e502bb640a1691238a4c9cae5cfed","8841e2aa774b89bd23302dede20663306dc1b9902431ac64b24be8b8d0e3f649","725b884357ba84171341a8e4cc08edf11417854fd069842ca6d22afb2e340e45",{"version":"271cde49dfd9b398ccc91bb3aaa43854cf76f4d14e10fed91cbac649aa6cbc63","affectsGlobalScope":true},"2bcecd31f1b4281710c666843fc55133a0ee25b143e59f35f49c62e168123f4b","a6273756fa05f794b64fe1aff45f4371d444f51ed0257f9364a8b25f3501915d","2374e4ddc628bd0af8ce7578621f1b9d08ab183f4dbacb8749eabb1a85018196","25d91fb9ed77a828cc6c7a863236fb712dafcd52f816eec481bd0c1f589f4404","4cd14cea22eed1bfb0dc76183e56989f897ac5b14c0e2a819e5162eafdcfe243","ab35d08aa06a7615f06dad04db7e88f27d623220f05de68a94f16d5d22e6aaea","bfe1b52cf71aea9bf8815810cc5d9490fa9617313e3d3c2ee3809a28b80d0bb4","70b34c8420d6226ed565d55f47fe04912d0ca0ad128825c5a06e018a3498db32","de18acda71730bac52f4b256ce7511bb56cc21f6f114c59c46782eff2f632857","7eb06594824ada538b1d8b48c3925a83e7db792f47a081a62cf3e5c4e23cf0ee","029769d13d9917e3284cb2356ed28a6576e8b07ae6a06ee1e672518adf21a102","c5a14bdeb170e0e67fb4200c54e0e02fd0ec94aca894c212c9d43c2916891542","82169f198ffdfc787fba368ccfad2b2d8ef3712f3c696df94ac13f6884bbbe2d","e8465811693dfe4e96ef2b3dffda539d6edfe896961b7af37b44db2c0e48532b",{"version":"e8bf92aabac2b11e1bf60a0161039cd6f5f0cd9713863ca2289dd7b10eddece8","affectsGlobalScope":true},"a84c95e04a7387764e5c9f03a1bb1083ffa1166254a517398524630e918f8627","2b8264b2fefd7367e0f20e2c04eed5d3038831fe00f5efbc110ff0131aab899b","29651525db5579157e617c77e869af8bfdc1130f5d811c1f759ad35b7bafc8ef","f8116d99ea6244e8b1492a9229b5d7e46e66f3fa21691d356ff173f03a14b6c9","341f07a69f65cbae19fc6ccf3c7ffe432365606d473d64d9be3d358ee2e86070","60aaac5fb1858fbd4c4eb40e01706eb227eed9eca5c665564bd146971280dbd3","3cfb0cb51cc2c2e1b313d7c4df04dbf7e5bda0a133c6b309bf6af77cf614b971","58a3914b1cce4560d9ad6eee2b716caaa030eda0a90b21ca2457ea9e2783eaa3","74b0245c42990ed8a849df955db3f4362c81b13f799ebc981b7bec2d5b414a57","3dce33e7eb25594863b8e615f14a45ab98190d85953436750644212d8a18c066",{"version":"fccaceadff070fd2caf21495a48c42444c28412556537a199cf1e57e30f70bf0","affectsGlobalScope":true},"f7e133b20ee2669b6c0e5d7f0cd510868c57cd64b283e68c7f598e30ce9d76d2","d9f5e2cb6bce0d05a252e991b33e051f6385299b0dd18d842fc863b59173a18e"],"options":{"composite":true,"declaration":true,"declarationMap":false,"esModuleInterop":true,"inlineSourceMap":false,"jsx":2,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitAny":true,"noImplicitReturns":false,"noImplicitThis":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./dist","rootDir":"./src","skipLibCheck":true,"sourceMap":false,"strict":true,"strictNullChecks":true,"strictPropertyInitialization":true,"target":2},"fileIdsList":[[103],[52,103],[57,58,103],[54,55,56,57,103],[58,103],[75,103,110,111],[103,119],[103,113,119],[103,114,115,116,117,118],[48,103],[103,122],[103,122,123],[75,103,110],[60,103],[63,103],[64,69,103],[65,75,76,83,92,102,103],[65,66,75,83,103],[67,103],[68,69,76,84,103],[69,92,99,103],[70,72,75,83,103],[71,103],[72,73,103],[74,75,103],[75,103],[75,76,77,92,102,103],[75,76,77,92,103],[78,83,92,102,103],[75,76,78,79,83,92,99,102,103],[78,80,92,99,102,103],[60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109],[75,81,103],[82,102,103],[72,75,83,92,103],[84,103],[85,103],[63,86,103],[87,101,103,107],[88,103],[89,103],[75,90,103],[90,91,103,105],[75,92,93,94,103],[92,94,103],[92,93,103],[95,103],[96,103],[75,97,98,103],[97,98,103],[69,83,99,103],[100,103],[83,101,103],[64,78,89,102,103],[69,103],[92,103,104],[103,105],[103,106],[64,69,75,77,86,92,102,103,105,107],[92,103,108],[48,103,119,132],[48,103,119],[44,45,46,47,103],[78,92,103,110],[103,110],[45,48,103,120],[103,140],[48,49,103]],"referencedMap":[[51,1],[53,2],[59,3],[54,1],[58,4],[55,5],[57,1],[112,6],[113,1],[117,7],[118,7],[114,8],[115,8],[116,8],[119,9],[120,10],[121,1],[122,1],[123,11],[124,12],[56,1],[125,1],[126,13],[127,1],[111,1],[128,1],[52,1],[60,14],[61,14],[63,15],[64,16],[65,17],[66,18],[67,19],[68,20],[69,21],[70,22],[71,23],[72,24],[73,24],[74,25],[75,26],[76,27],[77,28],[62,1],[109,1],[78,29],[79,30],[80,31],[110,32],[81,33],[82,34],[83,35],[84,36],[85,37],[86,38],[87,39],[88,40],[89,41],[90,42],[91,43],[92,44],[94,45],[93,46],[95,47],[96,48],[97,49],[98,50],[99,51],[100,52],[101,53],[102,54],[103,55],[104,56],[105,57],[106,58],[107,59],[108,60],[129,1],[130,1],[131,1],[46,1],[49,10],[133,61],[132,62],[134,10],[44,1],[48,63],[135,64],[136,1],[137,1],[47,1],[138,65],[139,66],[140,1],[141,67],[45,1],[9,1],[10,1],[14,1],[13,1],[3,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[21,1],[22,1],[4,1],[5,1],[26,1],[23,1],[24,1],[25,1],[27,1],[28,1],[29,1],[6,1],[30,1],[31,1],[32,1],[33,1],[7,1],[34,1],[35,1],[36,1],[37,1],[8,1],[42,1],[38,1],[39,1],[40,1],[41,1],[2,1],[1,1],[43,1],[12,1],[11,1],[50,68]],"exportedModulesMap":[[51,1],[53,2],[59,3],[54,1],[58,4],[55,5],[57,1],[112,6],[113,1],[117,7],[118,7],[114,8],[115,8],[116,8],[119,9],[120,10],[121,1],[122,1],[123,11],[124,12],[56,1],[125,1],[126,13],[127,1],[111,1],[128,1],[52,1],[60,14],[61,14],[63,15],[64,16],[65,17],[66,18],[67,19],[68,20],[69,21],[70,22],[71,23],[72,24],[73,24],[74,25],[75,26],[76,27],[77,28],[62,1],[109,1],[78,29],[79,30],[80,31],[110,32],[81,33],[82,34],[83,35],[84,36],[85,37],[86,38],[87,39],[88,40],[89,41],[90,42],[91,43],[92,44],[94,45],[93,46],[95,47],[96,48],[97,49],[98,50],[99,51],[100,52],[101,53],[102,54],[103,55],[104,56],[105,57],[106,58],[107,59],[108,60],[129,1],[130,1],[131,1],[46,1],[49,10],[133,61],[132,62],[134,10],[44,1],[48,63],[135,64],[136,1],[137,1],[47,1],[138,65],[139,66],[140,1],[141,67],[45,1],[9,1],[10,1],[14,1],[13,1],[3,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[21,1],[22,1],[4,1],[5,1],[26,1],[23,1],[24,1],[25,1],[27,1],[28,1],[29,1],[6,1],[30,1],[31,1],[32,1],[33,1],[7,1],[34,1],[35,1],[36,1],[37,1],[8,1],[42,1],[38,1],[39,1],[40,1],[41,1],[2,1],[1,1],[43,1],[12,1],[11,1]],"semanticDiagnosticsPerFile":[51,53,59,54,58,55,57,112,113,117,118,114,115,116,119,120,121,122,123,124,56,125,126,127,111,128,52,60,61,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,62,109,78,79,80,110,81,82,83,84,85,86,87,88,89,90,91,92,94,93,95,96,97,98,99,100,101,102,103,104,105,106,107,108,129,130,131,46,49,133,132,134,44,48,135,136,137,47,138,139,140,141,45,9,10,14,13,3,15,16,17,18,19,20,21,22,4,5,26,23,24,25,27,28,29,6,30,31,32,33,7,34,35,36,37,8,42,38,39,40,41,2,1,43,12,11,[50,[{"file":"./src/index.tsx","start":85,"length":25,"messageText":"Cannot find module '@waku/react-chat-sdk' or its corresponding type declarations.","category":1,"code":2307}]]]},"version":"4.4.3"}
diff --git a/packages/react-group-chat-example/webpack.config.js b/packages/react-group-chat-example/webpack.config.js
new file mode 100644
index 0000000..7a43998
--- /dev/null
+++ b/packages/react-group-chat-example/webpack.config.js
@@ -0,0 +1,88 @@
+const path = require('path');
+const HtmlWebpackPlugin = require('html-webpack-plugin');
+const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
+const webpack = require('webpack');
+const { ESBuildMinifyPlugin } = require('esbuild-loader');
+
+module.exports = env => {
+ const environment = env.ENV || 'development';
+ const communityKey = env.COMMUNITY_KEY || '';
+
+ return {
+ entry: './src/index.tsx',
+ output: {
+ filename: 'index.[fullhash].js',
+ path: path.join(__dirname, 'dist'),
+ publicPath: '/',
+ },
+ devtool: 'source-map',
+ resolve: {
+ extensions: ['.ts', '.tsx', '.js', '.json'],
+ fallback: {
+ buffer: require.resolve('buffer/'),
+ crypto: require.resolve('crypto-browserify'),
+ stream: require.resolve('stream-browserify'),
+ assert: require.resolve('assert/'),
+ http: require.resolve('stream-http'),
+ https: require.resolve('https-browserify'),
+ zlib: require.resolve('browserify-zlib')
+ },
+ },
+ module: {
+ rules: [
+ {
+ test: /\.tsx?$/,
+ loader: 'esbuild-loader',
+ exclude: /node_modules/,
+ options: {
+ loader: 'tsx',
+ target: 'es2018',
+ },
+ },
+ {
+ enforce: 'pre',
+ test: /\.js$/,
+ exclude: /node_modules/,
+ loader: 'source-map-loader',
+ },
+ {
+ test: /\.(png|svg|jpg|gif|woff|woff2|eot|ttf|otf|ico)$/,
+ use: ['file-loader'],
+ },
+ {
+ test: /\.css$/i,
+ use: ['style-loader', 'css-loader'],
+ },
+ ],
+ },
+ optimization: {
+ minimizer: [
+ new ESBuildMinifyPlugin({
+ target: 'es2018',
+ }),
+ ],
+ },
+ plugins: [
+ new ForkTsCheckerWebpackPlugin(),
+ new HtmlWebpackPlugin({
+ template: 'src/index.html',
+ }),
+ new webpack.DefinePlugin({
+ 'process.env.ENV': JSON.stringify(environment),
+ 'process.env.COMMUNITY_KEY': JSON.stringify(communityKey),
+ }),
+ new webpack.ProvidePlugin({
+ process: 'process/browser.js',
+ Buffer: ['buffer', 'Buffer'],
+ }),
+ ],
+ devServer: {
+ historyApiFallback: true,
+ host: '0.0.0.0',
+ stats: 'errors-only',
+ overlay: true,
+ hot: true,
+ },
+ stats: 'minimal',
+ };
+};
diff --git a/yarn.lock b/yarn.lock
index 0906a33..3c26c5e 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1343,6 +1343,60 @@ __metadata:
languageName: unknown
linkType: soft
+"@waku/react-group-chat-sdk-example@workspace:packages/react-group-chat-example":
+ version: 0.0.0-use.local
+ resolution: "@waku/react-group-chat-sdk-example@workspace:packages/react-group-chat-example"
+ dependencies:
+ "@testing-library/react-hooks": ^7.0.1
+ "@types/chai": ^4.2.21
+ "@types/mocha": ^9.0.0
+ "@types/node": ^16.4.12
+ "@types/react": ^17.0.15
+ "@types/react-dom": ^17.0.9
+ "@types/react-router": ^5.1.16
+ "@types/react-router-dom": ^5.1.8
+ "@types/styled-components": ^5.1.12
+ "@typescript-eslint/eslint-plugin": ^4.29.0
+ "@typescript-eslint/parser": ^4.29.0
+ "@waku/react-chat-sdk": ^0.1.0
+ assert: ^2.0.0
+ browserify-zlib: ^0.2.0
+ buffer: ^6.0.3
+ chai: ^4.3.4
+ crypto-browserify: ^3.12.0
+ css-loader: ^6.3.0
+ esbuild-loader: ^2.15.1
+ eslint: ^7.32.0
+ eslint-plugin-hooks: ^0.2.0
+ eslint-plugin-react: ^7.24.0
+ file-loader: ^6.2.0
+ fork-ts-checker-webpack-plugin: ^6.3.1
+ html-webpack-plugin: ^5.3.2
+ https-browserify: ^1.0.0
+ jsdom: ^16.7.0
+ jsdom-global: ^3.0.2
+ mocha: ^9.0.3
+ npm-run-all: ^4.1.5
+ prettier: ^2.3.2
+ process: ^0.11.10
+ react: ^17.0.2
+ react-dom: ^17.0.2
+ react-router-dom: ^5.2.0
+ rimraf: ^3.0.2
+ source-map-loader: ^3.0.0
+ stream-browserify: ^3.0.0
+ stream-http: ^3.2.0
+ style-loader: ^3.3.0
+ styled-components: ^5.3.1
+ ts-loader: ^9.2.5
+ ts-node: ^10.1.0
+ typescript: ^4.3.5
+ webpack: ^5.48.0
+ webpack-cli: ^4.7.2
+ webpack-dev-server: ^3.11.2
+ languageName: unknown
+ linkType: soft
+
"@waku/status-communities@^0.1.0, @waku/status-communities@workspace:packages/status-communities":
version: 0.0.0-use.local
resolution: "@waku/status-communities@workspace:packages/status-communities"