-
Notifications
You must be signed in to change notification settings - Fork 12
Ananya/user location guide #483
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
justinwongeecs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the changes in this file should be part of this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove the distanceLabelView private variable all together because it just contains DistanceLabelView.
You can use DistanceLabelView directly in the view's body.
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