From 1eb4078d2c04d738d44c9d34f7c8344847337505 Mon Sep 17 00:00:00 2001 From: Michael Chu Date: Tue, 26 Feb 2019 22:26:18 -0700 Subject: [PATCH 1/3] Improve the logic for the itemCount exercise --- step1-06/exercise/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/step1-06/exercise/README.md b/step1-06/exercise/README.md index 241ae98..3a86cd9 100644 --- a/step1-06/exercise/README.md +++ b/step1-06/exercise/README.md @@ -3,7 +3,7 @@ ### TodoFooter 1. Use the provided `itemCount` value drive the number of items left. -2. Use a ternary operator to print `item` vs `items` based on if `itemCount > 1` +2. Use a ternary operator to print `item` vs `items` based on if `itemCount == 1` ### TodoListItem From e353f860adf095e5e96e6a7e648c26b172113855 Mon Sep 17 00:00:00 2001 From: Michael Chu Date: Tue, 26 Feb 2019 22:31:40 -0700 Subject: [PATCH 2/3] improve logic of final footer to account for '0 items' --- step1-06/final/src/components/TodoFooter.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/step1-06/final/src/components/TodoFooter.tsx b/step1-06/final/src/components/TodoFooter.tsx index 7bd54e8..5a28a79 100644 --- a/step1-06/final/src/components/TodoFooter.tsx +++ b/step1-06/final/src/components/TodoFooter.tsx @@ -5,7 +5,7 @@ export const TodoFooter = (props: any) => { return (
- {itemCount} item{itemCount > 1 ? 's' : ''} left + {itemCount} item{itemCount === 1 ? '' : 's'} left
From ef1c1fbfe7781b059f629fe13af36c24c18a3d3c Mon Sep 17 00:00:00 2001 From: Michael Chu Date: Tue, 26 Feb 2019 22:32:12 -0700 Subject: [PATCH 3/3] use strict equality --- step1-06/exercise/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/step1-06/exercise/README.md b/step1-06/exercise/README.md index 3a86cd9..165dc83 100644 --- a/step1-06/exercise/README.md +++ b/step1-06/exercise/README.md @@ -3,7 +3,7 @@ ### TodoFooter 1. Use the provided `itemCount` value drive the number of items left. -2. Use a ternary operator to print `item` vs `items` based on if `itemCount == 1` +2. Use a ternary operator to print `item` vs `items` based on if `itemCount === 1` ### TodoListItem