Skip to content

Commit 0d92258

Browse files
committed
feat: add disabled prop in ButtonWithSelector
1 parent 8383942 commit 0d92258

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtron-labs/devtron-fe-common-lib",
3-
"version": "0.0.82-beta-12",
3+
"version": "0.0.82-beta-13",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

src/Shared/Components/ButtonWithSelector/ButtonWithSelector.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const ButtonWithSelector = ({
2525
className = '',
2626
popUpBodyClassName = '',
2727
showPopUp = true,
28+
disabled = false,
2829
}: ButtonWithSelectorProps) => {
2930
const [isMenuOpen, setIsMenuOpen] = useState<boolean>(false)
3031

@@ -34,12 +35,16 @@ const ButtonWithSelector = ({
3435
className={`cta flex h-28 ${showPopUp ? 'dc__no-right-radius' : ''} dc__no-border-imp fs-12 fw-6 lh-20-imp ${className}`}
3536
type="button"
3637
onClick={onClick}
38+
disabled={disabled}
3739
>
3840
{content}
3941
</button>
4042
{showPopUp && (
4143
<PopupMenu autoClose autoPosition onToggleCallback={setIsMenuOpen}>
42-
<PopupMenu.Button rootClassName="flex dc__transparent p-0 w-28 bcb-5 dc__right-radius-4 dc__no-left-radius dc__no-top-border dc__no-bottom-border dc__no-right-border button-with-selector">
44+
<PopupMenu.Button
45+
disabled={disabled}
46+
rootClassName="flex dc__transparent p-0 w-28 bcb-5 dc__right-radius-4 dc__no-left-radius dc__no-top-border dc__no-bottom-border dc__no-right-border button-with-selector"
47+
>
4348
<ICDropdown
4449
className="icon-dim-16 fcn-0 dc__no-shrink rotate"
4550
style={{ ['--rotateBy' as any]: isMenuOpen ? '180deg' : '0deg' }}

src/Shared/Components/ButtonWithSelector/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ export interface ButtonWithSelectorProps {
77
className?: string
88
popUpBodyClassName?: string
99
showPopUp?: boolean
10+
disabled?: boolean
1011
}

0 commit comments

Comments
 (0)