feat(settings): add admin toggle for prescription upload button and bind to header
This commit is contained in:
1 parent
3109e30fd7
commit
0132cce0cb
13 files changed
+5099
-4983
No files matched your search
@@ -33,6 +33,7 @@ export default function SystemSettingsPage() {
|
||||
CATALOG_ALLOW_CART: 'false',
|
||||
CATALOG_ALLOW_CHECKOUT: 'false',
|
||||
CATALOG_PREORDER_BTN: 'false',
|
||||
PRESCRIPTION_UPLOAD_ENABLED: 'true',
|
||||
});
|
||||
|
||||
const [isLoading, setIsLoading] = useState(true);
|
||||
@@ -64,6 +65,7 @@ export default function SystemSettingsPage() {
|
||||
CATALOG_ALLOW_CART: d.CATALOG_ALLOW_CART || 'false',
|
||||
CATALOG_ALLOW_CHECKOUT: d.CATALOG_ALLOW_CHECKOUT || 'false',
|
||||
CATALOG_PREORDER_BTN: d.CATALOG_PREORDER_BTN || 'false',
|
||||
PRESCRIPTION_UPLOAD_ENABLED: d.PRESCRIPTION_UPLOAD_ENABLED !== undefined ? d.PRESCRIPTION_UPLOAD_ENABLED : 'true',
|
||||
});
|
||||
}
|
||||
})
|
||||
@@ -310,6 +312,35 @@ export default function SystemSettingsPage() {
|
||||
</label>
|
||||
</div>
|
||||
|
||||
{/* Prescription Upload Button Toggle */}
|
||||
<div className="flex items-center justify-between p-4 bg-emerald-50/60 rounded-2xl border border-emerald-200/80 md:col-span-2">
|
||||
<div className="flex items-center gap-3">
|
||||
<div className="w-10 h-10 rounded-xl bg-emerald-600 text-white flex items-center justify-center font-black">
|
||||
<CheckCircle2 className="w-5 h-5" />
|
||||
</div>
|
||||
<div>
|
||||
<h4 className="font-bold text-gray-900 text-sm">دکمه و امکان «ثبت نسخه دامپزشک» در سایت فعال باشد</h4>
|
||||
<p className="text-xs text-gray-600 mt-0.5">
|
||||
با غیرفعالسازی این گزینه، دکمه و پنجره ثبت نسخه در هدر دسکتاپ و منوی موبایل پنهان میشود.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<label className="relative inline-flex items-center cursor-pointer">
|
||||
<input
|
||||
type="checkbox"
|
||||
className="sr-only peer"
|
||||
checked={catalogSettings.PRESCRIPTION_UPLOAD_ENABLED !== 'false'}
|
||||
onChange={(e) =>
|
||||
setCatalogSettings({
|
||||
...catalogSettings,
|
||||
PRESCRIPTION_UPLOAD_ENABLED: e.target.checked ? 'true' : 'false',
|
||||
})
|
||||
}
|
||||
/>
|
||||
<div className="w-12 h-6 bg-gray-200 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-emerald-600"></div>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div className="md:col-span-2">
|
||||
<label className="block text-sm font-bold text-gray-700 mb-1">
|
||||
شماره تماس پشتیبانی اضطراری (در زمان تعمیرات)
|
||||
|
||||
Reference in new issue
Block a user