-
Notifications
You must be signed in to change notification settings - Fork 1
IdeaVoteComponent HTML
Ethan Dunzer edited this page Aug 29, 2024
·
1 revision
The HTML template for the IdeaVoteComponent is responsible for rendering a single idea with its associated upvote and downvote buttons. It displays the current voting status and provides a simple interface for users to cast their votes.
Idea Details
- lightning-formatted-text: Displays the idea's name.
- Voting Section: Contains upvote and downvote buttons along with the current count of votes.
Voting Buttons
- Upvote Button: Allows the user to upvote the idea. The button's appearance changes based on whether the user has already upvoted.
- Downvote Button: Allows the user to downvote the idea. The button's appearance changes based on whether the user has already downvoted.
Properties
- idea: The idea record to be displayed and interacted with.
- upVoteClass: Determines the CSS class for the upvote button based on the user's voting status.
- downVoteClass: Determines the CSS class for the downvote button based on the user's voting status.
Elements
- lightning-card: The container for displaying the idea and its voting buttons.
- lightning-button: Used for upvoting and downvoting the idea. The button's appearance is dynamic based on the user's interaction.
Conditional Rendering
- Voting Buttons: The buttons change their visual style based on whether the user has already voted on the idea.
Usage The template is built to work closely with the JavaScript controller to provide real-time feedback on the user's voting actions. It is designed to be simple and user-friendly, ensuring that users can easily interact with the idea's voting system.