From 8fe1927323b5e44354f43a5c1243fcd49c02f762 Mon Sep 17 00:00:00 2001 From: Shivam Dua Date: Mon, 30 Sep 2024 01:23:00 +0530 Subject: fix(web): Improve SidebarItem tap target accessibility (#409) --- apps/web/components/dashboard/sidebar/AllLists.tsx | 8 +++---- .../components/dashboard/sidebar/SidebarItem.tsx | 26 +++++++++++++++------- 2 files changed, 22 insertions(+), 12 deletions(-) (limited to 'apps/web/components/dashboard/sidebar') diff --git a/apps/web/components/dashboard/sidebar/AllLists.tsx b/apps/web/components/dashboard/sidebar/AllLists.tsx index b1c6ddb2..15bed88a 100644 --- a/apps/web/components/dashboard/sidebar/AllLists.tsx +++ b/apps/web/components/dashboard/sidebar/AllLists.tsx @@ -39,19 +39,19 @@ export default function AllLists({ logo={📋} name="All Lists" path={`/dashboard/lists`} - className="py-0.5" + linkClassName="py-0.5" /> ⭐️} name="Favourites" path={`/dashboard/favourites`} - className="py-0.5" + linkClassName="py-0.5" /> 🗄️} name="Archive" path={`/dashboard/archive`} - className="py-0.5" + linkClassName="py-0.5" /> { @@ -86,7 +86,7 @@ export default function AllLists({ } - className="group py-0.5" + linkClassName="group py-0.5" style={{ marginLeft: `${level * 1}rem` }} /> )} diff --git a/apps/web/components/dashboard/sidebar/SidebarItem.tsx b/apps/web/components/dashboard/sidebar/SidebarItem.tsx index 262fd9ae..83ce776e 100644 --- a/apps/web/components/dashboard/sidebar/SidebarItem.tsx +++ b/apps/web/components/dashboard/sidebar/SidebarItem.tsx @@ -10,6 +10,7 @@ export default function SidebarItem({ logo, path, className, + linkClassName, style, collapseButton, right = null, @@ -19,6 +20,7 @@ export default function SidebarItem({ path: string; style?: React.CSSProperties; className?: string; + linkClassName?: string; right?: React.ReactNode; collapseButton?: React.ReactNode; }) { @@ -26,20 +28,28 @@ export default function SidebarItem({ return (
  • {collapseButton} -
    - - {logo} - {name} - - {right} -
    + +
    +
    + {logo} + {name} +
    + {right} +
    +
  • ); } -- cgit v1.2.3-70-g09d2