diff --git a/web/src/components/DialogTorrentDetailsContent/DetailedView/index.jsx b/web/src/components/DialogTorrentDetailsContent/DetailedView/index.jsx new file mode 100644 index 0000000..a65a7e5 --- /dev/null +++ b/web/src/components/DialogTorrentDetailsContent/DetailedView/index.jsx @@ -0,0 +1,45 @@ +import { SectionTitle, WidgetWrapper } from '../style' +import { DetailedViewCacheSection, DetailedViewWidgetSection } from './style' +import TorrentCache from '../TorrentCache' +import { + SizeWidget, + PiecesLengthWidget, + StatusWidget, + PiecesCountWidget, + PeersWidget, + UploadSpeedWidget, + DownlodSpeedWidget, +} from '../widgets' + +export default function Test({ + downloadSpeed, + uploadSpeed, + torrent, + torrentSize, + PiecesCount, + PiecesLength, + statString, + cache, +}) { + return ( + <> + + Data + + + + + + + + + + + + + Cache + + + + ) +} diff --git a/web/src/components/DialogTorrentDetailsContent/DetailedView/style.js b/web/src/components/DialogTorrentDetailsContent/DetailedView/style.js new file mode 100644 index 0000000..3fd9431 --- /dev/null +++ b/web/src/components/DialogTorrentDetailsContent/DetailedView/style.js @@ -0,0 +1,19 @@ +import styled from 'styled-components' + +export const DetailedViewWidgetSection = styled.section` + padding: 40px; + background: linear-gradient(145deg, #e4f6ed, #b5dec9); + + @media (max-width: 800px) { + padding: 20px; + } +` + +export const DetailedViewCacheSection = styled.section` + padding: 40px; + box-shadow: inset 3px 25px 8px -25px rgba(0, 0, 0, 0.5); + + @media (max-width: 800px) { + padding: 20px; + } +` diff --git a/web/src/components/DialogTorrentDetailsContent/Table/index.jsx b/web/src/components/DialogTorrentDetailsContent/Table/index.jsx index ce2121e..87952d0 100644 --- a/web/src/components/DialogTorrentDetailsContent/Table/index.jsx +++ b/web/src/components/DialogTorrentDetailsContent/Table/index.jsx @@ -73,6 +73,7 @@ const Table = memo( })} + {playableFileList.map(({ id, path, length }) => { const { title, resolution, episode, season } = ptt.parse(path) @@ -84,12 +85,14 @@ const Table = memo(
{title}
-
-
viewed
-
-
+ {isViewed && ( +
+
viewed
+
+
+
-
+ )} {fileHasSeasonText && seasonAmount?.length === 1 && (
season
diff --git a/web/src/components/DialogTorrentDetailsContent/index.jsx b/web/src/components/DialogTorrentDetailsContent/index.jsx index ac4e15a..846dec5 100644 --- a/web/src/components/DialogTorrentDetailsContent/index.jsx +++ b/web/src/components/DialogTorrentDetailsContent/index.jsx @@ -12,9 +12,8 @@ import { useUpdateCache, useGetSettings } from './customHooks' import DialogHeader from './DialogHeader' import TorrentCache from './TorrentCache' import Table from './Table' +import DetailedView from './DetailedView' import { - DetailedViewWidgetSection, - DetailedViewCacheSection, DialogContentGrid, MainSection, Poster, @@ -27,20 +26,18 @@ import { TorrentFilesSection, Divider, } from './style' -import { - DownlodSpeedWidget, - UploadSpeedWidget, - PeersWidget, - SizeWidget, - PiecesCountWidget, - PiecesLengthWidget, - StatusWidget, -} from './widgets' +import { DownlodSpeedWidget, UploadSpeedWidget, PeersWidget, SizeWidget } from './widgets' import TorrentFunctions from './TorrentFunctions' import { isFilePlayable } from './helpers' const shortenText = (text, count) => text.slice(0, count) + (text.length > count ? '...' : '') +const Loader = () => ( +
+ +
+) + export default function DialogTorrentDetailsContent({ closeDialog, torrent }) { const [isLoading, setIsLoading] = useState(true) const [isDetailedCacheView, setIsDetailedCacheView] = useState(false) @@ -115,29 +112,18 @@ export default function DialogTorrentDetailsContent({ closeDialog, torrent }) {
{isLoading ? ( -
- -
+ ) : isDetailedCacheView ? ( - <> - - Data - - - - - - - - - - - - - Cache - - - + ) : ( diff --git a/web/src/components/DialogTorrentDetailsContent/style.js b/web/src/components/DialogTorrentDetailsContent/style.js index 8b83cd0..69beb40 100644 --- a/web/src/components/DialogTorrentDetailsContent/style.js +++ b/web/src/components/DialogTorrentDetailsContent/style.js @@ -251,21 +251,3 @@ export const Divider = styled.div` background-color: rgba(0, 0, 0, 0.12); margin: 30px 0; ` - -export const DetailedViewWidgetSection = styled.section` - padding: 40px; - background: linear-gradient(145deg, #e4f6ed, #b5dec9); - - @media (max-width: 800px) { - padding: 20px; - } -` - -export const DetailedViewCacheSection = styled.section` - padding: 40px; - box-shadow: inset 3px 25px 8px -25px rgba(0, 0, 0, 0.5); - - @media (max-width: 800px) { - padding: 20px; - } -`