Skip to content
This repository was archived by the owner on Oct 30, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added client/public/chime.mp3
Binary file not shown.
Binary file added client/public/door.mp3
Binary file not shown.
2 changes: 2 additions & 0 deletions client/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<audio id="custom-sound-chime" src="/chime.mp3"></audio>
<audio id="custom-sound-door" src="/door.mp3"></audio>
<div id="root"></div>
<!--
This HTML file is a template.
Expand Down
4 changes: 4 additions & 0 deletions client/src/components/ChatWindow/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
position: relative;
}

.hide-chatWindow-container {
display: none !important;
}

.loading-chatWindow {
background-color: #2f343d;
position: absolute;
Expand Down
9 changes: 7 additions & 2 deletions client/src/components/ChatWindow/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default function ChatWindow(props) {
useEffect(() => {
document.getElementsByTagName(
"iframe"
)[0].src = `${rcApiDomain}${pathname}/?layout=embedded`;
)[0].src = `${rcApiDomain}${pathname}?layout=embedded`;
// eslint-disable-next-line
}, []);
useEffect(() => {
Expand All @@ -18,7 +18,12 @@ export default function ChatWindow(props) {
);
}, [pathname]);
return (
<div className="chatWindow-container">
<div
className={`chatWindow-container ${
(pathname === "/home" || pathname === "/") &&
"hide-chatWindow-container"
}`}
>
<div className="loading-chatWindow hide-chatWindow"></div>
<iframe
src={`${rcApiDomain}/home/?layout=embedded`}
Expand Down
6 changes: 4 additions & 2 deletions client/src/components/CommunityListItem/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ export default function CommunityListItem(props) {
return (
<div className="community-wrapper">
<div className="community-title">{community_name}</div>
{community.map((room) => {
// Here the second condition holds when new room is created as the response from server doesn't return open field on creation
{community && Object.keys(community).map((roomId) => {
let room = community[roomId];
if (room.open || room.open === undefined)
// Here the second condition holds when new room is created as the response from server doesn't return open field on creation
return <RoomItem room={room} key={room._id}></RoomItem>;
return null;
})}
</div>
);
Expand Down
53 changes: 18 additions & 35 deletions client/src/components/MainLayout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,40 +42,23 @@ export default function MainLayout(props) {
const {authState, stats} = props;

return (
<Switch>
<Route
//TODO Shift this to programmatically check if repo is associated to hide activity
//_community (without repo) -> custom field (not repo)
//abcd (without repo) -> custom field (not repo)
path={["/direct", "(.*)_community"]}
render={(props) => {
return (
<div className="mainLayout-wrapper">
<ChatWindow {...props} />
</div>
);
}}
/>
<Route
path={["/channel", "/group"]}
render={(props) => {
return (
<div className="mainLayout-wrapper">
<ChatWindow {...props} />
<RightSidebar {...props} authState={authState} />
</div>
);
}}
/>
<Route
exact
path={["/home", "/"]}
render={(props) => {
return (
<Home {...props} authState={authState} stats={stats}/>
);
}}
/>
</Switch>
<div className="mainLayout-wrapper">
<ChatWindow {...props} />
<Switch>
<Route
path={["/channel", "/group"]}
render={(props) => {
return <RightSidebar {...props} authState={authState} />;
}}
/>
<Route
exact
path={["/home", "/"]}
render={(props) => {
return <Home {...props} authState={authState} stats={stats} />;
}}
/>
</Switch>
</div>
);
}
4 changes: 4 additions & 0 deletions client/src/components/RoomItem/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,8 @@

.active-room {
background-color: #41464f;
}

.highlight-room {
color: white !important;
}
5 changes: 3 additions & 2 deletions client/src/components/RoomItem/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default function RoomItem({room}) {
to={`/${
room["t"] === "c" ? "channel" : room["t"] === "p" ? "group" : "direct"
}/${room.username || room.name}`}
className="room-wrapper"
className={`room-wrapper ${room.alert && "highlight-room"}`}
activeClassName="active-room"
>
<img
Expand All @@ -31,7 +31,8 @@ export default function RoomItem({room}) {
)}
<span className="room-name">
{(room.fname && (room.fname.split(/_(.+)/)[1] || room.fname)) ||
room.name || room.username}
room.name ||
room.username}
</span>
</NavLink>
);
Expand Down
Loading