-
-
Notifications
You must be signed in to change notification settings - Fork 410
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add event cont for day, month and year (#565)
* feat: add event cont for day, month and year * chore: clean up * refactor: remove console.log * refactor: @gouz feedback * refactor: typo + run prettier
- Loading branch information
1 parent
b44f2a0
commit 31ff128
Showing
5 changed files
with
39 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const getCountText = count => { | ||
if (count) { | ||
const plural = count > 1 ? 's' : ''; | ||
return `${count} event${plural}`; | ||
} | ||
return 'no event'; | ||
}; | ||
|
||
const EventCount = ({events}) => { | ||
return <p className="eventCount">{getCountText(events.length)}</p>; | ||
}; | ||
export default EventCount; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,3 +20,8 @@ | |
.eventDateDisplay span { | ||
padding: 0 1rem; | ||
} | ||
|
||
.eventCount { | ||
text-align: center; | ||
font-weight: normal; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters