Hide cart for admin users and remove confirmation from view-only modals
Admin Cart Visibility: - Hide cart icon/badge in mobile header for admin users - Cart was already hidden in desktop sidebar - Admins don't need to purchase products Modal Confirmation Improvements: - Removed confirmation from AdminOrders detail dialog (view-only) - Removed confirmation from AdminMembers detail dialog (view-only) - Kept confirmation on AdminProducts form dialog (has form inputs) - Kept confirmation on AdminEvents form dialogs (Event and Block forms) - Kept confirmation on AdminConsulting meet link dialog (has form input) This prevents annoying confirmations on simple view/close actions while still protecting users from accidentally closing forms with unsaved data. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -244,14 +244,16 @@ export function AppLayout({ children }: AppLayoutProps) {
|
|||||||
<span>{brandName}</span>
|
<span>{brandName}</span>
|
||||||
</Link>
|
</Link>
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<Link to="/checkout" className="relative p-2">
|
{!isAdmin && (
|
||||||
<ShoppingCart className="w-5 h-5" />
|
<Link to="/checkout" className="relative p-2">
|
||||||
{items.length > 0 && (
|
<ShoppingCart className="w-5 h-5" />
|
||||||
<span className="absolute top-0 right-0 bg-primary text-primary-foreground text-xs w-4 h-4 flex items-center justify-center">
|
{items.length > 0 && (
|
||||||
{items.length}
|
<span className="absolute top-0 right-0 bg-primary text-primary-foreground text-xs w-4 h-4 flex items-center justify-center">
|
||||||
</span>
|
{items.length}
|
||||||
)}
|
</span>
|
||||||
</Link>
|
)}
|
||||||
|
</Link>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
|
|||||||
@@ -205,13 +205,7 @@ export default function AdminMembers() {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Dialog open={dialogOpen} onOpenChange={(open) => {
|
<Dialog open={dialogOpen} onOpenChange={setDialogOpen}>
|
||||||
if (!open) {
|
|
||||||
const confirmed = window.confirm('Tutup dialog? Data yang belum disimpan akan hilang.');
|
|
||||||
if (!confirmed) return;
|
|
||||||
}
|
|
||||||
setDialogOpen(open);
|
|
||||||
}}>
|
|
||||||
<DialogContent className="max-w-lg border-2 border-border">
|
<DialogContent className="max-w-lg border-2 border-border">
|
||||||
<DialogHeader>
|
<DialogHeader>
|
||||||
<DialogTitle>Detail Member</DialogTitle>
|
<DialogTitle>Detail Member</DialogTitle>
|
||||||
|
|||||||
@@ -262,13 +262,7 @@ export default function AdminOrders() {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Dialog open={dialogOpen} onOpenChange={(open) => {
|
<Dialog open={dialogOpen} onOpenChange={setDialogOpen}>
|
||||||
if (!open) {
|
|
||||||
const confirmed = window.confirm('Tutup dialog? Data yang belum disimpan akan hilang.');
|
|
||||||
if (!confirmed) return;
|
|
||||||
}
|
|
||||||
setDialogOpen(open);
|
|
||||||
}}>
|
|
||||||
<DialogContent className="max-w-lg border-2 border-border">
|
<DialogContent className="max-w-lg border-2 border-border">
|
||||||
<DialogHeader>
|
<DialogHeader>
|
||||||
<DialogTitle>Detail Order</DialogTitle>
|
<DialogTitle>Detail Order</DialogTitle>
|
||||||
|
|||||||
Reference in New Issue
Block a user