1
0
Fork 0
mirror of https://github.com/sussy-code/smov.git synced 2024-12-20 14:37:43 +01:00

Refine latest features

This commit is contained in:
Cooper Ransom 2024-03-18 20:19:13 -04:00
parent 7a8e78e767
commit c426b501bd
3 changed files with 20 additions and 11 deletions

View file

@ -64,16 +64,19 @@ function ConfigValue(props: {
<div className="flex"> <div className="flex">
<p className="flex-1 font-bold text-white pr-5 pl-3"> <p className="flex-1 font-bold text-white pr-5 pl-3">
{link ? ( {link ? (
<p onClick={() => navigate(link)} className="hover:underline"> <p
onClick={() => navigate(link)}
className="cursor-pointer hover:underline"
>
{props.name} {props.name}
</p> </p>
) : ( ) : (
<p>{props.name}</p> <p>{props.name}</p>
)} )}
</p> </p>
<p className="pr-3">{props.children}</p> <p className="pr-3 cursor-default">{props.children}</p>
</div> </div>
<p className="pr-5 pl-3"> <p className="pr-5 pl-3 cursor-default">
{props.type.charAt(0).toUpperCase() + props.type.slice(1)} {props.type.charAt(0).toUpperCase() + props.type.slice(1)}
</p> </p>
<Divider marginClass="my-3" /> <Divider marginClass="my-3" />
@ -237,13 +240,13 @@ export function TopFlix() {
The most popular movies on sudo-flix.lol, this data is fetched from The most popular movies on sudo-flix.lol, this data is fetched from
the current backend deployment. the current backend deployment.
</Paragraph> </Paragraph>
<div className="mt-8 flex-col gap-2 w-auto"> <div className="mt-8 flex gap-2 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-2">
<p className="font-bold bg-opacity-90 text-buttons-secondaryText"> <p className="font-bold bg-opacity-90 text-buttons-secondaryText">
Server Lifetime: {timeSinceProcessStart} Server Lifetime: {timeSinceProcessStart}
</p> </p>
</div> </div>
<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-2">
<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>
@ -282,7 +285,9 @@ export function TopFlix() {
> >
Previous page Previous page
</Button> </Button>
<div style={{ display: "flex", alignItems: "center" }}> <div
style={{ display: "flex", alignItems: "center", cursor: "default" }}
>
{currentPage}/{maxPageCount} {currentPage}/{maxPageCount}
</div> </div>
<Button <Button

View file

@ -55,7 +55,7 @@ export function Banner(props: {
); );
} }
// This jawn is for advertising the extension for le // This jawn is for advertising the extension for le skids
export function ExtensionBanner(props: { export function ExtensionBanner(props: {
location?: string; location?: string;
extensionState: ExtensionStatus; extensionState: ExtensionStatus;
@ -65,6 +65,10 @@ export function ExtensionBanner(props: {
const currentLocation = useBannerStore((s) => s.location); const currentLocation = useBannerStore((s) => s.location);
const loc = props.location ?? null; const loc = props.location ?? null;
const { pathname } = useLocation(); const { pathname } = useLocation();
const isEligible =
/CrOS/.test(navigator.userAgent) ||
/TV/.test(navigator.userAgent) ||
/iPhone|iPad|iPod/i.test(navigator.userAgent);
useEffect(() => { useEffect(() => {
if (loc) { if (loc) {
@ -83,8 +87,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 50% chance or not if users dont meet requirements
if (Math.random() < 0.4) { if (!isEligible && Math.random() < 0.5) {
let bannerText = ""; let bannerText = "";
switch (props.extensionState) { switch (props.extensionState) {
case "noperms": case "noperms":

View file

@ -15,7 +15,7 @@ export interface LanguageStore {
export const useLanguageStore = create( export const useLanguageStore = create(
persist( persist(
immer<LanguageStore>((set) => ({ immer<LanguageStore>((set) => ({
language: "en", language: navigator.language.split("-")[0],
setLanguage(v) { setLanguage(v) {
set((s) => { set((s) => {
s.language = v; s.language = v;