Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

모달 수정 #120

Merged
merged 2 commits into from
Aug 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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} />
})
Loading