From 065174920d9edebfa4c1423a34134841bff3622b Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Sun, 18 Nov 2018 15:24:52 +0200 Subject: [PATCH] Fix card image margin when there is no image --- src/components/Card/Card.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/Card/Card.tsx b/src/components/Card/Card.tsx index cc3a084..1740acc 100644 --- a/src/components/Card/Card.tsx +++ b/src/components/Card/Card.tsx @@ -24,10 +24,12 @@ class Card extends React.Component { minute: "2-digit" }; const datetime = new Date(this.props.start_time).toLocaleString("fi-FI", options); + + const imageElem = !!image ? : null; if (link) { return ( - + {imageElem}
{datetime}
{title}
{text}
@@ -37,7 +39,7 @@ class Card extends React.Component { } else { return (
- + {imageElem}
{datetime}
{title}
{text}