-
Notifications
You must be signed in to change notification settings - Fork 35
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
[LMN-21] SwiftUI Map Markers #1724
Conversation
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.
Left some nitpicks here/there.
Looks good overall, only odd one is the disabled POI marker being larger than the non disabled ones :']
(And it looks like the price marker selected version)
.clipShape(MarkerShape()) | ||
.overlay( | ||
MarkerShape() | ||
.stroke(Color(.statusSuccessSpotColor), lineWidth: 1) |
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.
nit: Should this be part of the state enum?
|
||
public var body: some View { | ||
Circle() | ||
.stroke(Color(.surfaceDefaultColor), lineWidth: 2) |
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.
nit: Should we use a constant for this? To avoid magic numbers in code?
private let strokeWidth = 2
This can help when we have to later adjust the marker
|
||
extension BPKPriceMapMarker { | ||
struct MarkerShape: Shape { | ||
let flareSize = CGSize(width: 16, height: 6) |
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.
nit: Is the width related to a BPKSpacing token? Should we use the BPKSpacingBase on this one?
let flareSize = CGSize(width: 16, height: 6) | ||
let cornerRadius = BPKSpacing.sm |
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.
Can we make these private?
case .default: | ||
return .label2 | ||
case .focused: | ||
return .label1 | ||
case .viewed: | ||
return .label2 | ||
case .disabled: | ||
return .label2 |
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.
Can we change this to:
case .default: | |
return .label2 | |
case .focused: | |
return .label1 | |
case .viewed: | |
return .label2 | |
case .disabled: | |
return .label2 | |
case .focused: | |
return .label1 | |
default: | |
return .label2 |
.padding(.horizontal, .md) | ||
.overlay( | ||
RoundedRectangle(cornerRadius: .xs) | ||
.stroke(Color(.coreAccentColor), lineWidth: 4) |
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.
Can we use a token for this, or declare it as a constant at the top?
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.
done!
) | ||
.background(state.backgroundColor) | ||
Color(.coreAccentColor) | ||
.frame(width: 16, height: 6) |
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.
Can we use BPKSpacingBase for the 16px token?
The 6px seems fishy, did we double check if we can't use another token?
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.
yeah 6 is the number, it's not a toke that we want to 'support' for the outside world.. but i've extracted it to a constant at least so that's not sparsed around in the class
.padding(.bottom, 6) | ||
.padding(.vertical, 4) |
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.
Can these be Backpack spacing tokens?
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.
yess
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.
This doesn't look disabled, but that's more of a critique on the design...
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.
for the record: fixed this. figma was showing as disabled what was viewed and mixing the focused one.. all is fixed now.
…kpack-ios into lmn-21/map_marker-swiftui
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.
2 tiny things, only thing I think we should address is the docs screenshot.
Do we align the types, or do we align with Android is the question.
Happy to approve if we don't want to change the 2 nit:
comments.
The markers are looking fabulous ✨
import SwiftUI | ||
|
||
public struct BPKPriceMapMarker: View { | ||
public enum State { |
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.
nit: can we move this State enum to a separate extension file? To keep the component 'neater'
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.
nit: should we flip the disabled and focused POI marker, so they align with the price marker?
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.
Looking Good to me 🚀
Introducing the Map Markers for SwiftUI
https://www.figma.com/file/irZ3YBx8vOm16ICkAr7mB3/Backpack?type=design&node-id=8191-8904&mode=design&t=2QzKjHwIqZM3Z6si-0