Skip to content

Commit 0355eee

Browse files
Merge pull request #328 from boostcampwm-2024/dev
[Deploy] 6주차 4차 배포
2 parents 5c21965 + b3b53a1 commit 0355eee

File tree

27 files changed

+359
-149
lines changed

27 files changed

+359
-149
lines changed

backend/src/room/room.gateway.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ export class RoomGateway implements OnGatewayDisconnect, OnGatewayInit, OnGatewa
5151

5252
public async handleDisconnect(client: Socket) {
5353
await this.handleLeaveRoom(client);
54-
this.logger.log(`Client disconnected: ${client.id}`);
54+
this.logger.log(`Client disconnected: ${client.handshake.address}:${client.id}`);
5555
await this.infraService.removeSocketMetadata(client);
5656
}
5757

5858
public async handleConnection(client: Socket) {
59-
this.logger.log(`Client disconnected: ${client.id}`);
59+
this.logger.log(`Client connected: ${client.handshake.address}:${client.id}`);
6060
await this.infraService.createSocketMetadata(client);
6161
}
6262

backend/src/room/room.service.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ export class RoomService {
5959

6060
await this.roomRepository.setRoom(room);
6161

62-
socket.emit(EMIT_EVENT.CREATE, room);
63-
6462
return {
6563
nickname: createRoomDto.nickname,
6664
participants: 0,

backend/src/room/services/room.service.ts

Whitespace-only changes.

frontend/src/api/question-list/getMyQuestionList.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import axios from "axios";
1+
import { api } from "@/api/config/axios.ts";
22

33
interface QuestionListProps {
44
page: number;
@@ -37,7 +37,7 @@ interface ApiResponse {
3737
}
3838

3939
const getMyQuestionList = async ({ page, limit }: QuestionListProps) => {
40-
const response = await axios.get<ApiResponse>("/api/question-list/my", {
40+
const response = await api.get<ApiResponse>("/api/question-list/my", {
4141
params: {
4242
page,
4343
limit,

frontend/src/api/question-list/getScrapQuestionList.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ interface ApiResponse {
2525
success: boolean;
2626
message: string;
2727
data: {
28-
questionLists: QuestionList[];
28+
questionList: QuestionList[];
2929
meta: {
3030
itemsPerPage: number;
3131
totalItems: number;

frontend/src/components/common/Button/DefaultButton.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,25 @@ interface ButtonProps {
55
type: "gray" | "green";
66
icon?: IconType;
77
onClick: () => void;
8+
disabled?: boolean;
89
}
910

10-
const DefaultButton = ({ text, type, icon: Icon, onClick }: ButtonProps) => {
11+
const DefaultButton = ({
12+
text,
13+
type,
14+
icon: Icon,
15+
onClick,
16+
disabled,
17+
}: ButtonProps) => {
1118
const buttonColor =
1219
type === "gray"
1320
? "bg-gray-200 text-gray-black"
1421
: "bg-green-200 text-gray-white";
1522

1623
return (
1724
<button
18-
className={`w-full h-12 flex flex-row items-center justify-center gap-2 rounded-custom-m text-semibold-r ${buttonColor} hover:opacity-80`}
25+
disabled={disabled}
26+
className={`w-full h-12 flex flex-row items-center justify-center gap-2 rounded-custom-m text-semibold-r ${buttonColor} hover:opacity-80 disabled:opacity-50 `}
1927
onClick={onClick}
2028
>
2129
{Icon ? <Icon /> : null}

frontend/src/components/mypage/QuestionList/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const QuestionList = ({ tab, page }: ListProps) => {
2020
} = useGetScrapQuestionList({ page, limit: 8 });
2121

2222
const currentQuestionList =
23-
tab === "myList" ? myData?.myQuestionLists : scrapData?.questionLists;
23+
tab === "myList" ? myData?.myQuestionLists : scrapData?.questionList;
2424
const isLoading = tab === "myList" ? isMyListLoading : isScrapListLoading;
2525
const error = tab === "myList" ? myListError : scrapListError;
2626

frontend/src/components/questions/detail/ButtonSection.tsx/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Button from "@/components/common/Button/DefaultButton";
22
import { FaBookmark, FaRegBookmark } from "react-icons/fa";
33
import { IoMdShare } from "react-icons/io";
4+
import useAuth from "@hooks/useAuth.ts";
45

56
interface ButtonSectionProps {
67
scrapQuestionList: () => void;
@@ -15,6 +16,7 @@ const ButtonSection = ({
1516
isScrapped,
1617
shareQuestionList,
1718
}: ButtonSectionProps) => {
19+
const { isLoggedIn } = useAuth();
1820
return (
1921
<div className="flex w-full gap-4 mt-4">
2022
<Button
@@ -24,6 +26,7 @@ const ButtonSection = ({
2426
onClick={shareQuestionList}
2527
/>
2628
<Button
29+
disabled={!isLoggedIn}
2730
text={isScrapped ? "스크랩 취소" : "스크랩하기"}
2831
type={isScrapped ? "gray" : "green"}
2932
icon={isScrapped ? FaBookmark : FaRegBookmark}

frontend/src/components/questions/detail/QuestionTitle.tsx/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const QuestionTitle = ({ questionId }: { questionId: string }) => {
4141
</div>
4242
<div className="flex gap-1 items-center">
4343
<FaRegBookmark />
44-
<span>{question.usage}</span>
44+
<span>{question.scrapCount}</span>
4545
</div>
4646
</div>
4747
</div>

frontend/src/components/session/CommonTools.tsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
MdMic,
55
MdMicOff,
66
MdThumbUp,
7+
MdLink,
78
} from "react-icons/md";
89
import { IoChevronDownSharp } from "react-icons/io5";
910
import Modal from "../common/Modal";
@@ -12,6 +13,7 @@ import { useNavigate } from "react-router-dom";
1213
import useToast from "@/hooks/useToast";
1314
import useModal from "@/hooks/useModal";
1415
import useSocket from "@/hooks/useSocket";
16+
import ToolTip from "@components/common/ToolTip";
1517

1618
interface CommonToolsProps {
1719
handleVideoToggle: () => void;
@@ -60,6 +62,14 @@ const CommonTools = ({
6062
navigate("/sessions");
6163
};
6264

65+
const shareSessionLink = () => {
66+
navigator.clipboard.writeText(window.location.href);
67+
toast.success(
68+
`현재 세션의 링크가 복사되었습니다.
69+
동료에게 공유해보세요!`
70+
);
71+
};
72+
6373
const modalProps = isHost
6474
? {
6575
title: "세션을 종료할까요?",
@@ -83,6 +93,15 @@ const CommonTools = ({
8393
return (
8494
<>
8595
<div className={"inline-flex gap-2"}>
96+
<ToolTip text="세션 링크 복사">
97+
<button
98+
className="aspect-square px-3 bg-green-200 text-white rounded-custom-m border-custom-s border-green-200 hover:bg-green-100"
99+
aria-label={"세션 링크 복사"}
100+
onClick={shareSessionLink}
101+
>
102+
<MdLink className="w-6 h-6" />
103+
</button>
104+
</ToolTip>
86105
<div className="relative">
87106
<select
88107
className="w-16 bg-white text-white py-3 rounded-custom-m border-custom-s border-gray-200"

0 commit comments

Comments
 (0)