mirror of
https://github.com/sussy-code/smov.git
synced 2024-12-20 14:37:43 +01:00
Sticking with the og
This commit is contained in:
parent
9a74bb8030
commit
beb832a7ec
2 changed files with 18 additions and 7 deletions
|
@ -57,6 +57,7 @@ function directLinkToContent(tmdbFullId: string) {
|
||||||
|
|
||||||
function ConfigValue(props: {
|
function ConfigValue(props: {
|
||||||
name: string;
|
name: string;
|
||||||
|
type: string;
|
||||||
id: string;
|
id: string;
|
||||||
children?: ReactNode;
|
children?: ReactNode;
|
||||||
}) {
|
}) {
|
||||||
|
@ -75,6 +76,9 @@ function ConfigValue(props: {
|
||||||
</p>
|
</p>
|
||||||
<p className="pr-3">{props.children}</p>
|
<p className="pr-3">{props.children}</p>
|
||||||
</div>
|
</div>
|
||||||
|
<p className="pr-5 pl-3">
|
||||||
|
{props.type.charAt(0).toUpperCase() + props.type.slice(1)}
|
||||||
|
</p>
|
||||||
<Divider marginClass="my-3" />
|
<Divider marginClass="my-3" />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
@ -176,7 +180,11 @@ export function TopFlix() {
|
||||||
const sortedItems = recentPlayedItems.sort((a, b) => b.count - a.count);
|
const sortedItems = recentPlayedItems.sort((a, b) => b.count - a.count);
|
||||||
const startIndex = (currentPage - 1) * itemsPerPage;
|
const startIndex = (currentPage - 1) * itemsPerPage;
|
||||||
const endIndex = startIndex + itemsPerPage;
|
const endIndex = startIndex + itemsPerPage;
|
||||||
return sortedItems.slice(startIndex, endIndex);
|
|
||||||
|
return sortedItems.slice(startIndex, endIndex).map((item, index) => ({
|
||||||
|
...item,
|
||||||
|
rank: startIndex + index + 1,
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (loading) {
|
if (loading) {
|
||||||
|
@ -207,12 +215,15 @@ export function TopFlix() {
|
||||||
return (
|
return (
|
||||||
<ConfigValue
|
<ConfigValue
|
||||||
key={item.tmdbFullId}
|
key={item.tmdbFullId}
|
||||||
|
type={isShowOrMovie(item.tmdbFullId)}
|
||||||
id={item.tmdbFullId}
|
id={item.tmdbFullId}
|
||||||
name={item.title}
|
name={item.title}
|
||||||
>
|
>
|
||||||
{`${item.providerId}, ${isShowOrMovie(
|
{`${
|
||||||
item.tmdbFullId,
|
item.providerId.charAt(0).toUpperCase() +
|
||||||
)} - Views: `}
|
item.providerId.slice(1)
|
||||||
|
}`}{" "}
|
||||||
|
<strong>-</strong> {`Views: `}
|
||||||
<strong>{item.count}</strong>
|
<strong>{item.count}</strong>
|
||||||
</ConfigValue>
|
</ConfigValue>
|
||||||
);
|
);
|
||||||
|
@ -230,7 +241,7 @@ export function TopFlix() {
|
||||||
Previous page
|
Previous page
|
||||||
</Button>
|
</Button>
|
||||||
<div style={{ display: "flex", alignItems: "center" }}>
|
<div style={{ display: "flex", alignItems: "center" }}>
|
||||||
{currentPage} / {maxPageCount}
|
{currentPage}/{maxPageCount}
|
||||||
</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"
|
||||||
|
|
|
@ -67,8 +67,8 @@ export function ExtensionBanner(props: {
|
||||||
if (currentLocation !== loc || pathname === "/onboarding/extension")
|
if (currentLocation !== loc || pathname === "/onboarding/extension")
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
// Show the banner with a 40% chance
|
// Show the banner with a 45% chance
|
||||||
if (Math.random() < 0.4) {
|
if (Math.random() < 0.45) {
|
||||||
let bannerText = "";
|
let bannerText = "";
|
||||||
switch (props.extensionState) {
|
switch (props.extensionState) {
|
||||||
case "noperms":
|
case "noperms":
|
||||||
|
|
Loading…
Reference in a new issue