feat: improve handling of stays

This commit is contained in:
Matilda Landström
2024-07-16 17:21:58 +02:00
committed by Michael Zetterberg
parent e733ce283a
commit f46207a308
11 changed files with 39 additions and 46 deletions

View File

@@ -5,7 +5,8 @@ import NextImage from "next/image"
import type { ImageLoaderProps, ImageProps } from "next/image"
function imageLoader({ quality, src, width }: ImageLoaderProps) {
return `${src}?w=${width}${quality ? "&q=" + quality : ""}`
const hasQS = src.indexOf("?") !== -1
return `${src}${hasQS ? "&" : "?"}w=${width}${quality ? "&q=" + quality : ""}`
}
// Next/Image adds & instead of ? before the params