Merge pull request 'Fix extra points UI' (#66) from fix/extra-point-card-ui into main

Reviewed-on: https://10.10.0.4/AcuPedia/acupedia-mobile-ui/pulls/66
This commit is contained in:
Amit Salunke 2026-10-14 09:14:32 +00:00
commit be19a39127
1 changed files with 11 additions and 12 deletions

View File

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