Skip to content

Commit

Permalink
Merge pull request #250 from NateshR/release/v1.14.0
Browse files Browse the repository at this point in the history
Release v1.14.0
  • Loading branch information
omenUchiha authored May 3, 2024
2 parents 1181eca + f4d906f commit 1158f62
Show file tree
Hide file tree
Showing 14 changed files with 628 additions and 188 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
REACT_APP_API_KEY =
REACT_APP_XPLATFORM_CODE = rt
REACT_APP_XVERSION_CODE = 38
REACT_APP_XVERSION_CODE = 39
SKIP_PREFLIGHT_CHECK=true
68 changes: 34 additions & 34 deletions .firebase/hosting.YnVpbGQ.cache
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
robots.txt,1711966042603,391d14b3c2f8c9143a27a28c7399585142228d4d1bdbe2c87ac946de411fa9a2
asset-manifest.json,1711966091947,70272fea83f0b3730cfb92cf25ba8cff0c9f6fe6c9d4f06fd36e5c81d4d19ca6
manifest.json,1711966042602,341d52628782f8ac9290bbfc43298afccb47b7cbfcee146ae30cf0f46bc30900
index.html,1711966091919,d8c23a1f71b1b3bd96615d54fb76d07b8c06ee8d80b7930fed46e674db1760fa
favicon.ico,1711966042600,b72f7455f00e4e58792d2bca892abb068e2213838c0316d6b7a0d6d16acd1955
static/js/main.4cfb1026.js.LICENSE.txt,1711966091947,1dd5348860a98e6dd4035891cda394702fd6aeb1c6d22a08b60fb851371784f6
static/media/abm.0c8d0a92900c532757d3d9affd120633.svg,1711966091916,567591cea3d1883031e623eda49e05bf26d32832d49e5aa7c285319e44f89406
logo192.png,1711966042601,caff018b7f1e8fd481eb1c50d75b0ef236bcd5078b1d15c8bb348453fee30293
logo512.png,1711966042602,191fc21360b4ccfb1cda11a1efb97f489ed22672ca83f4064316802bbfdd750e
static/media/arrow-left.1e1cbca73f3ffe7b532bf956255e7891.svg,1711966091916,ab7e6de688683a289f3b0fa7fd9b88f50bb9822a199963cc848600bf0ab5880b
static/media/accept.4e9da557a936c99bda6fe77927f9efb9.svg,1711966091942,931edbc52705e06e7f96c42354f0087188af31c5505d8fee515db9a579e38987
static/media/camera.8c8136405c69e736dcd7c4f2fb117ffd.svg,1711966091917,a9ce31ef4b58f9cf698916bda7fd74ba43a13851273f3bf8d1341c6a2e4e73dc
static/media/cancel.b76a728373298319aa4162cc45fd32aa.svg,1711966091917,4124f410ec98059d6b0c877ff142ab0a4f80c0bc44cf6891850e18c6afb806ad
static/media/dm.ec00e8820014b69a9f11e229eacd53bd.svg,1711966091917,4f96a5d3916258d89c21ab6e8a123023d5021c142a26e848817062bace321255
static/media/checkMark.120f6501b12ba27e123a95236330ad88.svg,1711966091950,793c00904aeb76c4e4b1c93689a35768cd32fb0b383c58bb086cecf787fdb464
static/css/main.f92c7d92.css,1711966091947,aea4bc2844c25b913d4c17acd3133b38e5e778172b5bbcb2126ff1d6127f2af0
static/media/forum.e804e6e6cde99822a29c8eb02599389b.svg,1711966091917,42a3b1d070aac3f54e603a42e2c0c10f96d19f802c9c2bf957fb77fc63815dda
static/media/events.2b4b8fdb79d01ebfe38f2a92bda2d1ab.svg,1711966091917,1e78063cab04ebe9bc585ca5c0c9371fa8ea72f5ea3e20ed6fc0df4232456263
static/media/giffy.c9de18de750545bdd71ac8ebe81e1aa0.svg,1711966091917,133734fdd9b48b14c39f2b85ec48ea898e1552dfa1eca6bd64b427a72869b784
static/media/groups.482b6aa7e78319d1fa9e77d609f1cf54.svg,1711966091916,98444fa800f478795ceeee4b387f2fe7e4c6c2169324ff87a7cd95c4a4df3b81
static/media/more-vertical.260b2bef498c3e9834d9a47a22952fdc.svg,1711966091943,888cd38c98ad521379b4d3e79ada625ede3f024d54daea6b23448554a2ee1341
static/media/menu.e6cfe0dc688d828f8bb50fba766e1cbe.svg,1711966091942,0a988f6608d1e787dcdd092f74095d843edc7a85d8cc8fee6dcf79dbb5bb5276
static/media/pdf-document.79777399c9e50edf7fbd39ee3a28c230.svg,1711966091916,15519dee941e51fb66cb274fd5597810c9d51d3760257885114bbad95342ad2f
static/media/paperclip.bdfef3e16b5867497ec7d146471ec318.svg,1711966091918,f31276b2b8767bdf7faff0d31b9761a67dc2573f283e1ea98c6f8f833229699b
static/media/search.a176386538cf80eabcb8b415dc9f62d1.svg,1711966091916,ed409b7b2aecf0a672de20baa6cf2d1560e808ef4a17403bce8e01b040467a9f
static/media/right-arrow.3ecedc4c33bc5afc087d5e5a1c06dab3.svg,1711966091916,84b7d2e3996caba4f77b114f7264df832f688571546452f7365492ebea47c89e
static/media/searchBoxIcon.3d5b38edd72280bcfdcfb6fddb489336.svg,1711966091942,74a80552dd72073ded6bd6506cdb67d472014764389fa5e64fc60e7bbfa1ce5e
static/media/send.f9e22b549375df73794ecf361099b0d7.svg,1711966091916,e2cdd6a775b04e48b91cc97acfa12a0f99630e3b5ae78278f206b531349674a8
static/media/smile.5656bc7ba72554d31789f300dd4073c4.svg,1711966091917,81df6977e8b3084f5f78a2528b7ed07082fb2b9e092032409f0118ce007d95a5
static/css/main.f92c7d92.css.map,1711966091949,39149110cfd9973a5e9898ff9e17b5b1699d28a568409c2d4fa4954fe5b6fac9
static/media/traya_logo.7609c303424b3afff3fd.webp,1711966091943,672bed057f8f8a81a5960ce64a8c78d0db8b25bc877bdb91fd465f02aa9e0723
static/media/noResults.91392261b0d70ec333af73e2eb24826f.svg,1711966091942,f48be8ac669703f5693684a2e70a8d92d6c08d4b5f0e21bd65c7b7924c98705c
static/js/main.4cfb1026.js,1711966091947,3d750a88a22ad1aa4a9a4def36ed41f9435b76d66d7d3911b5a7b1c8f87083e0
static/js/main.4cfb1026.js.map,1711966091945,bfe3da8f7437724855552f9cbbfa4d829443af66664a7416a9098eaf072341dd
asset-manifest.json,1714641848016,99c5a1fa9c35eba0618460cb3f284740e5b49a909765f617a8544b71c4a83596
index.html,1714641847992,6f0be882e98769e13323084b3653f13cd513ae12a9e690d8ed01ddc038c35764
favicon.ico,1714641786255,b72f7455f00e4e58792d2bca892abb068e2213838c0316d6b7a0d6d16acd1955
manifest.json,1714641786258,341d52628782f8ac9290bbfc43298afccb47b7cbfcee146ae30cf0f46bc30900
logo192.png,1714641786256,caff018b7f1e8fd481eb1c50d75b0ef236bcd5078b1d15c8bb348453fee30293
robots.txt,1714641786258,391d14b3c2f8c9143a27a28c7399585142228d4d1bdbe2c87ac946de411fa9a2
logo512.png,1714641786257,191fc21360b4ccfb1cda11a1efb97f489ed22672ca83f4064316802bbfdd750e
static/js/main.fac608c6.js.LICENSE.txt,1714641848016,1dd5348860a98e6dd4035891cda394702fd6aeb1c6d22a08b60fb851371784f6
static/css/main.982acfb1.css,1714641848152,83a8475dda8cf15d96ec9c5ec4de5e7141b90bda7e6a4b825ccd4bcfa126d626
static/media/accept.4e9da557a936c99bda6fe77927f9efb9.svg,1714641848016,931edbc52705e06e7f96c42354f0087188af31c5505d8fee515db9a579e38987
static/media/abm.0c8d0a92900c532757d3d9affd120633.svg,1714641847989,567591cea3d1883031e623eda49e05bf26d32832d49e5aa7c285319e44f89406
static/media/arrow-left.1e1cbca73f3ffe7b532bf956255e7891.svg,1714641847990,ab7e6de688683a289f3b0fa7fd9b88f50bb9822a199963cc848600bf0ab5880b
static/media/cancel.b76a728373298319aa4162cc45fd32aa.svg,1714641848016,4124f410ec98059d6b0c877ff142ab0a4f80c0bc44cf6891850e18c6afb806ad
static/media/camera.8c8136405c69e736dcd7c4f2fb117ffd.svg,1714641847990,a9ce31ef4b58f9cf698916bda7fd74ba43a13851273f3bf8d1341c6a2e4e73dc
static/media/checkMark.120f6501b12ba27e123a95236330ad88.svg,1714641848016,793c00904aeb76c4e4b1c93689a35768cd32fb0b383c58bb086cecf787fdb464
static/media/dm.ec00e8820014b69a9f11e229eacd53bd.svg,1714641847990,4f96a5d3916258d89c21ab6e8a123023d5021c142a26e848817062bace321255
static/media/events.2b4b8fdb79d01ebfe38f2a92bda2d1ab.svg,1714641847990,1e78063cab04ebe9bc585ca5c0c9371fa8ea72f5ea3e20ed6fc0df4232456263
static/media/forum.e804e6e6cde99822a29c8eb02599389b.svg,1714641847988,42a3b1d070aac3f54e603a42e2c0c10f96d19f802c9c2bf957fb77fc63815dda
static/media/groups.482b6aa7e78319d1fa9e77d609f1cf54.svg,1714641847990,98444fa800f478795ceeee4b387f2fe7e4c6c2169324ff87a7cd95c4a4df3b81
static/media/giffy.c9de18de750545bdd71ac8ebe81e1aa0.svg,1714641847990,133734fdd9b48b14c39f2b85ec48ea898e1552dfa1eca6bd64b427a72869b784
static/media/more-vertical.260b2bef498c3e9834d9a47a22952fdc.svg,1714641847990,888cd38c98ad521379b4d3e79ada625ede3f024d54daea6b23448554a2ee1341
static/media/menu.e6cfe0dc688d828f8bb50fba766e1cbe.svg,1714641848016,0a988f6608d1e787dcdd092f74095d843edc7a85d8cc8fee6dcf79dbb5bb5276
static/media/pdf-document.79777399c9e50edf7fbd39ee3a28c230.svg,1714641847989,15519dee941e51fb66cb274fd5597810c9d51d3760257885114bbad95342ad2f
static/media/paperclip.bdfef3e16b5867497ec7d146471ec318.svg,1714641847989,f31276b2b8767bdf7faff0d31b9761a67dc2573f283e1ea98c6f8f833229699b
static/media/search.a176386538cf80eabcb8b415dc9f62d1.svg,1714641847989,ed409b7b2aecf0a672de20baa6cf2d1560e808ef4a17403bce8e01b040467a9f
static/media/right-arrow.3ecedc4c33bc5afc087d5e5a1c06dab3.svg,1714641847989,84b7d2e3996caba4f77b114f7264df832f688571546452f7365492ebea47c89e
static/media/searchBoxIcon.3d5b38edd72280bcfdcfb6fddb489336.svg,1714641848016,74a80552dd72073ded6bd6506cdb67d472014764389fa5e64fc60e7bbfa1ce5e
static/media/smile.5656bc7ba72554d31789f300dd4073c4.svg,1714641847990,81df6977e8b3084f5f78a2528b7ed07082fb2b9e092032409f0118ce007d95a5
static/css/main.982acfb1.css.map,1714641848152,c1444843f9aea63d2149d35477d7b873ed928dadef8a1bb629b43158c0f16ab7
static/media/traya_logo.7609c303424b3afff3fd.webp,1714641848016,672bed057f8f8a81a5960ce64a8c78d0db8b25bc877bdb91fd465f02aa9e0723
static/media/send.f9e22b549375df73794ecf361099b0d7.svg,1714641847989,e2cdd6a775b04e48b91cc97acfa12a0f99630e3b5ae78278f206b531349674a8
static/media/noResults.91392261b0d70ec333af73e2eb24826f.svg,1714641848016,f48be8ac669703f5693684a2e70a8d92d6c08d4b5f0e21bd65c7b7924c98705c
static/js/main.fac608c6.js,1714641848151,3156c119d9e27ea9e3ac20fc290095873f250dc5d2c929e4f5c5b9ba33a1aa8b
static/js/main.fac608c6.js.map,1714641848102,d3309563fd560c215730eccaf941afc223090d473a18aea52a4495671eddfd63
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"@emotion/react": "11.10.5",
"@emotion/styled": "11.10.5",
"@giphy/react-components": "^9.2.3",
"@likeminds.community/chat-js": "^1.5.0",
"@likeminds.community/chat-js": "1.7.1",
"@mui/icons-material": "5.10.9",
"@mui/material": "5.10.13",
"@mui/x-date-pickers": "6.9.1",
Expand Down
13 changes: 13 additions & 0 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,17 @@
display: inline-block;
line-height: 24px;
z-index: 1;
}

