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 type { DetailRendererProps } from "../../types/renderer.types";
|
||||||
import { ContentLinkAttributeSections } from "../shared/ContentLinkAttributeSections";
|
import { ContentLinkAttributeSections } from "../shared/ContentLinkAttributeSections";
|
||||||
import { Hero } from "../shared/Hero";
|
import { Hero } from "../shared/Hero";
|
||||||
|
import { Paragraphs } from "../shared/Paragraphs";
|
||||||
|
import { SectionCard } from "../shared/SectionCard";
|
||||||
import { asRecordArray, asString, asStringArray } from "../helpers/value";
|
import { asRecordArray, asString, asStringArray } from "../helpers/value";
|
||||||
|
|
||||||
function resolveSequenceTargetTemplate(
|
function resolveSequenceTargetTemplate(
|
||||||
|
|
@ -195,37 +197,23 @@ export function FiveElementsDetailRenderer({
|
||||||
</View>
|
</View>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
{/* Numbered Pattern Cards from data.sections */}
|
{/* Collapsible Pattern Cards from data.sections */}
|
||||||
{rawSections.length > 0 ? (
|
{rawSections.map((sec, idx) => {
|
||||||
<View style={styles.sectionsContainer}>
|
const sectionTitle = asString(sec.title) || `Pattern ${idx + 1}`;
|
||||||
<Text style={styles.sectionHeading}>Patterns & Manifestations</Text>
|
const sectionContent = extractParagraphs(sec.content);
|
||||||
{rawSections.map((sec, idx) => {
|
|
||||||
const sectionTitle = asString(sec.title) || `Pattern ${idx + 1}`;
|
|
||||||
const sectionContent = extractParagraphs(sec.content);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View key={idx} style={styles.patternCard}>
|
<SectionCard
|
||||||
<View style={styles.patternHeader}>
|
key={idx}
|
||||||
<View style={styles.numberBadge}>
|
title={sectionTitle}
|
||||||
<Text style={styles.numberText}>{idx + 1}</Text>
|
defaultExpanded={false}
|
||||||
</View>
|
>
|
||||||
<Text style={styles.patternTitle}>{sectionTitle}</Text>
|
{sectionContent.length > 0 ? (
|
||||||
</View>
|
<Paragraphs items={sectionContent} />
|
||||||
|
) : null}
|
||||||
{sectionContent.length > 0 ? (
|
</SectionCard>
|
||||||
<View style={styles.patternBody}>
|
);
|
||||||
{sectionContent.map((text, cIdx) => (
|
})}
|
||||||
<Text key={cIdx} style={styles.contentText}>
|
|
||||||
{text}
|
|
||||||
</Text>
|
|
||||||
))}
|
|
||||||
</View>
|
|
||||||
) : null}
|
|
||||||
</View>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</View>
|
|
||||||
) : null}
|
|
||||||
|
|
||||||
<ContentLinkAttributeSections
|
<ContentLinkAttributeSections
|
||||||
data={data}
|
data={data}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue