Merge pull request 'gynecology' (#102) from gynecology into main
Reviewed-on: https://git.zedobject.local/AcuPedia/acupedia-mobile-ui/pulls/102 Reviewed-by: Amit Salunke <amit@noreply.localhost>
This commit is contained in:
commit
3663323c20
|
|
@ -1,26 +1,401 @@
|
|||
import React from "react";
|
||||
import { Pressable, StyleSheet, Text, View } from "react-native";
|
||||
import React, { useMemo, useState } from "react";
|
||||
import {
|
||||
ActivityIndicator,
|
||||
LayoutAnimation,
|
||||
Platform,
|
||||
Pressable,
|
||||
StyleSheet,
|
||||
Text,
|
||||
UIManager,
|
||||
View,
|
||||
} from "react-native";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import { useRouter } from "expo-router";
|
||||
import { moderateScale, verticalScale } from "react-native-size-matters";
|
||||
|
||||
import { Colors } from "@/theme";
|
||||
import { asNumber, asString, asStringArray, humanizeKey } from "../helpers/value";
|
||||
import { CollectionScaffold } from "../shared/CollectionScaffold";
|
||||
import { ContentCountBadge } from "../shared/ContentCountBadge";
|
||||
import { greenTone } from "../shared/reading-palette";
|
||||
import {
|
||||
useModuleContentDetailQuery,
|
||||
useModuleTemplateContentDetailsQuery,
|
||||
} from "../../hooks/use-content-queries";
|
||||
import type {
|
||||
CollectionItemRendererProps,
|
||||
CollectionRendererProps,
|
||||
} from "../../types/renderer.types";
|
||||
|
||||
if (Platform.OS === "android" && UIManager.setLayoutAnimationEnabledExperimental) {
|
||||
UIManager.setLayoutAnimationEnabledExperimental(true);
|
||||
}
|
||||
|
||||
export function ModuleCatalogCollectionRenderer(props: CollectionRendererProps) {
|
||||
return <CollectionScaffold {...props} />;
|
||||
}
|
||||
|
||||
function normalizePointCode(raw: string): string {
|
||||
let code = raw.replace(/\s*\([^)]*\)/g, "").trim().toLowerCase();
|
||||
code = code.replace(/^ren-/, "cv-");
|
||||
code = code.replace(/^rn-/, "cv-");
|
||||
code = code.replace(/^du-/, "gv-");
|
||||
code = code.replace(/^sj-/, "te-");
|
||||
code = code.replace(/^tb-/, "te-");
|
||||
code = code.replace(/^liv-/, "lr-");
|
||||
code = code.replace(/^ub-/, "bl-");
|
||||
return code;
|
||||
}
|
||||
|
||||
function renderExplanationParts(
|
||||
text: string,
|
||||
onPointPress: (code: string) => void,
|
||||
) {
|
||||
const pointRegex = /\b([A-Za-z]{1,4}-\d{1,2})\b/g;
|
||||
const parts: React.ReactNode[] = [];
|
||||
let lastIndex = 0;
|
||||
let match: RegExpExecArray | null;
|
||||
|
||||
while ((match = pointRegex.exec(text)) !== null) {
|
||||
if (match.index > lastIndex) {
|
||||
parts.push(text.substring(lastIndex, match.index));
|
||||
}
|
||||
const ptCode = match[1];
|
||||
parts.push(
|
||||
<Text
|
||||
key={`pt-${match.index}`}
|
||||
accessibilityRole="button"
|
||||
onPress={() => onPointPress(ptCode)}
|
||||
style={accordionStyles.pointTextLink}
|
||||
>
|
||||
{ptCode}
|
||||
</Text>
|
||||
);
|
||||
lastIndex = match.index + match[0].length;
|
||||
}
|
||||
if (lastIndex < text.length) {
|
||||
parts.push(text.substring(lastIndex));
|
||||
}
|
||||
return parts.length > 0 ? parts : text;
|
||||
}
|
||||
|
||||
export function PatternAccordionCardRenderer({
|
||||
item,
|
||||
onPress,
|
||||
}: CollectionItemRendererProps) {
|
||||
const router = useRouter();
|
||||
const [expanded, setExpanded] = useState(false);
|
||||
const attributes = item.attributes;
|
||||
const rawTitle = asString(attributes.name) || item.title;
|
||||
const title = humanizeKey(rawTitle);
|
||||
|
||||
const link = attributes?.link as Record<string, unknown> | undefined;
|
||||
const linkTarget = link?.target as Record<string, unknown> | undefined;
|
||||
const contentId = (linkTarget?.content_id as string) || item.id;
|
||||
const moduleCode = (linkTarget?.module_code as string) || "m0042";
|
||||
|
||||
const detailQuery = useModuleContentDetailQuery(
|
||||
{ module_code: moduleCode },
|
||||
contentId,
|
||||
);
|
||||
|
||||
// Query all acupuncture points from m0001 to resolve links
|
||||
const { data: pointsData } = useModuleTemplateContentDetailsQuery({
|
||||
module_code: "m0001",
|
||||
template_code: "m0001_ct0003",
|
||||
});
|
||||
|
||||
const pointsMap = useMemo(() => {
|
||||
const map = new Map<string, string>();
|
||||
if (!pointsData?.items) return map;
|
||||
for (const pItem of pointsData.items) {
|
||||
const id = pItem.content.id;
|
||||
const code = asString(pItem.data.code) || asString(pItem.data.name);
|
||||
if (code) {
|
||||
const lower = code.toLowerCase().trim();
|
||||
map.set(lower, id);
|
||||
if (lower.startsWith("cv-")) {
|
||||
map.set(lower.replace("cv-", "ren-"), id);
|
||||
map.set(lower.replace("cv-", "rn-"), id);
|
||||
}
|
||||
if (lower.startsWith("gv-")) {
|
||||
map.set(lower.replace("gv-", "du-"), id);
|
||||
}
|
||||
if (lower.startsWith("te-")) {
|
||||
map.set(lower.replace("te-", "sj-"), id);
|
||||
map.set(lower.replace("te-", "tb-"), id);
|
||||
}
|
||||
if (lower.startsWith("lr-")) {
|
||||
map.set(lower.replace("lr-", "liv-"), id);
|
||||
}
|
||||
if (lower.startsWith("bl-")) {
|
||||
map.set(lower.replace("bl-", "ub-"), id);
|
||||
}
|
||||
}
|
||||
if (pItem.content.title) {
|
||||
map.set(pItem.content.title.toLowerCase().trim(), id);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}, [pointsData?.items]);
|
||||
|
||||
const handlePointPress = (rawPt: string) => {
|
||||
const match = rawPt.match(/([A-Za-z]{1,4}-\d{1,2})/);
|
||||
const pointCode = match ? match[1] : rawPt.trim();
|
||||
const normalized = normalizePointCode(pointCode);
|
||||
const pointContentId = pointsMap.get(normalized);
|
||||
|
||||
if (pointContentId) {
|
||||
router.push(`/modules/m0001/m0001_ct0003/${encodeURIComponent(pointContentId)}` as never);
|
||||
} else {
|
||||
router.push(`/modules/m0001/search?q=${encodeURIComponent(pointCode)}` as never);
|
||||
}
|
||||
};
|
||||
|
||||
const toggle = () => {
|
||||
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
|
||||
setExpanded((prev) => !prev);
|
||||
};
|
||||
|
||||
const detailData = (detailQuery.data?.data as Record<string, unknown> | undefined) || attributes;
|
||||
|
||||
// Extract fields matching the user's diagram
|
||||
const rawManifestations = detailData.clinical_manifestations;
|
||||
const clinicalManifestations: string[] = Array.isArray(rawManifestations)
|
||||
? (rawManifestations as string[]).map(String)
|
||||
: typeof rawManifestations === "string" && rawManifestations.trim()
|
||||
? rawManifestations.split("\n").map((s) => s.trim()).filter(Boolean)
|
||||
: [];
|
||||
|
||||
const tongue = asString(detailData.tongue);
|
||||
const pulse = asString(detailData.pulse);
|
||||
const rawPrinciples = detailData.treatment_principle;
|
||||
const treatmentPrinciples: string[] = Array.isArray(rawPrinciples)
|
||||
? (rawPrinciples as string[]).map(String).map((s) => s.trim()).filter(Boolean)
|
||||
: typeof rawPrinciples === "string" && rawPrinciples.trim()
|
||||
? rawPrinciples
|
||||
.split(/[,;\n]/)
|
||||
.map((s) => s.trim().replace(/^[-*•]\s*/, ""))
|
||||
.filter(Boolean)
|
||||
: [];
|
||||
|
||||
const rawAcupuncture = detailData.acupuncture;
|
||||
let acuPoints = "";
|
||||
let acuMethod = "";
|
||||
if (rawAcupuncture && typeof rawAcupuncture === "object") {
|
||||
const acuObj = rawAcupuncture as Record<string, unknown>;
|
||||
acuPoints = asString(acuObj.points);
|
||||
acuMethod = asString(acuObj.method);
|
||||
} else if (typeof rawAcupuncture === "string") {
|
||||
acuPoints = rawAcupuncture;
|
||||
}
|
||||
|
||||
const rawExplanation = detailData.explanation;
|
||||
const explanations: string[] = Array.isArray(rawExplanation)
|
||||
? (rawExplanation as string[]).map(String)
|
||||
: typeof rawExplanation === "string" && rawExplanation.trim()
|
||||
? rawExplanation.split("\n").map((s) => s.trim()).filter(Boolean)
|
||||
: [];
|
||||
|
||||
const category = asString(detailData.category);
|
||||
|
||||
// Split points by comma into chips
|
||||
const pointChips = acuPoints
|
||||
? acuPoints.split(/,\s*/).map((p) => p.trim()).filter(Boolean)
|
||||
: [];
|
||||
|
||||
return (
|
||||
<View style={accordionStyles.cardContainer}>
|
||||
<Pressable
|
||||
accessibilityRole="button"
|
||||
accessibilityLabel={`${expanded ? "Collapse" : "Expand"} ${title}`}
|
||||
onPress={toggle}
|
||||
style={({ pressed }) => [
|
||||
accordionStyles.headerRow,
|
||||
expanded && accordionStyles.headerRowExpanded,
|
||||
pressed && accordionStyles.pressed,
|
||||
]}
|
||||
>
|
||||
<View style={[accordionStyles.accentBar, expanded && accordionStyles.accentBarExpanded]} />
|
||||
<Text style={[accordionStyles.title, expanded && accordionStyles.titleExpanded]}>
|
||||
{title}
|
||||
</Text>
|
||||
<View style={accordionStyles.chevronWrapper}>
|
||||
<Ionicons
|
||||
name={expanded ? "chevron-up" : "chevron-down"}
|
||||
size={18}
|
||||
color={expanded ? greenTone.accent : "#829B8E"}
|
||||
/>
|
||||
</View>
|
||||
</Pressable>
|
||||
|
||||
{expanded ? (
|
||||
<View style={accordionStyles.expandedBody}>
|
||||
{detailQuery.isLoading && !detailQuery.data ? (
|
||||
<View style={accordionStyles.loadingRow}>
|
||||
<ActivityIndicator size="small" color={greenTone.accent} />
|
||||
<Text style={accordionStyles.loadingText}>Loading pattern details…</Text>
|
||||
</View>
|
||||
) : (
|
||||
<>
|
||||
{/* 1. Clinical Manifestations */}
|
||||
{clinicalManifestations.length > 0 ? (
|
||||
<View style={accordionStyles.section}>
|
||||
<Text style={accordionStyles.sectionTitle}>
|
||||
Clinical Manifestations
|
||||
</Text>
|
||||
<View style={accordionStyles.bulletList}>
|
||||
{clinicalManifestations.map((itemText, idx) => (
|
||||
<View key={idx} style={accordionStyles.bulletRow}>
|
||||
<View style={accordionStyles.bulletDot} />
|
||||
<Text style={accordionStyles.bulletText}>{itemText}</Text>
|
||||
</View>
|
||||
))}
|
||||
</View>
|
||||
</View>
|
||||
) : null}
|
||||
|
||||
{/* 2. Tongue & Pulse (Side-by-Side as drawn) */}
|
||||
{tongue || pulse ? (
|
||||
<View style={accordionStyles.twoColumnBox}>
|
||||
{tongue ? (
|
||||
<View style={accordionStyles.column}>
|
||||
<Text style={accordionStyles.columnLabel}>Tongue</Text>
|
||||
<Text style={accordionStyles.columnValue}>{tongue}</Text>
|
||||
</View>
|
||||
) : null}
|
||||
{tongue && pulse ? <View style={accordionStyles.columnDivider} /> : null}
|
||||
{pulse ? (
|
||||
<View style={accordionStyles.column}>
|
||||
<Text style={accordionStyles.columnLabel}>Pulse</Text>
|
||||
<Text style={accordionStyles.columnValue}>{pulse}</Text>
|
||||
</View>
|
||||
) : null}
|
||||
</View>
|
||||
) : null}
|
||||
|
||||
{/* 3. Treatment Principle */}
|
||||
{treatmentPrinciples.length > 0 ? (
|
||||
<View style={accordionStyles.section}>
|
||||
<Text style={accordionStyles.sectionTitle}>
|
||||
Treatment Principle
|
||||
</Text>
|
||||
<View style={accordionStyles.bulletList}>
|
||||
{treatmentPrinciples.map((itemText, idx) => (
|
||||
<View key={idx} style={accordionStyles.bulletRow}>
|
||||
<View style={accordionStyles.bulletDot} />
|
||||
<Text style={accordionStyles.bulletText}>{itemText}</Text>
|
||||
</View>
|
||||
))}
|
||||
</View>
|
||||
</View>
|
||||
) : null}
|
||||
|
||||
{/* 4. Acupuncture Points & Method */}
|
||||
{pointChips.length > 0 || acuMethod ? (
|
||||
<View style={accordionStyles.section}>
|
||||
<Text style={accordionStyles.sectionTitle}>
|
||||
Acupuncture Points
|
||||
</Text>
|
||||
{pointChips.length > 0 ? (
|
||||
<View style={accordionStyles.chipsContainer}>
|
||||
{pointChips.map((pt, idx) => (
|
||||
<Pressable
|
||||
key={idx}
|
||||
accessibilityRole="button"
|
||||
accessibilityLabel={`View ${pt} acupuncture point`}
|
||||
onPress={() => handlePointPress(pt)}
|
||||
style={({ pressed }) => [
|
||||
accordionStyles.pointChip,
|
||||
pressed && accordionStyles.pointChipPressed,
|
||||
]}
|
||||
>
|
||||
<Text style={accordionStyles.pointChipText}>{pt}</Text>
|
||||
<Ionicons
|
||||
name="chevron-forward"
|
||||
size={12}
|
||||
color="#35664E"
|
||||
style={{ marginLeft: 2 }}
|
||||
/>
|
||||
</Pressable>
|
||||
))}
|
||||
</View>
|
||||
) : null}
|
||||
{acuMethod ? (
|
||||
<View style={accordionStyles.methodContainer}>
|
||||
<Text style={accordionStyles.subSectionLabel}>Method:</Text>
|
||||
<Text style={accordionStyles.methodText}>{acuMethod}</Text>
|
||||
</View>
|
||||
) : null}
|
||||
</View>
|
||||
) : null}
|
||||
|
||||
{/* 5. Explanation */}
|
||||
{explanations.length > 0 ? (
|
||||
<View style={accordionStyles.section}>
|
||||
<Text style={accordionStyles.sectionTitle}>
|
||||
Explanation
|
||||
</Text>
|
||||
<View style={accordionStyles.explanationList}>
|
||||
{explanations.map((exp, idx) => (
|
||||
<View key={idx} style={accordionStyles.explanationRow}>
|
||||
<View style={accordionStyles.explanationDot} />
|
||||
<Text style={accordionStyles.explanationText}>
|
||||
{renderExplanationParts(exp, handlePointPress)}
|
||||
</Text>
|
||||
</View>
|
||||
))}
|
||||
</View>
|
||||
</View>
|
||||
) : null}
|
||||
|
||||
{/* 6. Category */}
|
||||
{category ? (
|
||||
<View style={accordionStyles.categoryRow}>
|
||||
<Text style={accordionStyles.categoryLabel}>Category:</Text>
|
||||
<View style={accordionStyles.categoryBadge}>
|
||||
<Text style={accordionStyles.categoryBadgeText}>{category}</Text>
|
||||
</View>
|
||||
</View>
|
||||
) : null}
|
||||
|
||||
{/* Optional link to navigate to full detail screen */}
|
||||
{onPress ? (
|
||||
<Pressable
|
||||
accessibilityRole="button"
|
||||
onPress={onPress}
|
||||
style={({ pressed }) => [
|
||||
accordionStyles.viewFullDetailBtn,
|
||||
pressed && accordionStyles.pressed,
|
||||
]}
|
||||
>
|
||||
<Text style={accordionStyles.viewFullDetailText}>
|
||||
View Full Details
|
||||
</Text>
|
||||
<Ionicons name="arrow-forward" size={14} color={greenTone.accent} />
|
||||
</Pressable>
|
||||
) : null}
|
||||
</>
|
||||
)}
|
||||
</View>
|
||||
) : null}
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
export function ModuleCatalogCardRenderer({
|
||||
item,
|
||||
onPress,
|
||||
}: CollectionItemRendererProps) {
|
||||
const attributes = item.attributes;
|
||||
const link = attributes?.link as Record<string, unknown> | undefined;
|
||||
const isContentRef = link?.type === "content_ref";
|
||||
|
||||
// If this item points to a pattern content item, render inline accordion
|
||||
if (isContentRef) {
|
||||
return <PatternAccordionCardRenderer item={item} onPress={onPress} />;
|
||||
}
|
||||
|
||||
const rawTitle = asString(attributes.name) || item.title;
|
||||
const parenMatch = rawTitle.match(/^(.*?)\s*\(([^()]+)\)\s*(.*?)$/);
|
||||
const title = parenMatch
|
||||
|
|
@ -76,6 +451,266 @@ export function ModuleCatalogCardRenderer({
|
|||
);
|
||||
}
|
||||
|
||||
const accordionStyles = StyleSheet.create({
|
||||
cardContainer: {
|
||||
backgroundColor: "#FFFFFF",
|
||||
width: "100%",
|
||||
},
|
||||
headerRow: {
|
||||
minHeight: verticalScale(56),
|
||||
flexDirection: "row",
|
||||
alignItems: "center",
|
||||
paddingHorizontal: moderateScale(16),
|
||||
paddingVertical: verticalScale(14),
|
||||
backgroundColor: "#FFFFFF",
|
||||
gap: moderateScale(10),
|
||||
},
|
||||
headerRowExpanded: {
|
||||
backgroundColor: greenTone.soft,
|
||||
borderBottomWidth: StyleSheet.hairlineWidth,
|
||||
borderBottomColor: greenTone.border,
|
||||
},
|
||||
accentBar: {
|
||||
width: moderateScale(4),
|
||||
height: verticalScale(22),
|
||||
borderRadius: moderateScale(999),
|
||||
backgroundColor: "transparent",
|
||||
},
|
||||
accentBarExpanded: {
|
||||
backgroundColor: greenTone.accent,
|
||||
},
|
||||
pressed: {
|
||||
opacity: 0.74,
|
||||
},
|
||||
title: {
|
||||
flex: 1,
|
||||
fontSize: moderateScale(15),
|
||||
lineHeight: moderateScale(21),
|
||||
fontWeight: "700",
|
||||
color: "#1E293B",
|
||||
letterSpacing: 0.1,
|
||||
},
|
||||
titleExpanded: {
|
||||
color: greenTone.title,
|
||||
},
|
||||
chevronWrapper: {
|
||||
width: moderateScale(30),
|
||||
height: moderateScale(30),
|
||||
borderRadius: moderateScale(15),
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
backgroundColor: "#FFFFFFB8",
|
||||
},
|
||||
expandedBody: {
|
||||
paddingHorizontal: moderateScale(18),
|
||||
paddingTop: verticalScale(16),
|
||||
paddingBottom: verticalScale(18),
|
||||
backgroundColor: "#FFFFFF",
|
||||
gap: verticalScale(16),
|
||||
},
|
||||
loadingRow: {
|
||||
flexDirection: "row",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
paddingVertical: verticalScale(16),
|
||||
gap: moderateScale(8),
|
||||
},
|
||||
loadingText: {
|
||||
fontSize: moderateScale(13),
|
||||
color: "#64748B",
|
||||
},
|
||||
section: {
|
||||
borderBottomWidth: StyleSheet.hairlineWidth,
|
||||
borderBottomColor: "#E2EAE5",
|
||||
paddingBottom: verticalScale(14),
|
||||
gap: verticalScale(8),
|
||||
},
|
||||
sectionTitle: {
|
||||
fontSize: moderateScale(12),
|
||||
lineHeight: moderateScale(16),
|
||||
fontWeight: "700",
|
||||
color: "#4A6B5B",
|
||||
textTransform: "uppercase",
|
||||
letterSpacing: 0.7,
|
||||
},
|
||||
bulletList: {
|
||||
gap: verticalScale(8),
|
||||
},
|
||||
bulletRow: {
|
||||
flexDirection: "row",
|
||||
alignItems: "flex-start",
|
||||
gap: moderateScale(10),
|
||||
},
|
||||
bulletDot: {
|
||||
width: moderateScale(6),
|
||||
height: moderateScale(6),
|
||||
marginTop: verticalScale(7),
|
||||
borderRadius: moderateScale(3),
|
||||
backgroundColor: greenTone.accent,
|
||||
},
|
||||
bulletText: {
|
||||
flex: 1,
|
||||
fontSize: moderateScale(14),
|
||||
lineHeight: moderateScale(21),
|
||||
color: "#334155",
|
||||
},
|
||||
twoColumnBox: {
|
||||
flexDirection: "row",
|
||||
backgroundColor: greenTone.soft,
|
||||
borderRadius: moderateScale(10),
|
||||
borderWidth: 1,
|
||||
borderColor: greenTone.border,
|
||||
paddingHorizontal: moderateScale(14),
|
||||
paddingVertical: verticalScale(11),
|
||||
alignItems: "stretch",
|
||||
},
|
||||
column: {
|
||||
flex: 1,
|
||||
gap: verticalScale(3),
|
||||
},
|
||||
columnDivider: {
|
||||
width: StyleSheet.hairlineWidth,
|
||||
backgroundColor: greenTone.border,
|
||||
marginHorizontal: moderateScale(12),
|
||||
},
|
||||
columnLabel: {
|
||||
fontSize: moderateScale(11),
|
||||
lineHeight: moderateScale(15),
|
||||
fontWeight: "700",
|
||||
color: "#597064",
|
||||
textTransform: "uppercase",
|
||||
letterSpacing: 0.5,
|
||||
},
|
||||
columnValue: {
|
||||
fontSize: moderateScale(14),
|
||||
lineHeight: moderateScale(20),
|
||||
color: "#1E293B",
|
||||
fontWeight: "600",
|
||||
},
|
||||
principleBox: {
|
||||
backgroundColor: greenTone.soft,
|
||||
paddingHorizontal: moderateScale(12),
|
||||
paddingVertical: verticalScale(10),
|
||||
borderRadius: moderateScale(8),
|
||||
borderLeftWidth: moderateScale(3),
|
||||
borderLeftColor: greenTone.accent,
|
||||
},
|
||||
principleText: {
|
||||
fontSize: moderateScale(14),
|
||||
lineHeight: moderateScale(21),
|
||||
color: greenTone.title,
|
||||
fontStyle: "italic",
|
||||
},
|
||||
chipsContainer: {
|
||||
flexDirection: "row",
|
||||
flexWrap: "wrap",
|
||||
gap: moderateScale(7),
|
||||
},
|
||||
pointChip: {
|
||||
flexDirection: "row",
|
||||
alignItems: "center",
|
||||
backgroundColor: "#EEF7F1",
|
||||
borderWidth: 1,
|
||||
borderColor: "#D5E8DB",
|
||||
paddingHorizontal: moderateScale(11),
|
||||
paddingVertical: verticalScale(5),
|
||||
borderRadius: moderateScale(999),
|
||||
},
|
||||
pointChipPressed: {
|
||||
opacity: 0.72,
|
||||
transform: [{ scale: 0.96 }],
|
||||
},
|
||||
pointChipText: {
|
||||
fontSize: moderateScale(13),
|
||||
lineHeight: moderateScale(18),
|
||||
fontWeight: "700",
|
||||
color: "#35664E",
|
||||
},
|
||||
pointTextLink: {
|
||||
color: "#285A44",
|
||||
fontWeight: "700",
|
||||
textDecorationLine: "underline",
|
||||
},
|
||||
methodContainer: {
|
||||
marginTop: verticalScale(4),
|
||||
flexDirection: "row",
|
||||
alignItems: "flex-start",
|
||||
gap: moderateScale(6),
|
||||
},
|
||||
subSectionLabel: {
|
||||
fontSize: moderateScale(13),
|
||||
fontWeight: "700",
|
||||
color: "#597064",
|
||||
},
|
||||
methodText: {
|
||||
flex: 1,
|
||||
fontSize: moderateScale(13),
|
||||
lineHeight: moderateScale(19),
|
||||
color: "#334155",
|
||||
},
|
||||
explanationList: {
|
||||
gap: verticalScale(8),
|
||||
},
|
||||
explanationRow: {
|
||||
flexDirection: "row",
|
||||
alignItems: "flex-start",
|
||||
gap: moderateScale(10),
|
||||
},
|
||||
explanationDot: {
|
||||
width: moderateScale(5),
|
||||
height: moderateScale(5),
|
||||
marginTop: verticalScale(7),
|
||||
borderRadius: moderateScale(2.5),
|
||||
backgroundColor: "#829B8E",
|
||||
},
|
||||
explanationText: {
|
||||
flex: 1,
|
||||
fontSize: moderateScale(13),
|
||||
lineHeight: moderateScale(19),
|
||||
color: "#334155",
|
||||
},
|
||||
categoryRow: {
|
||||
flexDirection: "row",
|
||||
alignItems: "center",
|
||||
gap: moderateScale(10),
|
||||
paddingTop: verticalScale(2),
|
||||
},
|
||||
categoryLabel: {
|
||||
fontSize: moderateScale(11),
|
||||
lineHeight: moderateScale(15),
|
||||
fontWeight: "700",
|
||||
color: "#597064",
|
||||
textTransform: "uppercase",
|
||||
letterSpacing: 0.5,
|
||||
},
|
||||
categoryBadge: {
|
||||
backgroundColor: "#EEF7F1",
|
||||
borderWidth: 1,
|
||||
borderColor: "#D5E8DB",
|
||||
paddingHorizontal: moderateScale(11),
|
||||
paddingVertical: verticalScale(4),
|
||||
borderRadius: moderateScale(999),
|
||||
},
|
||||
categoryBadgeText: {
|
||||
fontSize: moderateScale(12),
|
||||
lineHeight: moderateScale(16),
|
||||
fontWeight: "600",
|
||||
color: "#35664E",
|
||||
},
|
||||
viewFullDetailBtn: {
|
||||
flexDirection: "row",
|
||||
alignItems: "center",
|
||||
justifyContent: "flex-end",
|
||||
gap: moderateScale(6),
|
||||
paddingTop: verticalScale(6),
|
||||
},
|
||||
viewFullDetailText: {
|
||||
fontSize: moderateScale(13),
|
||||
fontWeight: "600",
|
||||
color: greenTone.accent,
|
||||
},
|
||||
});
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
row: {
|
||||
minHeight: moderateScale(68),
|
||||
|
|
@ -111,3 +746,4 @@ const styles = StyleSheet.create({
|
|||
lineHeight: moderateScale(16),
|
||||
},
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,11 @@ import type { CollectionItemRendererComponent, CollectionRendererComponent, Deta
|
|||
import { GenericCollectionRenderer } from "./GenericCollectionRenderer";
|
||||
import { GenericCardRenderer } from "./GenericCardRenderer";
|
||||
import { GenericDetailRenderer } from "./GenericDetailRenderer";
|
||||
import { ModuleCatalogCollectionRenderer, ModuleCatalogCardRenderer } from "./collections/ModuleCatalogRenderers";
|
||||
import {
|
||||
ModuleCatalogCollectionRenderer,
|
||||
ModuleCatalogCardRenderer,
|
||||
PatternAccordionCardRenderer,
|
||||
} from "./collections/ModuleCatalogRenderers";
|
||||
import { AcuPointCollectionRenderer, AcuPointIndexCollectionRenderer, AcuPointCardRenderer, AcuPointIndexCardRenderer } from "./collections/PointRenderers";
|
||||
import { MeridianCollectionRenderer, MeridianIndexCollectionRenderer, MeridianCardRenderer, MeridianIndexCardRenderer } from "./collections/MeridianRenderers";
|
||||
import { EovCollectionRenderer, EovIndexCollectionRenderer, EovCardRenderer, EovIndexCardRenderer } from "./collections/EovRenderers";
|
||||
|
|
@ -74,6 +78,7 @@ export const collectionRenderers: Readonly<Record<string, CollectionRendererComp
|
|||
});
|
||||
export const collectionItemRenderers: Readonly<Record<string, CollectionItemRendererComponent>> = Object.freeze({
|
||||
module_catalog_card: ModuleCatalogCardRenderer,
|
||||
pattern_accordion_card: PatternAccordionCardRenderer,
|
||||
acu_point_index_card: AcuPointIndexCardRenderer,
|
||||
acu_point_card: AcuPointCardRenderer,
|
||||
meridian_index_card: MeridianIndexCardRenderer,
|
||||
|
|
|
|||
Loading…
Reference in New Issue