fix(ux-33): prevent support button overlap on contact form and elevate with safe-area spacing

This commit is contained in:
devops committed 2026-10-17 18:56:13 +00:00
1 parent f23efbf90d
commit b5b4e64453
3 files changed
+39 -2

No files matched your search

+1 -1
View File
@@ -42,7 +42,7 @@ export default async function ContactPage() {
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: safeJsonLd(breadcrumbs) }}
/>
<div className="bg-medical-gray-50 py-16 px-4 sm:px-6 lg:px-8 font-vazir" dir="rtl">
<div className="bg-medical-gray-50 pt-10 pb-28 sm:py-16 px-4 sm:px-6 lg:px-8 font-vazir" dir="rtl">
<div className="max-w-6xl mx-auto space-y-16">
{/* Title */}
@@ -194,7 +194,7 @@ export default function SupportChat() {
if (!config?.enabled) return configError ? <span role="status" className="sr-only">تنظیمات پشتیبان هوشمند در دسترس نیست.</span> : null;
const botIcon = { chat: '💬', paw: '🐾', bot: '🤖' }[config.icon];
return (
<aside dir="rtl" className="fixed bottom-20 left-5 z-30 max-w-[calc(100vw-2.5rem)] font-vazir select-none">
<aside dir="rtl" className="fixed bottom-24 sm:bottom-6 left-4 sm:left-6 z-30 max-w-[calc(100vw-2.5rem)] font-vazir select-none pb-[env(safe-area-inset-bottom,0px)]">
{/* Floating Launcher Button */}
<button
type="button"
@@ -0,0 +1,37 @@
import React from "react";
import { describe, it, expect, vi } from "vitest";
import { render, waitFor } from "@testing-library/react";
// Mock fetch for SupportChat config
const mockFetch = vi.fn().mockImplementation(() =>
Promise.resolve({
ok: true,
json: () =>
Promise.resolve({
data: {
enabled: true,
label: "پشتیبانی آنلاین",
icon: "chat",
},
}),
})
);
global.fetch = mockFetch as any;
import SupportChat from "../SupportChat";
describe("SupportChat Safe Area & Positioning (UX-33)", () => {
it("ensures SupportChat launcher has bottom-24 on mobile and safe-area inset to avoid overlapping contact form actions and bottom nav", async () => {
const { container } = render(<SupportChat />);
await waitFor(() => {
const aside = container.querySelector("aside");
expect(aside).not.toBeNull();
expect(aside?.className).toContain("fixed");
expect(aside?.className).toContain("bottom-24");
expect(aside?.className).toContain("sm:bottom-6");
expect(aside?.className).toContain("left-4");
expect(aside?.className).toContain("pb-[env(safe-area-inset-bottom,0px)]");
});
});
});