-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add basic preset handling for multiple countries
- Introduce default/minimal preset set - Introduce URL param to change presets - Extend readme
- Loading branch information
Showing
4 changed files
with
162 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,106 +1,148 @@ | ||
import { Preset } from '../../../utils/types/preset' | ||
import { Presets } from '../../../utils/types/preset' | ||
|
||
export const presets: Preset[] = [ | ||
{ | ||
key: 'noStopping', | ||
tags: [ | ||
{ k: 'parking:lane:{side}', v: 'no_stopping' }, | ||
{ k: 'parking:condition:{side}', v: '' }, | ||
{ k: 'parking:condition:{side}:time_interval', v: '' }, | ||
{ k: 'parking:condition:{side}:default', v: '' }, | ||
{ k: 'parking:condition:{side}:maxstay', v: '' }, | ||
], | ||
img: { | ||
src: '/assets/no_stopping/no_stopping.svg', | ||
height: 20, | ||
width: 20, | ||
alt: 'No Stopping Sign', | ||
title: 'No Stopping', | ||
export function presetCountryNames() { | ||
return Object.keys(presets).map(key => key) | ||
} | ||
|
||
export const presets: Presets = { | ||
default: [ | ||
{ | ||
key: 'noStopping', | ||
tags: [ | ||
{ k: 'parking:lane:{side}', v: 'no_stopping' }, | ||
{ k: 'parking:condition:{side}', v: '' }, | ||
{ k: 'parking:condition:{side}:time_interval', v: '' }, | ||
{ k: 'parking:condition:{side}:default', v: '' }, | ||
{ k: 'parking:condition:{side}:maxstay', v: '' }, | ||
], | ||
img: { | ||
src: '/assets/no_stopping/no_stopping.svg', | ||
height: 20, | ||
width: 20, | ||
alt: 'No Stopping Sign', | ||
title: 'No Stopping', | ||
}, | ||
}, | ||
{ | ||
key: 'noParking', | ||
tags: [ | ||
{ k: 'parking:lane:{side}', v: 'no_parking' }, | ||
{ k: 'parking:condition:{side}', v: '' }, | ||
{ k: 'parking:condition:{side}:time_interval', v: '' }, | ||
{ k: 'parking:condition:{side}:default', v: '' }, | ||
{ k: 'parking:condition:{side}:maxstay', v: '' }, | ||
], | ||
img: { | ||
src: '/assets/no_parking/no_parking.svg', | ||
height: 20, | ||
width: 20, | ||
alt: 'No Parking Sign', | ||
title: 'No Parking', | ||
}, | ||
}, | ||
], | ||
russia: [ | ||
{ | ||
key: 'noStopping', | ||
tags: [ | ||
{ k: 'parking:lane:{side}', v: 'no_stopping' }, | ||
{ k: 'parking:condition:{side}', v: '' }, | ||
{ k: 'parking:condition:{side}:time_interval', v: '' }, | ||
{ k: 'parking:condition:{side}:default', v: '' }, | ||
{ k: 'parking:condition:{side}:maxstay', v: '' }, | ||
], | ||
img: { | ||
src: '/assets/no_stopping/no_stopping.svg', | ||
height: 20, | ||
width: 20, | ||
alt: 'No Stopping Sign', | ||
title: 'No Stopping', | ||
}, | ||
}, | ||
}, | ||
{ | ||
key: 'noParking', | ||
tags: [ | ||
{ k: 'parking:lane:{side}', v: 'no_parking' }, | ||
{ k: 'parking:condition:{side}', v: '' }, | ||
{ k: 'parking:condition:{side}:time_interval', v: '' }, | ||
{ k: 'parking:condition:{side}:default', v: '' }, | ||
{ k: 'parking:condition:{side}:maxstay', v: '' }, | ||
], | ||
img: { | ||
src: '/assets/no_parking/no_parking.svg', | ||
height: 20, | ||
width: 20, | ||
alt: 'No Parking Sign', | ||
title: 'No Parking', | ||
{ | ||
key: 'noParking', | ||
tags: [ | ||
{ k: 'parking:lane:{side}', v: 'no_parking' }, | ||
{ k: 'parking:condition:{side}', v: '' }, | ||
{ k: 'parking:condition:{side}:time_interval', v: '' }, | ||
{ k: 'parking:condition:{side}:default', v: '' }, | ||
{ k: 'parking:condition:{side}:maxstay', v: '' }, | ||
], | ||
img: { | ||
src: '/assets/no_parking/no_parking.svg', | ||
height: 20, | ||
width: 20, | ||
alt: 'No Parking Sign', | ||
title: 'No Parking', | ||
}, | ||
}, | ||
}, | ||
{ | ||
key: 'noParkingOdd', | ||
tags: [ | ||
{ k: 'parking:lane:{side}', v: 'no_parking' }, | ||
{ k: 'parking:condition:{side}', v: '' }, | ||
{ k: 'parking:condition:{side}:time_interval', v: '1-31/2' }, | ||
{ k: 'parking:condition:{side}:default', v: 'free' }, | ||
{ k: 'parking:condition:{side}:maxstay', v: '' }, | ||
], | ||
img: { | ||
src: '/assets/no_parking/no_parking_on_odd_days.svg', | ||
height: 20, | ||
width: 20, | ||
alt: 'No Parking on Odd Days Sign', | ||
title: 'No Parking on Odd Days', | ||
{ | ||
key: 'noParkingOdd', | ||
tags: [ | ||
{ k: 'parking:lane:{side}', v: 'no_parking' }, | ||
{ k: 'parking:condition:{side}', v: '' }, | ||
{ k: 'parking:condition:{side}:time_interval', v: '1-31/2' }, | ||
{ k: 'parking:condition:{side}:default', v: 'free' }, | ||
{ k: 'parking:condition:{side}:maxstay', v: '' }, | ||
], | ||
img: { | ||
src: '/assets/no_parking/no_parking_on_odd_days.svg', | ||
height: 20, | ||
width: 20, | ||
alt: 'No Parking on Odd Days Sign', | ||
title: 'No Parking on Odd Days', | ||
}, | ||
}, | ||
}, | ||
{ | ||
key: 'noParkingEven', | ||
tags: [ | ||
{ k: 'parking:lane:{side}', v: 'no_parking' }, | ||
{ k: 'parking:condition:{side}', v: '' }, | ||
{ k: 'parking:condition:{side}:time_interval', v: '2-30/2' }, | ||
{ k: 'parking:condition:{side}:default', v: 'free' }, | ||
{ k: 'parking:condition:{side}:maxstay', v: '' }, | ||
], | ||
img: { | ||
src: '/assets/no_parking/no_parking_on_even_days.svg', | ||
height: 20, | ||
width: 20, | ||
alt: 'No Parking on Even Days Sign', | ||
title: 'No Parking on Even Days', | ||
{ | ||
key: 'noParkingEven', | ||
tags: [ | ||
{ k: 'parking:lane:{side}', v: 'no_parking' }, | ||
{ k: 'parking:condition:{side}', v: '' }, | ||
{ k: 'parking:condition:{side}:time_interval', v: '2-30/2' }, | ||
{ k: 'parking:condition:{side}:default', v: 'free' }, | ||
{ k: 'parking:condition:{side}:maxstay', v: '' }, | ||
], | ||
img: { | ||
src: '/assets/no_parking/no_parking_on_even_days.svg', | ||
height: 20, | ||
width: 20, | ||
alt: 'No Parking on Even Days Sign', | ||
title: 'No Parking on Even Days', | ||
}, | ||
}, | ||
}, | ||
{ | ||
key: 'parking', | ||
tags: [ | ||
{ k: 'parking:lane:{side}', v: '' }, | ||
{ k: 'parking:condition:{side}', v: 'free' }, | ||
{ k: 'parking:condition:{side}:time_interval', v: '' }, | ||
{ k: 'parking:condition:{side}:default', v: '' }, | ||
{ k: 'parking:condition:{side}:maxstay', v: '' }, | ||
], | ||
img: { | ||
src: '/assets/free_parking/free_parking_russia.svg', | ||
height: 20, | ||
width: 20, | ||
alt: 'Free Parking Sign', | ||
title: 'Free Parking', | ||
{ | ||
key: 'parking', | ||
tags: [ | ||
{ k: 'parking:lane:{side}', v: '' }, | ||
{ k: 'parking:condition:{side}', v: 'free' }, | ||
{ k: 'parking:condition:{side}:time_interval', v: '' }, | ||
{ k: 'parking:condition:{side}:default', v: '' }, | ||
{ k: 'parking:condition:{side}:maxstay', v: '' }, | ||
], | ||
img: { | ||
src: '/assets/free_parking/free_parking_russia.svg', | ||
height: 20, | ||
width: 20, | ||
alt: 'Free Parking Sign', | ||
title: 'Free Parking', | ||
}, | ||
}, | ||
}, | ||
{ | ||
key: 'ticket', | ||
tags: [ | ||
{ k: 'parking:lane:{side}', v: '' }, | ||
{ k: 'parking:condition:{side}', v: 'ticket' }, | ||
{ k: 'parking:condition:{side}:time_interval', v: '' }, | ||
{ k: 'parking:condition:{side}:default', v: '' }, | ||
{ k: 'parking:condition:{side}:maxstay', v: '' }, | ||
], | ||
img: { | ||
src: '/assets/paid_parking/paid_parking_russia.svg', | ||
height: 20, | ||
width: 40, | ||
alt: 'Paid Parking Sign', | ||
title: 'Paid Parking', | ||
{ | ||
key: 'ticket', | ||
tags: [ | ||
{ k: 'parking:lane:{side}', v: '' }, | ||
{ k: 'parking:condition:{side}', v: 'ticket' }, | ||
{ k: 'parking:condition:{side}:time_interval', v: '' }, | ||
{ k: 'parking:condition:{side}:default', v: '' }, | ||
{ k: 'parking:condition:{side}:maxstay', v: '' }, | ||
], | ||
img: { | ||
src: '/assets/paid_parking/paid_parking_russia.svg', | ||
height: 20, | ||
width: 40, | ||
alt: 'Paid Parking Sign', | ||
title: 'Paid Parking', | ||
}, | ||
}, | ||
}, | ||
] | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters