Points #78
|
|
@ -33,6 +33,9 @@ export function EarAcupunctureCatalogCardRenderer({
|
||||||
|
|
||||||
const contentCount = asNumber(attributes.content_count);
|
const contentCount = asNumber(attributes.content_count);
|
||||||
const contentLabel = asString(attributes.content_label).trim();
|
const contentLabel = asString(attributes.content_label).trim();
|
||||||
|
const isCatalog =
|
||||||
|
contentCount !== null ||
|
||||||
|
(attributes.link as Record<string, unknown> | undefined)?.type === "template_ref";
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<StandardIndexCard
|
<StandardIndexCard
|
||||||
|
|
@ -40,6 +43,8 @@ export function EarAcupunctureCatalogCardRenderer({
|
||||||
subtitle={item.summary || null}
|
subtitle={item.summary || null}
|
||||||
count={contentCount}
|
count={contentCount}
|
||||||
countLabel={contentLabel || null}
|
countLabel={contentLabel || null}
|
||||||
|
icon={isCatalog ? "book" : "dot"}
|
||||||
|
tone={isCatalog ? "green" : undefined}
|
||||||
onPress={onPress}
|
onPress={onPress}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ export interface StandardIndexCardProps {
|
||||||
count?: number | null;
|
count?: number | null;
|
||||||
countLabel?: string | null;
|
countLabel?: string | null;
|
||||||
tone?: StandardIndexCardTone;
|
tone?: StandardIndexCardTone;
|
||||||
|
icon?: "dot" | "book";
|
||||||
onPress: () => void;
|
onPress: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -30,12 +31,13 @@ export function StandardIndexCard({
|
||||||
count,
|
count,
|
||||||
countLabel,
|
countLabel,
|
||||||
tone,
|
tone,
|
||||||
|
icon = "dot",
|
||||||
onPress,
|
onPress,
|
||||||
}: StandardIndexCardProps) {
|
}: StandardIndexCardProps) {
|
||||||
const { tone: contextTone } = usePageTone();
|
const { tone: contextTone } = usePageTone();
|
||||||
const normalizedTitle = title.trim();
|
const normalizedTitle = title.trim();
|
||||||
const normalizedSubtitle = subtitle?.trim() || null;
|
const normalizedSubtitle = subtitle?.trim() || null;
|
||||||
const effectiveTone = tone || contextTone || "purple";
|
const effectiveTone = tone || (icon === "book" ? "green" : contextTone) || "purple";
|
||||||
const currentTone = cardTones[effectiveTone] || cardTones.purple;
|
const currentTone = cardTones[effectiveTone] || cardTones.purple;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
@ -46,7 +48,11 @@ export function StandardIndexCard({
|
||||||
style={({ pressed }) => [styles.row, pressed && styles.pressed]}
|
style={({ pressed }) => [styles.row, pressed && styles.pressed]}
|
||||||
>
|
>
|
||||||
<View style={[styles.accent, { backgroundColor: currentTone.soft }]}>
|
<View style={[styles.accent, { backgroundColor: currentTone.soft }]}>
|
||||||
<View style={[styles.accentDot, { backgroundColor: currentTone.accent }]} />
|
{icon === "book" ? (
|
||||||
|
<Ionicons name="book-outline" size={19} color={currentTone.accent} />
|
||||||
|
) : (
|
||||||
|
<View style={[styles.accentDot, { backgroundColor: currentTone.accent }]} />
|
||||||
|
)}
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<View style={styles.titleBlock}>
|
<View style={styles.titleBlock}>
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import { Ionicons } from "@expo/vector-icons";
|
||||||
import { router } from "expo-router";
|
import { router } from "expo-router";
|
||||||
|
|
||||||
import { Colors } from "@/theme";
|
import { Colors } from "@/theme";
|
||||||
import { PageToneProvider } from "../context/PageToneContext";
|
import { type PageTone, PageToneProvider } from "../context/PageToneContext";
|
||||||
import { ContentPageHeader } from "../components/layout/ContentPageHeader";
|
import { ContentPageHeader } from "../components/layout/ContentPageHeader";
|
||||||
import { ScreenError } from "../components/ContentScreenState";
|
import { ScreenError } from "../components/ContentScreenState";
|
||||||
import { ContractSortModal } from "../components/search/ContractSortModal";
|
import { ContractSortModal } from "../components/search/ContractSortModal";
|
||||||
|
|
@ -131,8 +131,15 @@ export function CollectionTemplateScreen({
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const isCatalog =
|
||||||
|
collectionRendererCode === "module_catalog_collection" ||
|
||||||
|
itemRendererCode === "module_catalog_card" ||
|
||||||
|
templateCode === "m0001_ct0001" ||
|
||||||
|
templateCode === "m0002_ct0001";
|
||||||
|
const pageTone: PageTone = isCatalog ? "green" : "purple";
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PageToneProvider tone="purple">
|
<PageToneProvider tone={pageTone}>
|
||||||
<SafeAreaView style={styles.screen} edges={["top", "left", "right"]}>
|
<SafeAreaView style={styles.screen} edges={["top", "left", "right"]}>
|
||||||
<ContentPageHeader
|
<ContentPageHeader
|
||||||
title={moduleDisplay.name}
|
title={moduleDisplay.name}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue