Add ability to explore and join space rooms

Signed-off-by: ajbura <ajbura@gmail.com>
This commit is contained in:
ajbura 2022-02-16 20:25:36 +05:30
parent a55f1df17f
commit 1f6e5e71ef
8 changed files with 538 additions and 7 deletions

View file

@ -100,8 +100,8 @@ function useWindowToggle(setSelectedTab) {
const [window, setWindow] = useState(null);
useEffect(() => {
const openSpaceSettings = (spaceId, tab) => {
setWindow({ spaceId, tabText });
const openSpaceSettings = (roomId, tab) => {
setWindow({ roomId, tabText });
const tabItem = tabItems.find((item) => item.text === tab);
if (tabItem) setSelectedTab(tabItem);
};
@ -120,7 +120,7 @@ function SpaceSettings() {
const [selectedTab, setSelectedTab] = useState(tabItems[0]);
const [window, requestClose] = useWindowToggle(setSelectedTab);
const isOpen = window !== null;
const roomId = window?.spaceId;
const roomId = window?.roomId;
const mx = initMatrix.matrixClient;
const room = mx.getRoom(roomId);