Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
frugoman committed Aug 4, 2023
1 parent 0004291 commit 5d3ee9d
Showing 1 changed file with 68 additions and 19 deletions.
87 changes: 68 additions & 19 deletions Backpack-SwiftUI/MapMarker/README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,86 @@
# Backpack-SwiftUI/Badge
# Backpack-SwiftUI/MapMarker

[![Cocoapods](https://img.shields.io/cocoapods/v/Backpack-SwiftUI.svg?style=flat)](hhttps://cocoapods.org/pods/Backpack-SwiftUI)
[![class reference](https://img.shields.io/badge/Class%20reference-iOS-blue)](https://backpack.github.io/ios/versions/latest/swiftui/Structs/BPKBadge.html)
[![view on Github](https://img.shields.io/badge/Source%20code-GitHub-lightgrey)](https://github.com/Skyscanner/backpack-ios/tree/main/Backpack-SwiftUI/Badge)

## Default
[![class reference](https://img.shields.io/badge/Class%20reference-iOS-blue) Price Marker](https://backpack.github.io/ios/versions/latest/swiftui/Structs/BPKPriceMapMarker.html)
[![class reference](https://img.shields.io/badge/Class%20reference-iOS-blue) Pointer Marker](https://backpack.github.io/ios/versions/latest/swiftui/Structs/BPKPointerMapMarker.html)
[![class reference](https://img.shields.io/badge/Class%20reference-iOS-blue) Poi Marker](https://backpack.github.io/ios/versions/latest/swiftui/Structs/BPKPoiMapMarker.html)
[![view on Github](https://img.shields.io/badge/Source%20code-GitHub-lightgrey)](https://github.com/Skyscanner/backpack-ios/tree/main/Backpack-SwiftUI/MapMarker)

| Day | Night |
| --- | --- |
| <img src="https://raw.githubusercontent.com/Skyscanner/backpack-ios/main/screenshots/iPhone-swiftui_badge___default_lm.png" alt="" width="375" /> |<img src="https://raw.githubusercontent.com/Skyscanner/backpack-ios/main/screenshots/iPhone-swiftui_badge___default_dm.png" alt="" width="375" /> |
| <img src="https://raw.githubusercontent.com/Skyscanner/backpack-ios/main/screenshots/iPhone-swiftui_map-markers___default_lm.png" alt="" width="375" /> |<img src="https://raw.githubusercontent.com/Skyscanner/backpack-ios/main/screenshots/iPhone-swiftui_map-markers___default_dm.png" alt="" width="375" /> |

## Usage

### Basic text badge
If you don't specify a `.badgeStyle(<style>)` it will use the `.default` type
## Price Marker

The Price Marker receives a price string and a status. The status can be one of the following:

```swift
public enum BPKPriceMapMarkerStatus {
case `default`
case focused
case viewed
case disabled
}
```

### Default Price Marker

```swift
BPKPriceMapMarker(status: .default, price: "£123")
```

### Focused Price Marker

```swift
BPKPriceMapMarker(status: .focused, price: "£123")
```

### Viewed Price Marker

```swift
BPKPriceMapMarker(status: .viewed, price: "£123")
```

### Disabled Price Marker

```swift
BPKPriceMapMarker(status: .disabled, price: "Sold out")
```

## Pointer Marker

```swift
BPKPointerMapMarker()
```

## Poi Marker

The Poi Marker receives an icon and a status. The status can be one of the following:

```swift
import Backpack_SwiftUI
public enum BPKPoiMapMarkerStatus {
case `default`
case focused
case disabled
}
```

BPKBadge("Hello World")
### Default Poi Marker

BPKBadge("Hello World")
.badgeStyle(.destructive)
```swift
BPKPoiMapMarker(status: .default, icon: .landmark)
```

### Badge with icon
If you don't specify a `.badgeStyle(<style>)` it will use the `.default` type
### Focused Poi Marker

```swift
import Backpack_SwiftUI
BPKPoiMapMarker(status: .focused, icon: .landmark)
```

BPKBadge("Hello World", icon: .tickCircle)
### Disabled Poi Marker

BPKBadge("Hello World", icon: .tickCircle)
.badgeStyle(.destructive)
```
```swift
BPKPoiMapMarker(status: .disabled, icon: .landmark)
```

0 comments on commit 5d3ee9d

Please sign in to comment.