initial commit

This commit is contained in:
2022-01-22 16:37:32 +01:00
commit a494abf762
6 changed files with 90 additions and 0 deletions

13
set-image-url.js Normal file
View File

@@ -0,0 +1,13 @@
export const setImage = (image, folder= '/images') => {
if (image.charAt(0) !== '/') {
image = '/' + image
}
if (folder.charAt(0) !== '/') {
folder = '/' + folder
}
if (folder.charAt(folder.length - 1) === '/') {
folder = folder.slice(0, -1)
}
return '' + process.env.PUBLIC_URL + folder + image
}