Skip to content

Commit 7033ff3

Browse files
committed
vite-shadcn 修改角色切换样式
1 parent ef6c56a commit 7033ff3

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

vite-shadcn/src/components/nav-user.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export function NavUser() {
106106

107107
{/* Profile */}
108108
<button
109-
className="flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-accent"
109+
className="flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:text-primary"
110110
>
111111
<IconUserCircle className="size-4" />
112112
{intl.formatMessage({ id: 'sidebar.user.message' })}
@@ -117,8 +117,8 @@ export function NavUser() {
117117
{/* Roles */}
118118
<button
119119
className={cn(
120-
"w-full rounded-md px-2 py-1.5 text-left text-sm hover:bg-accent",
121-
userInfo?.currentRole === 'all' && "bg-accent text-accent-foreground"
120+
"w-full rounded-md px-2 py-1.5 text-left text-sm hover:bg-accent hover:text-primary",
121+
userInfo?.currentRole === 'all' && "bg-primary text-accent-foreground"
122122
)}
123123
onClick={() => updateUserInfo({ currentRole: 'all' })}
124124
>
@@ -129,8 +129,8 @@ export function NavUser() {
129129
<button
130130
key={role.id}
131131
className={cn(
132-
"w-full rounded-md px-2 py-1.5 text-left text-sm hover:bg-accent",
133-
userInfo?.currentRole === role.id && "bg-accent text-accent-foreground"
132+
"w-full rounded-md px-2 py-1.5 text-left text-sm hover:bg-accent hover:text-primary",
133+
userInfo?.currentRole === role.id && "bg-primary text-accent-foreground"
134134
)}
135135
onClick={() => updateUserInfo({ currentRole: role.id })}
136136
>

0 commit comments

Comments
 (0)