Skip to content

Commit a28e7ea

Browse files
authored
Remove unused import, add tabindex={-1} to buttons, add rounded-md (#246)
Remove unused import, add `tabindex={-1}` to buttons, add `rounded-md` Rounds the outline when navigating by tab, tabindex ensures buttons are only outlined once Change sideOffset from string to number
1 parent 4f9447b commit a28e7ea

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

src/components/AccentColorSelector.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export const AccentColorSelector: React.FC = () => {
7575
</TooltipTrigger>
7676
<TooltipContent
7777
side="left"
78-
sideOffset="0"
78+
sideOffset={0}
7979
className="bg-muted text-foreground">
8080
{option.colorName}
8181
<Arrow className="fill-muted" width={12} height={6} />

src/components/SideMenu.tsx

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
import React from 'react';
22

3-
import {
4-
Sheet,
5-
SheetContent,
6-
SheetTitle,
7-
SheetTrigger,
8-
} from './ui/sheet';
3+
import { Sheet, SheetContent, SheetTitle, SheetTrigger } from './ui/sheet';
94

105
import {
116
NavigationMenu,
127
NavigationMenuList,
138
NavigationMenuItem,
14-
NavigationMenuTrigger,
159
NavigationMenuLink,
1610
} from './ui/navigation-menu';
1711

@@ -27,8 +21,11 @@ const MainNavButtons: React.FC = () => {
2721
<NavigationMenuList className="flex w-full flex-col items-start justify-start space-x-0">
2822
{mainLinks.map((link) => (
2923
<NavigationMenuItem key={link.name} className="w-full">
30-
<NavigationMenuLink href={link.href} className="">
31-
<Button variant="ghost" className="h-9 w-full justify-start px-3">
24+
<NavigationMenuLink href={link.href} className="rounded-md">
25+
<Button
26+
tabIndex={-1}
27+
variant="ghost"
28+
className="h-9 w-full justify-start px-3">
3229
{React.createElement(link.icon, {
3330
className: iconStyles,
3431
})}
@@ -50,7 +47,7 @@ const ProjectNavButtons: React.FC = () => {
5047
<NavigationMenuList className="flex w-full flex-col items-start justify-start space-x-0">
5148
{projectLinks.map((project) => (
5249
<NavigationMenuItem key={project.name} className="w-full">
53-
<NavigationMenuLink href={project.href} className="">
50+
<NavigationMenuLink href={project.href} className="rounded-md">
5451
<Button
5552
tabIndex={-1}
5653
variant="link"
@@ -89,4 +86,4 @@ export const SideMenu: React.FC = () => {
8986
</SheetContent>
9087
</Sheet>
9188
);
92-
}
89+
};

0 commit comments

Comments
 (0)