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(); 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>