Conversation
justinwongeecs
left a comment
There was a problem hiding this comment.
The only file that should be changed in the diff is GuideDetailView and a new file for a reusable view with the person walking symbol and the numerical distance used for items in the home drawer and now in GuideDetailView.
| VStack(alignment: .leading, spacing: 4) { | ||
| Text(place.name) | ||
| .font(Font(BMFont.bold(20))) | ||
|
|
||
| if let d = place.distanceToUser { | ||
| Text(String(format: "%.1f miles away", d)) | ||
| .font(Font(BMFont.regular(14))) | ||
| .foregroundStyle(.secondary) | ||
| } | ||
| } |
There was a problem hiding this comment.
I don't think this file and all the files under Common/FilterView should be in this PR
There was a problem hiding this comment.
I don't think the changes in this file should be part of this PR?
There was a problem hiding this comment.
I was working on two issues almost parallelly. These files are a part of this PR: #482. Sorry for the confusion!
There was a problem hiding this comment.
Cleaned up my branch with irrelevant commits. Refactored distance label into reusable DistanceLabelView component as requested
979f9ee to
c6145d6
Compare
| private var distanceLabelView: some View { | ||
| HStack { | ||
| Image(systemName: "figure.walk") | ||
| .foregroundStyle(Color(BMColor.blackText)) | ||
| .font(.system(size: 12)) | ||
|
|
||
| Text("\(rowItem.distanceToUser ?? 0.0, specifier: "%.1f") mi") | ||
| .foregroundStyle(Color(BMColor.blackText)) | ||
| .font(Font(BMFont.light(12))) | ||
| } | ||
| DistanceLabelView(distance: rowItem.distanceToUser) |
There was a problem hiding this comment.
We can remove the distanceLabelView private variable all together because it just contains DistanceLabelView.
You can use DistanceLabelView directly in the view's body.
There was a problem hiding this comment.
My branch is updated and ready for review. There are merge conflicts caused by the file rename/restructure in master. I'm not entirely sure which code path should be used, so I didn't resolve them.
7344c69 to
02692f8
Compare
This PR adds the missing distance label to each Guide Place inside the GuideDetailView.
The goal is to match the behavior already used in Dining, Fitness, and Study views, where each location shows how far it is from the current user.
Previously, the distance-to-user display was implemented inline in HomeSectionListRowView. We now extract that implementation into a shared DistanceLabelView component and use it in both the Home drawer and Guide detail views.
What Was Changed
Testing
Closes #462