File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
src/Shared/Components/ButtonWithSelector Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import { ReactComponent as ICDropdown } from '../../../Assets/Icon/ic-chevron-do
19
19
import { PopupMenu } from '../../../Common'
20
20
import { ButtonWithSelectorProps } from './types'
21
21
import './buttonWithSelector.scss'
22
+ import { ButtonWithLoader } from '../ButtonWithLoader'
22
23
23
24
/**
24
25
* Button With Selector
@@ -42,19 +43,21 @@ const ButtonWithSelector = ({
42
43
popUpBodyClassName = '' ,
43
44
showPopUp = true ,
44
45
disabled = false ,
46
+ isLoading = false ,
45
47
} : ButtonWithSelectorProps ) => {
46
48
const [ isMenuOpen , setIsMenuOpen ] = useState < boolean > ( false )
47
49
48
50
return (
49
51
< div className = "flexbox bcb-5 br-4" >
50
- < button
51
- className = { `cta flex h-28 ${ showPopUp ? 'dc__no-right-radius' : '' } dc__no-border-imp fs-12 fw-6 lh-20-imp ${ className } ` }
52
+ < ButtonWithLoader
53
+ isLoading = { isLoading }
54
+ rootClassName = { `cta flex h-28 ${ showPopUp ? 'dc__no-right-radius' : '' } dc__no-border-imp fs-12 fw-6 lh-20-imp ${ className } ` }
52
55
type = "button"
53
56
onClick = { onClick }
54
- disabled = { disabled }
57
+ disabled = { isLoading || disabled }
55
58
>
56
59
{ content }
57
- </ button >
60
+ </ ButtonWithLoader >
58
61
{ showPopUp && (
59
62
< PopupMenu autoClose autoPosition onToggleCallback = { setIsMenuOpen } >
60
63
< PopupMenu . Button
Original file line number Diff line number Diff line change @@ -24,4 +24,5 @@ export interface ButtonWithSelectorProps {
24
24
popUpBodyClassName ?: string
25
25
showPopUp ?: boolean
26
26
disabled ?: boolean
27
+ isLoading ?: boolean
27
28
}
You can’t perform that action at this time.
0 commit comments