feat(five-elements): make pattern cards collapsible on final detail page
This commit is contained in:
parent
a05c3c71b1
commit
00e8c7467e
|
|
@ -8,6 +8,8 @@ import { Colors } from "@/theme";
|
|||
import type { DetailRendererProps } from "../../types/renderer.types";
|
||||
import { ContentLinkAttributeSections } from "../shared/ContentLinkAttributeSections";
|
||||
import { Hero } from "../shared/Hero";
|
||||
import { Paragraphs } from "../shared/Paragraphs";
|
||||
import { SectionCard } from "../shared/SectionCard";
|
||||
import { asRecordArray, asString, asStringArray } from "../helpers/value";
|
||||
|
||||
function resolveSequenceTargetTemplate(
|
||||
|
|
@ -195,37 +197,23 @@ export function FiveElementsDetailRenderer({
|
|||
</View>
|
||||
) : null}
|
||||
|
||||
{/* Numbered Pattern Cards from data.sections */}
|
||||
{rawSections.length > 0 ? (
|
||||
<View style={styles.sectionsContainer}>
|
||||
<Text style={styles.sectionHeading}>Patterns & Manifestations</Text>
|
||||
{rawSections.map((sec, idx) => {
|
||||
const sectionTitle = asString(sec.title) || `Pattern ${idx + 1}`;
|
||||
const sectionContent = extractParagraphs(sec.content);
|
||||
{/* Collapsible Pattern Cards from data.sections */}
|
||||
{rawSections.map((sec, idx) => {
|
||||
const sectionTitle = asString(sec.title) || `Pattern ${idx + 1}`;
|
||||
const sectionContent = extractParagraphs(sec.content);
|
||||
|
||||
return (
|
||||
<View key={idx} style={styles.patternCard}>
|
||||
<View style={styles.patternHeader}>
|
||||
<View style={styles.numberBadge}>
|
||||
<Text style={styles.numberText}>{idx + 1}</Text>
|
||||
</View>
|
||||
<Text style={styles.patternTitle}>{sectionTitle}</Text>
|
||||
</View>
|
||||
|
||||
{sectionContent.length > 0 ? (
|
||||
<View style={styles.patternBody}>
|
||||
{sectionContent.map((text, cIdx) => (
|
||||
<Text key={cIdx} style={styles.contentText}>
|
||||
{text}
|
||||
</Text>
|
||||
))}
|
||||
</View>
|
||||
) : null}
|
||||
</View>
|
||||
);
|
||||
})}
|
||||
</View>
|
||||
) : null}
|
||||
return (
|
||||
<SectionCard
|
||||
key={idx}
|
||||
title={sectionTitle}
|
||||
defaultExpanded={false}
|
||||
>
|
||||
{sectionContent.length > 0 ? (
|
||||
<Paragraphs items={sectionContent} />
|
||||
) : null}
|
||||
</SectionCard>
|
||||
);
|
||||
})}
|
||||
|
||||
<ContentLinkAttributeSections
|
||||
data={data}
|
||||
|
|
|
|||
Loading…
Reference in New Issue