From a2b0702e990ff6602e3036d8b94c76b25c52c619 Mon Sep 17 00:00:00 2001 From: kyungmim Date: Fri, 20 Dec 2024 15:17:39 +0900 Subject: [PATCH 1/2] =?UTF-8?q?Hotfix:=20=EB=A9=94=EB=89=B4=20=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ImageSwiper/ImageSwiper.tsx | 5 +---- src/pages/Studio/StudioMenu/StudioMenu.tsx | 5 ++--- src/pages/Studio/StudioMenu/StudioMenuDetail.tsx | 2 +- .../Studio/StudioMenu/StudioMenuDetailInfo.tsx | 13 +++++++++---- src/types/types.ts | 5 ++++- 5 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/components/ImageSwiper/ImageSwiper.tsx b/src/components/ImageSwiper/ImageSwiper.tsx index 9ff8ace..625813d 100644 --- a/src/components/ImageSwiper/ImageSwiper.tsx +++ b/src/components/ImageSwiper/ImageSwiper.tsx @@ -11,8 +11,7 @@ interface ImageSwiperProps extends SwiperProps { imageStyle?: ReturnType; imgprops?: { - - customStyle?: ReturnType; + customStyle?: ReturnType; loading?: string; onLoad?: (e: React.SyntheticEvent) => void; onClick?: () => void; @@ -72,9 +71,7 @@ const ImageSwiper = ({ export default ImageSwiper; const containerFullStyle = css` - width: 100vw; margin-left: calc(-1 * ${variables.layoutPadding}); - margin-right: calc(-1 * ${variables.layoutPadding}); `; const containerDefaultStyle = css` diff --git a/src/pages/Studio/StudioMenu/StudioMenu.tsx b/src/pages/Studio/StudioMenu/StudioMenu.tsx index fdd4e15..736c59c 100644 --- a/src/pages/Studio/StudioMenu/StudioMenu.tsx +++ b/src/pages/Studio/StudioMenu/StudioMenu.tsx @@ -1,6 +1,5 @@ /** @jsxImportSource @emotion/react */ import { css } from '@emotion/react'; -import BackButton from '@components/BackButton/BackButton'; import StudioNavigator from '@components/Navigator/StudioNavigator'; import StudioMenuItem from './StudioMenuItem'; import { useParams } from 'react-router-dom'; @@ -40,8 +39,8 @@ const StudioMenu = () => { const StudioMenuList = data?.map((item) => ); return ( <> -
- +
+
{StudioMenuList}
); diff --git a/src/pages/Studio/StudioMenu/StudioMenuDetail.tsx b/src/pages/Studio/StudioMenu/StudioMenuDetail.tsx index d8fd4b7..3ac60b1 100644 --- a/src/pages/Studio/StudioMenu/StudioMenuDetail.tsx +++ b/src/pages/Studio/StudioMenu/StudioMenuDetail.tsx @@ -16,7 +16,7 @@ const StudioMenuDetail = () => { const [data, setData] = useState(); const [scrollY, setScrollY] = useState(false); const [tabMenuState, setTabMenuState] = useState('info'); - const [totalPrice, setTotalPrice] = useState(data ? data.price : 0); + const [totalPrice, setTotalPrice] = useState(0); const [checkState, setCheckState] = useState>({}); const fetchMenuDetail = async () => { diff --git a/src/pages/Studio/StudioMenu/StudioMenuDetailInfo.tsx b/src/pages/Studio/StudioMenu/StudioMenuDetailInfo.tsx index 360253c..dc99bb6 100644 --- a/src/pages/Studio/StudioMenu/StudioMenuDetailInfo.tsx +++ b/src/pages/Studio/StudioMenu/StudioMenuDetailInfo.tsx @@ -16,6 +16,9 @@ const StudioMenuDetailInfo = ({ checkState: Record; setCheckState: Dispatch>>; }) => { + const [hours, minutes, seconds] = infoItem.duration ? infoItem.duration.split(':').map(Number) : [0, 0, 0]; + const totalMinutes = hours * 60 + minutes + seconds / 60; + const handleOptionClick = (price: number, id: number, e: React.ChangeEvent) => { const isChecked = e.target.checked; setTotalPrice((prev) => (isChecked ? prev + price : prev - price)); @@ -28,25 +31,27 @@ const StudioMenuDetailInfo = ({ // console.log('최종 결제 금액:', totalPrice); // }; + console.log(infoItem); + return ( <>

예상 소요 시간

-

약 60분

+

약 {infoItem.duration ? totalMinutes : 60}분

기본 촬영 수

-

70-80컷

+

{infoItem.pictureNum ? infoItem.pictureNum : `70-80컷`}

인화 사이즈

-

4x6in

+

{infoItem.pictureSize ? infoItem.pictureSize : '4x6in'}

기본 제공 파일

-

3포즈 리터칭 JPG파일

+

{infoItem.offerFile ? infoItem.offerFile : '3포즈 리터칭 JPG파일'}

diff --git a/src/types/types.ts b/src/types/types.ts index 83d92f2..370273d 100644 --- a/src/types/types.ts +++ b/src/types/types.ts @@ -112,9 +112,12 @@ export interface IMenuListRes { name: string; description: string; price: number; - duration: string | null; additionalOptions: IAdditionalOptionsRes[]; menuImages: IPortfolio[] | IReviewImages[]; + duration: string | null; //소요시간 + offerFile: string | null; //기본 제공 파일 + pictureNum: string | null; //촬영 수 + pictureSize: string | null; //인화 사이즈 avgScore: number; reviews: { content: Review[] }; reviewCount: number; From 427279af2ba6941a4896d2fd57c02604602fc307 Mon Sep 17 00:00:00 2001 From: kyungmim Date: Fri, 20 Dec 2024 15:24:15 +0900 Subject: [PATCH 2/2] =?UTF-8?q?Type:=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20?= =?UTF-8?q?=EC=8A=A4=EC=99=80=EC=9D=B4=ED=8D=BC=20=EC=B6=A9=EB=8F=8C?= =?UTF-8?q?=EC=9D=B4=EC=8A=88=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ImageSwiper/ImageSwiper.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/ImageSwiper/ImageSwiper.tsx b/src/components/ImageSwiper/ImageSwiper.tsx index 625813d..6a842dc 100644 --- a/src/components/ImageSwiper/ImageSwiper.tsx +++ b/src/components/ImageSwiper/ImageSwiper.tsx @@ -9,12 +9,11 @@ import { IPortfolio, IReviewImages } from 'types/types'; interface ImageSwiperProps extends SwiperProps { images: IPortfolio[] | IReviewImages[]; imageStyle?: ReturnType; - + customStyle?: ReturnType; imgprops?: { customStyle?: ReturnType; loading?: string; onLoad?: (e: React.SyntheticEvent) => void; - onClick?: () => void; }; }