From ce29ee63b735bdd5176c4c4f9a5092bde2191e2f Mon Sep 17 00:00:00 2001 From: Egor Date: Tue, 27 Jan 2026 00:26:04 +0300 Subject: [PATCH] Update AdminEmailTemplates.tsx --- src/pages/AdminEmailTemplates.tsx | 149 +++++++++++++++--------------- 1 file changed, 77 insertions(+), 72 deletions(-) diff --git a/src/pages/AdminEmailTemplates.tsx b/src/pages/AdminEmailTemplates.tsx index 44d6c15..b415d0f 100644 --- a/src/pages/AdminEmailTemplates.tsx +++ b/src/pages/AdminEmailTemplates.tsx @@ -85,20 +85,20 @@ function TemplateCard({ return ( -
-

{label}

-

+

+

{label}

+

{detail.description[interfaceLang] || detail.description['en'] || ''}

{langData && !langData.is_default && ( - + Custom )} {/* Language tabs */} -
+
{Object.keys(detail.languages).map(lang => { const isActive = lang === activeLang const langInfo = detail.languages[lang] @@ -303,13 +303,14 @@ function TemplateEditor({ if (isDirty && !window.confirm(t('admin.emailTemplates.unsavedWarning', 'Unsaved changes will be lost. Continue?'))) return setActiveLang(lang) }} - className={`flex-1 px-3 py-2 rounded-md text-sm font-medium transition-all duration-150 flex items-center justify-center gap-1.5 ${ + className={`flex-1 px-2 sm:px-3 py-2 rounded-md text-xs sm:text-sm font-medium transition-all duration-150 flex items-center justify-center gap-1 sm:gap-1.5 whitespace-nowrap ${ isActive ? 'bg-dark-700 text-dark-100 shadow-sm' : 'text-dark-400 hover:text-dark-200 hover:bg-dark-800' }`} > - {LANG_FULL_LABELS[lang] || lang} + {LANG_LABELS[lang] || lang} + {LANG_FULL_LABELS[lang] || lang} {!langInfo.is_default && ( )} @@ -334,11 +335,11 @@ function TemplateEditor({ {/* Context variables hint */} {detail.context_vars.length > 0 && ( -
+

{t('admin.emailTemplates.variables', 'Available Variables')}

-
+
{detail.context_vars.map(v => ( handleBodyChange(e.target.value)} - rows={16} - className="w-full px-3 py-2.5 bg-dark-900 border border-dark-600 rounded-lg text-sm text-dark-100 placeholder-dark-500 font-mono leading-relaxed focus:outline-none focus:ring-1 focus:ring-accent-500 focus:border-accent-500 transition-colors resize-y" + rows={12} + className="w-full px-3 py-2.5 bg-dark-900 border border-dark-600 rounded-lg text-xs sm:text-sm text-dark-100 placeholder-dark-500 font-mono leading-relaxed focus:outline-none focus:ring-1 focus:ring-accent-500 focus:border-accent-500 transition-colors resize-y min-h-[200px] sm:min-h-[300px]" placeholder="

Title

Content...

" spellCheck={false} /> @@ -376,53 +377,57 @@ function TemplateEditor({
{/* Actions */} -
- - - - - - - {langData && !langData.is_default && ( +
+
- )} + + +
+ +
+ + + {langData && !langData.is_default && ( + + )} +
{/* Toast */} {toast && ( -
-
-
+
+
+

{t('admin.emailTemplates.preview', 'Preview')}

@@ -449,7 +454,7 @@ function TemplateEditor({