-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(#72) 🎨 design: 채팅창 이미지 클릭시 모달창으로 띄우기
- Loading branch information
Showing
2 changed files
with
43 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React, { useState } from "react"; | ||
import Image from "next/image"; | ||
|
||
const ImageModal = ({ imageSrc, onClose }: { imageSrc: string, onClose: () => void }) => { | ||
return ( | ||
<div className="fixed inset-0 bg-black bg-opacity-50 flex justify-center items-center z-50"> | ||
<div className="relative bg-white p-4 rounded-lg"> | ||
<Image | ||
src={imageSrc} | ||
alt="Enlarged" | ||
className="max-w-full max-h-full" /> | ||
<button | ||
onClick={onClose} | ||
className="absolute top-0 right-0 w-5 h-5 text-xl mr-3 text-grayscale-50 p-2 rounded-full"> | ||
X | ||
</button> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ImageModal; |
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