2017-04-11 10:43:05 +02:00
|
|
|
export const formatPrice = p => {
|
|
|
|
|
if (isNaN(p)) {
|
|
|
|
|
return 'Po dogovoru'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return p.toLocaleString('bs') + ' KM'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const formatFilterNumber = num => {
|
|
|
|
|
if (isNaN(num) || num == null) {
|
|
|
|
|
return ''
|
|
|
|
|
}
|
|
|
|
|
return num
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const galleryImageUrl = img =>
|
|
|
|
|
img && img.replace('upload/', 'upload/w_500/')
|
|
|
|
|
|
|
|
|
|
export const listingImageUrl = img =>
|
|
|
|
|
img && img.replace('upload/', 'upload/w_205/')
|
2017-04-12 13:08:06 +02:00
|
|
|
|
|
|
|
|
export const defaultContactMessage = (url) => {
|
|
|
|
|
return `Pozdrav,
|
|
|
|
|
|
|
|
|
|
Našao/Našla sam vaš oglas na portalu Kivi za sljedeću nekretninu:
|
|
|
|
|
|
|
|
|
|
${url}
|
|
|
|
|
|
|
|
|
|
Želim da me kontaktirate kako bih dobio/dobila više informacija.
|
|
|
|
|
|
|
|
|
|
S poštovanjem
|
|
|
|
|
`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const listingUrl = (id) => {
|
|
|
|
|
// TODO: fix this once removing hardcoded values
|
|
|
|
|
return `http://localhost:8080/?listingId=${id}`
|
|
|
|
|
}
|