mirror of
https://github.com/coollabsio/coolify-examples.git
synced 2026-06-20 00:58:30 +00:00
Refactor image loader URL in loader.js
This commit is contained in:
1 parent
b56754c84f
commit
9cce2ed824
1 file changed
+11
-2
@@ -8,7 +8,16 @@ export default function myImageLoader({ src, width, quality }) {
|
|||||||
if (isLocal) {
|
if (isLocal) {
|
||||||
const baseUrl = 'https://xoos0kk.heyandras.dev';
|
const baseUrl = 'https://xoos0kk.heyandras.dev';
|
||||||
const fullSrc = `${baseUrl}${src}`;
|
const fullSrc = `${baseUrl}${src}`;
|
||||||
return `https://images.coollabs.io/o/${fullSrc}?width=${width}&quality=${quality || 75}`
|
if (quality) {
|
||||||
|
return `https://images.coollabs.io/o/${fullSrc}?width=${width}&quality=${quality}`
|
||||||
|
} else {
|
||||||
|
return `https://images.coollabs.io/o/${fullSrc}?width=${width}`
|
||||||
}
|
}
|
||||||
return `https://images.coollabs.io/o/${src}?width=${width}&quality=${quality|| 75}`
|
}
|
||||||
|
if (quality) {
|
||||||
|
return `https://images.coollabs.io/o/${src}?width=${width}&quality=${quality}`
|
||||||
|
} else {
|
||||||
|
return `https://images.coollabs.io/o/${src}?width=${width}`
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user