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.
94 lines
2.4 KiB
TypeScript
94 lines
2.4 KiB
TypeScript
/**
|
|
* ListRow primitive — a pressable row with title, optional subtitle and chevron.
|
|
* Used for navigation lists (settings, menus). No emoji.
|
|
*/
|
|
|
|
import type { ReactNode } from "react";
|
|
import {
|
|
Pressable,
|
|
StyleSheet,
|
|
Text,
|
|
View,
|
|
type StyleProp,
|
|
type ViewStyle,
|
|
} from "react-native";
|
|
|
|
import { colors } from "@/components/me/theme";
|
|
import { radius, spacing } from "@/src/shared/theme";
|
|
import { Icon } from "./Icon";
|
|
|
|
export interface ListRowProps {
|
|
title: string;
|
|
subtitle?: string;
|
|
/** Optional leading element (icon, avatar, badge). */
|
|
leading?: ReactNode;
|
|
/** Optional trailing element (replaces default chevron when set). */
|
|
trailing?: ReactNode;
|
|
/** Show the default chevron. Defaults true when onPress is provided. */
|
|
showChevron?: boolean;
|
|
onPress?: () => void;
|
|
disabled?: boolean;
|
|
style?: StyleProp<ViewStyle>;
|
|
/** Apply highlighted border. */
|
|
highlighted?: boolean;
|
|
}
|
|
|
|
export function ListRow({
|
|
title,
|
|
subtitle,
|
|
leading,
|
|
trailing,
|
|
showChevron,
|
|
onPress,
|
|
disabled,
|
|
style,
|
|
highlighted = false,
|
|
}: ListRowProps): React.JSX.Element {
|
|
const chevron = showChevron ?? !!onPress;
|
|
|
|
return (
|
|
<Pressable
|
|
onPress={onPress}
|
|
disabled={disabled}
|
|
accessibilityRole={onPress ? "button" : "none"}
|
|
accessibilityState={{ disabled: !!disabled }}
|
|
style={[
|
|
styles.row,
|
|
highlighted && styles.highlighted,
|
|
disabled && styles.disabled,
|
|
style,
|
|
]}
|
|
>
|
|
{leading ? <View style={styles.leading}>{leading}</View> : null}
|
|
<View style={styles.body}>
|
|
<Text style={styles.title}>{title}</Text>
|
|
{subtitle ? <Text style={styles.subtitle}>{subtitle}</Text> : null}
|
|
</View>
|
|
{trailing ?? null}
|
|
{!trailing && chevron ? (
|
|
<Icon name="chevron-forward" style={styles.chevron} />
|
|
) : null}
|
|
</Pressable>
|
|
);
|
|
}
|
|
|
|
const styles = StyleSheet.create({
|
|
row: {
|
|
flexDirection: "row",
|
|
alignItems: "center",
|
|
gap: spacing.md,
|
|
backgroundColor: colors.card,
|
|
borderColor: colors.border,
|
|
borderWidth: 1,
|
|
borderRadius: radius.lg,
|
|
padding: spacing.lg,
|
|
},
|
|
highlighted: { borderColor: colors.accent },
|
|
disabled: { opacity: 0.5 },
|
|
leading: { flexShrink: 0 },
|
|
body: { flex: 1, gap: 4 },
|
|
title: { color: colors.textPrimary, fontSize: 15, fontWeight: "700" },
|
|
subtitle: { color: colors.muted, fontSize: 12 },
|
|
chevron: { color: colors.muted, fontSize: 22, fontWeight: "700" },
|
|
});
|