Skip to content

Commit

Permalink
#585 create disabled option on rigth panel
Browse files Browse the repository at this point in the history
  • Loading branch information
oleojake committed Dec 23, 2024
1 parent 3fddd6e commit 50654f9
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.container {
display: flex;
gap: 0.5em;
align-items: center;
padding: var(--space-xs) var(--space-md);
border-bottom: 1px solid var(--primary-300);
}

.container :first-child {
flex: 1;
}

.checkbox {
width: var(--space-md);
height: var(--space-md);
cursor: pointer;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import classes from './disabled-selector.component.module.css';

interface Props {
label: string;
disabled: boolean;
onChange: (disabled: boolean) => void;
}

export const Disabled: React.FC<Props> = props => {
const { label, disabled, onChange } = props;

return (
<div className={classes.container}>
<p>{label}</p>
<input
type="checkbox"
checked={disabled}
onChange={() => onChange(!disabled)}
className={classes.checkbox}
/>
</div>
);
};
1 change: 1 addition & 0 deletions src/pods/properties/components/disabled/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './disabled-selector.component';
1 change: 1 addition & 0 deletions src/pods/properties/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ export * from './color-picker';
export * from './icon-selector';
export * from './progress';
export * from './border-radius';
export * from './disabled';
20 changes: 19 additions & 1 deletion src/pods/properties/properties.pod.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import classes from './properties.pod.module.css';
import { ZIndexOptions } from './components/zindex/zindex-option.component';
import { ColorPicker } from './components/color-picker/color-picker.component';
import { Checked } from './components/checked/checked.component';
import { SelectSize, SelectIcon, BorderRadius } from './components';
import { SelectSize, SelectIcon, BorderRadius, Disabled } from './components';
import { StrokeStyle } from './components/stroke-style/stroke.style.component';
import { ImageSrc } from './components/image-src/image-selector.component';
import { ImageBlackAndWhite } from './components/image-black-and-white/image-black-and-white-selector.component';
Expand Down Expand Up @@ -224,6 +224,24 @@ export const PropertiesPod = () => {
}
/>
</ShowProp>
<ShowProp
singleSelection={isSingleSelection}
multipleSelectionPropsInCommon={multipleSelectionPropsInCommon}
propKey="disabled"
propValue={selectedShapeData?.otherProps?.disabled}
>
<Disabled
label="Disabled"
disabled={selectedShapeData?.otherProps?.disabled ?? false}
onChange={Disabled =>
updateOtherPropsOnSelected(
'disabled',
Disabled,
isMultipleSelection
)
}
/>
</ShowProp>
<ShowProp
singleSelection={isSingleSelection}
multipleSelectionPropsInCommon={multipleSelectionPropsInCommon}
Expand Down

0 comments on commit 50654f9

Please sign in to comment.