feat(enamad): dynamic enamad HTML embedding with exact code fallback & admin edit support
Deploy Canina / deploy (push) Failing after 29s
Deploy Canina / deploy (push) Failing after 29s
This commit is contained in:
1 parent
74b3d24622
commit
ea3bdf1ea3
3 files changed
+23
-38
No files matched your search
@@ -347,16 +347,17 @@ export default function Settings() {
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label className="block text-xs font-bold text-gray-700 mb-1">کد / شناسه اینماد (Enamad Code/HTML)</label>
|
||||
<input
|
||||
type="text"
|
||||
<div className="md:col-span-2">
|
||||
<label className="block text-xs font-bold text-gray-700 mb-1">کد و اسکریپت نماد اعتماد الکترونیکی (Enamad HTML/Embed Code)</label>
|
||||
<textarea
|
||||
rows={4}
|
||||
value={settings.ENAMAD_CODE}
|
||||
onChange={(e) => setSettings({ ...settings, ENAMAD_CODE: e.target.value })}
|
||||
placeholder="https://trustseal.enamad.ir/..."
|
||||
className="w-full border border-gray-200 rounded-xl p-2.5 outline-none focus:ring-2 focus:ring-purple-500 text-xs font-mono"
|
||||
placeholder="<a referrerpolicy='origin' target='_blank' href='...'><img src='...' code='...' /></a>"
|
||||
className="w-full border border-gray-200 rounded-xl p-3 outline-none focus:ring-2 focus:ring-purple-500 text-xs font-mono bg-slate-50"
|
||||
dir="ltr"
|
||||
/>
|
||||
<p className="text-[11px] text-gray-500 mt-1">کد کامل HTML دریافت شده از سامانه اینماد (trustseal.enamad.ir) را مستقیماً وارد کنید.</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
|
||||
@@ -2,31 +2,24 @@
|
||||
'use client';
|
||||
|
||||
import React from 'react';
|
||||
import { useSettingsStore } from '../lib/store/settingsStore';
|
||||
|
||||
const DEFAULT_ENAMAD_HTML = `<a referrerpolicy='origin' target='_blank' href='https://trustseal.enamad.ir/?id=765218&Code=dOdphRTqZwp3Kep5m07XwaqA0DTFh5ny'><img referrerpolicy='origin' src='https://trustseal.enamad.ir/logo.aspx?id=765218&Code=dOdphRTqZwp3Kep5m07XwaqA0DTFh5ny' alt='' style='cursor:pointer' code='dOdphRTqZwp3Kep5m07XwaqA0DTFh5ny'></a>`;
|
||||
|
||||
export default function EnamadBadge() {
|
||||
const getText = useSettingsStore((state) => state.getText);
|
||||
const enamadHtml = getText('ENAMAD_HTML_CODE', DEFAULT_ENAMAD_HTML);
|
||||
|
||||
return (
|
||||
<div className="relative flex flex-col items-center justify-center p-6 bg-white/90 backdrop-blur-md rounded-2xl border border-gray-100 shadow-sm hover:shadow-md transition-all duration-300">
|
||||
<div className="text-xs font-semibold text-teal-600 bg-teal-50 px-3 py-1 rounded-full mb-3">
|
||||
نماد اعتماد الکترونیکی (eNamad)
|
||||
</div>
|
||||
|
||||
<div className="relative w-36 h-36 flex items-center justify-center bg-white rounded-xl overflow-hidden border border-gray-100 p-2">
|
||||
<a
|
||||
referrerPolicy="origin"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
href="https://trustseal.enamad.ir/?id=765218&Code=dOdphRTqZwp3Kep5m07XwaqA0DTFh5ny"
|
||||
className="w-full h-full flex items-center justify-center"
|
||||
>
|
||||
<img
|
||||
referrerPolicy="origin"
|
||||
src="https://trustseal.enamad.ir/logo.aspx?id=765218&Code=dOdphRTqZwp3Kep5m07XwaqA0DTFh5ny"
|
||||
alt="نماد اعتماد الکترونیکی کانینا"
|
||||
style={{ cursor: 'pointer' }}
|
||||
className="max-w-full max-h-full object-contain"
|
||||
/>
|
||||
</a>
|
||||
</div>
|
||||
<div
|
||||
className="relative min-w-[120px] min-h-[120px] flex items-center justify-center bg-white rounded-xl overflow-hidden border border-gray-100 p-2"
|
||||
dangerouslySetInnerHTML={{ __html: enamadHtml }}
|
||||
/>
|
||||
|
||||
<p className="text-xs text-gray-500 mt-4 text-center leading-relaxed font-medium">
|
||||
صادر شده توسط مرکز توسعه تجارت الکترونیکی (وزارت صمت)
|
||||
|
||||
@@ -172,21 +172,12 @@ export default function Footer({
|
||||
</div>
|
||||
|
||||
{/* Official eNamad Clickable Seal */}
|
||||
<div className="bg-white p-2 rounded-xl shadow-md flex items-center justify-center flex-shrink-0 hover:scale-105 transition-transform">
|
||||
<a
|
||||
referrerPolicy='origin'
|
||||
target='_blank'
|
||||
rel="noopener noreferrer"
|
||||
href='https://trustseal.enamad.ir/?id=765218&Code=dOdphRTqZwp3Kep5m07XwaqA0DTFh5ny'
|
||||
>
|
||||
<img
|
||||
referrerPolicy='origin'
|
||||
src='https://trustseal.enamad.ir/logo.aspx?id=765218&Code=dOdphRTqZwp3Kep5m07XwaqA0DTFh5ny'
|
||||
alt='نماد اعتماد الکترونیکی کانینا'
|
||||
style={{ cursor: 'pointer', width: '65px', height: '65px' }}
|
||||
/>
|
||||
</a>
|
||||
</div>
|
||||
<div
|
||||
className="bg-white p-2 rounded-xl shadow-md flex items-center justify-center flex-shrink-0 hover:scale-105 transition-transform"
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: getText('ENAMAD_HTML_CODE', `<a referrerpolicy='origin' target='_blank' href='https://trustseal.enamad.ir/?id=765218&Code=dOdphRTqZwp3Kep5m07XwaqA0DTFh5ny'><img referrerpolicy='origin' src='https://trustseal.enamad.ir/logo.aspx?id=765218&Code=dOdphRTqZwp3Kep5m07XwaqA0DTFh5ny' alt='' style='cursor:pointer; width: 65px; height: 65px;' code='dOdphRTqZwp3Kep5m07XwaqA0DTFh5ny'></a>`)
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in new issue
Block a user