Skip to content

Commit

Permalink
Merge pull request #118 from fishshi/OptiUI
Browse files Browse the repository at this point in the history
fix: Some Fixes
  • Loading branch information
ximu3 authored Jan 2, 2025
2 parents aa4ce65 + 80e9d1a commit 4eb3505
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
6 changes: 4 additions & 2 deletions src/renderer/src/components/Game/FilterAdder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function FilterAdder({
value: string
className?: string
}): JSX.Element {
const { addFilter, updateFilter } = useFilterStore()
const { filter, addFilter, updateFilter } = useFilterStore()
return (
<Button
variant="link"
Expand All @@ -24,7 +24,9 @@ export function FilterAdder({
if (filed === 'releaseDate') {
updateFilter(filed, [value, value])
} else {
addFilter(filed, value)
if (!filter[filed]?.includes(value)) {
addFilter(filed, value)
}
}
toast.info(`已添加筛选器,${filed}: ${value}`)
}}
Expand Down
6 changes: 3 additions & 3 deletions src/renderer/src/components/Librarybar/Filter/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ export function Filter({ children }: { children: React.ReactNode }): JSX.Element
return (
<Popover open={isFilterMenuOpen}>
<Tooltip>
<TooltipTrigger>
<PopoverTrigger asChild>{children}</PopoverTrigger>
</TooltipTrigger>
<PopoverTrigger>
<TooltipTrigger asChild>{children}</TooltipTrigger>
</PopoverTrigger>
<TooltipContent side="right">高级筛选</TooltipContent>
</Tooltip>
<PopoverContent side="right" className="w-80 h-screen">
Expand Down
8 changes: 6 additions & 2 deletions src/renderer/src/pages/Library/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ export function Library({ className }: { className?: string }): JSX.Element {
})
}, [])
return (
<ResizablePanelGroup direction="horizontal" className={cn('w-full h-full', className)}>
<ResizablePanel defaultSize={18} maxSize={30} minSize={12}>
<ResizablePanelGroup
autoSaveId="LibraryPanelGroup"
direction="horizontal"
className={cn('w-full h-full', className)}
>
<ResizablePanel defaultSize={18} maxSize={26} minSize={10} className={cn('min-w-[150px]')}>
<Librarybar />
</ResizablePanel>
<ResizableHandle />
Expand Down

0 comments on commit 4eb3505

Please sign in to comment.