Skip to content

Commit 4cd0154

Browse files
committed
feat: add disabled state in select option
1 parent 5882c30 commit 4cd0154

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/Common/MultiSelectCustomization.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,31 @@
1515
*/
1616

1717
import React from 'react'
18-
import Select, { components } from 'react-select'
18+
import Select, { OptionProps, components } from 'react-select'
1919
import { ReactComponent as ClearIcon } from '../Assets/Icon/ic-appstatus-cancelled.svg'
2020
import { ReactComponent as Check } from '../Assets/Icon/ic-check.svg'
2121
import { ReactComponent as RedWarning } from '../Assets/Icon/ic-error-medium.svg'
2222
import { Checkbox } from './Checkbox'
2323
import { CHECKBOX_VALUE } from './Types'
2424

25-
export const Option = (props) => {
26-
const { selectOption, data } = props
25+
export const Option = (props: OptionProps) => {
26+
const { selectOption, data, isDisabled } = props
2727

2828
const handleChange = (e) => {
2929
selectOption(data)
3030
}
3131

3232
return (
3333
<div
34-
className="flex left pl-12 cursor dc__gap-8"
34+
className={`flex left pl-12 cursor dc__gap-8 ${isDisabled ? 'dc__disabled' : ''}`}
3535
style={{ background: props.isFocused ? 'var(--N100)' : 'transparent' }}
3636
>
3737
<Checkbox
3838
isChecked={props.isSelected || false}
3939
onChange={handleChange}
4040
value={CHECKBOX_VALUE.CHECKED}
4141
rootClassName="mb-0 w-20"
42+
disabled={isDisabled || false}
4243
/>
4344
<components.Option {...props} />
4445
</div>

0 commit comments

Comments
 (0)