Skip to content

Commit

Permalink
refactor: 명시적인 함수 이름으로 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
GC-Park committed Oct 19, 2023
1 parent a85076a commit 933e4c3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions frontend/src/components/PinImageContainer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Image from '../common/Image';
import RemoveImageButton from '../../assets/remove_image_icon.svg';
import useDelete from '../../apiHooks/useDelete';
import useToast from '../../hooks/useToast';
import { useModalContext, ModalPortal } from '../../context/ImageModalContext';
import { useModalContext, ImageModal } from '../../context/ImageModalContext';
import { useState } from 'react';
import Button from '../common/Button';
import Space from '../common/Space';
Expand Down Expand Up @@ -68,15 +68,15 @@ const PinImageContainer = ({ images, getPinData }: PinImageContainerProps) => {
),
)}
{isModalOpen && (
<ModalPortal closeModalHandler={closeModal}>
<ImageModal closeModalHandler={closeModal}>
<ModalImageWrapper>
<ModalImage src={modalImage} />
<Space size={3} />
<Button variant="custom" onClick={closeModal}>
닫기
</Button>
</ModalImageWrapper>
</ModalPortal>
</ImageModal>
)}
</FilmList>
</>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/context/ImageModalContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import React, {
import ReactDOM from 'react-dom';
import { styled } from 'styled-components';

interface ModalPortalProps {
interface ImageModalProps {
children: ReactChild;
closeModalHandler: () => void;
}

export const ModalPortal = (props: ModalPortalProps) => {
export const ImageModal = (props: ImageModalProps) => {
const $modalRoot = document.getElementById('modal-root') as HTMLElement;
const modalRef = useRef<HTMLDialogElement>(null);

Expand Down

0 comments on commit 933e4c3

Please sign in to comment.