Skip to content

Commit 7399639

Browse files
committed
fixup! feat: add support for classList in image editor components
1 parent ae493ea commit 7399639

4 files changed

Lines changed: 12 additions & 10 deletions

File tree

src/editors/sharedComponents/ImageUploadModal/ImageSettingsModal/CSSEditControls.tsx

Whitespace-only changes.

src/editors/sharedComponents/ImageUploadModal/ImageSettingsModal/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ interface ImageSettingsModalInternalProps extends ImageSettingsModalCommonProps
3939
}
4040

4141
interface ImageSettingsModalProps extends ImageSettingsModalCommonProps {
42-
saveToEditor: (config: AltText & { dimensions: ImageDimensions; classList?: string[] }) => void;
42+
saveToEditor: (config: AltText & { dimensions: ImageDimensions; classList?: string[]; }) => void;
4343
}
4444

4545
export interface ImageSettingsModalFormProps<T extends ImageConfig = ImageConfig>

src/plugin-slots/ImageAdditionalSettingsSlot/README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,20 @@ const ShowcaseClassEditor = () => {
2828
// Toggle the 'showcase' class based on the checkbox state
2929
const filteredList = classList.filter(c => c !== 'showcase');
3030
const newList = event.target.checked
31-
? [...filteredList, "showcase"]
31+
? [...filteredList, 'showcase']
3232
: filteredList;
3333
await formik.setFieldValue('classList', newList);
3434
};
3535

3636
return (
3737
<Form.Group>
38-
<Form.Checkbox
39-
checked={checked}
40-
onChange={handleChange}
41-
/>
42-
<Form.Label>Showcase Image</Form.Label>
38+
<Form.Label>
39+
<Form.Checkbox
40+
checked={checked}
41+
onChange={handleChange}
42+
/>
43+
Showcase Image
44+
</Form.Label>
4345
</Form.Group>
4446
);
4547
};
@@ -53,7 +55,7 @@ const config = {
5355
widget: {
5456
id: 'showcase_class_editor',
5557
type: 'DIRECT_PLUGIN',
56-
RenderWidget: ShowCaseClassEditor,
58+
RenderWidget: ShowcaseClassEditor,
5759
},
5860
},
5961
],

src/plugin-slots/ImageSettingsModalSlot/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
This slot wraps the image settings modal. It can be used to modify the form's initial values, validation schema, or to wrap the entire modal component. You can also use this slot to add validation and initial values to the form. The `processValues` function is called to clean up values being submitted.
1414

1515
Combined with `ImageAdditionalSettingsSlot`, this slot allows extending the image editing capabilities of the image settings modal.
16-
16+
1717
Since this slot wraps a modal that uses a React portal, you can't use it to wrap the modal in another div etc.
1818

1919
## Example
2020

21-
The following `env.config.jsx` will modify the image settings modal to log the values being submitted.
21+
The following `env.config.jsx` will modify the image settings modal to log the values being submitted.
2222

2323
```jsx
2424
import { PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';

0 commit comments

Comments
 (0)