diff --git a/public/svg/ic_x.svg b/public/svg/ic_x.svg new file mode 100644 index 00000000..cd4ba259 --- /dev/null +++ b/public/svg/ic_x.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/assets/svgs/IcX.tsx b/src/assets/svgs/IcX.tsx new file mode 100644 index 00000000..093f894d --- /dev/null +++ b/src/assets/svgs/IcX.tsx @@ -0,0 +1,18 @@ +import type { SVGProps } from 'react'; +const SvgIcX = (props: SVGProps) => ( + + + +); +export default SvgIcX; diff --git a/src/assets/svgs/index.ts b/src/assets/svgs/index.ts index 7a1b0fce..65671d33 100644 --- a/src/assets/svgs/index.ts +++ b/src/assets/svgs/index.ts @@ -28,6 +28,7 @@ export { default as IcSearchCategoryCheerUnactivate } from './IcSearchCategoryCh export { default as IcSearchCategorySeasonUnactivate } from './IcSearchCategorySeasonUnactivate'; export { default as IcToastCheck } from './IcToastCheck'; export { default as IcToastError } from './IcToastError'; +export { default as IcX } from './IcX'; export { default as ImgLogo } from './ImgLogo'; export { default as ImgMypageProfileLogin } from './ImgMypageProfileLogin'; export { default as ImgStore11Cm } from './ImgStore11Cm'; diff --git a/src/pages/store/components/ImageModal/ImageModal.css.ts b/src/pages/store/components/ImageModal/ImageModal.css.ts new file mode 100644 index 00000000..411749d4 --- /dev/null +++ b/src/pages/store/components/ImageModal/ImageModal.css.ts @@ -0,0 +1,28 @@ +import { style } from '@vanilla-extract/css'; + +import { flexGenerator } from '@styles/generator.css'; +import { vars } from '@styles/theme.css'; + +export const modalContainer = style([ + flexGenerator('column', 'flex-start', 'flex-start'), + { + position: 'relative', + width: '100dvw', + maxWidth: 'var(--max-width)', + minWidth: 'var(--min-width)', + height: '100dvh', + backgroundColor: vars.colors.black, + }, +]); + +export const imageWrapper = style({ + margin: 'auto 0', + width: '100%', +}); + +export const closeButton = style({ + position: 'absolute', + top: '2rem', + right: '2rem', + cursor: 'pointer', +}); diff --git a/src/pages/store/components/ImageModal/ImageModal.tsx b/src/pages/store/components/ImageModal/ImageModal.tsx new file mode 100644 index 00000000..452ed826 --- /dev/null +++ b/src/pages/store/components/ImageModal/ImageModal.tsx @@ -0,0 +1,19 @@ +import { IcX } from '@svgs'; + +import { modalContainer, imageWrapper, closeButton } from './ImageModal.css'; + +interface ImageModalProps { + imgUrl: string; + onClose: () => void; +} + +const ImageModal = ({ imgUrl, onClose }: ImageModalProps) => { + return ( +
+ + +
+ ); +}; + +export default ImageModal; diff --git a/src/pages/store/components/StoreDesign/StoreDesign.tsx b/src/pages/store/components/StoreDesign/StoreDesign.tsx index ecc00073..b2c9e6f4 100644 --- a/src/pages/store/components/StoreDesign/StoreDesign.tsx +++ b/src/pages/store/components/StoreDesign/StoreDesign.tsx @@ -1,6 +1,9 @@ -import { Image } from '@components'; +import { useState } from 'react'; + +import { Image, Modal } from '@components'; import { gridStyle } from './StoreDesign.css'; +import ImageModal from '../ImageModal/ImageModal'; interface DesignData { cakeId: number; @@ -13,17 +16,39 @@ interface StoreDesignProps { } const StoreDesign = ({ designData = [] }: StoreDesignProps) => { + const [selectedImage, setSelectedImage] = useState(null); + + const handleImageClick = (imageUrl: string) => { + setSelectedImage(imageUrl); + }; + + const closeImageModal = () => { + setSelectedImage(null); + }; + return ( -
- {designData.map((design) => ( - - ))} -
+ <> + + + {selectedImage && ( + + + + )} + ); }; diff --git a/src/routes/index.ts b/src/routes/index.ts index 09e2cc2d..79897dc2 100644 --- a/src/routes/index.ts +++ b/src/routes/index.ts @@ -2,7 +2,6 @@ import authRoutes from './authRoutes'; import designListRoutes from './designListRoutes'; import homeRoutes from './homeRoutes'; import myPageRoutes from './myPageRoutes'; -import routePath from './routePath'; import storeRoutes from './storeRoutes'; import viewRoutes from './viewRoutes';