diff --git a/packages/react-chat/src/components/Chat.tsx b/packages/react-chat/src/components/Chat.tsx index e55cbb0..408ad16 100644 --- a/packages/react-chat/src/components/Chat.tsx +++ b/packages/react-chat/src/components/Chat.tsx @@ -1,5 +1,4 @@ import React, { useMemo, useState } from "react"; -import { Identity } from "status-communities/dist/cjs"; import styled from "styled-components"; import { useMessengerContext } from "../contexts/messengerProvider"; @@ -15,11 +14,7 @@ import { CommunityModal } from "./Modals/CommunityModal"; import { EditModal } from "./Modals/EditModal"; import { CommunitySkeleton } from "./Skeleton/CommunitySkeleton"; -interface ChatProps { - identity: Identity; -} - -export function Chat({ identity }: ChatProps) { +export function Chat() { const [showMembers, setShowMembers] = useState(true); const [showChannels, setShowChannels] = useState(true); const [membersList, setMembersList] = useState([]); @@ -72,7 +67,6 @@ export function Chat({ identity }: ChatProps) { {!createChat && ( setShowMembers(!showMembers)} showMembers={showMembers} community={communityData} @@ -88,14 +82,12 @@ export function Chat({ identity }: ChatProps) { )} {showMembers && !narrow && !createChat && ( )} {createChat && communityData && ( void; showMembers: boolean; @@ -36,7 +34,6 @@ interface ChatBodyProps { } export function ChatBody({ - identity, community, onClick, showMembers, @@ -78,7 +75,6 @@ export function ChatBody({ {editGroup && community ? ( ([]); diff --git a/packages/react-chat/src/components/ChatLoader.tsx b/packages/react-chat/src/components/ChatLoader.tsx index 1a300cb..f58e44a 100644 --- a/packages/react-chat/src/components/ChatLoader.tsx +++ b/packages/react-chat/src/components/ChatLoader.tsx @@ -1,6 +1,7 @@ import React, { useState } from "react"; import { Identity } from "status-communities/dist/cjs"; +import { IdentityProvider } from "../contexts/identityProvider"; import { MessengerProvider } from "../contexts/messengerProvider"; import { Chat } from "./Chat"; @@ -15,9 +16,11 @@ export function ChatLoader({ communityKey }: ChatLoaderProps) { if (identity) { return ( - - - + + + + + ); } else { return ; diff --git a/packages/react-chat/src/components/Members/Members.tsx b/packages/react-chat/src/components/Members/Members.tsx index d5a3324..9b9ba13 100644 --- a/packages/react-chat/src/components/Members/Members.tsx +++ b/packages/react-chat/src/components/Members/Members.tsx @@ -1,25 +1,18 @@ import React from "react"; -import { Identity } from "status-communities/dist/cjs"; import styled from "styled-components"; import { MembersList } from "./MembersList"; interface MembersProps { - identity: Identity; setShowChannels: (val: boolean) => void; setMembersList: any; } -export function Members({ - identity, - setShowChannels, - setMembersList, -}: MembersProps) { +export function Members({ setShowChannels, setMembersList }: MembersProps) { return ( Members diff --git a/packages/react-chat/src/components/Members/MembersList.tsx b/packages/react-chat/src/components/Members/MembersList.tsx index 8d9b162..fba80e3 100644 --- a/packages/react-chat/src/components/Members/MembersList.tsx +++ b/packages/react-chat/src/components/Members/MembersList.tsx @@ -1,27 +1,27 @@ import React from "react"; -import { Identity, utils } from "status-communities/dist/cjs"; +import { utils } from "status-communities/dist/cjs"; import { bufToHex } from "status-communities/dist/cjs/utils"; import styled from "styled-components"; +import { useIdentity } from "../../contexts/identityProvider"; import { useMessengerContext } from "../../contexts/messengerProvider"; import { UserIcon } from "../Icons/UserIcon"; import { Member, MemberData, MemberIcon } from "./Member"; interface MembersListProps { - identity: Identity; setShowChannels: (val: boolean) => void; setShowMembers?: (val: boolean) => void; setMembersList: any; } export function MembersList({ - identity, setShowChannels, setShowMembers, setMembersList, }: MembersListProps) { const { contacts } = useMessengerContext(); + const identity = useIdentity(); return ( diff --git a/packages/react-chat/src/components/NarrowMode/NarrowMembers.tsx b/packages/react-chat/src/components/NarrowMode/NarrowMembers.tsx index d8e7734..2320781 100644 --- a/packages/react-chat/src/components/NarrowMode/NarrowMembers.tsx +++ b/packages/react-chat/src/components/NarrowMode/NarrowMembers.tsx @@ -1,5 +1,4 @@ import React from "react"; -import { Identity } from "status-communities/dist/cjs"; import styled from "styled-components"; import { CommunityData } from "../../models/CommunityData"; @@ -8,7 +7,6 @@ import { MembersList } from "../Members/MembersList"; import { NarrowTopbar } from "./NarrowTopbar"; interface NarrowMembersProps { - identity: Identity; community: CommunityData; setShowChannels: (val: boolean) => void; setShowMembersList: (val: boolean) => void; @@ -16,7 +14,6 @@ interface NarrowMembersProps { } export function NarrowMembers({ - identity, community, setShowChannels, setShowMembersList, @@ -26,7 +23,6 @@ export function NarrowMembers({ ; +}