don't render baseline if not exist

This commit is contained in:
Mateusz Tylka 2023-05-22 10:29:31 +02:00
parent 564996604c
commit e31bb7ff0f

View File

@ -69,6 +69,16 @@ const MiniChallenge = (props) => {
}
};
const baselineRender = () => {
if (props.baseline) {
return (
<IconLabel size="24px" gap="8px" type="baseline">
{props.baseline}
</IconLabel>
);
}
};
return (
<ChallengeStyle as={Link} to={`${CHALLENGE_PAGE}/${props.name}`}>
<FlexColumn as="article">
@ -102,9 +112,7 @@ const MiniChallenge = (props) => {
{props.bestScore ? props.bestScore.slice(0, 6) : 'xxx'}
</IconLabel>
{deadlineRender()}
<IconLabel size="24px" gap="8px" type="baseline">
{props.baseline ? props.baseline : 'xxx'}
</IconLabel>
{baselineRender()}
{props.prize ? (
<IconLabel size="24px" gap="8px" type="prize">
{props.prize}