Skip to content

Commit c011c54

Browse files
committed
feat: disable logo embed
Im disabling this feature rn to focus on other task Plan to revisit later on
1 parent ed79d69 commit c011c54

File tree

1 file changed

+61
-61
lines changed

1 file changed

+61
-61
lines changed

apps/web/src/app/[locale]/(marketing)/meet-together/plans/[planId]/plan-details-client.tsx

Lines changed: 61 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ export default function PlanDetailsClient({
4646
if (!element) throw new Error('Plan element not found');
4747

4848
const backgroundColor = resolvedTheme === 'dark' ? '#0a0a0a' : '#ffffff';
49-
const logoSrc =
50-
resolvedTheme === 'dark'
51-
? '/media/official-logos/light-logo.png'
52-
: '/media/official-logos/dark-logo.png';
49+
// const logoSrc =
50+
// resolvedTheme === 'dark'
51+
// ? '/media/official-logos/light-logo.png'
52+
// : '/media/official-logos/dark-logo.png';
5353

5454
try {
5555
const canvas = await html2canvas(element, {
@@ -68,63 +68,63 @@ export default function PlanDetailsClient({
6868
},
6969
});
7070

71-
const ctx = canvas.getContext('2d');
72-
const logo = new window.Image();
73-
logo.crossOrigin = 'anonymous';
74-
logo.src = logoSrc;
75-
logo.onload = () => {
76-
if (ctx) {
77-
const logoWidth = 60;
78-
const logoHeight = 60;
79-
const logoPosition:
80-
| 'center'
81-
| 'top-left'
82-
| 'top-right'
83-
| 'bottom-left'
84-
| 'bottom-right' = 'bottom-right';
85-
const margin = 32;
86-
let x = 0;
87-
let y = 0;
88-
switch (logoPosition) {
89-
case 'center':
90-
x = (canvas.width - logoWidth) / 2;
91-
y = (canvas.height - logoHeight) / 2;
92-
break;
93-
case 'top-left':
94-
x = margin;
95-
y = margin;
96-
break;
97-
case 'top-right':
98-
x = canvas.width - logoWidth - margin;
99-
y = margin;
100-
break;
101-
case 'bottom-left':
102-
x = margin;
103-
y = canvas.height - logoHeight - margin;
104-
break;
105-
case 'bottom-right':
106-
x = canvas.width - logoWidth - margin;
107-
y = canvas.height - logoHeight - margin;
108-
break;
109-
default:
110-
x = (canvas.width - logoWidth) / 2;
111-
y = (canvas.height - logoHeight) / 2;
112-
}
113-
ctx.drawImage(logo, x, y, logoWidth, logoHeight);
114-
}
115-
const link = document.createElement('a');
116-
link.download = `plan-${plan.id}.png`;
117-
link.href = canvas.toDataURL('image/png', 2.0);
118-
link.click();
119-
};
120-
logo.onerror = (e) => {
121-
console.error('Logo failed to load:', logoSrc, e);
122-
alert('Logo failed to load! Check the path and file type.');
123-
const link = document.createElement('a');
124-
link.download = `plan-${plan.id}.png`;
125-
link.href = canvas.toDataURL('image/png', 2.0);
126-
link.click();
127-
};
71+
// const ctx = canvas.getContext('2d');
72+
// const logo = new window.Image();
73+
// logo.crossOrigin = 'anonymous';
74+
// logo.src = logoSrc;
75+
// logo.onload = () => {
76+
// if (ctx) {
77+
// const logoWidth = 60;
78+
// const logoHeight = 60;
79+
// const logoPosition:
80+
// | 'center'
81+
// | 'top-left'
82+
// | 'top-right'
83+
// | 'bottom-left'
84+
// | 'bottom-right' = 'bottom-right';
85+
// const margin = 32;
86+
// let x = 0;
87+
// let y = 0;
88+
// switch (logoPosition) {
89+
// case 'center':
90+
// x = (canvas.width - logoWidth) / 2;
91+
// y = (canvas.height - logoHeight) / 2;
92+
// break;
93+
// case 'top-left':
94+
// x = margin;
95+
// y = margin;
96+
// break;
97+
// case 'top-right':
98+
// x = canvas.width - logoWidth - margin;
99+
// y = margin;
100+
// break;
101+
// case 'bottom-left':
102+
// x = margin;
103+
// y = canvas.height - logoHeight - margin;
104+
// break;
105+
// case 'bottom-right':
106+
// x = canvas.width - logoWidth - margin;
107+
// y = canvas.height - logoHeight - margin;
108+
// break;
109+
// default:
110+
// x = (canvas.width - logoWidth) / 2;
111+
// y = (canvas.height - logoHeight) / 2;
112+
// }
113+
// ctx.drawImage(logo, x, y, logoWidth, logoHeight);
114+
// }
115+
const link = document.createElement('a');
116+
link.download = `plan-${plan.id}.png`;
117+
link.href = canvas.toDataURL('image/png', 2.0);
118+
link.click();
119+
120+
// logo.onerror = (e) => {
121+
// console.error('Logo failed to load:', logoSrc, e);
122+
// alert('Logo failed to load! Check the path and file type.');
123+
// const link = document.createElement('a');
124+
// link.download = `plan-${plan.id}.png`;
125+
// link.href = canvas.toDataURL('image/png', 2.0);
126+
// link.click();
127+
// };
128128
} catch (error) {
129129
console.error('Error generating PNG:', error);
130130
throw error;

0 commit comments

Comments
 (0)