Show star ratings on game cards#21
Open
katherineattlc wants to merge 1 commit into
Open
Conversation
Display each game's star rating on listing cards and show 'No rating yet' when unrated. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds star-rating visibility to game listing cards so users can compare games directly from the index page, aligning the UI with the existing Game.starRating model field.
Changes:
- Import and render
StarRatinginGameCard.astrowhengame.starRatingis present. - Display a fallback label (
No rating yet) whengame.starRatingisnull.
Comment on lines
+43
to
+47
| {game.starRating !== null ? ( | ||
| <StarRating rating={game.starRating} /> | ||
| ) : ( | ||
| <p class="text-sm text-slate-400" data-testid="game-rating-empty">No rating yet</p> | ||
| )} |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Show each game's star rating on listing cards so users can compare games without opening detail pages. Cards now render the existing
starRatingvalue, and unrated games displayNo rating yet.Related Issue
Closes #20
Type of Change
Changes Made
src/components/GameCard.astroto import and renderStarRatingwhengame.starRatingis present.No rating yetwhengame.starRatingisnull.Testing
Data Layer Changes
npm run test:unit- all tests passnpm run db:generate) for any schema changeFrontend Changes
npm run test:e2e- all tests passdata-testidattributes to interactive elementsnpm run build)Checklist
Additional Notes
N/A