More small fixes
This commit is contained in:
@@ -38,3 +38,31 @@ export const listingUrl = (id) => {
|
||||
}
|
||||
|
||||
export const isMobile = () => window.matchMedia("(max-width: 768px)").matches
|
||||
|
||||
export const formatRooms = (rooms) => {
|
||||
const val = parseInt(rooms)
|
||||
|
||||
if (isNaN(val)) {
|
||||
return '--'
|
||||
}
|
||||
|
||||
if (val === 0) {
|
||||
return "Garsonjera"
|
||||
}
|
||||
|
||||
if ([2, 3, 4].includes(val)) {
|
||||
return `${val} sobe`
|
||||
}
|
||||
|
||||
return `${val} soba`
|
||||
}
|
||||
|
||||
export const formatFloor = (floor) => {
|
||||
|
||||
const val = parseInt(floor)
|
||||
if (isNaN(val)) {
|
||||
return '--'
|
||||
}
|
||||
|
||||
return `${val}. sprat`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user