Skip to content

Commit

Permalink
adding explore rooms section
Browse files Browse the repository at this point in the history
  • Loading branch information
Wadie-ess committed Oct 15, 2023
1 parent 5666c1f commit 14d27a3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 38 deletions.
27 changes: 1 addition & 26 deletions frontend/code/src/Components/Chat/Components/RecentChat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,8 @@ import {
RoomChatPlaceHolder,
RoomSettingsModal,
} from "./RoomChatHelpers";
import { useDisclosure } from "@mantine/hooks";

import {
Dialog,
Group,
Button,
TextInput,
Text,
Popover,
Modal,
RingProgress,
} from "@mantine/core";


export const RecentConversations = () => {
const [MyUsers] = useState(users);
Expand Down Expand Up @@ -123,22 +113,7 @@ export const ChatPlaceHolder = ({
);
};

function Demo() {
return (
<Popover width={200} position="bottom" withArrow shadow="md">
<Popover.Target>
<Button>Toggle popover</Button>
</Popover.Target>
<Popover.Dropdown>
<Text size="xs">
This is uncontrolled popover, it is opened when button is clicked
</Text>
</Popover.Dropdown>
</Popover>
);
}
export const OnlineNowUsers = () => {
const [opened, { open, close }] = useDisclosure(false);

const selectedChatType = useChatStore((state) => state.selectedChatType);
const changeChatType = useChatStore((state) => state.changeChatType);
Expand Down
15 changes: 6 additions & 9 deletions frontend/code/src/Components/Chat/Components/RoomChatHelpers.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SetStateAction, useState } from "react";
import { ChatType, useChatStore } from "../Controllers/ChatControllers";
import { useChatStore } from "../Controllers/ChatControllers";
import users, {
GroupChat,
Lock,
Expand All @@ -12,7 +12,7 @@ import users, {
groupIcon,
} from "./tools/Assets";
import { SelectedUserTile } from "..";
import { findRenderedComponentWithType } from "react-dom/test-utils";


interface NullComponentProps {
message: string;
Expand Down Expand Up @@ -83,7 +83,6 @@ export const CreateNewRoomModal = () => {
}) => {
setName(event.target.value);
};
const [MyUsers] = useState(users);
const createNewRoom = useChatStore((state) => state.createNewRoom);

const [selectedOption, setSelectedOption] = useState(RoomType.Public); // Initialize with a default value
Expand Down Expand Up @@ -244,9 +243,7 @@ export const RoomSettingsModal = () => {
);

const [selectedOption, setSelectedOption] = useState(currentRoom?.type); // Initialize with a default value
const handleOptionChange = (e: any) => {
setSelectedOption(e.target.value);
};


const resetModalState = () => {
setSelectedOption(RoomType.Public);
Expand Down Expand Up @@ -442,12 +439,12 @@ export const ExploreRoomsModal = () => {
}}
>
<div className="flex flex-row justify-between items-center">
<a>
<img className="w-[100%]" alt="" src={groupIcon} />
<a href="/#">
<img className="w-[100%]" alt="" src={groupIcon} />
</a>
<p>{room.name}</p>

<a>
<a href="/#">
<img
className=""
alt=""
Expand Down
5 changes: 2 additions & 3 deletions frontend/code/src/Components/Chat/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import React from "react";
import { ChatType, useChatStore } from "./Controllers/ChatControllers";

import { RecentConversations } from "./Components/RecentChat";
import { MantineProvider, createTheme } from "@mantine/core";


export interface ConversationProps {
onRemoveUserPreview: () => void;
Expand All @@ -26,7 +26,7 @@ export const Chat = () => {
setShowUserPreview(!showUserPreview);
};
return (
<MantineProvider>

<>
<div className="flex h-full divide-black divide-x-4 bg-[#1A1C26]">
<div
Expand All @@ -50,7 +50,6 @@ export const Chat = () => {
</div>
</div>
</>
</MantineProvider>
);
};

Expand Down

0 comments on commit 14d27a3

Please sign in to comment.