.isEdited-conversation-tag::after {
content: "";
height: 2px;
width: 2px;
border-radius: 50%;
background-color: #323232;
display: inline-block;
color: #323232;
margin-bottom: 2px;
margin-right: 2px;
margin-left: 1px;
}
179 changes: 139 additions & 40 deletions src/modules/components/channel-search/index.tsx
Original file line number Diff line number Diff line change
@@ -1,37 +1,53 @@
import { IconButton } from "@mui/material";
import React, { useContext, useEffect, useRef, useState } from "react";
import React, {
useCallback,
useContext,
useEffect,
useRef,
useState,
} from "react";
import ArrowBackIcon from "@mui/icons-material/ArrowBack";
import { myClient } from "../../..";
import searchConversationsInsideChatroom from "../../../sdkFunctions/searchFunctions";
import routeVariable from "../../../enums/routeVariables";
import { useParams } from "react-router";
import ProfileTile from "./profile-tile";
import ProfileTile, { MemberSearchProfileTile } from "./profile-tile";
import { log } from "../../../sdkFunctions";
import { ref } from "@firebase/database";
import InfiniteScroll from "react-infinite-scroll-component";
import { GeneralContext } from "../../contexts/generalContext";
import { useLocation } from "react-router-dom";
// import { log } from "console";
// log

