mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-27 03:14:11 +00:00
feat(notification): add unread sidebar count badge and fix project scope upload authorization check
This commit is contained in:
@@ -7,6 +7,7 @@ import { UserMenu } from './user-menu'
|
||||
interface DualSidebarItemProps {
|
||||
icon: React.ReactNode
|
||||
label: string
|
||||
badge?: React.ReactNode
|
||||
children?: React.ReactNode
|
||||
onItemClick?: () => void
|
||||
}
|
||||
@@ -113,13 +114,14 @@ export const DualSidebar: React.FC<DualSidebarProps> = ({ children }) => {
|
||||
onClick={() => handleItemClick(index)}
|
||||
aria-label={item.props.label}
|
||||
aria-expanded={activeItem === index}
|
||||
className={`w-12 h-12 [&_svg:not([class*='size-'])]:size-6 transition-all duration-200 ${
|
||||
className={`relative w-12 h-12 [&_svg:not([class*='size-'])]:size-6 transition-all duration-200 ${
|
||||
activeItem === index
|
||||
? 'bg-blue-600 text-white shadow-lg hover:bg-blue-600 hover:text-white'
|
||||
: 'text-slate-400 hover:text-slate-500 dark:hover:text-slate-400 dark:text-slate-500 hover:bg-slate-200 dark:hover:bg-slate-800'
|
||||
}`}
|
||||
>
|
||||
{item.props.icon}
|
||||
{item.props.badge}
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent
|
||||
|
||||
@@ -55,6 +55,14 @@ export const NotificationList = () => {
|
||||
[data],
|
||||
)
|
||||
|
||||
useEffect(() => {
|
||||
if (teamId) {
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: ['teams', teamId, 'me'],
|
||||
})
|
||||
}
|
||||
}, [teamId, notifications.length, queryClient])
|
||||
|
||||
const $post = client.api.teams[':teamId'].notifications.read.$post
|
||||
const markReadMutation = useMutation<
|
||||
InferResponseType<typeof $post>,
|
||||
|
||||
Reference in New Issue
Block a user