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
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.
79 lines
2.3 KiB
TypeScript
79 lines
2.3 KiB
TypeScript
/**
|
|
* ContextualLinks — a compact deep-link card a funnel screen drops in to expose
|
|
* the advanced surfaces most relevant from where the user is. Data comes from
|
|
* lib/nav/contextual.ts, so the links stay in sync with the registry and never
|
|
* point at an unregistered/hidden screen.
|
|
*
|
|
* Usage (inside a funnel screen):
|
|
* ```tsx
|
|
* import { ContextualLinks } from "@/components/nav/ContextualLinks";
|
|
* <ContextualLinks context="jobs" title="Do more with this reel" />
|
|
* ```
|
|
*
|
|
* Renders nothing when the context resolves to no links, so it is always safe
|
|
* to mount unconditionally.
|
|
*/
|
|
|
|
import { useRouter } from "expo-router";
|
|
import { StyleSheet, Text, View } from "react-native";
|
|
|
|
import { ListRow } from "@/components/ui/ListRow";
|
|
import { colors } from "@/components/me/theme";
|
|
import { spacing } from "@/src/shared/theme";
|
|
import { getContextualLinks, type NavContext } from "@/lib/nav/contextual";
|
|
import { pushRecent } from "@/lib/nav/recents";
|
|
|
|
export interface ContextualLinksProps {
|
|
context: NavContext;
|
|
/** Section heading. Defaults to a neutral prompt. */
|
|
title?: string;
|
|
/** How many links to show (default all for the context). */
|
|
limit?: number;
|
|
}
|
|
|
|
export function ContextualLinks({
|
|
context,
|
|
title = "Go deeper",
|
|
limit,
|
|
}: ContextualLinksProps): React.JSX.Element | null {
|
|
const router = useRouter();
|
|
const all = getContextualLinks(context);
|
|
const links = typeof limit === "number" ? all.slice(0, limit) : all;
|
|
|
|
if (links.length === 0) return null;
|
|
|
|
const open = (route: string): void => {
|
|
void pushRecent(route);
|
|
router.push(route as Parameters<typeof router.push>[0]);
|
|
};
|
|
|
|
return (
|
|
<View style={styles.container}>
|
|
<Text style={styles.title}>{title}</Text>
|
|
{links.map((screen) => (
|
|
<ListRow
|
|
key={screen.route}
|
|
title={screen.title}
|
|
subtitle={screen.subtitle}
|
|
onPress={() => open(screen.route)}
|
|
showChevron
|
|
style={styles.row}
|
|
/>
|
|
))}
|
|
</View>
|
|
);
|
|
}
|
|
|
|
const styles = StyleSheet.create({
|
|
container: { gap: spacing.sm, marginVertical: spacing.md },
|
|
title: {
|
|
color: colors.muted,
|
|
fontSize: 11,
|
|
fontWeight: "700",
|
|
letterSpacing: 1.2,
|
|
textTransform: "uppercase",
|
|
paddingLeft: 2,
|
|
},
|
|
row: { marginBottom: 0 },
|
|
});
|