From 511bf78f93bba5cd74d1c9d62fcef9aa3a5712af Mon Sep 17 00:00:00 2001 From: Catherine Tan Date: Thu, 21 Nov 2024 01:09:45 -0800 Subject: [PATCH] simplify difficulty level return logic --- components/DifficultyLevelBar/index.tsx | 15 ++++++++------- components/PlantCareDescription/style.ts | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/components/DifficultyLevelBar/index.tsx b/components/DifficultyLevelBar/index.tsx index 1604ae0..2c362f3 100644 --- a/components/DifficultyLevelBar/index.tsx +++ b/components/DifficultyLevelBar/index.tsx @@ -8,11 +8,12 @@ export default function DifficultyLevelBar({ }: { difficultyLevel: DifficultyLevelEnum; }) { - return ( -
- {difficultyLevel === 'EASY' && } - {difficultyLevel === 'MODERATE' && } - {difficultyLevel === 'HARD' && } -
- ); + if (difficultyLevel === 'EASY') { + return ; + } else if (difficultyLevel === 'MODERATE') { + return ; + } else { + // difficultyLevel === 'HARD' + return ; + } } diff --git a/components/PlantCareDescription/style.ts b/components/PlantCareDescription/style.ts index c8c026d..cbb935f 100644 --- a/components/PlantCareDescription/style.ts +++ b/components/PlantCareDescription/style.ts @@ -12,7 +12,7 @@ export const Title = styled.h2` export const CareItem = styled.div` display: flex; align-items: center; - margin-bottom: 0.5rem; + margin-bottom: 10px; `; export const IconWrapper = styled.div`