Skip to content

Commit 143b509

Browse files
committed
πŸ›Fix: modal -> navigate, fade λ”œλ ˆμ΄
1 parent 012dcc0 commit 143b509

File tree

2 files changed

+36
-26
lines changed

2 files changed

+36
-26
lines changed

β€Žsrc/modals/ModalContainer/index.tsx

Lines changed: 33 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -44,29 +44,39 @@ const ModalAnimation = ({
4444
children: React.ReactNode
4545
animationType?: AnimationType
4646
index: number
47-
}) => (
48-
<motion.div
49-
variants={animationVariants[animationType || 'fade']}
50-
initial='initial'
51-
animate='animate'
52-
exit='exit'
53-
transition={{
54-
type: 'tween',
55-
duration: 0.3,
56-
delay: index * 0.1, // 각 λͺ¨λ‹¬μ— μ•½κ°„μ˜ μ§€μ—° μΆ”κ°€
57-
}}
58-
style={{
59-
zIndex: 1000 + index, // 동적 z-index
60-
position: 'absolute',
61-
top: 0,
62-
left: 0,
63-
right: 0,
64-
bottom: 0,
65-
}}
66-
>
67-
{children}
68-
</motion.div>
69-
)
47+
}) => {
48+
const transitionConfig =
49+
animationType === 'fade'
50+
? {
51+
type: 'tween',
52+
duration: 0.15, // Shorter duration for fade animation
53+
delay: index * 0.05, // Adjusted delay for fade animation
54+
}
55+
: {
56+
type: 'tween',
57+
duration: 0.3,
58+
delay: index * 0.1,
59+
}
60+
return (
61+
<motion.div
62+
variants={animationVariants[animationType || 'fade']}
63+
initial='initial'
64+
animate='animate'
65+
exit='exit'
66+
transition={transitionConfig}
67+
style={{
68+
zIndex: 1000 + index, // 동적 z-index
69+
position: 'absolute',
70+
top: 0,
71+
left: 0,
72+
right: 0,
73+
bottom: 0,
74+
}}
75+
>
76+
{children}
77+
</motion.div>
78+
)
79+
}
7080

7181
export default function ModalContainer() {
7282
const { modalList, popModal } = useModalStore()

β€Žsrc/pages/RegisterPage/Register/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { validateOwnerProfile } from '~utils/validateOwnerProfile'
1313
import RegisterDogPage from '~pages/RegisterPage/Dog'
1414
import Toast from '~components/Toast'
1515
import { useToastStore } from '~stores/toastStore'
16-
import { useSearchParams } from 'react-router-dom'
16+
import { useNavigate, useSearchParams } from 'react-router-dom'
1717
import { createRegister } from '~apis/register/createRegister'
1818
import { FamilyRole } from '~types/common'
1919
import { useEffect } from 'react'
@@ -27,7 +27,7 @@ export default function Register() {
2727
const [searchParams] = useSearchParams()
2828
const email = searchParams.get('email') || ''
2929
const provider = searchParams.get('provider') || ''
30-
30+
const navigate = useNavigate()
3131
const handleNextClick = async () => {
3232
const alertMessage = validateOwnerProfile(ownerProfile)
3333
if (alertMessage) {
@@ -55,7 +55,7 @@ export default function Register() {
5555
if (response.code === 201) {
5656
//? μ±„νŒ… κ΅¬ν˜„μ„ μœ„ν•΄ μž„μ˜λ‘œ μΆ”κ°€ν•œ λΆ€λΆ„μž…λ‹ˆλ‹€.
5757
setOwnerProfile({ memberId: response.data.memberId })
58-
pushModal(<RegisterDogPage />)
58+
navigate('/register/dog')
5959
}
6060
} catch (error) {
6161
showToast(error instanceof Error ? error.message : 'νšŒμ›κ°€μž…μ— μ‹€νŒ¨ν–ˆμŠ΅λ‹ˆλ‹€')

0 commit comments

Comments
Β (0)