Skip to content

Commit

Permalink
Fix scrolling issues in Trackers / Peers tabs (#8259)
Browse files Browse the repository at this point in the history
  • Loading branch information
egbertbouman authored Nov 12, 2024
2 parents 56f477b + 5c52d6b commit 77d9615
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/tribler/ui/src/pages/Downloads/Details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export default function DownloadDetails({ selectedDownloads }: { selectedDownloa
</TabsContent>
<TabsContent value="peers" style={contentStyle}>
<ScrollArea className="h-full">
<Peers download={download} />
<Peers download={download} height={contentStyle.height}/>
</ScrollArea>
</TabsContent>
</Tabs>
Expand Down
4 changes: 2 additions & 2 deletions src/tribler/ui/src/pages/Downloads/Peers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ const peerColumns: ColumnDef<Peer>[] = [
},
]

export default function Peers({ download }: { download: Download }) {
export default function Peers({ download, height }: { download: Download, height?: string }) {
if (!download.peers)
return null;

return <SimpleTable data={download.peers} columns={peerColumns} />
return <SimpleTable data={download.peers} columns={peerColumns} maxHeight={height}/>
}
10 changes: 5 additions & 5 deletions src/tribler/ui/src/pages/Downloads/Trackers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ export default function Trackers({ download }: { download: Download }) {

return (
<div>
<div className="flex-col items-center grid-cols-1">
<SimpleTable data={download.trackers as TrackerRow[]} columns={trackerColumns} />
<div className="flex-none h-1 min-h-1 max-h-1 bg-secondary"></div>
<Button className="flex-none mx-4 my-2 min-w-24 max-h-8" variant="secondary" onClick={() => {setTrackerDialogOpen(true)}}>{t('Add')}</Button>
<div className="border-b-4 border-muted">
<SimpleTable data={download.trackers as TrackerRow[]} columns={trackerColumns} maxHeight={''} />
</div>
<Button className="mx-4 my-2 min-w-24 max-h-8" variant="secondary" onClick={() => { setTrackerDialogOpen(true) }}>{t('Add')}</Button>

<Dialog open={trackerDialogOpen} onOpenChange={setTrackerDialogOpen}>
<DialogContent>
<DialogHeader>
Expand All @@ -109,7 +109,7 @@ export default function Trackers({ download }: { download: Download }) {
triblerService.addDownloadTracker(download.infohash, trackerInput).then((response) => {
if (response === undefined) {
toast.error(`${"ToastErrorTrackerAdd"} ${"ToastErrorGenNetworkErr"}`);
} else if (isErrorDict(response)){
} else if (isErrorDict(response)) {
toast.error(`${"ToastErrorTrackerAdd"} ${response.error}`);
}
});
Expand Down

0 comments on commit 77d9615

Please sign in to comment.