chore: fix challenge modal automatically closing
This commit is contained in:
@@ -241,7 +241,13 @@ const ChallengeModal: FunctionComponent<Props> = ({
|
|||||||
})
|
})
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ModalOverlay isOpen={true} key={challenge.id} ref={setModalElement} close={cancelChallenge}>
|
<ModalOverlay
|
||||||
|
isOpen={true}
|
||||||
|
key={challenge.id}
|
||||||
|
ref={setModalElement}
|
||||||
|
close={cancelChallenge}
|
||||||
|
hideOnInteractOutside={false}
|
||||||
|
>
|
||||||
<Modal
|
<Modal
|
||||||
title="Authenticate"
|
title="Authenticate"
|
||||||
close={cancelChallenge}
|
close={cancelChallenge}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { mergeRefs } from '@/Hooks/mergeRefs'
|
import { mergeRefs } from '@/Hooks/mergeRefs'
|
||||||
import { Dialog, useDialogStore } from '@ariakit/react'
|
import { Dialog, DialogOptions, useDialogStore } from '@ariakit/react'
|
||||||
import { ForwardedRef, forwardRef, ReactNode } from 'react'
|
import { ForwardedRef, forwardRef, ReactNode } from 'react'
|
||||||
import { useModalAnimation } from '../Modal/useModalAnimation'
|
import { useModalAnimation } from '../Modal/useModalAnimation'
|
||||||
|
|
||||||
@@ -11,7 +11,10 @@ type Props = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const ModalOverlay = forwardRef(
|
const ModalOverlay = forwardRef(
|
||||||
({ isOpen, children, animationVariant, close, ...props }: Props, ref: ForwardedRef<HTMLDivElement>) => {
|
(
|
||||||
|
{ isOpen, children, animationVariant, close, ...props }: Props & Partial<DialogOptions>,
|
||||||
|
ref: ForwardedRef<HTMLDivElement>,
|
||||||
|
) => {
|
||||||
const [isMounted, setElement] = useModalAnimation(isOpen, animationVariant)
|
const [isMounted, setElement] = useModalAnimation(isOpen, animationVariant)
|
||||||
const dialog = useDialogStore({
|
const dialog = useDialogStore({
|
||||||
open: isMounted,
|
open: isMounted,
|
||||||
|
|||||||
Reference in New Issue
Block a user