Fix Opportunities page bug, make image urls support base64 (#547)
This commit is contained in:
@ -1,5 +1,10 @@
|
||||
export function getImageAbsoluteURI(imageRelativePath?: string | null) {
|
||||
return imageRelativePath
|
||||
? `${process.env.REACT_APP_FILES_URL}/${imageRelativePath}`
|
||||
: null;
|
||||
export function getImageAbsoluteURIOrBase64(imageUrl?: string | null) {
|
||||
if (!imageUrl) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (imageUrl?.startsWith('data:')) {
|
||||
return imageUrl;
|
||||
}
|
||||
return `${process.env.REACT_APP_FILES_URL}/${imageUrl}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user