const ChannelSearch = ({ setOpenSearch }: any) => {
// states for member search
const [memberSearchKey, setMemberSearchkey] = useState("");
const [loadMoreMembers, setLoadModeMembers] = useState(true);
const [searchMembersPageCount, setSearchMembersPageCount] = useState(1);
const [memberSearchArray, setMemberSearchArray] = useState<any[]>([]);
const generalContext = useContext(GeneralContext);
// states for conversations search
const [searchKey, setSearchKey] = useState("");
const [searchState, setSearchState] = useState(0);
const [searchArray, setSearchArray] = useState<any>([]);

const [loadMoreConversations, setLoadMoreConversations] = useState(true);
const params = useParams();
const id = params[routeVariable.id];

const id = params[routeVariable.id];
const operation = params[routeVariable.operation];
const searchInputBoxRef = useRef<HTMLDivElement>(null);

const generalContext = useContext(GeneralContext);
function setSearchString(e: any) {
setSearchKey(e.target.value);
}
function setMemberSearchString(e: any) {
setMemberSearchkey(e.target.value);
}
async function searchFunction() {
try {
const pageNo = Math.floor(searchArray?.length / 20) + 1;
// console.log("the page is");
// console.log(searchArray);
const pageSize = 20;
const call = await searchConversationsInsideChatroom(
id!.toString(),
Expand All @@ -44,7 +60,7 @@ const ChannelSearch = ({ setOpenSearch }: any) => {
}
})(),
pageNo,
pageSize,
pageSize
);
const response: any = call?.data?.conversations;
log("the profiles after the search are");
Expand All @@ -60,15 +76,43 @@ const ChannelSearch = ({ setOpenSearch }: any) => {
}
}

