Merged in feat/sw-3225-move-parking-information-to-booking-flow (pull request #2614)
feat(SW-3225): Move ParkingInformation to design-system * Inline ParkingInformation types to remove trpc dependency * Move ParkingInformation to design-system * Move numberFormatting to common package * Add deps to external * Fix imports and i18n script * Add common as dependency * Merge branch 'master' into feat/sw-3225-move-parking-information-to-booking-flow Approved-by: Linus Flood
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import { ParkingPricePeriods } from '../parkingInformationTypes'
|
||||
|
||||
import type { IntlShape } from 'react-intl'
|
||||
|
||||
export function getPeriod(intl: IntlShape, period?: string) {
|
||||
switch (period) {
|
||||
case ParkingPricePeriods.hour:
|
||||
return intl.formatMessage({
|
||||
defaultMessage: 'Price per hour',
|
||||
})
|
||||
case ParkingPricePeriods.day:
|
||||
return intl.formatMessage({
|
||||
defaultMessage: 'Price per day',
|
||||
})
|
||||
case ParkingPricePeriods.night:
|
||||
return intl.formatMessage({
|
||||
defaultMessage: 'Price per night',
|
||||
})
|
||||
case ParkingPricePeriods.allDay:
|
||||
return intl.formatMessage({
|
||||
defaultMessage: 'Price per 24 hours',
|
||||
})
|
||||
default:
|
||||
return period
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user