feat(notification): use Shadcn Switch for project card context menu notification toggle

This commit is contained in:
yiling
2026-05-29 22:57:07 +08:00
parent ff66d4af14
commit 9c1d672c1e
+9 -5
View File
@@ -31,6 +31,7 @@ import { useQuery, useSuspenseQuery, useQueryClient } from '@tanstack/react-quer
import { createFileRoute, useNavigate } from '@tanstack/react-router'
import { MoreHorizontal, PlusIcon } from 'lucide-react'
import { useState } from 'react'
import { Switch } from '@/ui/components/ui/switch'
import { Input } from '@/ui/components/ui/input'
function TeamPage() {
@@ -308,14 +309,17 @@ function TeamPage() {
Project Settings
</DropdownMenuItem>
<DropdownMenuItem
onClick={(e) => {
e.stopPropagation()
className="flex items-center justify-between gap-4 cursor-pointer"
onSelect={(e) => {
e.preventDefault()
toggleProjectNotificationsMutation.mutate(project)
}}
>
{project.enableNotification
? 'Disable Notifications'
: 'Enable Notifications'}
<span>Notification</span>
<Switch
checked={project.enableNotification ?? true}
className="pointer-events-none"
/>
</DropdownMenuItem>
<DropdownMenuItem
className="text-destructive focus:text-destructive"