Skip to content
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

Merged
merged 15 commits into from
Aug 8, 2023
Merged

[LMN-21] SwiftUI Map Markers #1724

merged 15 commits into from
Aug 8, 2023

Conversation

frugoman
Copy link
Contributor

@frugoman frugoman commented Aug 4, 2023

@frugoman frugoman added the minor Non breaking change label Aug 4, 2023
Copy link
Contributor

@gert-janvercauteren gert-janvercauteren left a 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)
Copy link
Contributor

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)
Copy link
Contributor

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)
Copy link
Contributor

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?

Comment on lines 23 to 24
let flareSize = CGSize(width: 16, height: 6)
let cornerRadius = BPKSpacing.sm
Copy link
Contributor

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?

Comment on lines 30 to 37
case .default:
return .label2
case .focused:
return .label1
case .viewed:
return .label2
case .disabled:
return .label2
Copy link
Contributor

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:

Suggested change
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)
Copy link
Contributor

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?

Copy link
Contributor Author

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)
Copy link
Contributor

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?

Copy link
Contributor Author

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

Comment on lines 103 to 104
.padding(.bottom, 6)
.padding(.vertical, 4)
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yess

Backpack-SwiftUI/MapMarker/Classes/BPKPoiMapMarker.swift Outdated Show resolved Hide resolved
Copy link
Contributor

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...

Copy link
Contributor Author

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.

@frugoman frugoman enabled auto-merge (squash) August 7, 2023 14:34
Copy link
Contributor

@gert-janvercauteren gert-janvercauteren left a 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 {
Copy link
Contributor

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'

Copy link
Contributor

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?

Copy link
Contributor

@gert-janvercauteren gert-janvercauteren left a 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 🚀

@frugoman frugoman merged commit 0915e51 into main Aug 8, 2023
12 checks passed
@frugoman frugoman deleted the lmn-21/map_marker-swiftui branch August 8, 2023 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor Non breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants