caelum0x d56639a594
Some checks failed
build-images / web (push) Has been cancelled
vision2026-ci / Python SDK resource tests (push) Has been cancelled
build-images / api (push) Has been cancelled
build-images / worker-gpu (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (comfy-workflow-schema) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (effects-core) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (eventbus-types) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (growth-analytics) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (provider-adapter-kit) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (publishing-connectors) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (render-core) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (shot-template-schema) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (trends-schema) (push) Has been cancelled
vision2026-ci / Desktop engine crates (test + clippy + fmt) (push) Has been cancelled
codeql / Analyze (javascript-typescript) (push) Has been cancelled
codeql / Analyze (python) (push) Has been cancelled
perf / API hot-path micro-smoke (budgeted) (push) Has been cancelled
perf / Desktop engine crates (release build check) (push) Has been cancelled
vision2026-ci / API phase modules (ruff + pytest) (push) Has been cancelled
vision2026-ci / Alembic upgrade + drift check (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (caption-engine) (push) Has been cancelled
Menivor — open source release (MIT), free to use and fork
Paid, hosted product at menivor.com, now retired as a company project.
Fresh squashed history of the cleaned working tree (secret-scanned,
no .env, no customer data, no outreach logs). Built on
MoneyPrinterTurbo (MIT, harry0703) — see NOTICE.
2026-12-04 02:10:26 +03:00

72 lines
3.2 KiB
TypeScript

import * as React from "react";
import { FlatList, Pressable, ScrollView, StyleSheet, Text, View } from "react-native";
import { router, useFocusEffect, useLocalSearchParams } from "expo-router";
import { storefront, type Storefront } from "../../../src/api/ott";
import { useWatch } from "../../../src/context";
import { readSession } from "../../../src/session/store";
import { PushOptIn } from "../../../src/push/PushOptIn";
import { Tile } from "../../../src/ui/Tile";
import { brandAccent, theme } from "../../../src/ui/theme";
/** A channel's home: rails of titles; the first tile has focus when the screen opens. */
export default function ChannelHome() {
const { handle } = useLocalSearchParams<{ handle: string }>();
const { api, kv } = useWatch();
const [data, setData] = React.useState<Storefront | null>(null);
const [session, setSession] = React.useState<string | null>(null);
const signedIn = Boolean(session);
const [error, setError] = React.useState("");
React.useEffect(() => {
storefront(api, handle).then(setData).catch((err: Error) => setError(err.message));
}, [api, handle]);
useFocusEffect(React.useCallback(() => {
void readSession(kv, handle).then((s) => setSession(s));
}, [kv, handle]));
if (error) return <Text accessibilityRole="alert" style={styles.message}>{error}</Text>;
if (!data) return <Text style={styles.message}>Loading</Text>;
const rails = data.rails.length ? data.rails : [{ id: "all", title: "All", items: data.titles }];
const open = (titleId: string) => router.push(`/c/${handle}/${titleId}`);
return (
<ScrollView style={styles.page} contentContainerStyle={{ padding: 48, gap: 28 }}>
<View style={styles.header}>
<Text style={[styles.h1, { color: brandAccent(data.brand_colors) }]}>{data.title}</Text>
{!signedIn ? (
<Pressable style={styles.signIn} onPress={() => router.push(`/c/${handle}/sign-in`)} accessibilityRole="button">
<Text style={styles.signInText}>Sign in</Text>
</Pressable>
) : null}
</View>
{data.tagline ? <Text style={styles.tagline}>{data.tagline}</Text> : null}
{session ? <PushOptIn handle={handle} session={session} /> : null}
{rails.map((rail, row) => (
<View key={rail.id}>
<Text style={styles.rail}>{rail.title}</Text>
<FlatList
horizontal
data={rail.items.filter((item) => item.available_here)}
keyExtractor={(item) => item.id}
renderItem={({ item, index }) => (
<Tile item={item} onSelect={() => open(item.id)} preferred={row === 0 && index === 0} />
)}
/>
</View>
))}
</ScrollView>
);
}
const styles = StyleSheet.create({
page: { flex: 1, backgroundColor: theme.background },
header: { flexDirection: "row", alignItems: "center", justifyContent: "space-between" },
h1: { fontSize: 34, fontWeight: "700" },
tagline: { color: theme.muted, fontSize: 18 },
rail: { color: theme.text, fontSize: 22, marginBottom: 12 },
signIn: { backgroundColor: theme.surface, borderRadius: theme.radius, paddingHorizontal: 18, paddingVertical: 10 },
signInText: { color: theme.text, fontSize: 18 },
message: { color: theme.text, fontSize: 20, padding: 48 },
});