Skip to content

Commit

Permalink
FOIMOD-3131 Update img src
Browse files Browse the repository at this point in the history
  • Loading branch information
Jocelyn Cabildo authored and Jocelyn Cabildo committed Dec 13, 2024
1 parent bef7389 commit 10b3868
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { getOSSHeaderDetails, getFileFromS3 } from "../../../../apiManager/servi
import { renderTemplate, applyVariables, getTemplateVariables, getTemplateVariablesAsync } from './util';
import { OSS_S3_BUCKET_FULL_PATH, FOI_FFA_URL } from "../../../../constants/constants";
import { EmailExport } from '../../../FOI/customComponents';
import logo from "../../../../assets/FOI/images/logo-banner.png";


export const PreviewModal = React.memo(({
Expand Down Expand Up @@ -43,12 +44,16 @@ export const PreviewModal = React.memo(({
filename: "header_footer_template.html",
s3sourceuri: rootpath+templatePath
}]
const replaceFFAUrlLogo = (template: string, logo: string) => {
return template.replace(/{{ffaurl}}\/logobanner\.jpg/g, logo);
};
React.useEffect(() => {
getOSSHeaderDetails(fileInfoList, dispatch, (err: any, res: any) => {
if (!err) {
res.map(async (header: any, _index: any) => {
getFileFromS3(header, async (_err: any, response: any) => {
let html = await new Response(response.data).text();
html = replaceFFAUrlLogo(html, logo);
setTemplate( `${html}` );
});
});
Expand Down

0 comments on commit 10b3868

Please sign in to comment.