diff --git a/src/front/Components/DesignSystem/Select/classes.module.scss b/src/front/Components/DesignSystem/Select/classes.module.scss index 50161650..89f6a04d 100644 --- a/src/front/Components/DesignSystem/Select/classes.module.scss +++ b/src/front/Components/DesignSystem/Select/classes.module.scss @@ -7,6 +7,13 @@ width: 100%; border: 1px solid $grey-medium; + &[data-disabled="true"]{ + .container-label{ + cursor: not-allowed; + } + opacity: 0.6; + } + .container-label { display: flex; justify-content: space-between; @@ -17,6 +24,8 @@ padding: 24px; z-index: 1; + + &[data-border-right-collapsed="true"] { border-radius: 8px 0 0 8px; } diff --git a/src/front/Components/DesignSystem/Select/index.tsx b/src/front/Components/DesignSystem/Select/index.tsx index 72425ece..3ea8698b 100644 --- a/src/front/Components/DesignSystem/Select/index.tsx +++ b/src/front/Components/DesignSystem/Select/index.tsx @@ -9,12 +9,13 @@ import classes from "./classes.module.scss"; type IProps = { selectedOption?: IOption; - onChange: (selectedOption: IOption) => void; + onChange?: (selectedOption: IOption) => void; options: IOption[]; hasBorderRightCollapsed?: boolean; placeholder?: string; className?: string; name?: string; + disabled: boolean; }; export type IOption = { @@ -35,6 +36,10 @@ export default class Select extends React.Component { private rootRef = React.createRef(); private removeOnresize = () => {}; + static defaultProps = { + disabled: false, + }; + constructor(props: IProps) { super(props); this.state = { @@ -50,7 +55,10 @@ export default class Select extends React.Component { public override render(): JSX.Element { const selectedOption = this.state.selectedOption ?? this.props.selectedOption; return ( -
+
{selectedOption && }