diff --git a/src/app/(afterlogin)/practice/[id]/page.module.scss b/src/app/(afterlogin)/practice/[id]/page.module.scss index 36dc5a1..0cd122c 100644 --- a/src/app/(afterlogin)/practice/[id]/page.module.scss +++ b/src/app/(afterlogin)/practice/[id]/page.module.scss @@ -2,6 +2,8 @@ @import '@/styles/mixins'; .container { + display: flex; + justify-content: center; position: relative; width: 100%; padding: 60px; @@ -15,8 +17,8 @@ .presentation { width: 900px; height: 100%; + border: 1px solid $gray-1; border-radius: 15px; - background: $purple-1; &__box { display: flex; @@ -58,8 +60,8 @@ width: 100%; height: 100%; margin-top: 12px; + border: 1px solid $gray-1; border-radius: 15px; - background: $purple-1; } &__box { @@ -86,6 +88,6 @@ .bubble { position: absolute; - top: 8px; - left: 30%; + top: 75px; + left: 35%; } diff --git a/src/app/(afterlogin)/practice/[id]/page.tsx b/src/app/(afterlogin)/practice/[id]/page.tsx index 62b8aaa..f0752db 100644 --- a/src/app/(afterlogin)/practice/[id]/page.tsx +++ b/src/app/(afterlogin)/practice/[id]/page.tsx @@ -7,63 +7,140 @@ import { useEffect, useState } from 'react'; import useRecorder from '../_hooks/useRecorder'; import Alert from '@/app/_components/_modules/_modal/Alert'; import SpeechBubble from '@/app/_components/_modules/SpeechBubble'; +import { useQuery } from '@tanstack/react-query'; +import { PracticeDetail } from '@/types/service'; +import { PracticeService } from '@/services/client/practice'; +import Image from 'next/image'; +import PracticeNav from '../_components/PracticeNav'; +import Confirm from '@/app/_components/_modules/_modal/Confirm'; export default function Page({ params }: { params: { id: string } }) { + const id = Number(params.id); + + // #region state + const [slideIdx, setSlideIdx] = useState(0); const modal = useToggle(); + const confirm = useToggle(); const bubble = useToggle(); const recorder = useRecorder(); + // #endregion + // const cx = classNames.bind(styles); + // #region query + const { isLoading, data } = useQuery({ + queryKey: ['practice', id], + queryFn: () => PracticeService.getPracticeDetail(Number(id)), + }); + + /** 발표 이름 */ + const title = data?.title ?? ''; + + /** 슬라이드 페이징 문자열 */ + const slidePaging = `${slideIdx}/${data?.slides.length ?? 0}`; + + /** 마지막 슬라이드 여부 */ + const isLastSlide = data?.slides.length === slideIdx + 1; + // #endregion + useEffect(() => { modal.onOpen(); recorder.getMedia(); recorder.processPermission(); }, []); + // #region event-handler const handleModalAction = () => { recorder.startRecording(); modal.onClose(); bubble.onOpen(); }; + const handleNextSlide = () => { + console.log('go to next slide'); + }; + + const handleRecordingPause = () => { + if (recorder.isRecording) recorder.pauseRecording(); + else recorder.resumeRecording(); + }; + + const handleClose = () => { + console.log('close ... '); + confirm.onOpen(); + }; + // #endregion + + // #region function + const goToPresentationsPage = () => { + console.log('go to presentation page...'); + confirm.onClose(); + }; + // #endregion + return ( -
-
-
-
img...
-
-
-

- 다음 슬라이드 - 2/15 -

-
img...
-
-
-

- 메모하기 - - 발표 연습 중 메모를 입력하면 녹음이 일시정지돼요. - -

-