mirror of
https://github.com/strapi/strapi.git
synced 2025-12-27 15:13:21 +00:00
Fix PR feedback
Signed-off-by: soupette <cyril.lpz@gmail.com>
This commit is contained in:
parent
3553025d59
commit
e97b8cca71
@ -151,8 +151,6 @@ const Wysiwyg = ({
|
||||
}
|
||||
|
||||
const handleChange = data => {
|
||||
console.log(data);
|
||||
|
||||
if (data.mime.includes('image')) {
|
||||
const imgTag = `<p><img src="${data.url}" caption="${data.caption}" alt="${data.alternativeText}"></img></p>`;
|
||||
const newValue = value ? `${value}${imgTag}` : imgTag;
|
||||
@ -160,7 +158,7 @@ const Wysiwyg = ({
|
||||
onChange({ target: { name, value: newValue } });
|
||||
}
|
||||
|
||||
// Handle videos and other type of files
|
||||
// Handle videos and other type of files by adding some code
|
||||
};
|
||||
|
||||
const handleToggle = () => setIsOpen(prev => !prev);
|
||||
|
||||
@ -93,8 +93,8 @@ const Initializer = ({ updatePlugin }) => {
|
||||
ref.current = updatePlugin;
|
||||
|
||||
useEffect(() => {
|
||||
// Register the new field
|
||||
strapi.componentApi.registerComponent({ name: 'm-component', Component: MyComponent });
|
||||
// Register the new component
|
||||
strapi.componentApi.registerComponent({ name: 'my-component', Component: MyComponent });
|
||||
|
||||
ref.current(pluginId, 'isReady', true);
|
||||
}, []);
|
||||
|
||||
@ -22,7 +22,7 @@ const MediaLib = ({ isOpen, onChange, onToggle }) => {
|
||||
const handleInputChange = data => {
|
||||
if (data) {
|
||||
const { name, alternativeText, url } = data;
|
||||
const alt = alternativeText === '' ? name : alternativeText;
|
||||
const alt = alternativeText || name;
|
||||
|
||||
setData({ alt, url: prefixFileUrlWithBackendUrl(url) });
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user