Skip to content

Commit

Permalink
minor react warning fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
xgi committed Dec 17, 2024
1 parent e7593e0 commit a284c5b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/renderer/components/downloads/DownloadQueue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const DownloadQueue: React.FC = () => {

const value = task.page && task.totalPages ? (task.page / task.totalPages) * 100 : 0;
return (
<Card className="w-full">
<Card key={`${task.series.id}-${task.chapter.id}`} className="w-full">
<CardHeader className="px-4 pt-3 pb-2">
<CardTitle>
{task.series.title} - Chapter {task.chapter.chapterNumber}
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/settings/SettingsKeybinds.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export const SettingsKeybinds: React.FC = () => {
setting: ReaderSetting.KeyToggleShowingSidebar,
},
].map((entry) => (
<div className="flex space-x-2 items-center">
<div key={entry.setting} className="flex space-x-2 items-center">
<Button
size="sm"
className="w-28 justify-center font-semibold"
Expand Down
12 changes: 7 additions & 5 deletions src/renderer/components/settings/SettingsLibrary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
} from '@/renderer/state/settingStates';
import { Checkbox } from '@/ui/components/Checkbox';
import { Label } from '@/ui/components/Label';
import { Input } from '@/ui/components/Input';
import { Button } from '@/ui/components/Button';

const defaultDownloadsDir = await ipcRenderer.invoke(ipcChannels.GET_PATH.DEFAULT_DOWNLOADS_DIR);
Expand Down Expand Up @@ -59,9 +58,10 @@ export const SettingsLibrary: React.FC = () => {
<div className="grid w-full items-center gap-1.5">
<Label htmlFor="picture">Custom download location</Label>
<div className="flex w-full items-center space-x-2">
<Input
className="cursor-pointer"
value={customDownloadsDir || defaultDownloadsDir}
<Button
className="w-full truncate"
variant="outline"
title={customDownloadsDir || defaultDownloadsDir}
onClick={() =>
ipcRenderer
.invoke(ipcChannels.APP.SHOW_OPEN_DIALOG, true, [], 'Select Downloads Directory')
Expand All @@ -71,7 +71,9 @@ export const SettingsLibrary: React.FC = () => {
}
})
}
/>
>
{customDownloadsDir || defaultDownloadsDir}
</Button>
{customDownloadsDir && <Button onClick={() => setCustomDownloadsDir('')}>Reset</Button>}
</div>
</div>
Expand Down

0 comments on commit a284c5b

Please # to comment.