Fix extra points UI #66

Merged
amit merged 1 commits from fix/extra-point-card-ui into main 2026-10-14 09:14:33 +00:00
1 changed files with 11 additions and 12 deletions
Showing only changes of commit aee5aacec0 - Show all commits

View File

@ -1,8 +1,6 @@
import React from "react"; import React from "react";
import { Pressable, Text, View } from "react-native"; import { asString } from "../helpers/value";
import { asString, asStringArray } from "../helpers/value";
import { CollectionScaffold } from "../shared/CollectionScaffold"; import { CollectionScaffold } from "../shared/CollectionScaffold";
import { ChipList } from "../shared/ChipList";
import { StandardIndexCard } from "../shared/StandardIndexCard"; import { StandardIndexCard } from "../shared/StandardIndexCard";
import type { CollectionItemRendererProps, CollectionRendererProps } from "../../types/renderer.types"; import type { CollectionItemRendererProps, CollectionRendererProps } from "../../types/renderer.types";
@ -25,15 +23,16 @@ export function AcuPointIndexCardRenderer({ item, onPress }: CollectionItemRende
} }
export function AcuPointCardRenderer({ item, onPress }: CollectionItemRendererProps) { export function AcuPointCardRenderer({ item, onPress }: CollectionItemRendererProps) {
const a = item.attributes; const a = item.attributes;
const subtitle =
asString(a.pt_meaning) ||
asString(a.channel) ||
[asString(a.alt_name_1), asString(a.alt_name_2)].filter(Boolean).join(" · ");
return ( return (
<Pressable onPress={onPress}> <StandardIndexCard
<View style={{ padding: 14, gap: 7 }}> title={asString(a.point_name) || asString(a.name) || item.title}
<View style={{ flexDirection: "row", gap: 10 }}> subtitle={subtitle || null}
<Text style={{ flex: 1, fontSize: 17, fontWeight: "600" }}>{asString(a.point_name) || asString(a.name) || item.title}</Text> onPress={onPress}
</View> />
<Text>{asString(a.channel)}</Text>
<ChipList items={asStringArray(a.point_type).slice(0, 3)} />
</View>
</Pressable>
); );
} }