-
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.
* feat: 이미지 전체보기 모달 구현 * fix: routes/index.ts 읽히지 않은 import 삭제
- Loading branch information
1 parent
e4cc00f
commit 5634da5
Showing
7 changed files
with
106 additions
and
12 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,18 @@ | ||
import type { SVGProps } from 'react'; | ||
const SvgIcX = (props: SVGProps<SVGSVGElement>) => ( | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
fill="none" | ||
viewBox="0 0 30 30" | ||
{...props} | ||
> | ||
<path | ||
stroke="#fff" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
strokeWidth={1.5} | ||
d="m23.125 6.875-16.25 16.25M6.875 6.875l16.25 16.25" | ||
/> | ||
</svg> | ||
); | ||
export default SvgIcX; |
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,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', | ||
}); |
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,19 @@ | ||
import { IcX } from '@svgs'; | ||
|
||
import { modalContainer, imageWrapper, closeButton } from './ImageModal.css'; | ||
|
||
interface ImageModalProps { | ||
imgUrl: string; | ||
onClose: () => void; | ||
} | ||
|
||
const ImageModal = ({ imgUrl, onClose }: ImageModalProps) => { | ||
return ( | ||
<div className={modalContainer}> | ||
<img src={imgUrl} className={imageWrapper} /> | ||
<IcX width={30} height={30} className={closeButton} onClick={onClose} /> | ||
</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
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