From e31bb7ff0fcd4e7a16cbdfd704a5270c75fcb6da Mon Sep 17 00:00:00 2001 From: Mateusz Tylka Date: Mon, 22 May 2023 10:29:31 +0200 Subject: [PATCH] don't render baseline if not exist --- src/pages/Challanges/components/MiniChallenge.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/pages/Challanges/components/MiniChallenge.js b/src/pages/Challanges/components/MiniChallenge.js index 3976de0..a4e1cab 100644 --- a/src/pages/Challanges/components/MiniChallenge.js +++ b/src/pages/Challanges/components/MiniChallenge.js @@ -69,6 +69,16 @@ const MiniChallenge = (props) => { } }; + const baselineRender = () => { + if (props.baseline) { + return ( + + {props.baseline} + + ); + } + }; + return ( @@ -102,9 +112,7 @@ const MiniChallenge = (props) => { {props.bestScore ? props.bestScore.slice(0, 6) : 'xxx'} {deadlineRender()} - - {props.baseline ? props.baseline : 'xxx'} - + {baselineRender()} {props.prize ? ( {props.prize}