diff --git a/src/screens/DownloadQueue.tsx b/src/screens/DownloadQueue.tsx index 66f9e3a1fe..21801ef1ad 100644 --- a/src/screens/DownloadQueue.tsx +++ b/src/screens/DownloadQueue.tsx @@ -23,9 +23,12 @@ import List from '@mui/material/List'; import DragHandleIcon from '@mui/icons-material/DragHandle'; import ListItem from '@mui/material/ListItem'; import { ListItemIcon } from '@mui/material'; -import ListItemText from '@mui/material/ListItemText'; import EmptyView from 'components/util/EmptyView'; +import { Box } from '@mui/system'; +import Typography from '@mui/material/Typography'; +import { useHistory } from 'react-router-dom'; + const baseWebsocketUrl = JSON.parse(window.localStorage.getItem('serverBaseURL')!).replace('http', 'ws'); const getItemStyle = (isDragging: boolean, @@ -48,6 +51,8 @@ export default function DownloadQueue() { const [queueState, setQueueState] = useState(initialQueue); const { queue, status } = queueState; + const history = useHistory(); + const theme = useTheme(); const { setTitle, setAction } = useContext(NavbarContext); @@ -111,6 +116,22 @@ export default function DownloadQueue() { {(provided, snapshot) => ( history.push(`/manga/${item.chapter.mangaId}`)} {...provided.draggableProps} {...provided.dragHandleProps} style={getItemStyle( @@ -120,19 +141,27 @@ export default function DownloadQueue() { )} ref={provided.innerRef} > - + - state: ${item.state}` - } - /> + + + + {item.manga.title} + + + {`${item.chapter.name} ` + + `(${(item.progress * 100).toFixed(2)}%)` + + ` => state: ${item.state}`} + + + { - // deleteCategory(index); + sx={{ marginLeft: 'auto' }} + onClick={(e) => { + // deleteCategory(index); + // prevent parent tags from getting the event + e.stopPropagation(); }} size="large" > @@ -141,6 +170,7 @@ export default function DownloadQueue() { )} + ))} {provided.placeholder} diff --git a/src/typings.d.ts b/src/typings.d.ts index 18d779c52b..4496eea99b 100644 --- a/src/typings.d.ts +++ b/src/typings.d.ts @@ -155,6 +155,7 @@ interface IDownloadChapter{ state: 'Queued' | 'Downloading' | 'Finished' | 'Error' progress: number chapter: IChapter + manga: IManga } interface IQueue {