diff options
Diffstat (limited to 'frontend/lib/image.js')
| -rw-r--r-- | frontend/lib/image.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/frontend/lib/image.js b/frontend/lib/image.js new file mode 100644 index 0000000..5b6efb9 --- /dev/null +++ b/frontend/lib/image.js @@ -0,0 +1,6 @@ +import { imageEndpoint } from '../config'; + +export default function(image, width = 300, height = 300) { + if (!image || !image.secret) return ''; + return `${imageEndpoint}/${image.secret}/${width}x${height}`; +} |