const searchMembers = useCallback(
async function (pgNo?: number) {
try {
const call = await myClient.viewParticipants({
// searchKey: memberSearchKey,
participantName: memberSearchKey,
page: pgNo || searchMembersPageCount,
pageSize: 10,
isSecret: generalContext.currentChatroom.is_secret || false,
chatroomId: parseInt(id || ""),
});
const members: any = call?.data?.participants;
if (!members.length) {
setLoadModeMembers(false);
} else {
setSearchMembersPageCount((pageCount) => pageCount + 1);
setMemberSearchArray((currentMembers: any) => {
const newMemberList = [...currentMembers, ...members];
return newMemberList;
});
}
} catch (error) {
console.log(error);
}
},
[
memberSearchArray,
memberSearchKey,
searchMembersPageCount,
generalContext,
id,
]
);

useEffect(() => {
function searchClickHandler(e: any) {
// if (
// searchInputBoxRef.current &&
// !searchInputBoxRef.current.contains(e.target)
// ) {
// setOpenSearch(false);
// log(e);
// }
//
}
document.addEventListener("click", searchClickHandler, true);
return () => {
Expand All @@ -77,20 +121,36 @@ const ChannelSearch = ({ setOpenSearch }: any) => {
}, [searchInputBoxRef]);

useEffect(() => {
const searchChatroomTimeOut = setTimeout(() => {
searchFunction();
}, 500);
return () => {
clearTimeout(searchChatroomTimeOut);
};
if (operation !== "info") {
const searchChatroomTimeOut = setTimeout(() => {
searchFunction();
}, 500);
return () => {
clearTimeout(searchChatroomTimeOut);
};
}
}, [searchKey]);

useEffect(() => {
if (operation === "info") {
const memberSearchTimeout = setTimeout(() => {
searchMembers(1);
}, 500);
return () => {
clearTimeout(memberSearchTimeout);
setSearchMembersPageCount((prev) => 1);
setLoadModeMembers(true);
setMemberSearchArray((p) => []);
};
}
}, [memberSearchKey]);

// for rendering the profiles
function renderProfiles() {
try {
return searchArray?.map((profile: any) => {
return (
<div className="my-2" key={profile?.id}>
<div className="py-2 hover:bg-[#efefef]" key={profile?.id}>
<ProfileTile profile={profile} setOpenSearch={setOpenSearch} />
</div>
);
Expand All @@ -100,6 +160,26 @@ const ChannelSearch = ({ setOpenSearch }: any) => {
log(error);
}
}
function renderSearchMembersProfiles() {
try {
if (!memberSearchArray.length) {
return <div className="p-4">No Profile found</div>;
}
return memberSearchArray?.map((profile: any) => {
return (
<div className="py-2 hover:bg-[#efefef]" key={profile?.uuid}>
<MemberSearchProfileTile
profile={profile}
setOpenSearch={setOpenSearch}
/>
</div>
);
});
} catch (error) {
log("error in renderProfiles");
log(error);
}
}
return (
<div className="">
<div
Expand All @@ -120,33 +200,52 @@ const ChannelSearch = ({ setOpenSearch }: any) => {
</IconButton>
<input
type="text"
value={searchKey}
onChange={setSearchString}
placeholder={`Search withing ${generalContext.currentChatroom?.header}`}
value={operation === "info" ? memberSearchKey : searchKey}
onChange={
operation === "info" ? setMemberSearchString : setSearchString
}
placeholder={
operation === "info"
? `Search for members within this group`
: `Search withing ${generalContext.currentChatroom?.header}`
}
className="py-3 focus:border-0 focus:outline-0 active:border-0 focus:outline-0 px-14 bg-transparent grow"
autoFocus={true}
/>
</div>
</div>
<div
className="mx-4 max-h-[400px] overflow-auto"
className="mx-4 max-h-[400px] overflow-auto bg-white"
id="conversations-holder"
>
<InfiniteScroll
hasMore={loadMoreConversations}
scrollableTarget="conversations-holder"
dataLength={(() => {
if (searchArray) {
return 0;
} else {
return searchArray.length;
}
})()}
next={searchFunction}
loader={null}
>
{renderProfiles()}
</InfiniteScroll>
{operation === "info" ? (
// for hadnling search for members within the groups
<InfiniteScroll
hasMore={loadMoreMembers}
scrollableTarget="conversations-holder"
dataLength={memberSearchArray.length}
next={searchMembers}
loader={null}
>
{renderSearchMembersProfiles()}
</InfiniteScroll>
) : (
<InfiniteScroll
hasMore={loadMoreConversations}
scrollableTarget="conversations-holder"
dataLength={(() => {
if (searchArray) {
return 0;
} else {
return searchArray.length;
}
})()}
next={searchFunction}
loader={null}
>
{renderProfiles()}
</InfiniteScroll>
)}
</div>
</div>
);
Expand Down
Loading

0 comments on commit 1158f62

Please sign in to comment.