feat: hromadne pouzitie cenovky aj s polohou, rovnaka vyska clankov a receptov
- tlacidla "Pouzit v celom newsletteri" a "Pouzit pre vsetky produkty v tejto sekcii" kopiruju aj polohu cenovky (pod / vedla obrazka) - sekcia Clanky a Recepty (aj letaky) ma karty v riadku rovnako vysoke Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0aa664b08b
commit
61c8c2fb76
3 files changed
+10
-7
No files matched your search
+2
-1
@@ -562,7 +562,7 @@ export default function Home() {
|
||||
};
|
||||
|
||||
// Hromadná aplikácia cenovky na všetky produkty v celej kampani (všetky sekcie + vernostné zľavy)
|
||||
const handleApplyBadgeToAll = (badge: BadgeTemplate) => {
|
||||
const handleApplyBadgeToAll = (badge: BadgeTemplate, badgeLayout?: 'below' | 'side') => {
|
||||
setCampaign((prev) => ({
|
||||
...prev,
|
||||
modules: prev.modules.map((m) => {
|
||||
@@ -579,6 +579,7 @@ export default function Home() {
|
||||
badgeAlign: badge.align ?? prod.badgeAlign ?? 'center',
|
||||
badgePaddingTop: badge.paddingTop ?? prod.badgePaddingTop ?? 4,
|
||||
badgePaddingBottom: badge.paddingBottom ?? prod.badgePaddingBottom ?? 4,
|
||||
badgeLayout: badgeLayout ?? prod.badgeLayout,
|
||||
customBadgePngUrl: undefined
|
||||
}))
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ const PRODUCT_BG_PRESETS = [
|
||||
interface ConfigPanelProps {
|
||||
module: NewsletterModule | null;
|
||||
onUpdateModule: (updated: NewsletterModule) => void;
|
||||
onApplyBadgeToAll?: (badge: BadgeTemplate) => void;
|
||||
onApplyBadgeToAll?: (badge: BadgeTemplate, badgeLayout?: 'below' | 'side') => void;
|
||||
onOpenBadgeManager?: (productId: string) => void;
|
||||
onOpenImport?: () => void;
|
||||
availableBadges?: BadgeTemplate[];
|
||||
@@ -725,6 +725,7 @@ export const ConfigPanel: React.FC<ConfigPanelProps> = ({
|
||||
badgeAlign: p.badgeAlign || p.badgeCustomTemplate?.align || 'center',
|
||||
badgePaddingTop: p.badgePaddingTop ?? p.badgeCustomTemplate?.paddingTop ?? 4,
|
||||
badgePaddingBottom: p.badgePaddingBottom ?? p.badgeCustomTemplate?.paddingBottom ?? 4,
|
||||
badgeLayout: p.badgeLayout || 'below',
|
||||
customBadgePngUrl: undefined
|
||||
}));
|
||||
updateData({ products });
|
||||
@@ -745,7 +746,7 @@ export const ConfigPanel: React.FC<ConfigPanelProps> = ({
|
||||
align: p.badgeAlign || p.badgeCustomTemplate?.align || 'center',
|
||||
paddingTop: p.badgePaddingTop ?? p.badgeCustomTemplate?.paddingTop ?? 4,
|
||||
paddingBottom: p.badgePaddingBottom ?? p.badgeCustomTemplate?.paddingBottom ?? 4
|
||||
});
|
||||
}, p.badgeLayout || 'below');
|
||||
}
|
||||
}}
|
||||
className="w-full py-1.5 text-[11px] font-bold text-red-700 bg-red-50 hover:bg-red-100 border border-red-200 rounded-lg transition-colors text-center flex items-center justify-center gap-1.5"
|
||||
@@ -1348,7 +1349,8 @@ export const ConfigPanel: React.FC<ConfigPanelProps> = ({
|
||||
badgeWidth: p.badgeWidth || p.badgeCustomTemplate?.width || 120,
|
||||
badgeAlign: p.badgeAlign || p.badgeCustomTemplate?.align || 'center',
|
||||
badgePaddingTop: p.badgePaddingTop ?? p.badgeCustomTemplate?.paddingTop ?? 4,
|
||||
badgePaddingBottom: p.badgePaddingBottom ?? p.badgeCustomTemplate?.paddingBottom ?? 4
|
||||
badgePaddingBottom: p.badgePaddingBottom ?? p.badgeCustomTemplate?.paddingBottom ?? 4,
|
||||
badgeLayout: p.badgeLayout || 'below'
|
||||
}));
|
||||
updateData({ products });
|
||||
}
|
||||
@@ -1368,7 +1370,7 @@ export const ConfigPanel: React.FC<ConfigPanelProps> = ({
|
||||
align: p.badgeAlign || p.badgeCustomTemplate?.align || 'center',
|
||||
paddingTop: p.badgePaddingTop ?? p.badgeCustomTemplate?.paddingTop ?? 4,
|
||||
paddingBottom: p.badgePaddingBottom ?? p.badgeCustomTemplate?.paddingBottom ?? 4
|
||||
});
|
||||
}, p.badgeLayout || 'below');
|
||||
}
|
||||
}}
|
||||
className="w-full py-1.5 text-[11px] font-bold text-red-700 bg-red-50 hover:bg-red-100 border border-red-200 rounded-lg transition-colors text-center flex items-center justify-center gap-1.5"
|
||||
|
||||
@@ -408,7 +408,7 @@ function renderModule(m: any, campaign: NewsletterCampaign): string {
|
||||
if (it1?.btnText) {
|
||||
return `
|
||||
<!-- DVA STĹPCE - LETÁKY -->
|
||||
<table align="center" role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%">
|
||||
<table align="center" role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" height="1">
|
||||
<tr>
|
||||
<!-- Leták 1 -->
|
||||
<td width="50%" valign="top" height="100%" style="padding-right: 6px; height: 100%;">
|
||||
@@ -486,7 +486,7 @@ function renderModule(m: any, campaign: NewsletterCampaign): string {
|
||||
// Inak články / recepty
|
||||
return `
|
||||
<!-- ČLÁNKY / RECEPTY (2 stĺpce) -->
|
||||
<table align="center" role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%">
|
||||
<table align="center" role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" height="1">
|
||||
<tr>
|
||||
<!-- Článok 1 -->
|
||||
<td width="50%" valign="top" height="100%" style="padding-right: 6px; padding-bottom: 20px; height: 100%;">
|
||||
|
||||
Reference in new issue
Block a user