Files
sofa/components/update-toast.tsx
T
jake 383f0b819b Polish mobile layouts, extract ExpandableText, fix image sizing
- Stack title-hero poster/metadata vertically on mobile (flex-col md:flex-row),
  switch backdrop tall breakpoint from sm to md
- Extract bio expand/collapse logic into reusable ExpandableText component;
  use it in PersonHero and TitleHero
- Fix ContinueWatchingCard image to use fill + sizes instead of fixed
  width/height to avoid layout shift
- Add fade-out gradient on genre chip scrollbar edge on mobile
- Show scaled-down ambient glow on mobile instead of hiding it entirely
- Humanize knownForDepartment labels (Acting→Actor, Directing→Director, etc.)
- Change cast member name from truncate to line-clamp-2 for wrapping
- Hide tooltip arrow via [&>:last-child]:hidden instead of color-matching it
- Apply safe-area-inset padding to HeroBanner content on notched devices
2026-03-07 12:09:51 -05:00

34 lines
907 B
TypeScript

"use client";
import { useAtom } from "jotai";
import { useEffect } from "react";
import { toast } from "sonner";
import { getUpdateCheckAction } from "@/lib/actions/settings";
import { updateToastShownAtom } from "@/lib/atoms/update-check";
export function UpdateToast() {
const [shown, setShown] = useAtom(updateToastShownAtom);
useEffect(() => {
if (shown) return;
void getUpdateCheckAction().then((data) => {
if (!data?.updateAvailable) return;
setShown(true);
toast.info(`Sofa v${data.latestVersion} is available`, {
description: `You're running v${data.currentVersion}.`,
duration: 15_000,
action: data.releaseUrl
? {
label: "View release",
onClick: () => window.open(data.releaseUrl as string, "_blank"),
}
: undefined,
});
});
}, [shown, setShown]);
return null;
}