Skip to content

Commit

Permalink
모달 수정
Browse files Browse the repository at this point in the history
모달 수정
  • Loading branch information
woogie0303 authored Aug 17, 2024
2 parents ecb55ca + 0049f60 commit 8816b24
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions apps/service/src/entities/modal/ui/ModalController.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
'use client'

import {
forwardRef,
useCallback,
useEffect,
useImperativeHandle,
useState,
} from 'react'
import { forwardRef, useCallback, useImperativeHandle, useState } from 'react'
import { CreateModalElement } from '../model'

interface ModalPropsType {
Expand All @@ -18,7 +12,7 @@ export default forwardRef(function ModalController(
{ modalElement: ModalElement, exitFromModalArr }: ModalPropsType,
ref,
) {
const [isOpen, setIsOpen] = useState(false)
const [isOpen, setIsOpen] = useState(true)
const handleModalClose = useCallback(() => {
setIsOpen(false)
// 메모리에서 완전히 모달을 삭제 하기 위함이고 아래 코드를 추가 안하면 모달 animation이 바로 적용이 안된다.
Expand All @@ -35,9 +29,5 @@ export default forwardRef(function ModalController(
[handleModalClose],
)

useEffect(() => {
setIsOpen(true)
}, [])

return <ModalElement isOpen={isOpen} close={handleModalClose} />
})

0 comments on commit 8816b24

Please sign in to comment.