fix(prescription): raise modal z-index above header, add backdrop dismiss, and show upload button on mobile header and drawer
This commit is contained in:
1 parent
63e10449ad
commit
6cacfd447b
13 files changed
+1747
-1714
No files matched your search
@@ -238,13 +238,15 @@ export default function Header({
|
||||
|
||||
{/* Left Action Buttons */}
|
||||
<div className="flex items-center gap-1.5 sm:gap-3 shrink-0">
|
||||
{/* Prescription Upload Button */}
|
||||
{/* Prescription Upload Button (Desktop & Mobile) */}
|
||||
<button
|
||||
onClick={() => setIsPrescriptionModalOpen(true)}
|
||||
className="hidden sm:flex items-center gap-1.5 px-3 py-2 bg-emerald-50 text-emerald-700 border border-emerald-200 hover:bg-emerald-100 rounded-xl text-xs font-black transition-all shadow-xs"
|
||||
className="flex items-center gap-1.5 px-2.5 sm:px-3 py-2 bg-emerald-50 text-emerald-700 border border-emerald-200 hover:bg-emerald-100 rounded-xl text-[11px] sm:text-xs font-black transition-all shadow-xs cursor-pointer"
|
||||
title="ثبت نسخه دامپزشک"
|
||||
>
|
||||
<FileHeart className="w-4 h-4 text-emerald-600" />
|
||||
<span>ثبت نسخه دامپزشک</span>
|
||||
<FileHeart className="w-3.5 h-3.5 sm:w-4 sm:h-4 text-emerald-600 shrink-0" />
|
||||
<span className="hidden xs:inline sm:inline">ثبت نسخه دامپزشک</span>
|
||||
<span className="inline xs:hidden sm:hidden">ثبت نسخه</span>
|
||||
</button>
|
||||
|
||||
{/* User Account Button with Dropdown & Pets List */}
|
||||
@@ -520,11 +522,32 @@ export default function Header({
|
||||
placeholder="جستجو در محصولات..."
|
||||
value={searchQuery}
|
||||
onChange={(e) => setSearchQuery(e.target.value)}
|
||||
className="w-full bg-medical-gray-50 border border-medical-gray-200 rounded-xl py-2.5 pr-10 pl-4 text-xs font-bold focus:ring-2 focus:ring-canina-blue/20 outline-none"
|
||||
className="w-full bg-medical-gray-50 border border-medical-gray-200 rounded-xl py-2.5 pr-10 pl-4 text-xs font-bold focus:ring-2 focus:ring-canina-blue/20 outline-none font-vazir placeholder:font-vazir"
|
||||
/>
|
||||
<Search className="w-4 h-4 text-medical-gray-400 absolute right-3 top-1/2 -translate-y-1/2" />
|
||||
</form>
|
||||
|
||||
{/* Direct Prescription CTA in Mobile Drawer */}
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => {
|
||||
setIsMobileMenuOpen(false);
|
||||
setIsPrescriptionModalOpen(true);
|
||||
}}
|
||||
className="w-full flex items-center justify-between p-3.5 bg-gradient-to-r from-emerald-500 to-teal-600 text-white rounded-2xl font-black text-xs shadow-md shadow-emerald-500/20 hover:brightness-105 transition-all cursor-pointer font-vazir"
|
||||
>
|
||||
<div className="flex items-center gap-2.5">
|
||||
<div className="p-1.5 bg-white/20 rounded-xl">
|
||||
<FileHeart className="w-4 h-4 text-white" />
|
||||
</div>
|
||||
<div className="text-right">
|
||||
<div className="text-xs font-black">ثبت و استعلام نسخه دامپزشک</div>
|
||||
<div className="text-[10px] text-emerald-100 font-medium">تامین فوری دارو و مکملهای اورجینال</div>
|
||||
</div>
|
||||
</div>
|
||||
<span className="text-lg">←</span>
|
||||
</button>
|
||||
|
||||
{/* Dynamic Menu Groups in Mobile Drawer */}
|
||||
{headerNavItems.map((navGroup) => {
|
||||
const hasChildren = Array.isArray(navGroup.children) && navGroup.children.length > 0;
|
||||
|
||||
@@ -149,18 +149,28 @@ export default function PrescriptionUploadModal({ isOpen, onClose }: Prescriptio
|
||||
|
||||
return (
|
||||
<AnimatePresence>
|
||||
<div className="fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/60 backdrop-blur-sm font-vazir" dir="rtl">
|
||||
<div
|
||||
className="fixed inset-0 z-[100] flex items-center justify-center p-4 bg-black/60 backdrop-blur-sm font-vazir"
|
||||
dir="rtl"
|
||||
onClick={(e) => {
|
||||
if (e.target === e.currentTarget) {
|
||||
handleClose();
|
||||
}
|
||||
}}
|
||||
>
|
||||
<motion.div
|
||||
initial={{ opacity: 0, scale: 0.95 }}
|
||||
animate={{ opacity: 1, scale: 1 }}
|
||||
exit={{ opacity: 0, scale: 0.95 }}
|
||||
className="bg-white rounded-3xl max-w-lg w-full max-h-[90vh] overflow-y-auto shadow-2xl border border-medical-gray-200 flex flex-col"
|
||||
initial={{ opacity: 0, scale: 0.95, y: 15 }}
|
||||
animate={{ opacity: 1, scale: 1, y: 0 }}
|
||||
exit={{ opacity: 0, scale: 0.95, y: 15 }}
|
||||
className="bg-white rounded-3xl max-w-lg w-full max-h-[90vh] overflow-y-auto shadow-2xl border border-medical-gray-200 flex flex-col z-10 my-auto"
|
||||
>
|
||||
{/* Header */}
|
||||
<div className="bg-canina-blue text-white p-6 relative shrink-0">
|
||||
<button
|
||||
type="button"
|
||||
onClick={handleClose}
|
||||
className="absolute left-5 top-5 text-white/80 hover:text-white bg-white/10 p-1.5 rounded-full transition-colors cursor-pointer"
|
||||
className="absolute left-5 top-5 text-white/90 hover:text-white bg-white/20 hover:bg-white/30 p-2 rounded-full transition-all cursor-pointer z-20"
|
||||
aria-label="بستن پنجره"
|
||||
>
|
||||
<X className="w-5 h-5" />
|
||||
</button>
|
||||
|
||||
Reference in new issue
Block a user