-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
⚡️ improve : 이미지 모달로 크게 보기 속도 개선 ( ImageModal -> PoseImage)
- Loading branch information
Showing
4 changed files
with
50 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import Image from 'next/image'; | ||
import { useState } from 'react'; | ||
|
||
interface DetailedImageI { | ||
src: string; | ||
responsive?: boolean; | ||
} | ||
export default function PoseImage({ src, responsive = false }: DetailedImageI) { | ||
const [isModalShow, setIsModalShow] = useState(false); | ||
return ( | ||
<> | ||
{isModalShow && ( | ||
<div | ||
className="fixed inset-x-0 inset-y-0 z-30 flex items-center justify-center" | ||
onClick={() => setIsModalShow(false)} | ||
> | ||
<div className="fixed inset-x-0 inset-y-0 bg-dimmed opacity-70" /> | ||
<div className="h-screen w-full"> | ||
<Image src={src} alt="fullImage" fill className="object-contain" /> | ||
</div> | ||
</div> | ||
)} | ||
{responsive ? ( | ||
<Image | ||
src={src} | ||
alt="이미지" | ||
layout="responsive" | ||
width={400} | ||
height={400} | ||
className="cursor-pointer object-contain" | ||
onClick={() => setIsModalShow(true)} | ||
/> | ||
) : ( | ||
<Image | ||
src={src} | ||
fill | ||
priority | ||
className="cursor-pointer object-contain" | ||
alt="포즈픽" | ||
onClick={() => setIsModalShow(true)} | ||
/> | ||
)} | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
export { default as Popup } from './Popup'; | ||
export { default as ImageModal } from './ImageModal.client'; | ||
export { default as PreparingPopup } from './PreparingPopup'; |