17
17
import { ButtonHTMLAttributes , ChangeEvent , cloneElement , useCallback , useEffect , useState } from 'react'
18
18
import { AnimatePresence , motion } from 'framer-motion'
19
19
import { CustomInput , noop , stopPropagation , useRegisterShortcut , UseRegisterShortcutProvider } from '@Common/index'
20
- import { ComponentSizeType , DEFAULT_ROUTE_PROMPT_MESSAGE } from '@Shared/constants'
21
- import { usePrompt } from '@Shared/Hooks'
22
- import { Prompt } from 'react-router-dom'
20
+ import { ComponentSizeType } from '@Shared/constants'
23
21
import { ConfirmationModalBodyProps , ConfirmationModalProps } from './types'
24
22
import { getPrimaryButtonStyleFromVariant , getConfirmationLabel , getIconFromVariant } from './utils'
25
23
import { Button , ButtonStyleType , ButtonVariantType } from '../Button'
@@ -171,9 +169,6 @@ const ConfirmationModalBody = ({
171
169
export const BaseConfirmationModal = ( ) => {
172
170
const { modalKey, settersRef } = useConfirmationModalContext ( )
173
171
const [ confirmationProps , setConfirmationProps ] = useState < ConfirmationModalProps | null > ( null )
174
- const apiCallInProgress = modalKey && ( confirmationProps ?. buttonConfig . primaryButtonConfig . isLoading ?? false )
175
-
176
- usePrompt ( { shouldPrompt : apiCallInProgress } )
177
172
178
173
useEffect ( ( ) => {
179
174
settersRef . current = {
@@ -183,7 +178,6 @@ export const BaseConfirmationModal = () => {
183
178
184
179
return (
185
180
< UseRegisterShortcutProvider ignoreTags = { [ 'button' ] } >
186
- < Prompt when = { apiCallInProgress } message = { DEFAULT_ROUTE_PROMPT_MESSAGE } />
187
181
< AnimatePresence > { ! ! modalKey && < ConfirmationModalBody { ...confirmationProps } /> } </ AnimatePresence >
188
182
</ UseRegisterShortcutProvider >
189
183
)
0 commit comments