fixed click event on non-repeatable empty component

Signed-off-by: akhilmhdh <akhilmhdh@gmail.com>
This commit is contained in:
akhilmhdh 2020-11-18 01:18:22 +05:30
parent 5fe7fa2f79
commit c1b7ab3231

View File

@ -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>