added certifactions and configurations, util function for constructing image paths

This commit is contained in:
Blake Joynes
2021-05-31 14:48:00 -04:00
parent e390891329
commit b5034bfa9c
11 changed files with 18 additions and 14 deletions

View File

@@ -6,7 +6,11 @@
* @param {string} baseUrl base image url
* @param {string} fileSize file size
* @param {string} imagePath raw image path
* @param {boolean} svg get svg version if true
*/
export const getFullImagePath = (baseUrl: string, fileSize: string, imagePath: string): string => {
return `${baseUrl}${fileSize}${imagePath}`;
export const getFullImagePath = (baseUrl: string, fileSize: string, imagePath: string, svg = false): string => {
const imagePathArr = imagePath.split('.');
const imageFormat = svg ? 'svg' : imagePathArr[1];
return `${baseUrl}${fileSize}${imagePathArr[0]}.${imageFormat}`;
};