@poolse/react-native 2.0.6 → 2.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +17 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +18 -13
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -511,18 +511,16 @@ function MemberList({
|
|
|
511
511
|
style: { backgroundColor: theme.colors.paper },
|
|
512
512
|
renderItem: ({ item }) => {
|
|
513
513
|
if (renderItem) return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: renderItem(item) });
|
|
514
|
-
const name = labelFor?.(item.external_id) ?? item.external_id;
|
|
515
|
-
const avatarUrl = avatarFor?.(item.external_id) ?? null;
|
|
516
514
|
const isOnline = effectiveOnline.has(item.external_id);
|
|
517
515
|
const showRemove = canRemove?.(item) ?? false;
|
|
518
516
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
519
517
|
MemberRow,
|
|
520
518
|
{
|
|
521
|
-
name,
|
|
522
519
|
externalId: item.external_id,
|
|
523
|
-
avatarUrl,
|
|
524
520
|
role: item.role,
|
|
525
521
|
online: isOnline,
|
|
522
|
+
...labelFor ? { labelFor } : {},
|
|
523
|
+
...avatarFor ? { avatarFor } : {},
|
|
526
524
|
...showRemove ? { onRemove: () => removeMember(item.external_id) } : {}
|
|
527
525
|
}
|
|
528
526
|
);
|
|
@@ -531,14 +529,17 @@ function MemberList({
|
|
|
531
529
|
);
|
|
532
530
|
}
|
|
533
531
|
function MemberRow({
|
|
534
|
-
name,
|
|
535
532
|
externalId,
|
|
536
|
-
avatarUrl,
|
|
537
533
|
role,
|
|
538
534
|
online,
|
|
535
|
+
labelFor,
|
|
536
|
+
avatarFor,
|
|
539
537
|
onRemove
|
|
540
538
|
}) {
|
|
541
539
|
const theme = usePoolseTheme();
|
|
540
|
+
const resolved = react$1.useUser(externalId);
|
|
541
|
+
const name = labelFor?.(externalId) ?? resolved.profile?.displayName ?? externalId;
|
|
542
|
+
const avatarUrl = avatarFor?.(externalId) ?? resolved.profile?.avatarUrl ?? null;
|
|
542
543
|
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles2.row, children: [
|
|
543
544
|
/* @__PURE__ */ jsxRuntime.jsx(Avatar, { src: avatarUrl, name, seed: externalId, online, size: "md" }),
|
|
544
545
|
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles2.body, children: [
|
|
@@ -1557,7 +1558,8 @@ function ReplyChip({
|
|
|
1557
1558
|
onCancel
|
|
1558
1559
|
}) {
|
|
1559
1560
|
const theme = usePoolseTheme();
|
|
1560
|
-
const
|
|
1561
|
+
const resolved = react$1.useUser(message.sender_external_id);
|
|
1562
|
+
const senderName = message.sender_external_id ? labelFor?.(message.sender_external_id) ?? resolved.profile?.displayName ?? message.sender_external_id : "Unknown";
|
|
1561
1563
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1562
1564
|
reactNative.View,
|
|
1563
1565
|
{
|
|
@@ -2522,7 +2524,8 @@ function QuotedCard({
|
|
|
2522
2524
|
onPress
|
|
2523
2525
|
}) {
|
|
2524
2526
|
const theme = usePoolseTheme();
|
|
2525
|
-
const
|
|
2527
|
+
const resolved = react$1.useUser(quoted.sender_external_id);
|
|
2528
|
+
const senderName = quoted.sender_external_id ? labelFor?.(quoted.sender_external_id) ?? resolved.profile?.displayName ?? quoted.sender_external_id : "Unknown";
|
|
2526
2529
|
const bg = isSelf ? "rgba(255,255,255,0.18)" : theme.colors.surface2;
|
|
2527
2530
|
const accent = isSelf ? theme.colors.onBrand : theme.colors.brand;
|
|
2528
2531
|
const txt = isSelf ? theme.colors.onBrand : theme.colors.ink;
|
|
@@ -2872,8 +2875,9 @@ function MessageRow({
|
|
|
2872
2875
|
});
|
|
2873
2876
|
const showAvatarSlot = showAvatar && !isSelf;
|
|
2874
2877
|
const showAvatarRender = showAvatarSlot && (groupPosition === "last" || groupPosition === "standalone");
|
|
2875
|
-
const
|
|
2876
|
-
const
|
|
2878
|
+
const rowSender = react$1.useUser(showAvatarSlot ? msg.sender_external_id : null);
|
|
2879
|
+
const avatarUrl = msg.sender_external_id ? avatarFor?.(msg.sender_external_id) ?? rowSender.profile?.avatarUrl ?? null : null;
|
|
2880
|
+
const senderLabel = msg.sender_external_id ? labelFor?.(msg.sender_external_id) ?? rowSender.profile?.displayName ?? msg.sender_external_id : null;
|
|
2877
2881
|
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles17.row, { alignSelf: isSelf ? "flex-end" : "flex-start" }], children: [
|
|
2878
2882
|
showAvatarSlot ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles17.avatarSlot, children: showAvatarRender ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2879
2883
|
Avatar,
|
|
@@ -4266,8 +4270,9 @@ function DefaultConversationRow({
|
|
|
4266
4270
|
const theme = usePoolseTheme();
|
|
4267
4271
|
const isDirect = conv.type === "direct";
|
|
4268
4272
|
const otherExtId = isDirect && meExternalId ? (conv.member_external_ids ?? []).find((x) => x !== meExternalId) : null;
|
|
4269
|
-
const
|
|
4270
|
-
const
|
|
4273
|
+
const resolvedOther = react$1.useUser(isDirect ? otherExtId ?? null : null);
|
|
4274
|
+
const title = isDirect ? otherExtId ? labelFor?.(otherExtId) ?? resolvedOther.profile?.displayName ?? otherExtId : "Direct chat" : conv.name ?? "Untitled group";
|
|
4275
|
+
const avatarUrl = isDirect && otherExtId ? avatarFor?.(otherExtId) ?? resolvedOther.profile?.avatarUrl ?? null : null;
|
|
4271
4276
|
const avatarSeed = isDirect ? otherExtId ?? conv.id : conv.id;
|
|
4272
4277
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4273
4278
|
reactNative.Pressable,
|