Skip to content

Commit

Permalink
Merge pull request #47 from CS3219-AY2425S1/termination-description-fix
Browse files Browse the repository at this point in the history
fix termination description
  • Loading branch information
jayllo-c authored Nov 10, 2024
2 parents c4ddcf6 + 143fa51 commit d230e74
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
12 changes: 6 additions & 6 deletions frontend/peerprep/.env.sample
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
NEXT_PUBLIC_USER_SERVICE_URL=http://localhost:8003
NEXT_PUBLIC_MATCHING_SERVICE_URL=http://localhost:8004
NEXT_PUBLIC_QUESTION_SERVICE_URL=http://localhost:8002
NEXT_PUBLIC_COLLAB_SERVICE_URL=http://localhost:8005
NEXT_PUBLIC_MATCHING_SOCKET_URL=http://localhost:8004
NEXT_PUBLIC_COLLAB_SOCKET_URL=http://localhost:8005
NEXT_PUBLIC_USER_SERVICE_URL=http://localhost:8004
NEXT_PUBLIC_MATCHING_SERVICE_URL=http://localhost:8002
NEXT_PUBLIC_QUESTION_SERVICE_URL=http://localhost:8003
NEXT_PUBLIC_COLLAB_SERVICE_URL=http://localhost:8010
NEXT_PUBLIC_MATCHING_SOCKET_URL=http://localhost:8002
NEXT_PUBLIC_COLLAB_SOCKET_URL=http://localhost:8010
NEXT_PUBLIC_MATCHING_SOCKET_PATH=/socket.io
NEXT_PUBLIC_COLLAB_SOCKET_PATH=/socket.io
NEXT_PUBLIC_IMAGE_UPLOAD_KEY= # You can get this from portive
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export const CollabNavbar = ({
<NavbarItem className="flex items-center justify-end gap-3">
<TerminateModal
isModalVisible={isModalVisible}
usersInRoom={usersInRoom}
userConfirmed={userConfirmed}
isCancelled={isCancelled}
isFirstToCancel={isFirstToCancel}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {

interface TerminateModalProps {
isModalVisible: boolean;
usersInRoom: string[];
userConfirmed: boolean;
isCancelled: boolean;
isFirstToCancel: boolean;
Expand All @@ -22,6 +23,7 @@ interface TerminateModalProps {

export default function TerminateModal({
isModalVisible,
usersInRoom = [],
userConfirmed,
isCancelled,
isFirstToCancel,
Expand All @@ -30,6 +32,10 @@ export default function TerminateModal({
handleConfirm,
setIsCancelled,
}: TerminateModalProps) {


const terminateDescription = usersInRoom.length > 1 ? "Both users need to confirm to terminate the session." : "Other user has left, click to terminate.";

return (
<div className="flex justify-center items-center h-full w-full">
<Button className="" variant="flat" color="danger" onClick={openModal}>
Expand All @@ -50,7 +56,7 @@ export default function TerminateModal({
</ModalHeader>
<ModalBody>
<p className="text-center">
Both users need to confirm to terminate the session.
{terminateDescription}
</p>
</ModalBody>
<ModalFooter>
Expand Down

0 comments on commit d230e74

Please sign in to comment.