Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

feat(native): category emoji of older installs as widget symbols

Maurice89f7bd2e2f99
diff --git a/client/src/native/widgetExtras.test.ts b/client/src/native/widgetExtras.test.ts
index 30bc1bcb4..4fb185194 100644
--- a/client/src/native/widgetExtras.test.ts
+++ b/client/src/native/widgetExtras.test.ts
@@ -150,6 +150,7 @@ describe('stopLook and temperature', () => {
it('maps a category to a colour and an SF Symbol, ignoring what it cannot use', () => {
expect(stopLook({ color: '#E8A13A', icon: 'Coffee' })).toEqual({ color: '#E8A13A', symbol: 'cup.and.saucer.fill' });
expect(stopLook({ color: 'red', icon: 'Unknown' })).toEqual({ color: null, symbol: null });
+ expect(stopLook({ color: '#84cc16', icon: '🌿' })).toEqual({ color: '#84cc16', symbol: 'leaf.fill' });
expect(stopLook(null)).toEqual({ color: null, symbol: null });
});
diff --git a/client/src/native/widgetExtras.ts b/client/src/native/widgetExtras.ts
index 710c60c0b..6eb0c2cb6 100644
--- a/client/src/native/widgetExtras.ts
+++ b/client/src/native/widgetExtras.ts
@@ -81,6 +81,17 @@ const SYMBOLS: Record<string, string> = {
Luggage: 'suitcase.rolling.fill',
Backpack: 'backpack.fill',
Zap: 'bolt.fill',
+ // The emoji icons of the categories older installs were seeded with.
+ '🏨': 'bed.double.fill',
+ '🍽️': 'fork.knife',
+ '🏛️': 'building.columns.fill',
+ '🛍️': 'bag.fill',
+ '🚌': 'bus.fill',
+ '🎯': 'figure.walk',
+ '☕': 'cup.and.saucer.fill',
+ '🏖️': 'beach.umbrella.fill',
+ '🌿': 'leaf.fill',
+ '📍': 'mappin',
};
const HEX = /^#[0-9a-f]{6}$/i;