mirror of
https://github.com/strapi/strapi.git
synced 2025-09-25 08:19:07 +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();
|
||||
|
||||
return (
|
||||
<NonRepeatableWrapper isEmpty isReadOnly={isReadOnly}>
|
||||
<PlusButton
|
||||
onClick={() => {
|
||||
if (!isReadOnly) {
|
||||
addNonRepeatableComponentToField(name, componentUid);
|
||||
}
|
||||
}}
|
||||
type="button"
|
||||
/>
|
||||
<NonRepeatableWrapper
|
||||
isEmpty
|
||||
isReadOnly={isReadOnly}
|
||||
onClick={() => {
|
||||
if (!isReadOnly) {
|
||||
addNonRepeatableComponentToField(name, componentUid);
|
||||
}
|
||||
}}
|
||||
>
|
||||
<PlusButton type="button" />
|
||||
<FormattedMessage id={`${pluginId}.components.empty-repeatable`}>
|
||||
{msg => <P style={{ paddingTop: 78 }}>{msg}</P>}
|
||||
</FormattedMessage>
|
||||
|
Loading…
x
Reference in New Issue
Block a user