fix: Improve payment gateway display and modal z-index

 Payments Page Fixes:
- Use method_title instead of title for unique gateway names
  - Manual: Shows 'Direct bank transfer' instead of empty
  - 3rd Party: Shows 'TriPay - BNI VA' instead of 'Pembayaran TriPay'
- Use method_description for 3rd party gateways
- Rename 'Other Payment Methods' → '3rd Party Payment Methods'
- Better description: 'Additional payment gateways from plugins'

 Modal Z-Index Fix:
- Increased dialog overlay z-index: z-50 → z-[9999]
- Increased dialog content z-index: z-50 → z-[9999]
- Ensures modals appear above fullscreen mode elements

🎯 Result:
- No more duplicate 'Pembayaran TriPay' × 5
- Each gateway shows unique name from WooCommerce
- Modals work properly in fullscreen mode

Addresses user feedback from screenshots 1-4
This commit is contained in:
dwindown
2025-11-05 22:06:23 +07:00
parent 213870a4e2
commit c7d20e6e20
2 changed files with 10 additions and 10 deletions

View File

@@ -19,7 +19,7 @@ const DialogOverlay = React.forwardRef<
<DialogPrimitive.Overlay
ref={ref}
className={cn(
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
"fixed inset-0 z-[9999] bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
className
)}
{...props}
@@ -36,7 +36,7 @@ const DialogContent = React.forwardRef<
<DialogPrimitive.Content
ref={ref}
className={cn(
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
"fixed left-[50%] top-[50%] z-[9999] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
className
)}
{...props}

View File

@@ -166,7 +166,7 @@ export default function PaymentsPage() {
<Banknote className="h-5 w-5 text-muted-foreground" />
</div>
<div>
<h3 className="font-medium">{gateway.title}</h3>
<h3 className="font-medium">{gateway.method_title || gateway.title}</h3>
{gateway.description && (
<p className="text-sm text-muted-foreground mt-1">
{gateway.description}
@@ -230,7 +230,7 @@ export default function PaymentsPage() {
</div>
<div className="flex-1">
<div className="flex items-center gap-2 mb-1">
<h3 className="font-semibold">{gateway.title}</h3>
<h3 className="font-semibold">{gateway.method_title || gateway.title}</h3>
{gateway.enabled ? (
<Badge variant="default" className="bg-green-500">
Enabled
@@ -276,11 +276,11 @@ export default function PaymentsPage() {
)}
</SettingsCard>
{/* Other Gateways */}
{/* 3rd Party Gateways */}
{otherGateways.length > 0 && (
<SettingsCard
title="Other Payment Methods"
description="Additional payment gateways"
title="3rd Party Payment Methods"
description="Additional payment gateways from plugins"
>
<div className="space-y-4">
{otherGateways.map((gateway: PaymentGateway) => (
@@ -294,10 +294,10 @@ export default function PaymentsPage() {
<CreditCard className="h-5 w-5 text-muted-foreground" />
</div>
<div>
<h3 className="font-medium">{gateway.title}</h3>
{gateway.description && (
<h3 className="font-medium">{gateway.method_title || gateway.title}</h3>
{gateway.method_description && (
<p className="text-sm text-muted-foreground mt-1">
{gateway.description}
{gateway.method_description}
</p>
)}
</div>