diff --git a/admin-spa/src/components/EmailBuilder/BlockRenderer.tsx b/admin-spa/src/components/EmailBuilder/BlockRenderer.tsx index cbd93e2..024afa0 100644 --- a/admin-spa/src/components/EmailBuilder/BlockRenderer.tsx +++ b/admin-spa/src/components/EmailBuilder/BlockRenderer.tsx @@ -26,18 +26,6 @@ export function BlockRenderer({ const renderBlockContent = () => { switch (block.type) { - case 'header': - return ( -
-

-

- ); - - case 'text': - return ( -
- ); - case 'card': const cardStyles: { [key: string]: React.CSSProperties } = { default: { diff --git a/admin-spa/src/components/EmailBuilder/EmailBuilder.tsx b/admin-spa/src/components/EmailBuilder/EmailBuilder.tsx index 4d248b8..bf8e6cc 100644 --- a/admin-spa/src/components/EmailBuilder/EmailBuilder.tsx +++ b/admin-spa/src/components/EmailBuilder/EmailBuilder.tsx @@ -30,12 +30,8 @@ export function EmailBuilder({ blocks, onChange, variables = [] }: EmailBuilderP const newBlock: EmailBlock = (() => { const id = `block-${Date.now()}`; switch (type) { - case 'header': - return { id, type, content: '

Header Title

' }; - case 'text': - return { id, type, content: '

Your text content here...

' }; case 'card': - return { id, type, cardType: 'default', content: '

Card Title

Card content...

' }; + return { id, type, cardType: 'default', content: '

Card Title

Your content here...

' }; case 'button': return { id, type, text: 'Click Here', link: '{order_url}', style: 'solid' }; case 'divider': @@ -69,9 +65,7 @@ export function EmailBuilder({ blocks, onChange, variables = [] }: EmailBuilderP const openEditDialog = (block: EmailBlock) => { setEditingBlockId(block.id); - if (block.type === 'header' || block.type === 'text') { - setEditingContent(block.content); - } else if (block.type === 'card') { + if (block.type === 'card') { setEditingContent(block.content); setEditingCardType(block.cardType); } else if (block.type === 'button') { @@ -89,11 +83,7 @@ export function EmailBuilder({ blocks, onChange, variables = [] }: EmailBuilderP const newBlocks = blocks.map(block => { if (block.id !== editingBlockId) return block; - if (block.type === 'header') { - return { ...block, content: editingContent }; - } else if (block.type === 'text') { - return { ...block, content: editingContent }; - } else if (block.type === 'card') { + if (block.type === 'card') { return { ...block, content: editingContent, cardType: editingCardType }; } else if (block.type === 'button') { return { ...block, text: editingButtonText, link: editingButtonLink, style: editingButtonStyle }; @@ -116,26 +106,6 @@ export function EmailBuilder({ blocks, onChange, variables = [] }: EmailBuilderP {__('Add Block:')} - -
+ + + +
+ +
diff --git a/admin-spa/src/routes/Settings/Notifications/EditTemplate.tsx b/admin-spa/src/routes/Settings/Notifications/EditTemplate.tsx index 2c78777..ae3f69d 100644 --- a/admin-spa/src/routes/Settings/Notifications/EditTemplate.tsx +++ b/admin-spa/src/routes/Settings/Notifications/EditTemplate.tsx @@ -7,6 +7,7 @@ import { Card, CardContent } from '@/components/ui/card'; import { Button } from '@/components/ui/button'; import { Input } from '@/components/ui/input'; import { EmailBuilder, EmailBlock, blocksToHTML, htmlToBlocks } from '@/components/EmailBuilder'; +import { CodeEditor } from '@/components/ui/code-editor'; import { Label } from '@/components/ui/label'; import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'; import { ArrowLeft, Eye, Edit, RotateCcw } from 'lucide-react'; @@ -368,14 +369,13 @@ export default function EditTemplate() { {activeTab === 'editor' && codeMode ? (
-