Skip to content

Commit

Permalink
Adds resourceId for Lobby, and removes image in front of Lobby (#85)
Browse files Browse the repository at this point in the history
* added resourceId for lobby

* Removes lobby from buzz spaces list

* Removes image in front of Lobby in header
  • Loading branch information
ottpeter authored Nov 6, 2024
1 parent 6022258 commit 547a74d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
5 changes: 4 additions & 1 deletion src/MainRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ import {
MAX_COMMENTS_LOADED,
MAX_SESSIONS_SHOWN,
SELF_NOTE_TOPIC,
LOBBY_TITLE,
CATEGORY_NAMES_TO_ID_MAP,
} from "./utils/constants";
import {
getSessionsByDay,
Expand Down Expand Up @@ -313,7 +315,8 @@ const MainRouter = (): ReactElement => {
const orderedRooms = roomsWithUserCount.sort(
(a, b) => b.userCount! - a.userCount!
);
setOrderedList(orderedRooms);
const withoutLobby = orderedList.filter((room) => CATEGORY_NAMES_TO_ID_MAP.get(room.topic) !== LOBBY_TITLE);
setOrderedList(withoutLobby);
}

console.log("Rooms with user counts: ", orderedList);
Expand Down
10 changes: 6 additions & 4 deletions src/components/ChatHeader/ChatHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import "./ChatHeader.scss";
import ActiveVisitors from "../ActiveVisitors/ActiveVisitors";
import { CATEGORY_IMAGES_MAP } from "../../utils/constants";
import { CATEGORY_IMAGES_MAP, LOBBY_TITLE } from "../../utils/constants";

interface ChatHeaderProps {
category?: string;
Expand All @@ -15,9 +15,11 @@ const ChatHeader: React.FC<ChatHeaderProps> = ({
const imageUrl = CATEGORY_IMAGES_MAP.get(category ? category : "");
return (
<div className="chat-header">
<div className="chat-header__img">
<img src={imageUrl} alt="" className="chat-header__img" />
</div>
{category !== LOBBY_TITLE && (
<div className="chat-header__img">
<img src={imageUrl} alt="" className="chat-header__img" />
</div>
)}
<div className="chat-header__category-name">{category}</div>
<div>
<ActiveVisitors
Expand Down
2 changes: 1 addition & 1 deletion src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export const RESOURCE_IDS = new Map([
"entertainment",
"2600000000000000000000000000000000000000000000000000000000000000"
],
["lobby", "000"],
["lobby", "190e000000000000000000000000000000000000000000000000000000000000"],
]);

export const DATE_TO_DEVCON_DAY = new Map([
Expand Down

0 comments on commit 547a74d

Please sign in to comment.