From fa99c2e8c5a4d90385b3b6377169dfb38e972a63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Tue, 22 Dec 2020 13:14:55 +0100 Subject: [PATCH] Hide add button when new item field is empty MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/components/views/elements/EditableItemList.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/components/views/elements/EditableItemList.js b/src/components/views/elements/EditableItemList.js index 34e53906a2..3537d8fad0 100644 --- a/src/components/views/elements/EditableItemList.js +++ b/src/components/views/elements/EditableItemList.js @@ -118,15 +118,23 @@ export default class EditableItemList extends React.Component { }; _renderNewItemField() { + let addButton; + console.log(this.props.newItem); + if (this.props.newItem) { + addButton = ( + + {_t("Add")} + + ); + } + return (
- - {_t("Add")} - + { addButton } ); }