fix(ui): use StandardIndexCard in AcuPointCardRenderer for colorful badges and chevrons
This commit is contained in:
parent
b93b8f672f
commit
aee5aacec0
|
|
@ -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}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue