From 97b5420a579125db94f1d5a4ca8000ecfb8de581 Mon Sep 17 00:00:00 2001 From: navyjeongs Date: Tue, 12 Dec 2023 17:16:59 +0900 Subject: [PATCH 1/4] =?UTF-8?q?=E2=9C=A8=20=ED=95=84=EC=9A=94=EC=97=86?= =?UTF-8?q?=EB=8A=94=20=EC=98=B5=EC=85=98=20=EC=82=AD=EC=A0=9C=20=EB=B0=8F?= =?UTF-8?q?=20timeout=205=EC=B4=88=EB=A1=9C=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/apis/fetchThemeTimeTable.ts | 9 +++++++-- frontend/src/hooks/useTimeTableQuery.tsx | 1 - 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/frontend/src/apis/fetchThemeTimeTable.ts b/frontend/src/apis/fetchThemeTimeTable.ts index 0e4afd99..b8a46a61 100644 --- a/frontend/src/apis/fetchThemeTimeTable.ts +++ b/frontend/src/apis/fetchThemeTimeTable.ts @@ -2,8 +2,13 @@ import userInstance from '@config/userInstance'; import { Value } from 'react-calendar/dist/cjs/shared/types'; const fetchThemeTimeTable = async (themeId: number, date: Value) => { - return (await userInstance({ method: 'get', url: `/themes/${themeId}/timetable?date=${date}` })) - .data; + return ( + await userInstance({ + method: 'get', + url: `/themes/${themeId}/timetable?date=${date}`, + timeout: 5000, + }) + ).data; }; export default fetchThemeTimeTable; diff --git a/frontend/src/hooks/useTimeTableQuery.tsx b/frontend/src/hooks/useTimeTableQuery.tsx index 98263084..3cbe96e0 100644 --- a/frontend/src/hooks/useTimeTableQuery.tsx +++ b/frontend/src/hooks/useTimeTableQuery.tsx @@ -7,7 +7,6 @@ const useTimeTableQuery = (themeId: number, date: Value) => { const { data, isSuccess, isLoading, isError } = useQuery({ queryKey: [QUERY_MANAGEMENT['themeTimeTable'].key, themeId, date], queryFn: () => QUERY_MANAGEMENT['themeTimeTable'].fn(themeId, date), - retryDelay: 5000, }); return { data, isSuccess, isLoading, isError }; From 59efe598b633d6a948566b6abe91157010fa2491 Mon Sep 17 00:00:00 2001 From: navyjeongs Date: Tue, 12 Dec 2023 17:18:10 +0900 Subject: [PATCH 2/4] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20=EC=97=90=EB=9F=AC=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/utils/pickRandomNumber.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/utils/pickRandomNumber.ts b/frontend/src/utils/pickRandomNumber.ts index cfd21bb4..638074a1 100644 --- a/frontend/src/utils/pickRandomNumber.ts +++ b/frontend/src/utils/pickRandomNumber.ts @@ -7,7 +7,7 @@ const START_INDEX = 0; */ const pickRandomNumber = (n: number, k: number): Array => { if (k > n) { - throw new Error('asd'); + throw new Error('k는 n보다 클 수 없습니다.'); } const numbersArray = Array.from({ length: n }, (_, index) => index + 1).sort( From b6c2f0c82200adc1e38ccde64a877fca1f920916 Mon Sep 17 00:00:00 2001 From: navyjeongs Date: Tue, 12 Dec 2023 17:19:35 +0900 Subject: [PATCH 3/4] =?UTF-8?q?=E2=9C=A8=20=ED=83=80=EC=9E=85=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20=EB=B0=8F=20=EC=9B=B9=EC=82=AC=EC=9D=B4=ED=8A=B8=20?= =?UTF-8?q?=EB=B0=94=EB=A1=9C=EA=B0=80=EA=B8=B0=20=EA=B8=B0=EB=8A=A5=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/RoomInfoPanel/RoomInfoPanel.tsx | 3 ++- .../RoomInfoPanel/TimeTable/TimeTable.tsx | 18 +++++++++++++++++- frontend/src/types/chat.ts | 1 + 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/ChatRoom/components/RoomInfoPanel/RoomInfoPanel.tsx b/frontend/src/pages/ChatRoom/components/RoomInfoPanel/RoomInfoPanel.tsx index decfb7ce..d85c0dd6 100644 --- a/frontend/src/pages/ChatRoom/components/RoomInfoPanel/RoomInfoPanel.tsx +++ b/frontend/src/pages/ChatRoom/components/RoomInfoPanel/RoomInfoPanel.tsx @@ -34,6 +34,7 @@ const RoomInfoPanel = memo(function RoomInfoPanel({ settingMode, changeRoom }: P recruitmentCompleted, appointmentCompleted, themeId, + website, } = roomInfo as RoomInfo; const handleSettingButton = () => { @@ -93,7 +94,7 @@ const RoomInfoPanel = memo(function RoomInfoPanel({ settingMode, changeRoom }: P - + ); }); diff --git a/frontend/src/pages/ChatRoom/components/RoomInfoPanel/TimeTable/TimeTable.tsx b/frontend/src/pages/ChatRoom/components/RoomInfoPanel/TimeTable/TimeTable.tsx index ddae2b0d..2a331ce6 100644 --- a/frontend/src/pages/ChatRoom/components/RoomInfoPanel/TimeTable/TimeTable.tsx +++ b/frontend/src/pages/ChatRoom/components/RoomInfoPanel/TimeTable/TimeTable.tsx @@ -8,7 +8,12 @@ import { FaArrowsRotate } from 'react-icons/fa6'; import { keyframes } from '@emotion/react'; import { getStringByDate } from '@utils/dateUtil'; -const TimeTable = ({ themeId }: { themeId: number }) => { +interface Props { + themeId: number; + website: string; +} + +const TimeTable = ({ themeId, website }: Props) => { const today = new Date(); const [date, setDate] = useState(today); const { data, isLoading } = useTimeTableQuery(themeId, date); @@ -65,6 +70,9 @@ const TimeTable = ({ themeId }: { themeId: number }) => { 시간표를 불러올 수 없습니다. )} + + 예약 사이트 바로가기 + )} @@ -126,3 +134,11 @@ const InfoText = styled.div([ line-height: 2.5rem; `, ]); + +const WebsiteLink = styled.a([ + tw`font-pretendard text-white text-l border border-white border-solid py-3 px-4 rounded-[1rem]`, + css` + text-decoration: none; + cursor: pointer; + `, +]); diff --git a/frontend/src/types/chat.ts b/frontend/src/types/chat.ts index d2db09a0..5aa888a0 100644 --- a/frontend/src/types/chat.ts +++ b/frontend/src/types/chat.ts @@ -41,6 +41,7 @@ export interface RoomInfo { currentMembers: number; recruitmentCompleted: boolean; appointmentCompleted: boolean; + website: string; } export type ChangeRoomData = { From 67320676dd7c6ae3172ffa7398e6ad03823448f8 Mon Sep 17 00:00:00 2001 From: navyjeongs Date: Tue, 12 Dec 2023 17:26:09 +0900 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=A4=A1=20=EB=AA=A9=20=EB=8D=B0?= =?UTF-8?q?=EC=9D=B4=ED=84=B0=EC=97=90=20website=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/pages/ChatRoom/mock/mockRoomInfoData.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/src/pages/ChatRoom/mock/mockRoomInfoData.ts b/frontend/src/pages/ChatRoom/mock/mockRoomInfoData.ts index e578e857..5010e07a 100644 --- a/frontend/src/pages/ChatRoom/mock/mockRoomInfoData.ts +++ b/frontend/src/pages/ChatRoom/mock/mockRoomInfoData.ts @@ -13,4 +13,5 @@ export const mockRoomInfo: RoomInfo = { currentMembers: 5, recruitmentCompleted: false, appointmentCompleted: true, + website: 'https://www.naver.com', };