Show state next to location in public Courses UI - #1194
Draft
rustynwac wants to merge 1 commit into
Draft
Conversation
Append ", {state}" to the course location text when the location's
state is set, covering both the placeName and city branches of the
location helper. When no state is present the display is unchanged.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N6dNLcBLhKetQwKErRNefe
Contributor
|
Preview deployment: https://claudextriage-1193-nnopob.preview.avy-fx.org |
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
The public Courses listing (rendered via
CoursePreviewSmallRow) shows a single location string next to the map-pin icon. Because a Course'slocation.placeNameis a required field, the previous helper always returnedplaceNameon its own and thestatevalue was effectively never displayed. This change appends the location's two-letterstateabbreviation to the displayed text when it is set (e.g.Bellingham Ski Shop, WA), for both theplaceNameandcitybranches. When nostateis present, the display is unchanged.Related Issues
Fixes #1193
Key Changes
src/components/CoursePreviewSmallRow.tsx: Reworked thegetLocationText()helper so that whenlocation.stateis present it appends, {state}to whichever ofplaceName/cityis shown. Behavior is unchanged when there is no state (no trailing comma/space), when only a state is set, and when there is no location.How to test
placeNameand astateshows{placeName}, {state}(e.g.Bellingham Ski Shop, WA).cityand astate(noplaceName) shows{city}, {state}.placeNamebut nostateshows just{placeName}(no trailing comma/space).stateshows the state alone; a course with no location renders no location line.pnpm tscandpnpm lintboth pass.Screenshots / Demo video
N/A — text-only location tweak (appends the state abbreviation to the existing location line; no styling or icon changes).
Migration Explanation
N/A — no schema changes.
Future enhancements / Questions
🤖 Generated with Claude Code
Generated by Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.