Add category associated to each torrent

This commit is contained in:
LIAUD Corentin
2023-11-22 14:08:10 +01:00
parent 286609acec
commit 8c92856595
22 changed files with 171 additions and 70 deletions

View File

@@ -44,7 +44,16 @@ const Torrent = ({ torrent }) => {
const openDeleteTorrentAlert = () => setIsDeleteTorrentOpened(true)
const closeDeleteTorrentAlert = () => setIsDeleteTorrentOpened(false)
const { title, name, poster, torrent_size: torrentSize, download_speed: downloadSpeed, hash, stat } = torrent
const {
title,
name,
category,
poster,
torrent_size: torrentSize,
download_speed: downloadSpeed,
hash,
stat,
} = torrent
const dropTorrent = () => axios.post(torrentsHost(), { action: 'drop', hash })
const deleteTorrent = () => axios.post(torrentsHost(), { action: 'rem', hash })
@@ -107,9 +116,15 @@ const Torrent = ({ torrent }) => {
</TorrentCardButtons>
<TorrentCardDescription>
<div className='description-title-wrapper'>
<div className='description-section-name'>{t('Name')}</div>
<div className='description-torrent-title'>{parsedTitle}</div>
<div className='description-wrapper'>
<div className='description-title-wrapper'>
<div className='description-section-name'>{t('Name')}</div>
<div className='description-torrent-title'>{parsedTitle}</div>
</div>
<div className='description-category-wrapper'>
<div className='description-section-name'>{t('Category')}</div>
<div className='description-torrent-title'>{category}</div>
</div>
</div>
<div className='description-statistics-wrapper'>

View File

@@ -110,6 +110,15 @@ export const TorrentCardDescription = styled.div`
gap: 3px;
}
.description-wrapper {
display: flex;
flex-direction: row;
}
.description-wrapper > * {
flex: 1;
}
.description-title-wrapper {
display: flex;
flex-direction: column;
@@ -128,6 +137,12 @@ export const TorrentCardDescription = styled.div`
}
}
.description-category-wrapper {
display: flex;
flex-direction: column;
align-items: end;
}
.description-status-wrapper {
display: inline-block;
height: 8px;