add badges for tag filter shortcuts

This commit is contained in:
mbecker20
2024-06-21 00:15:40 -07:00
parent cb363d1559
commit 32e1bd2dda
2 changed files with 34 additions and 4 deletions
+1 -1
View File
@@ -28,8 +28,8 @@ export const ExportButton = ({
<Dialog open={open} onOpenChange={setOpen}>
<DialogTrigger asChild>
<Button variant="outline" className="flex gap-2 items-center">
Toml
<FileDown className="w-4 h-4" />
Toml
</Button>
</DialogTrigger>
<DialogContent className="w-[900px] max-w-[95vw]">
+33 -3
View File
@@ -39,6 +39,23 @@ export const TagsFilter = () => {
tag_ids={tags}
onBadgeClick={(tag_id) => setTags(tags.filter((id) => id !== tag_id))}
/>
{tags.length > 0 && (
<Badge
variant="destructive"
className="flex items-center gap-2 py-1"
onClick={() => setTags([])}
>
Clear
<Badge
variant="outline"
className="text-muted-foreground hidden md:inline-flex"
>
shift + c
</Badge>
</Badge>
)}
<Popover
open={open}
onOpenChange={(open) => {
@@ -47,8 +64,15 @@ export const TagsFilter = () => {
}}
>
<PopoverTrigger asChild>
<Button variant="outline" className="flex gap-3">
Filter by Tag <Tag className="w-3 h-3" />
<Button variant="outline" className="flex items-center gap-2">
<Tag className="w-3 h-3" />
Tag Filter
<Badge
variant="outline"
className="text-muted-foreground hidden md:inline-flex"
>
shift + t
</Badge>
</Button>
</PopoverTrigger>
<PopoverContent className="w-[200px] max-h-[200px] p-0" sideOffset={12}>
@@ -257,8 +281,14 @@ export const AddTags = ({ target }: { target: TargetExcludingSystem }) => {
return (
<Popover open={open} onOpenChange={setOpen}>
<PopoverTrigger asChild>
<Button variant="secondary" className="px-2 py-0 h-auto">
<Button variant="secondary" className="px-2 py-0.5 h-fit">
<PlusCircle className="w-3" />
{/* <Badge
variant="outline"
className="text-muted-foreground hidden md:inline-flex"
>
shift + t
</Badge> */}
</Button>
</PopoverTrigger>
<PopoverContent className="w-[200px] p-0" sideOffset={12} align="end">