Fix PDF logo URL to include Vite base path in production
window.location.origin alone gives https://baic.oliver.solutions, but the app is deployed at /modcomms/ (VITE_BASE_PATH=/modcomms/), so the logo was loading from the wrong path (404). Now uses: window.location.origin + import.meta.env.BASE_URL + filename which resolves correctly in both dev (http://localhost:3000/...) and production (https://baic.oliver.solutions/modcomms/...). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
f520aba397
commit
ef1e4adabd
1 changed files with 3 additions and 3 deletions
|
|
@ -7,7 +7,6 @@ import { ChannelIcon } from './icons/ChannelIcon';
|
|||
interface PDFReportProps {
|
||||
campaignName: string;
|
||||
proofs: any[];
|
||||
baseUrl?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -109,7 +108,8 @@ const RagStatusBadge: React.FC<{ status: RagStatus }> = ({ status }) => {
|
|||
};
|
||||
|
||||
|
||||
export const PDFReport: React.FC<PDFReportProps> = ({ campaignName, proofs, baseUrl = window.location.origin }) => {
|
||||
export const PDFReport: React.FC<PDFReportProps> = ({ campaignName, proofs }) => {
|
||||
const logoUrl = `${window.location.origin}${import.meta.env.BASE_URL}BAR-ModComms-logo-v5.png`;
|
||||
const today = new Date().toLocaleDateString('en-GB', {
|
||||
day: '2-digit',
|
||||
month: 'long',
|
||||
|
|
@ -125,7 +125,7 @@ export const PDFReport: React.FC<PDFReportProps> = ({ campaignName, proofs, base
|
|||
<div style={{ width: '210mm', height: '297mm', display: 'flex', flexDirection: 'column', padding: '20mm', boxSizing: 'border-box', borderBottom: '1px solid #e5e5e5' }}>
|
||||
<div style={{ display: 'flex', alignItems: 'center', paddingBottom: '10mm', borderBottom: '1px solid #e5e5e5' }}>
|
||||
<div style={{ backgroundColor: '#000000', padding: '10px 16px', borderRadius: '6px', display: 'inline-flex' }}>
|
||||
<img src={`${baseUrl}/BAR-ModComms-logo-v5.png`} alt="Mod Comms AI — In partnership with Barclays" style={{ height: '60px', width: 'auto' }} />
|
||||
<img src={logoUrl} alt="Mod Comms AI — In partnership with Barclays" style={{ height: '60px', width: 'auto' }} />
|
||||
</div>
|
||||
</div>
|
||||
<div style={{ flexGrow: 1, display: 'flex', flexDirection: 'column', justifyContent: 'center', alignItems: 'center', textAlign: 'center' }}>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue