mirror of
https://github.com/sussy-code/smov.git
synced 2024-12-20 14:37:43 +01:00
Prime the flix page for poster dev
This commit is contained in:
parent
0b2729a850
commit
ac8b9066d1
1 changed files with 3 additions and 27 deletions
|
@ -114,8 +114,7 @@ export function TopFlix() {
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
const [currentPage, setCurrentPage] = useState(1);
|
const [currentPage, setCurrentPage] = useState(1);
|
||||||
const itemsPerPage = 12;
|
const itemsPerPage = 12;
|
||||||
const maxItemsToShow = 120; // Maximum items to show
|
const maxItemsToShow = 12; // Maximum items to show
|
||||||
const maxPageCount = Math.ceil(maxItemsToShow / itemsPerPage); // Calculate max page count based on maxItemsToShow
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getRecentPlayedItems()
|
getRecentPlayedItems()
|
||||||
|
@ -171,14 +170,13 @@ export function TopFlix() {
|
||||||
the current backend deployment.
|
the current backend deployment.
|
||||||
</Paragraph>
|
</Paragraph>
|
||||||
<div className="mt-8 w-auto">
|
<div className="mt-8 w-auto">
|
||||||
<div className="bg-buttons-secondary rounded-xl scale-95 py-3 px-5 mb-2 inline-block">
|
<div className="bg-buttons-secondary rounded-xl scale-95 py-3 px-5 mb-14 inline-block">
|
||||||
<p className="font-bold bg-opacity-90 text-buttons-secondaryText">
|
<p className="font-bold bg-opacity-90 text-buttons-secondaryText">
|
||||||
Overall Views: {totalViews}
|
Overall Views: {totalViews}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Divider marginClass="my-3" />
|
|
||||||
<MediaGrid>
|
<MediaGrid>
|
||||||
{getItemsForCurrentPage().map((item) => {
|
{getItemsForCurrentPage().map((item) => {
|
||||||
const tmdbId = item.tmdbFullId.split("-")[1];
|
const tmdbId = item.tmdbFullId.split("-")[1];
|
||||||
|
@ -190,35 +188,13 @@ export function TopFlix() {
|
||||||
title: item.title,
|
title: item.title,
|
||||||
type,
|
type,
|
||||||
poster,
|
poster,
|
||||||
year: 2009,
|
// year: 420,
|
||||||
};
|
};
|
||||||
|
|
||||||
return <MediaCard linkable media={media} />;
|
return <MediaCard linkable media={media} />;
|
||||||
})}
|
})}
|
||||||
</MediaGrid>
|
</MediaGrid>
|
||||||
</div>
|
</div>
|
||||||
<div
|
|
||||||
style={{ display: "flex", justifyContent: "space-between" }}
|
|
||||||
className="mt-5 w-full px-8"
|
|
||||||
>
|
|
||||||
<Button
|
|
||||||
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)}
|
|
||||||
disabled={currentPage === 1}
|
|
||||||
>
|
|
||||||
Previous page
|
|
||||||
</Button>
|
|
||||||
<div style={{ display: "flex", alignItems: "center" }}>
|
|
||||||
{currentPage} / {maxPageCount}
|
|
||||||
</div>
|
|
||||||
<Button
|
|
||||||
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)}
|
|
||||||
disabled={currentPage === maxPageCount}
|
|
||||||
>
|
|
||||||
Next page
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
</ThiccContainer>
|
</ThiccContainer>
|
||||||
</SubPageLayout>
|
</SubPageLayout>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue