mirror of
https://github.com/sussy-code/smov.git
synced 2024-12-20 14:37:43 +01:00
Polish TopFlix and TopSources
This commit is contained in:
parent
e3c38605b5
commit
7151b73e01
2 changed files with 19 additions and 10 deletions
|
@ -7,8 +7,6 @@ import { Divider } from "@/components/utils/Divider";
|
||||||
import { Heading1, Paragraph } from "@/components/utils/Text";
|
import { Heading1, Paragraph } from "@/components/utils/Text";
|
||||||
|
|
||||||
import { SubPageLayout } from "./layouts/SubPageLayout";
|
import { SubPageLayout } from "./layouts/SubPageLayout";
|
||||||
// import { MediaGrid } from "@/components/media/MediaGrid"
|
|
||||||
// import { TopFlixCard } from "@/components/media/FlixCard";
|
|
||||||
|
|
||||||
export function Button(props: {
|
export function Button(props: {
|
||||||
className: string;
|
className: string;
|
||||||
|
@ -163,7 +161,14 @@ async function getTimeSinceProcessStart(): Promise<string> {
|
||||||
const hours = Math.floor(timeDifference / (1000 * 60 * 60));
|
const hours = Math.floor(timeDifference / (1000 * 60 * 60));
|
||||||
const minutes = Math.floor((timeDifference % (1000 * 60 * 60)) / (1000 * 60));
|
const minutes = Math.floor((timeDifference % (1000 * 60 * 60)) / (1000 * 60));
|
||||||
const seconds = Math.floor((timeDifference % (1000 * 60)) / 1000);
|
const seconds = Math.floor((timeDifference % (1000 * 60)) / 1000);
|
||||||
|
const days = Math.floor(timeDifference / (1000 * 60 * 60 * 24));
|
||||||
|
|
||||||
|
if (days > 0) {
|
||||||
|
if (days === 1) {
|
||||||
|
return `${days} day`;
|
||||||
|
}
|
||||||
|
return `${days} days`;
|
||||||
|
}
|
||||||
if (hours > 0) {
|
if (hours > 0) {
|
||||||
return `${hours} hours`;
|
return `${hours} hours`;
|
||||||
}
|
}
|
||||||
|
@ -235,11 +240,13 @@ export function TopFlix() {
|
||||||
return (
|
return (
|
||||||
<SubPageLayout>
|
<SubPageLayout>
|
||||||
<ThiccContainer>
|
<ThiccContainer>
|
||||||
<div className="mt-8 w-full px-8">
|
<div className="mt-8 w-full px-8 cursor-default">
|
||||||
<Heading1>Top flix</Heading1>
|
<Heading1>Top flix</Heading1>
|
||||||
<Paragraph className="mb-6">
|
<Paragraph className="mb-6">
|
||||||
The most popular movies on sudo-flix.lol, this data is fetched from
|
The top 100 most-watched movies on sudo-flix.lol, sourced directly
|
||||||
the current backend deployment.
|
from the most recent sudo-backend deployment. The backend is
|
||||||
|
redeployed frequently which may result in low numbers being shown
|
||||||
|
here.
|
||||||
</Paragraph>
|
</Paragraph>
|
||||||
<div className="mt-2 w-full">
|
<div className="mt-2 w-full">
|
||||||
<div className="flex justify-center">
|
<div className="flex justify-center">
|
||||||
|
@ -291,8 +298,9 @@ export function TopFlix() {
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
className="py-px box-content bg-buttons-secondary hover:bg-buttons-secondaryHover bg-opacity-90 text-buttons-secondaryText justify-center items-center"
|
className="py-px box-content bg-buttons-secondary hover:bg-buttons-secondaryHover bg-opacity-90 text-buttons-secondaryText justify-center items-center"
|
||||||
onClick={() => setCurrentPage(currentPage - 1)}
|
onClick={() =>
|
||||||
disabled={currentPage === 1}
|
setCurrentPage(currentPage === 1 ? maxPageCount : currentPage - 1)
|
||||||
|
}
|
||||||
>
|
>
|
||||||
Previous page
|
Previous page
|
||||||
</Button>
|
</Button>
|
||||||
|
@ -303,8 +311,9 @@ export function TopFlix() {
|
||||||
</div>
|
</div>
|
||||||
<Button
|
<Button
|
||||||
className="py-px box-content bg-buttons-secondary hover:bg-buttons-secondaryHover bg-opacity-90 text-buttons-secondaryText justify-center items-center"
|
className="py-px box-content bg-buttons-secondary hover:bg-buttons-secondaryHover bg-opacity-90 text-buttons-secondaryText justify-center items-center"
|
||||||
onClick={() => setCurrentPage(currentPage + 1)}
|
onClick={() =>
|
||||||
disabled={currentPage === maxPageCount}
|
setCurrentPage(currentPage === maxPageCount ? 1 : currentPage + 1)
|
||||||
|
}
|
||||||
>
|
>
|
||||||
Next page
|
Next page
|
||||||
</Button>
|
</Button>
|
||||||
|
|
|
@ -99,7 +99,7 @@ export function TopSources() {
|
||||||
return (
|
return (
|
||||||
<SubPageLayout>
|
<SubPageLayout>
|
||||||
<ThiccContainer>
|
<ThiccContainer>
|
||||||
<div className="mt-8 w-full px-8">
|
<div className="mt-8 w-full px-8 cursor-default">
|
||||||
<Heading1>Top sources</Heading1>
|
<Heading1>Top sources</Heading1>
|
||||||
<Paragraph className="mb-6">
|
<Paragraph className="mb-6">
|
||||||
The most used providers on sudo-flix.lol, this data is fetched from
|
The most used providers on sudo-flix.lol, this data is fetched from
|
||||||
|
|
Loading…
Reference in a new issue