mirror of
https://github.com/strapi/strapi.git
synced 2025-09-27 09:25:46 +00:00
fixed click event on non-repeatable empty component
Signed-off-by: akhilmhdh <akhilmhdh@gmail.com>
This commit is contained in:
parent
5fe7fa2f79
commit
c1b7ab3231
@ -11,15 +11,16 @@ const ComponentInitializer = ({ componentUid, isReadOnly, name }) => {
|
|||||||
const { addNonRepeatableComponentToField } = useDataManager();
|
const { addNonRepeatableComponentToField } = useDataManager();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<NonRepeatableWrapper isEmpty isReadOnly={isReadOnly}>
|
<NonRepeatableWrapper
|
||||||
<PlusButton
|
isEmpty
|
||||||
onClick={() => {
|
isReadOnly={isReadOnly}
|
||||||
if (!isReadOnly) {
|
onClick={() => {
|
||||||
addNonRepeatableComponentToField(name, componentUid);
|
if (!isReadOnly) {
|
||||||
}
|
addNonRepeatableComponentToField(name, componentUid);
|
||||||
}}
|
}
|
||||||
type="button"
|
}}
|
||||||
/>
|
>
|
||||||
|
<PlusButton type="button" />
|
||||||
<FormattedMessage id={`${pluginId}.components.empty-repeatable`}>
|
<FormattedMessage id={`${pluginId}.components.empty-repeatable`}>
|
||||||
{msg => <P style={{ paddingTop: 78 }}>{msg}</P>}
|
{msg => <P style={{ paddingTop: 78 }}>{msg}</P>}
|
||||||
</FormattedMessage>
|
</FormattedMessage>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user