Round brand logos in station rows: 11 bundled assets (Simple Icons + Wikimedia), fuel-pump fallback for unknown brands
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"info": {
|
||||
"author": "xcode",
|
||||
"version": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"images": [
|
||||
{
|
||||
"filename": "brand_applegreen.png",
|
||||
"idiom": "universal",
|
||||
"scale": "2x"
|
||||
}
|
||||
],
|
||||
"info": {
|
||||
"author": "xcode",
|
||||
"version": 1
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 24 KiB |
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"images": [
|
||||
{
|
||||
"filename": "brand_asda.png",
|
||||
"idiom": "universal",
|
||||
"scale": "2x"
|
||||
}
|
||||
],
|
||||
"info": {
|
||||
"author": "xcode",
|
||||
"version": 1
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 8.2 KiB |
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"images": [
|
||||
{
|
||||
"filename": "brand_bp.png",
|
||||
"idiom": "universal",
|
||||
"scale": "2x"
|
||||
}
|
||||
],
|
||||
"info": {
|
||||
"author": "xcode",
|
||||
"version": 1
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 150 KiB |
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"images": [
|
||||
{
|
||||
"filename": "brand_esso.png",
|
||||
"idiom": "universal",
|
||||
"scale": "2x"
|
||||
}
|
||||
],
|
||||
"info": {
|
||||
"author": "xcode",
|
||||
"version": 1
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 8.1 KiB |
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"images": [
|
||||
{
|
||||
"filename": "brand_gulf.png",
|
||||
"idiom": "universal",
|
||||
"scale": "2x"
|
||||
}
|
||||
],
|
||||
"info": {
|
||||
"author": "xcode",
|
||||
"version": 1
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 30 KiB |
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"images": [
|
||||
{
|
||||
"filename": "brand_jet.png",
|
||||
"idiom": "universal",
|
||||
"scale": "2x"
|
||||
}
|
||||
],
|
||||
"info": {
|
||||
"author": "xcode",
|
||||
"version": 1
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 8.8 KiB |
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"images": [
|
||||
{
|
||||
"filename": "brand_morrisons.png",
|
||||
"idiom": "universal",
|
||||
"scale": "2x"
|
||||
}
|
||||
],
|
||||
"info": {
|
||||
"author": "xcode",
|
||||
"version": 1
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 11 KiB |
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"images": [
|
||||
{
|
||||
"filename": "brand_sainsburys.png",
|
||||
"idiom": "universal",
|
||||
"scale": "2x"
|
||||
}
|
||||
],
|
||||
"info": {
|
||||
"author": "xcode",
|
||||
"version": 1
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 12 KiB |
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"images": [
|
||||
{
|
||||
"filename": "brand_shell.png",
|
||||
"idiom": "universal",
|
||||
"scale": "2x"
|
||||
}
|
||||
],
|
||||
"info": {
|
||||
"author": "xcode",
|
||||
"version": 1
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 17 KiB |
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"images": [
|
||||
{
|
||||
"filename": "brand_tesco.png",
|
||||
"idiom": "universal",
|
||||
"scale": "2x"
|
||||
}
|
||||
],
|
||||
"info": {
|
||||
"author": "xcode",
|
||||
"version": 1
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 9.1 KiB |
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"images": [
|
||||
{
|
||||
"filename": "brand_texaco.png",
|
||||
"idiom": "universal",
|
||||
"scale": "2x"
|
||||
}
|
||||
],
|
||||
"info": {
|
||||
"author": "xcode",
|
||||
"version": 1
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 30 KiB |
@@ -235,6 +235,25 @@ struct StationRow: View {
|
||||
|
||||
var body: some View {
|
||||
HStack(spacing: 12) {
|
||||
// Round brand logo (or generic fuel pump fallback)
|
||||
Group {
|
||||
if let asset = station.brandImageName {
|
||||
Image(asset)
|
||||
.resizable()
|
||||
.scaledToFit()
|
||||
.padding(3)
|
||||
} else {
|
||||
Image(systemName: "fuelpump.fill")
|
||||
.font(.system(size: 16))
|
||||
.foregroundStyle(.white)
|
||||
}
|
||||
}
|
||||
.frame(width: 34, height: 34)
|
||||
.background(Circle().fill(.white))
|
||||
.clipShape(Circle())
|
||||
.overlay(Circle().stroke(Color.primary.opacity(0.08), lineWidth: 1))
|
||||
.shadow(color: .black.opacity(0.08), radius: 2, y: 1)
|
||||
|
||||
VStack(alignment: .leading, spacing: 2) {
|
||||
HStack(spacing: 6) {
|
||||
Text(station.name)
|
||||
|
||||
@@ -93,6 +93,29 @@ struct FuelStation: Identifiable, Codable, Equatable {
|
||||
var mapsDirectionsURL: URL? {
|
||||
URL(string: "http://maps.apple.com/?daddr=\(lat),\(lng)&t=d")
|
||||
}
|
||||
|
||||
/// Name of the bundled brand logo asset, or nil if unknown.
|
||||
/// Normalizes messy raw brand strings ("SHELL LEEDS ROAD" → "shell").
|
||||
var brandImageName: String? {
|
||||
let raw = brand.uppercased()
|
||||
let known: [(String, String)] = [
|
||||
("SHELL", "brand_shell"),
|
||||
("SAINSBURY", "brand_sainsburys"),
|
||||
("MORRISONS", "brand_morrisons"),
|
||||
("APPLEGREEN", "brand_applegreen"),
|
||||
("TESCO", "brand_tesco"),
|
||||
("TEXACO", "brand_texaco"),
|
||||
("ESSO", "brand_esso"),
|
||||
("ASDA", "brand_asda"),
|
||||
("GULF", "brand_gulf"),
|
||||
("BP", "brand_bp"),
|
||||
("JET", "brand_jet"),
|
||||
]
|
||||
for (needle, asset) in known where raw.contains(needle) {
|
||||
return asset
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Shared store
|
||||
|
||||