-
Notifications
You must be signed in to change notification settings - Fork 670
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
clarify requirements in project docs
- Loading branch information
1 parent
7e0a1cf
commit 05aa973
Showing
5 changed files
with
20 additions
and
18 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
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 |
---|---|---|
@@ -1,20 +1,22 @@ | ||
# Wave 03: Event Handling and Lifting Up State | ||
|
||
In this wave we will update to components to manage liking | ||
In this wave we will update the components to manage a **like** feature. | ||
|
||
- Add behavior to heart button in `ChatEntry` so that when it is clicked it toggles from an empty heart to a filled heart and from a filled heart to and empty heart. | ||
- Manage the click event and state of the chat messages such that when the like status of a chat message changes by clicking the heart button, it is tracked by the `App` such that the `App` reports the number of total messages that have been liked. | ||
|
||
🤍❤️ | ||
- Add behavior to heart button in `ChatEntry` so that when it is clicked it toggles from an empty heart (🤍) to a filled heart (❤️) and from a filled heart (❤️) to and empty heart (🤍). | ||
- Manage the click event and state of the chat entries such that when the like status of a chat message changes by clicking the heart button, it is tracked by the `App` such that the `App` reports the number of total messages that have been liked. | ||
- If the user has liked three messages, `3 ❤️s` will appear at the top of the screen. | ||
|
||
<details> | ||
<summary>Hints</summary> | ||
|
||
- Note the class names in `ChatEntry.css` that are used to render a filled and unfilled heart | ||
- Consider writing a helper function in `App` to calculate the number of filled heart | ||
<summary>Expand to see hints for implementing this feature</summary> | ||
|
||
- We will now need to update the `ChatEntry` component to use the `liked` field. | ||
- When we click a heart, the state of the `entries` will need to update in our `App` so that it can report the number of likes (❤️s). | ||
- Consider implementing a helper function to calculate the number of likes (❤️s). | ||
- Consider using a ternary to display a 🤍 or a ❤️ as needed. | ||
</details> | ||
|
||
## Tests | ||
|
||
The tests for this component don't make assumptions about the implementation details of like feature. They check that when you click on a 🤍 button it changes to a ❤️, and when you click on a ❤️ it changes to a 🤍. It also verifies that clicking on one `ChatEntry`'s like button (🤍) doesn't change other `ChatEntry`'s buttons. Finally, the tests check | ||
The tests for this component are integration tests. They don't make assumptions about the implementation details of like feature. The tests verify the following functionality: | ||
- When the user click on a 🤍 button it changes to a ❤️, and when the user clicks on a ❤️ it changes to a 🤍. This test also verifies that clicking on one `ChatEntry`'s like button (🤍) doesn't change other `ChatEntry`'s buttons. | ||
- The correct number of filled hearts is displayed at the top of the screen. |
File renamed without changes.