diff --git a/src/features/content/renderers/collections/ModuleCatalogRenderers.tsx b/src/features/content/renderers/collections/ModuleCatalogRenderers.tsx
index ae71088..31b159c 100644
--- a/src/features/content/renderers/collections/ModuleCatalogRenderers.tsx
+++ b/src/features/content/renderers/collections/ModuleCatalogRenderers.tsx
@@ -47,41 +47,9 @@ function normalizePointCode(raw: string): string {
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(
- onPointPress(ptCode)}
- style={accordionStyles.pointTextLink}
- >
- {ptCode}
-
- );
- 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);
@@ -340,9 +308,7 @@ export function PatternAccordionCardRenderer({
{explanations.map((exp, idx) => (
-
- {renderExplanationParts(exp, handlePointPress)}
-
+ {exp}
))}
@@ -359,22 +325,6 @@ export function PatternAccordionCardRenderer({
) : null}
- {/* Optional link to navigate to full detail screen */}
- {onPress ? (
- [
- accordionStyles.viewFullDetailBtn,
- pressed && accordionStyles.pressed,
- ]}
- >
-
- View Full Details
-
-
-
- ) : null}
>
)}
@@ -393,7 +343,7 @@ export function ModuleCatalogCardRenderer({
// If this item points to a pattern content item, render inline accordion
if (isContentRef) {
- return ;
+ return ;
}
const rawTitle = asString(attributes.name) || item.title;
@@ -422,12 +372,23 @@ export function ModuleCatalogCardRenderer({
const cleanTitle = humanizeKey(title);
const label = rawLabel ? humanizeKey(rawLabel) : null;
+ const count = asNumber(attributes.content_count);
+ const itemCode = asString(attributes.code).toLowerCase().trim();
+ const rawTitleLower = rawTitle.toLowerCase().trim();
+ const isClickable =
+ count !== 0 &&
+ !["diseases_after_childbirth", "other"].includes(itemCode) &&
+ !["diseases after childbirth", "other"].includes(rawTitleLower);
return (
[styles.row, pressed && styles.pressed]}
+ accessibilityRole={isClickable ? "button" : undefined}
+ disabled={!isClickable}
+ onPress={isClickable ? onPress : undefined}
+ style={({ pressed }) => [
+ styles.row,
+ isClickable && pressed && styles.pressed,
+ ]}
>
@@ -443,10 +404,12 @@ export function ModuleCatalogCardRenderer({
-
+ {isClickable ? (
+
+ ) : null}
);
}
@@ -626,11 +589,6 @@ const accordionStyles = StyleSheet.create({
fontWeight: "700",
color: "#35664E",
},
- pointTextLink: {
- color: "#285A44",
- fontWeight: "700",
- textDecorationLine: "underline",
- },
methodContainer: {
marginTop: verticalScale(4),
flexDirection: "row",
@@ -697,18 +655,6 @@ const accordionStyles = StyleSheet.create({
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({