Points #78

Merged
amit merged 8 commits from Points into main 2026-10-26 02:19:52 +00:00
3 changed files with 28 additions and 6 deletions
Showing only changes of commit da7e3e0bea - Show all commits

View File

@ -36,7 +36,7 @@ export const DivergentChannel = ({ data }: { data: Record<string, unknown> }) =>
export const LuoChannel = ({ data }: { data: Record<string, unknown> }) => ( export const LuoChannel = ({ data }: { data: Record<string, unknown> }) => (
<SectionCard title="Luo-Connecting Channel"> <SectionCard title="Luo-Connecting Channel">
<BulletList items={asStringArray(data.luo_connecting_channel)} /> <BulletList items={asStringArray(data.luo_connecting_channel)} />
<ObjectSections value={asRecord(data.luo_connecting_vessel)} /> <ObjectSections value={asRecord(data.luo_connecting_vessel)} withTopDivider />
</SectionCard> </SectionCard>
); );

View File

@ -145,7 +145,10 @@ export function MeridianDetailRenderer({
<> <>
<BulletList items={asStringArray(value)} /> <BulletList items={asStringArray(value)} />
{isPresent(data.luo_connecting_vessel) ? ( {isPresent(data.luo_connecting_vessel) ? (
<ObjectSections value={asRecord(data.luo_connecting_vessel)} /> <ObjectSections
value={asRecord(data.luo_connecting_vessel)}
withTopDivider
/>
) : null} ) : null}
</> </>
); );

View File

@ -9,7 +9,13 @@ import { ContentValue } from "./ContentValue";
* content references. ContentValue recursively handles arrays, objects and * content references. ContentValue recursively handles arrays, objects and
* hydrated content/template references. * hydrated content/template references.
*/ */
export function ObjectSections({ value }: { value: Record<string, unknown> }) { export function ObjectSections({
value,
withTopDivider = false,
}: {
value: Record<string, unknown>;
withTopDivider?: boolean;
}) {
const entries = Object.entries(value).filter(([, child]) => const entries = Object.entries(value).filter(([, child]) =>
isPresent(child), isPresent(child),
); );
@ -18,8 +24,14 @@ export function ObjectSections({ value }: { value: Record<string, unknown> }) {
return ( return (
<View style={styles.root}> <View style={styles.root}>
{entries.map(([key, child]) => ( {entries.map(([key, child], index) => (
<View key={key} style={styles.section}> <View
key={key}
style={[
styles.section,
(index > 0 || withTopDivider) && styles.divider,
]}
>
<Text style={styles.label}>{humanizeKey(key)}</Text> <Text style={styles.label}>{humanizeKey(key)}</Text>
<ContentValue value={child} /> <ContentValue value={child} />
</View> </View>
@ -39,7 +51,14 @@ function isPresent(value: unknown): boolean {
const styles = StyleSheet.create({ const styles = StyleSheet.create({
root: { gap: 16 }, root: { gap: 16 },
section: { gap: 7 }, section: {
gap: 7,
},
divider: {
paddingTop: 12,
borderTopWidth: StyleSheet.hairlineWidth,
borderTopColor: "#E8ECEF",
},
label: { label: {
fontWeight: "700", fontWeight: "700",
fontSize: 13, fontSize: 13,