Remove EmailBranding component and fix Puck sidebar scroll
- Remove EmailBranding from Puck editor (branding auto-shows for free tier) - Fix sidebar scroll in email template editor with single scrollbar - Fix logo data URL format in email_renderer.py 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
* (welcome, appointment confirmations, reminders, etc.) using a Puck editor.
|
||||
*/
|
||||
|
||||
import React, { useState, useCallback, useMemo } from 'react';
|
||||
import React, { useState, useCallback, useMemo, useEffect } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
|
||||
import { Puck, Render } from '@measured/puck';
|
||||
@@ -103,6 +103,36 @@ const SystemEmailTemplates: React.FC = () => {
|
||||
// Get email editor config
|
||||
const editorConfig = getEmailEditorConfig();
|
||||
|
||||
// Fix Puck sidebar scrolling when editor is open
|
||||
useEffect(() => {
|
||||
if (!editingTemplate) return;
|
||||
|
||||
const fixSidebars = () => {
|
||||
// Target only the main left/right sidebar containers
|
||||
const leftSidebar = document.querySelector('[class*="Sidebar--left"]') as HTMLElement;
|
||||
const rightSidebar = document.querySelector('[class*="Sidebar--right"]') as HTMLElement;
|
||||
|
||||
[leftSidebar, rightSidebar].forEach((sidebar) => {
|
||||
if (!sidebar) return;
|
||||
|
||||
// Make the main sidebar scroll
|
||||
sidebar.style.maxHeight = 'calc(100vh - 300px)';
|
||||
sidebar.style.overflowY = 'auto';
|
||||
|
||||
// Remove overflow from inner sections so only the main sidebar scrolls
|
||||
const innerSections = sidebar.querySelectorAll('[class*="SidebarSection"]');
|
||||
innerSections.forEach((section) => {
|
||||
(section as HTMLElement).style.overflow = 'visible';
|
||||
(section as HTMLElement).style.maxHeight = 'none';
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
// Run after Puck renders
|
||||
const timer = setTimeout(fixSidebars, 200);
|
||||
return () => clearTimeout(timer);
|
||||
}, [editingTemplate]);
|
||||
|
||||
// Fetch all email templates
|
||||
const { data: templates = [], isLoading } = useQuery<SystemEmailTemplate[]>({
|
||||
queryKey: ['system-email-templates'],
|
||||
@@ -281,6 +311,7 @@ const SystemEmailTemplates: React.FC = () => {
|
||||
puck_data: editorData,
|
||||
},
|
||||
});
|
||||
|
||||
setPreviewSubject(preview.subject);
|
||||
setPreviewHtml(preview.html);
|
||||
setPreviewText(preview.text);
|
||||
|
||||
Reference in New Issue
Block a user