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

This commit is contained in:
Maurice
2026-11-06 19:13:59 +01:00
parent 2fe487154f
commit 89f7bd2e2f
2 changed files with 12 additions and 0 deletions
+1
View File
@@ -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 });
});
+11
View File
@@ -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;