From 209cfae605b15c1272095b06804d6126bedbb01a Mon Sep 17 00:00:00 2001 From: shadcn Date: Tue, 29 Nov 2022 17:00:51 +0400 Subject: [PATCH] fix: dashboard a11y --- components/dashboard/nav.tsx | 2 +- components/dashboard/post-operations.tsx | 1 + ui/avatar.tsx | 21 +++++++++++++++++---- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/components/dashboard/nav.tsx b/components/dashboard/nav.tsx index 5a28059..1d9e433 100644 --- a/components/dashboard/nav.tsx +++ b/components/dashboard/nav.tsx @@ -28,7 +28,7 @@ export function DashboardNav({ items }: DashboardNavProps) { className={cn( "group flex items-center rounded-md px-3 py-2 text-sm font-medium text-slate-800 hover:bg-slate-100", path === item.href ? "bg-slate-200" : "transparent", - item.disabled && "cursor-not-allowed opacity-50" + item.disabled && "cursor-not-allowed opacity-80" )} > diff --git a/components/dashboard/post-operations.tsx b/components/dashboard/post-operations.tsx index 03bcd68..1608526 100644 --- a/components/dashboard/post-operations.tsx +++ b/components/dashboard/post-operations.tsx @@ -40,6 +40,7 @@ export function PostOperations({ post }: PostOperationsProps) { + Open diff --git a/ui/avatar.tsx b/ui/avatar.tsx index 5b427ce..69c55bc 100644 --- a/ui/avatar.tsx +++ b/ui/avatar.tsx @@ -1,6 +1,7 @@ import * as AvatarPrimitive from "@radix-ui/react-avatar" import { cn } from "@/lib/utils" +import Image, { ImageProps } from "next/image" type AvatarProps = AvatarPrimitive.AvatarProps @@ -16,10 +17,22 @@ export function Avatar({ className, ...props }: AvatarProps) { ) } -type AvatarImageProps = AvatarPrimitive.AvatarImageProps - -Avatar.Image = function AvatarImage({ className, ...props }: AvatarImageProps) { - return +Avatar.Image = function AvatarImage({ + className, + alt, + width = 32, + height = 32, + ...props +}: ImageProps) { + return ( + {alt} + ) } Avatar.Fallback = function AvatarFallback({