fix(mobile): ensure touch targets exceed 44x44px across bottom navigation
Deploy Canina / deploy (push) Successful in 2m10s
Deploy Canina / deploy (push) Successful in 2m10s
This commit is contained in:
1 parent
b4fdd7abb8
commit
ea4d33b6bb
2 files changed
+19
-4
No files matched your search
@@ -513,7 +513,7 @@ export default function MobileBottomNav({
|
||||
{/* Tab 1: Home */}
|
||||
<Link
|
||||
href="/"
|
||||
className={`flex flex-col items-center justify-center flex-1 py-1 transition-all ${
|
||||
className={`flex flex-col items-center justify-center flex-1 min-h-[48px] py-1 transition-all ${
|
||||
isHomeActive ? "text-canina-blue font-black" : "text-medical-gray-400 font-bold hover:text-medical-gray-700"
|
||||
}`}
|
||||
>
|
||||
@@ -528,7 +528,7 @@ export default function MobileBottomNav({
|
||||
if (activeSheet === "menu") closeSheet();
|
||||
else openSheet("menu");
|
||||
}}
|
||||
className={`flex flex-col items-center justify-center flex-1 py-1 transition-all ${
|
||||
className={`flex flex-col items-center justify-center flex-1 min-h-[48px] py-1 transition-all ${
|
||||
activeSheet === "menu" ? "text-canina-blue font-black" : "text-medical-gray-400 font-bold hover:text-medical-gray-700"
|
||||
}`}
|
||||
>
|
||||
@@ -543,7 +543,7 @@ export default function MobileBottomNav({
|
||||
if (activeSheet === "shop") closeSheet();
|
||||
else openSheet("shop");
|
||||
}}
|
||||
className={`flex flex-col items-center justify-center flex-1 py-1 transition-all ${
|
||||
className={`flex flex-col items-center justify-center flex-1 min-h-[48px] py-1 transition-all ${
|
||||
isShopActive ? "text-canina-blue font-black" : "text-medical-gray-400 font-bold hover:text-medical-gray-700"
|
||||
}`}
|
||||
>
|
||||
@@ -576,7 +576,7 @@ export default function MobileBottomNav({
|
||||
<button
|
||||
type="button"
|
||||
onClick={handleAccountClick}
|
||||
className={`flex flex-col items-center justify-center flex-1 py-1 transition-all ${
|
||||
className={`flex flex-col items-center justify-center flex-1 min-h-[48px] py-1 transition-all ${
|
||||
isAccountActive ? "text-canina-blue font-black" : "text-medical-gray-400 font-bold hover:text-medical-gray-700"
|
||||
}`}
|
||||
>
|
||||
|
||||
@@ -207,4 +207,19 @@ describe('MobileBottomNav Component', () => {
|
||||
expect(screen.getByText('مجله سلامت پت')).toBeInTheDocument();
|
||||
expect(screen.getByText('ویدیوهای بالینی')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("ensures all mobile bottom nav tabs have ergonomic touch targets with min-h-[48px]", () => {
|
||||
render(<MobileBottomNav />);
|
||||
|
||||
const homeLink = screen.getByText("خانه").closest("a");
|
||||
const menuBtn = screen.getByText("منو").closest("button");
|
||||
const shopBtn = screen.getByText("فروشگاه").closest("button");
|
||||
const accountBtn = screen.getByText("حساب من").closest("button");
|
||||
|
||||
expect(homeLink).toHaveClass("min-h-[48px]");
|
||||
expect(menuBtn).toHaveClass("min-h-[48px]");
|
||||
expect(shopBtn).toHaveClass("min-h-[48px]");
|
||||
expect(accountBtn).toHaveClass("min-h-[48px]");
|
||||
});
|
||||
|
||||
});
|
||||
Reference in new issue
Block a user