diff --git a/packages/react-chat/src/components/Chat.tsx b/packages/react-chat/src/components/Chat.tsx index 99149afb..64bad96c 100644 --- a/packages/react-chat/src/components/Chat.tsx +++ b/packages/react-chat/src/components/Chat.tsx @@ -12,6 +12,7 @@ import { Members } from "./Members/Members"; import { CommunityModal } from "./Modals/CommunityModal"; import { EditModal } from "./Modals/EditModal"; import { ProfileModal } from "./Modals/ProfileModal"; +import { ToastMessageList } from "./ToastMessages/ToastMessageList"; function Modals() { return ( @@ -45,6 +46,7 @@ export function Chat() { {showMembers && !narrow && state === ChatState.ChatBody && } {state === ChatState.ChatCreation && } + ); } @@ -53,6 +55,7 @@ const ChatWrapper = styled.div` width: 100%; height: 100%; display: flex; + position: relative; `; const ChannelsWrapper = styled.div` diff --git a/packages/react-chat/src/components/Modals/ProfileModal.tsx b/packages/react-chat/src/components/Modals/ProfileModal.tsx index 153c30f1..2d85e124 100644 --- a/packages/react-chat/src/components/Modals/ProfileModal.tsx +++ b/packages/react-chat/src/components/Modals/ProfileModal.tsx @@ -5,6 +5,7 @@ import styled from "styled-components"; import { useActivities } from "../../contexts/activityProvider"; import { useIdentity } from "../../contexts/identityProvider"; import { useModal } from "../../contexts/modalProvider"; +import { useToasts } from "../../contexts/toastProvider"; import { useManageContact } from "../../hooks/useManageContact"; import { copy } from "../../utils"; import { buttonStyles } from "../Buttons/buttonStyle"; @@ -42,6 +43,8 @@ export const ProfileModal = () => { ); const { setActivities } = useActivities(); + const { setToasts } = useToasts(); + const { setModal } = useModal(ProfileModalName); const identity = useIdentity(); const isUser = useMemo( @@ -160,6 +163,7 @@ export const ProfileModal = () => { maxLength={280} onInput={(e) => setRequest(e.currentTarget.value)} required + autoFocus /> )} @@ -201,7 +205,15 @@ export const ProfileModal = () => { status: "sent", }, ]), + setToasts((prev) => [ + ...prev, + { + id: id + request, + type: "request", + }, + ]), setRequestCreation(false), + setModal(false), setRequest(""); }} > diff --git a/packages/react-chat/src/components/ReactChat.tsx b/packages/react-chat/src/components/ReactChat.tsx index c1bdaa96..4af8590f 100644 --- a/packages/react-chat/src/components/ReactChat.tsx +++ b/packages/react-chat/src/components/ReactChat.tsx @@ -6,6 +6,7 @@ import { ActivityProvider } from "../contexts/activityProvider"; import { FetchMetadataProvider } from "../contexts/fetchMetadataProvider"; 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"; @@ -30,11 +31,13 @@ export function ReactChat({ - - - -