-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
*filters badge indicator that will also clear filters *change hide read filter to use actual checkbox *clean up
- Loading branch information
Showing
5 changed files
with
64 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
.../desktop/src/renderer/components/library/series/chapter-table/ChapterTableGroupFilter.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
...sktop/src/renderer/components/library/series/chapter-table/ChapterTableLanguageFilter.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 17 additions & 16 deletions
33
apps/desktop/src/renderer/components/library/series/chapter-table/ChapterTableReadFilter.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,28 @@ | ||
import { useRecoilState } from 'recoil'; | ||
import { ReadChaptersState } from '@/renderer/state/libraryStates'; | ||
import { Check, Square } from 'lucide-react'; | ||
|
||
import { hideUnreadChaptersState } from '@/renderer/state/libraryStates'; | ||
import { Checkbox } from '@houdoku/ui/components/Checkbox'; | ||
import { Label } from '@houdoku/ui/components/Label'; | ||
export function ChapterTableReadFilter() { | ||
const [hideReadChapters, setHideReadChapters] = useRecoilState(ReadChaptersState); | ||
const [hideReadChapters, setHideReadChapters] = useRecoilState(hideUnreadChaptersState); | ||
|
||
const toggleReadChapters = () => { | ||
setHideReadChapters(!hideReadChapters); | ||
}; | ||
|
||
return ( | ||
<div | ||
className="flex items-center space-x-2 cursor-pointer" | ||
onClick={toggleReadChapters} | ||
> | ||
{hideReadChapters ? ( | ||
<Check className="h-5 w-5 text-blue-500" /> | ||
) : ( | ||
<Square className="h-5 w-5 text-gray-500" /> | ||
)} | ||
<span className="text-sm"> | ||
Hide Read | ||
</span> | ||
<div className="flex items-center space-x-2" onClick={(e) => e.stopPropagation()}> | ||
<Checkbox | ||
id="hide-read" | ||
checked={hideReadChapters} | ||
onCheckedChange={toggleReadChapters} | ||
/> | ||
<Label | ||
htmlFor="hide-read" | ||
className="text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70" | ||
> | ||
Hide read | ||
</Label> | ||
</div> | ||
|
||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters