Skip to content

Commit

Permalink
Refactor sub-menu item styles to improve
Browse files Browse the repository at this point in the history
accessibility.
  • Loading branch information
filiptronicek committed Nov 13, 2023
1 parent 908ea12 commit e0c7dcd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions components/dashboard/src/components/PageWithSubMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,11 @@ export const SubmenuItem: FC<SubmenuItemProps> = ({ title, link, icon }) => {

let classes = "flex justify-between block rounded-md py-2 px-4 whitespace-nowrap max-w-52";

if (link.some((l) => l === location.pathname)) {
const isCurrent = link.some((l) => l === location.pathname);
if (isCurrent) {
classes += " bg-gray-300 text-gray-800 dark:bg-gray-800 dark:text-gray-50";
} else {
classes += " hover:bg-gray-100 dark:hover:bg-gray-800";
classes += " hover:bg-gray-100 dark:hover:bg-gray-800 dark:text-gray-400";
}

return (
Expand Down

0 comments on commit e0c7dcd

Please sign in to comment.