use IsActive props from sidebar component

This commit is contained in:
vergiLgood1 2025-03-23 06:54:54 +07:00
parent 398ca613ba
commit 179ddf6999
5 changed files with 9 additions and 25 deletions

View File

@ -52,7 +52,7 @@ function SubSubItemComponent({ item }: { item: SubSubItem }) {
asChild asChild
className={ className={
isActive isActive
? "bg-primary/40 active text-primary" ? "bg-muted active font-bold"
: "" : ""
} }
> >
@ -75,11 +75,7 @@ function SubItemComponent({ item }: { item: SubItem }) {
<SidebarMenuItem> <SidebarMenuItem>
<SidebarMenuButton <SidebarMenuButton
asChild asChild
className={ isActive={isActive}
isActive
? "bg-primary/40 active text-primary"
: ""
}
> >
<a href={formattedUrl}> <a href={formattedUrl}>
{item.icon && ( {item.icon && (
@ -97,11 +93,7 @@ function SubItemComponent({ item }: { item: SubItem }) {
<SidebarMenuItem> <SidebarMenuItem>
<CollapsibleTrigger asChild> <CollapsibleTrigger asChild>
<SidebarMenuButton <SidebarMenuButton
className={ isActive={isActive}
isActive
? "bg-primary/40 active text-primary"
: ""
}
> >
{item.icon && ( {item.icon && (
<item.icon /> <item.icon />
@ -136,11 +128,7 @@ function RecursiveNavItem({ item, index }: { item: NavItem; index: number }) {
<SidebarMenuButton <SidebarMenuButton
tooltip={item.title} tooltip={item.title}
asChild asChild
className={ isActive={isActive}
isActive
? "bg-primary/40 active text-primary"
: ""
}
> >
<a href={formattedUrl}> <a href={formattedUrl}>
{item.icon && ( {item.icon && (
@ -164,11 +152,7 @@ function RecursiveNavItem({ item, index }: { item: NavItem; index: number }) {
<CollapsibleTrigger asChild> <CollapsibleTrigger asChild>
<SidebarMenuButton <SidebarMenuButton
tooltip={item.title} tooltip={item.title}
className={ isActive={isActive}
isActive
? "bg-primary/40 active text-primary"
: ""
}
> >
{item.icon && ( {item.icon && (
<item.icon /> <item.icon />

View File

@ -317,7 +317,7 @@ export const createUserColumns = (
/* handle delete */ /* handle delete */
}} }}
> >
<Trash2 className="h-4 w-4 mr-2 text-red-500" /> <Trash2 className="h-4 w-4 mr-2 text-destructive" />
Delete Delete
</DropdownMenuItem> </DropdownMenuItem>
<DropdownMenuItem <DropdownMenuItem

View File

@ -11,7 +11,7 @@ export function FormField({ label, input, error }: FormFieldProps) {
<div className="space-y-2"> <div className="space-y-2">
<Label className="text-sm text-gray-300">{label}</Label> <Label className="text-sm text-gray-300">{label}</Label>
{input} {input}
{error && <p className="text-red-500 text-xs mt-1">{error}</p>} {error && <p className="text-destructive text-xs mt-1">{error}</p>}
</div> </div>
); );
} }

View File

@ -33,7 +33,7 @@ export function ReactHookFormField({
{...registration} {...registration}
{...props} {...props}
/> />
{error && <p className="text-sm text-red-500">{error.message}</p>} {error && <p className="text-sm text-destructive">{error.message}</p>}
</div> </div>
</div> </div>
) )

View File

@ -14,7 +14,7 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
type={type} type={type}
className={cn( className={cn(
"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
error && "ring-2 ring-red-500 focus-visible:ring-red-500", error && "ring-2 ring-destructive focus-visible:ring-destructive",
className className
)} )}
ref={ref} ref={ref}