mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-13 15:51:00 +00:00
feat(native): category emoji of older installs as widget symbols
This commit is contained in:
@@ -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 });
|
||||
});
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user