feat(mobile): display subtitle in module catalog and detail renderers

This commit is contained in:
ShivaniKhaire 2026-10-20 12:14:52 +05:30
parent abcb9823c2
commit f47f9cc710
2 changed files with 22 additions and 2 deletions

View File

@ -22,7 +22,15 @@ export function ModuleCatalogCardRenderer({
}: CollectionItemRendererProps) {
const attributes = item.attributes;
const title = asString(attributes.name) || item.title;
const label = asString(attributes.content_label) || item.summary || null;
const label =
asString(attributes.sub_title) ||
asString(attributes.content_label) ||
(asString(attributes.title) && asString(attributes.title) !== title
? asString(attributes.title)
: null) ||
asString(attributes.description) ||
item.summary ||
null;
return (
<Pressable

View File

@ -6,4 +6,16 @@ import { asString } from "../helpers/value";
import { Hero } from "../shared/Hero"; import { ImageGallery } from "../shared/ImageGallery";
import { KeyValueGrid } from "../shared/KeyValueGrid";
import { SectionCard } from "../shared/SectionCard";
export function IndexEntryDetailRenderer({content,data,definitions,presentationAttributes}:DetailRendererProps){ return <ScrollView contentContainerStyle={{paddingHorizontal:18,paddingTop:16,paddingBottom:40,gap:14}}><Hero title={content.title}/><ImageGallery images={[]}/><SectionCard title="Details"><KeyValueGrid rows={Object.entries(data).filter(([,v])=>typeof v==="string"||typeof v==="number").map(([k,v])=>({label:k,value:String(v)}))}/></SectionCard><ContentLinkAttributeSections data={data} definitions={definitions} presentationAttributes={presentationAttributes}/></ScrollView>; }
export function IndexEntryDetailRenderer({content,data,definitions,presentationAttributes}:DetailRendererProps){
const subtitle = asString(data.sub_title) || asString(data.subtitle) || undefined;
return (
<ScrollView contentContainerStyle={{paddingHorizontal:18,paddingTop:16,paddingBottom:40,gap:14}}>
<Hero title={content.title} subtitle={subtitle}/>
<ImageGallery images={[]}/>
<SectionCard title="Details">
<KeyValueGrid rows={Object.entries(data).filter(([,v])=>typeof v==="string"||typeof v==="number").map(([k,v])=>({label:k,value:String(v)}))}/>
</SectionCard>
<ContentLinkAttributeSections data={data} definitions={definitions} presentationAttributes={presentationAttributes}/>
</ScrollView>
);
}