From 627ffd68dcb3fb086879b7c8017e308b22b43e47 Mon Sep 17 00:00:00 2001 From: Max <ḿax.seyfried@gmx.de> Date: Mon, 6 Jul 2020 13:14:06 +0200 Subject: [PATCH] activation form only appears when a plant is added --- imports/ui/ActivatePlant.jsx | 40 ++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/imports/ui/ActivatePlant.jsx b/imports/ui/ActivatePlant.jsx index 7c30f87..f953b03 100644 --- a/imports/ui/ActivatePlant.jsx +++ b/imports/ui/ActivatePlant.jsx @@ -54,24 +54,28 @@ class ActivatePlant extends React.Component{ render (){ return ( <> -
- - Active plant: - - - {this.props.plants.map((plant, index) =>{ - return - })} - - - -
+ { + this.props.plants.length !== 0 ? +
+ + Active plant: + + + {this.props.plants.map((plant, index) =>{ + return + })} + + + +
+ :null + } ); }