Skip to content

Commit 9387610

Browse files
authored
Merge pull request #36 from KWcapstone/34-feat-meeting-page-project-id-유통
Feat: 컨퍼런스 데이터 유통 (#34)
2 parents 55ceae5 + fdb6bb2 commit 9387610

File tree

4 files changed

+46
-22
lines changed

4 files changed

+46
-22
lines changed

src/types/conferanceData.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export interface conferenceData {
2+
projectId: string;
3+
projectName: string;
4+
projectImage: null;
5+
updatedAt: string;
6+
creator: string;
7+
}

src/views/meeting/components/MindMapComponent.tsx

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ import {
1313
import "@xyflow/react/dist/style.css";
1414
import "@/views/meeting/style/mind-map.sass";
1515

16-
// api
17-
import { getMeetingId } from "@/api/meeting/meeting";
1816
// import { getProfile } from "@/api/main/profile";
1917

2018
// component
@@ -25,21 +23,22 @@ import useRecordingTimer from "@/views/meeting/components/RecodingTimer";
2523
import { useEffect, useState } from "react";
2624
import { Client } from "@stomp/stompjs";
2725

26+
// type
27+
import { conferenceData } from "@/types/conferanceData";
28+
2829
interface scriptData {
2930
time: string;
3031
script: string;
3132
}
3233

3334
interface MindMapComponentProps {
3435
setScripts: React.Dispatch<React.SetStateAction<scriptData[]>>;
35-
setProjectId: React.Dispatch<React.SetStateAction<string>>;
36-
projectId: string;
36+
conferenceData: conferenceData;
3737
}
3838

3939
const MindMapComponent = ({
4040
setScripts,
41-
setProjectId,
42-
projectId,
41+
conferenceData,
4342
}: MindMapComponentProps) => {
4443
const {
4544
// transcript,
@@ -53,16 +52,12 @@ const MindMapComponent = ({
5352
// audioUrl,
5453
} = UseSpeechToText();
5554

55+
console.log("컨퍼런스 데이터 :", conferenceData);
56+
5657
const { formattedTime } = useRecordingTimer(isRecording, isPaused);
5758

5859
const [mode, setMode] = useState<string>("none");
5960

60-
useEffect(() => {
61-
getMeetingId().then((res: any) => {
62-
setProjectId(res.data.data.projectId);
63-
});
64-
}, []);
65-
6661
const meetingStart = () => {
6762
const client = new Client({
6863
brokerURL: "wss://www.moaba.site/ws", // 서버 WebSocket URL q
@@ -73,7 +68,7 @@ const MindMapComponent = ({
7368
onConnect: () => {
7469
console.log("연결");
7570
client.subscribe(
76-
`/topic/conference/${projectId}/participants`,
71+
`/topic/conference/${conferenceData.projectId}/participants`,
7772
(message: any) => {
7873
const data: any = JSON.parse(message.body);
7974
console.log(data.participants);

src/views/meeting/components/SideBar.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ import test from "@/assets/imgs/common/user.svg";
1010
// import
1111
import { useState } from "react";
1212

13+
// type
14+
import { conferenceData } from "@/types/conferanceData";
15+
1316
interface scriptData {
1417
time: string;
1518
script: string;
@@ -18,20 +21,20 @@ interface SideBarProps {
1821
isSidebarOpen: boolean;
1922
setIsSidebarOpen: React.Dispatch<React.SetStateAction<boolean>>;
2023
scripts?: scriptData[];
21-
projectId: string;
24+
conferenceData: conferenceData;
2225
}
2326

2427
const SideBar = ({
2528
isSidebarOpen,
2629
setIsSidebarOpen,
2730
scripts,
28-
projectId,
31+
conferenceData,
2932
}: SideBarProps) => {
3033
const [isScript, setIsScript] = useState(false);
3134
const [isSummary, setIsSummary] = useState(true);
3235

3336
// console.log("스크립트", scripts);
34-
console.log("프로젝트 아이디", projectId);
37+
console.log("프로젝트 아이디", conferenceData.projectId);
3538
return (
3639
<div
3740
className={`side-bar ${isSidebarOpen ? "open" : "closed"}`}

src/views/meeting/page/MeetingPage.tsx

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,13 @@ import ShareModal from "@/views/components/ShareModal";
66
import MindMapComponent from "@/views/meeting/components/MindMapComponent.tsx";
77

88
// import
9-
import { useState, useRef } from "react";
9+
import { useState, useRef, useEffect } from "react";
1010

11+
// api
12+
import { getMeetingId } from "@/api/meeting/meeting";
13+
14+
// type
15+
import { conferenceData } from "@/types/conferanceData";
1116
interface scriptData {
1217
time: string;
1318
script: string;
@@ -17,7 +22,13 @@ const MeetingPage = () => {
1722
const [isSidebarOpen, setIsSidebarOpen] = useState(true); // 사이드바 상태
1823
const modalBackground = useRef<HTMLDivElement>(null);
1924
const [scripts, setScripts] = useState<scriptData[]>([]); // 스크립트 상태
20-
const [projectId, setProjectId] = useState<string>("");
25+
const [conferenceData, setConferenceData] = useState<conferenceData>({
26+
projectId: "",
27+
projectName: "",
28+
projectImage: null,
29+
updatedAt: "",
30+
creator: "",
31+
});
2132

2233
// modal
2334
type ModalType = "share" | null;
@@ -27,6 +38,12 @@ const MeetingPage = () => {
2738

2839
//console.log("projectId", projectId);
2940

41+
useEffect(() => {
42+
getMeetingId().then((res: any) => {
43+
setConferenceData(res.data.data);
44+
});
45+
}, []);
46+
3047
return (
3148
<>
3249
<HeaderBar onOpenModal={openModal} />
@@ -40,7 +57,10 @@ const MeetingPage = () => {
4057
}
4158
}}
4259
>
43-
<ShareModal onCloseModal={closeModal} projectId={projectId} />
60+
<ShareModal
61+
onCloseModal={closeModal}
62+
projectId={conferenceData.projectId}
63+
/>
4464
</div>
4565
)}
4666
</div>
@@ -49,7 +69,7 @@ const MeetingPage = () => {
4969
isSidebarOpen={isSidebarOpen}
5070
setIsSidebarOpen={setIsSidebarOpen}
5171
scripts={scripts}
52-
projectId={projectId}
72+
conferenceData={conferenceData}
5373
/>
5474

5575
<div
@@ -61,8 +81,7 @@ const MeetingPage = () => {
6181
{/* <MyVoiceComponent /> */}
6282
<MindMapComponent
6383
setScripts={setScripts}
64-
setProjectId={setProjectId}
65-
projectId={projectId}
84+
conferenceData={conferenceData}
6685
/>
6786
</div>
6887
</>

0 commit comments

Comments
 (0)