diff --git a/src/assets/Icons/ChatIcon.tsx b/src/assets/Icons/ChatIcon.tsx index fdc5945..f68ed35 100644 --- a/src/assets/Icons/ChatIcon.tsx +++ b/src/assets/Icons/ChatIcon.tsx @@ -1,8 +1,8 @@ import React from 'react'; -export const ChatIcon= ({ color = 'white', height, width }) => { +export const ChatIcon= ({ color = 'white', height = 15, width = 15 }) => { return ( - + diff --git a/src/assets/Icons/MembersIcon.tsx b/src/assets/Icons/MembersIcon.tsx index a37680e..8bbc0e1 100644 --- a/src/assets/Icons/MembersIcon.tsx +++ b/src/assets/Icons/MembersIcon.tsx @@ -1,8 +1,8 @@ import React from 'react'; -export const MembersIcon= ({ color = 'white', height, width }) => { +export const MembersIcon= ({ color = 'white', height = 9, width = 15 }) => { return ( - + diff --git a/src/assets/Icons/NotificationIcon2.tsx b/src/assets/Icons/NotificationIcon2.tsx index e670888..10d7a03 100644 --- a/src/assets/Icons/NotificationIcon2.tsx +++ b/src/assets/Icons/NotificationIcon2.tsx @@ -1,8 +1,8 @@ import React from 'react'; -export const NotificationIcon2= ({ color = 'white', height, width }) => { +export const NotificationIcon2= ({ color = 'white', height = 15, width = 15 }) => { return ( - + diff --git a/src/assets/Icons/ThreadsIcon.tsx b/src/assets/Icons/ThreadsIcon.tsx index 7a42763..86dfeaa 100644 --- a/src/assets/Icons/ThreadsIcon.tsx +++ b/src/assets/Icons/ThreadsIcon.tsx @@ -1,11 +1,11 @@ import React from 'react'; -export const ThreadsIcon= ({ color = 'white', height, width }) => { +export const ThreadsIcon= ({ color = 'white', height = 11, width = 15 }) => { return ( - - - - + + + + ); diff --git a/src/assets/svgs/Forum.svg b/src/assets/svgs/Forum.svg new file mode 100644 index 0000000..7957b06 --- /dev/null +++ b/src/assets/svgs/Forum.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/components/Chat/ChatGroup.tsx b/src/components/Chat/ChatGroup.tsx index 8dbf927..44446cf 100644 --- a/src/components/Chat/ChatGroup.tsx +++ b/src/components/Chat/ChatGroup.tsx @@ -388,7 +388,7 @@ const clearEditorContent = () => { return (
{ + return ( + + {children} + + {label} + + + ); +}; + +export const DesktopHeader = ({ + selectedGroup, + groupSection, + isUnread, + goToAnnouncements, + isUnreadChat, + goToChat, + goToThreads, + setOpenManageMembers, + groupChatHasUnread, + groupsAnnHasUnread, + directChatHasUnread, + chatMode, + openDrawerGroups, + goToHome, + setIsOpenDrawerProfile, + mobileViewMode, + setMobileViewMode, + setMobileViewModeKeepOpen, + hasUnreadGroups, + hasUnreadDirects, + isHome, + isGroups, + isDirects, + setDesktopSideView, + hasUnreadAnnouncements, + isAnnouncement, + hasUnreadChat, + isChat, + isForum, + setGroupSection +}) => { + const [value, setValue] = React.useState(0); + return ( + + + + {selectedGroup?.groupName} + + + + { + goToHome(); + }} + > + + + + + { + setDesktopSideView("groups"); + }} + > + + + + + { + setDesktopSideView("directs"); + }} + > + + + + + + { + goToAnnouncements() + }} + > + + + + + + { + goToChat() + }} + > + + + + + + { + setGroupSection("forum"); + + }} + > + + + + + { + setOpenManageMembers(true) + + }} + > + + + + + + + ); +}; diff --git a/src/components/Group/Group.tsx b/src/components/Group/Group.tsx index 365e094..e407acc 100644 --- a/src/components/Group/Group.tsx +++ b/src/components/Group/Group.tsx @@ -87,6 +87,7 @@ import { ReturnIcon } from "../../assets/Icons/ReturnIcon"; import { ExitIcon } from "../../assets/Icons/ExitIcon"; import { HomeDesktop } from "./HomeDesktop"; import { DesktopFooter } from "../Desktop/DesktopFooter"; +import { DesktopHeader } from "../Desktop/DesktopHeader"; // let touchStartY = 0; // let disablePullToRefresh = false; @@ -807,13 +808,20 @@ export const Group = ({ } }; + useEffect(()=> { + if(!selectedGroup) return + getGroupOwner(selectedGroup?.groupId); + }, [selectedGroup]) + + console.log('groupOwner', groupOwner) + useEffect(() => { - if (selectedGroup) { + if (selectedGroup && groupOwner && groupOwner?.isOpen === false) { setTriedToFetchSecretKey(false); getSecretKey(true); - getGroupOwner(selectedGroup?.groupId); + // getGroupOwner(selectedGroup?.groupId); } - }, [selectedGroup]); + }, [selectedGroup, groupOwner]); // const handleNotification = async (data)=> { // try { @@ -1320,6 +1328,7 @@ export const Group = ({ setNewChat(false); setSecretKey(null); + setGroupOwner(null) lastFetchedSecretKey.current = null; setSecretKeyPublishDate(null); setAdmins([]); @@ -1367,6 +1376,7 @@ export const Group = ({ setChatMode("groups"); setSelectedGroup(null); setSecretKey(null); + setGroupOwner(null) lastFetchedSecretKey.current = null; setSecretKeyPublishDate(null); setAdmins([]); @@ -1425,6 +1435,7 @@ export const Group = ({ setChatMode("groups"); setSelectedGroup(null); setSecretKey(null); + setGroupOwner(null) lastFetchedSecretKey.current = null; setSecretKeyPublishDate(null); setAdmins([]); @@ -1475,6 +1486,7 @@ export const Group = ({ setNewChat(false); setSelectedDirect(null); setSecretKey(null); + setGroupOwner(null) lastFetchedSecretKey.current = null; setSecretKeyPublishDate(null); setAdmins([]); @@ -1970,6 +1982,7 @@ export const Group = ({ setAdmins([]); setSecretKeyDetails(null); setAdminsWithNames([]); + setGroupOwner(null) setMembers([]); setMemberCountFromSecretKeyData(null); setHideCommonKeyPopup(false); @@ -2153,6 +2166,7 @@ export const Group = ({ info={infoSnack} setInfo={setInfoSnack} /> + {isMobile && (
+ {!isMobile && selectedGroup && ( + + + + )} {isMobile && ( {triedToFetchSecretKey && ( @@ -2572,7 +2624,7 @@ export const Group = ({ )} - {!isMobile && ( + {!isMobile && groupSection === "home" && ( - + {/* - )} + )} */} {/* )} - {!loading && groupsWithJoinRequests.length === 0 && ( + {!loading && (groupsWithJoinRequests.length === 0 || groupsWithJoinRequests?.filter((group)=> group?.data?.length > 0).length === 0) && ( {`, ${userInfo?.name}`} ) : null} - + {!isLoadingGroups && (