From aa3ec7c88ab9870c1415f30bf30e8dd8cf78c83d Mon Sep 17 00:00:00 2001
From: jhkang0516 <jhkang0516@ajou.ac.kr>
Date: Mon, 4 Dec 2023 12:16:31 +0900
Subject: [PATCH] =?UTF-8?q?[EDIT]=20=EC=88=98=EC=A0=95=ED=95=98=EA=B8=B0?=
 =?UTF-8?q?=20=EB=B2=84=ED=8A=BC=20url?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../src/components/ResultMakeForm.js          | 232 +-----------------
 1 file changed, 1 insertion(+), 231 deletions(-)

diff --git a/react-whenMeet/src/components/ResultMakeForm.js b/react-whenMeet/src/components/ResultMakeForm.js
index e94ce78..812e653 100644
--- a/react-whenMeet/src/components/ResultMakeForm.js
+++ b/react-whenMeet/src/components/ResultMakeForm.js
@@ -1,238 +1,8 @@
-// import React, { useState, useEffect } from "react";
-// import CalendarWeek from "./CalendarWeek";
-// import { useNavigate, useParams } from "react-router-dom";
-// import axios from "axios";
-
-// import "../styles/ResultMake.css";
-// function ResultMakeForm() {
-//   const [meetingData, setMeetingData] = useState(null);
-//   const { meeting_id } = useParams();
-//   const { currentParticipants, maxParticipants } = meetingData || {};
-//   const navigate = useNavigate();
-//   const [timeLeft, setTimeLeft] = useState("");
-//   const [hoveredInfo, setHoveredInfo] = useState(null);
-//   const [isLoading, setIsLoading] = useState(true); // 濡쒕뵫 �곹깭 愿�由�
-//   const [isModalOpen, setIsModalOpen] = useState(false);
-
-//   useEffect(() => {
-//     // �쒕쾭�먯꽌 誘명똿 �곗씠�곕� 媛��몄삤�� �⑥닔
-//     const fetchMeetingData = async () => {
-//       setIsLoading(true);
-//       try {
-//         const response = await axios.get(
-//           `http://localhost:3000/meetings/${meeting_id}/details`,
-//           {
-//             withCredentials: true,
-//           }
-//         );
-//         setMeetingData(response.data);
-//         setIsLoading(false);
-//       } catch (error) {
-//         console.error("�곗씠�� 濡쒕뵫 �먮윭:", error);
-//         setIsLoading(false);
-//       }
-//     };
-
-//     fetchMeetingData();
-//   }, [meeting_id]);
-
-//   // ���대㉧瑜� �쒖옉�섍퀬 愿�由ы븯�� 濡쒖쭅
-//   useEffect(() => {
-//     const calculateTimeLeft = () => {
-//       if (!meetingData || !meetingData.voteExpiresAt) {
-//         // meetingData�� voteExpiresAt�� �녿뒗 寃쎌슦 湲곕낯媛믪쓣 諛섑솚
-//         return {
-//           days: 0,
-//           hours: 0,
-//           minutes: 0,
-//           seconds: 0,
-//         };
-//       }
-//       const now = new Date();
-//       const voteExpires = new Date(meetingData.voteExpiresAt);
-//       const difference = voteExpires - now;
-
-//       if (difference > 0) {
-//         return {
-//           days: Math.floor(difference / (1000 * 60 * 60 * 24)),
-//           hours: Math.floor((difference / (1000 * 60 * 60)) % 24),
-//           minutes: Math.floor((difference / 1000 / 60) % 60),
-//           seconds: Math.floor((difference / 1000) % 60),
-//         };
-//       } else {
-//         // �쒓컙�� �대� 吏��� 寃쎌슦 湲곕낯媛믪쓣 諛섑솚
-//         return {
-//           days: 0,
-//           hours: 0,
-//           minutes: 0,
-//           seconds: 0,
-//         };
-//       }
-//     };
-
-//     const updateTimer = () => {
-//       const newTimeLeft = calculateTimeLeft() || {}; // newTimeLeft媛� undefined�� 寃쎌슦瑜� ��鍮꾪빐 湲곕낯 媛앹껜 �좊떦
-//       const formattedTime = `${
-//         newTimeLeft.days ? newTimeLeft.days + "�� " : ""
-//       }${newTimeLeft.hours ? newTimeLeft.hours + "�쒓컙 " : ""}${
-//         newTimeLeft.minutes ? newTimeLeft.minutes + "遺� " : ""
-//       }${newTimeLeft.seconds ? newTimeLeft.seconds + "珥�" : ""}`;
-//       setTimeLeft(formattedTime);
-//     };
-
-//     updateTimer();
-//     const timerId = setInterval(updateTimer, 1000);
-
-//     return () => clearInterval(timerId);
-//   }, [meetingData]);
-
-//   const handleEdit = async () => {
-//     try {
-//       const response = await axios.get(
-//         `http://localhost:3000/meetings/${meeting_id}/`
-//       );
-//       const {
-//         startDate,
-//         endDate,
-//         availableVotingStartTime,
-//         availableVotingEndTime,
-//       } = response.data;
-
-//       try {
-//         const scheduleResponse = await axios.get(
-//           `http://localhost:3000/meetings/${meeting_id}/my/schedules`
-//         );
-//         navigate("/UserTimeInfo", {
-//           state: {
-//             id: meeting_id,
-//             startTime: availableVotingStartTime,
-//             endTime: availableVotingEndTime,
-//             startDate,
-//             endDate,
-//             schedules: scheduleResponse.data.schedules,
-//           },
-//         });
-//       } catch (error) {
-//         console.error(error);
-//       }
-//     } catch (error) {
-//       console.error(error);
-//     }
-//   };
-
-//   const closeMeeting = async () => {
-//     const adminPassword = prompt("愿�由ъ옄 鍮꾨�踰덊샇瑜� �낅젰�섏꽭��:");
-
-//     if (adminPassword) {
-//       try {
-//         await axios.post(`http://localhost:3000/meetings/${meeting_id}/close`, {
-//           adminPassword,
-//         });
-
-//         navigate(`/resultend/${meeting_id}`);
-//       } catch (error) {
-//         if (error.response && error.response.status === 401) {
-//           alert("鍮꾨�踰덊샇媛� ���몄뒿�덈떎.");
-//         } else {
-//           console.error("�ㅻ쪟 諛쒖깮:", error);
-//         }
-//       }
-//     }
-//   };
-
-//   const handleModalClose = () => {
-//     setIsModalOpen(false);
-//   };
-
-//   const handlePasswordConfirm = async (password) => {
-//     setIsModalOpen(false);
-//     try {
-//       await axios.post(`http://localhost:3000/meetings/${meeting_id}/close`, {
-//         adminPassword: password,
-//       });
-//       navigate(`/resultend/${meeting_id}`);
-//     } catch (error) {
-//       if (error.response && error.response.status === 401) {
-//         alert("鍮꾨�踰덊샇媛� ���몄뒿�덈떎.");
-//       } else {
-//         console.error("�ㅻ쪟 諛쒖깮:", error);
-//       }
-//     }
-//   };
-
-//   return (
-//     <>
-//       {isLoading ? (
-//         <div>Loading...</div>
-//       ) : (
-//         <div className="column-container">
-//           <h1 className="title-box">{meetingData?.title}</h1>
-
-//           <div>
-//             �꾩옱 �꾨즺�� �몄썝�� {currentParticipants}
-//             {maxParticipants != null && ` / ${maxParticipants}`}
-//           </div>
-
-//           <div>醫낅즺源뚯� �⑥� �쒓컙 {timeLeft}</div>
-//           <button onClick={handleEdit}>�섏젙�섍린</button>
-//           <button onClick={closeMeeting}>�ы몴 醫낅즺�섍린</button>
-//         </div>
-//       )}
-//       {meetingData && (
-//         <span className="flex-row">
-//           <div className="calander-container">
-//             <CalendarWeek
-//               participants={meetingData.participants}
-//               startDate={meetingData.startDate}
-//               endDate={meetingData.endDate}
-//               currentParticipants={meetingData.currentParticipants}
-//               maxParticipants={meetingData.maxParticipants}
-//               hoveredInfo={hoveredInfo}
-//               setHoveredInfo={setHoveredInfo}
-//               availableVotingStartTime={meetingData.availableVotingStartTime}
-//               availableVotingEndTime={meetingData.availableVotingEndTime}
-//             />
-//           </div>
-
-//           <span className="mostTime">
-//             <div style={{ textAlign: "center" }}>
-//               媛��� 留롮� �щ엺�ㅼ씠 媛��ν븳 �쇱젙
-//             </div>
-//             <ol>//�쇱젙 5媛� �섏뿴</ol>
-//           </span>
-//           <span className="possible">
-//             {!hoveredInfo && (
-//               <div>
-//                 <strong>媛��ν븳 �щ엺�ㅼ씠 �쒖떆�⑸땲��.</strong>
-//                 <p>留덉슦�ㅻ� �щ젰 �꾩뿉 �щ젮蹂댁꽭��!</p>
-//               </div>
-//             )}
-
-//             {hoveredInfo && (
-//               <div style={{ textAlign: "center" }}>
-//                 <strong>
-//                   {hoveredInfo.date} {hoveredInfo.time}�� 媛��ν븳 �щ엺:
-//                 </strong>
-//                 <ul>
-//                   {hoveredInfo.participants.map((name) => (
-//                     <li key={name}>{name}</li>
-//                   ))}
-//                 </ul>
-//               </div>
-//             )}
-//           </span>
-//         </span>
-//       )}
-//     </>
-//   );
-// }
-// export default ResultMakeForm;
 import React, { useState, useEffect } from "react";
 import CalendarWeek from "./CalendarWeek";
 import PasswordModal from "./PasswordModal";
 import { useNavigate, useParams } from "react-router-dom";
 import axios from "axios";
-
 import "../styles/ResultMake.css";
 
 function ResultMakeForm() {
@@ -313,7 +83,7 @@ function ResultMakeForm() {
         const scheduleResponse = await axios.get(
           `http://localhost:3000/meetings/${meeting_id}/my/schedules`
         );
-        navigate("/UserTimeInfo", {
+        navigate(`/homeparticipate/${meeting_id}/usertimeinfo/`, {
           state: {
             id: meeting_id,
             startTime: availableVotingStartTime,
-- 
GitLab