Skip to content

Commit 39830c6

Browse files
committed
feat: add support for isLoading in ButtonWithSelector
1 parent 4cd0154 commit 39830c6

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/Shared/Components/ButtonWithSelector/ButtonWithSelector.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { ReactComponent as ICDropdown } from '../../../Assets/Icon/ic-chevron-do
1919
import { PopupMenu } from '../../../Common'
2020
import { ButtonWithSelectorProps } from './types'
2121
import './buttonWithSelector.scss'
22+
import { ButtonWithLoader } from '../ButtonWithLoader'
2223

2324
/**
2425
* Button With Selector
@@ -42,19 +43,21 @@ const ButtonWithSelector = ({
4243
popUpBodyClassName = '',
4344
showPopUp = true,
4445
disabled = false,
46+
isLoading = false,
4547
}: ButtonWithSelectorProps) => {
4648
const [isMenuOpen, setIsMenuOpen] = useState<boolean>(false)
4749

4850
return (
4951
<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}`}
5255
type="button"
5356
onClick={onClick}
54-
disabled={disabled}
57+
disabled={isLoading || disabled}
5558
>
5659
{content}
57-
</button>
60+
</ButtonWithLoader>
5861
{showPopUp && (
5962
<PopupMenu autoClose autoPosition onToggleCallback={setIsMenuOpen}>
6063
<PopupMenu.Button

src/Shared/Components/ButtonWithSelector/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@ export interface ButtonWithSelectorProps {
2424
popUpBodyClassName?: string
2525
showPopUp?: boolean
2626
disabled?: boolean
27+
isLoading?: boolean
2728
}

0 commit comments

Comments
 (0)