@poolse/react-native 2.0.6 → 2.0.7
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 +13 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +14 -11
- 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: [
|
|
@@ -2872,8 +2873,9 @@ function MessageRow({
|
|
|
2872
2873
|
});
|
|
2873
2874
|
const showAvatarSlot = showAvatar && !isSelf;
|
|
2874
2875
|
const showAvatarRender = showAvatarSlot && (groupPosition === "last" || groupPosition === "standalone");
|
|
2875
|
-
const
|
|
2876
|
-
const
|
|
2876
|
+
const rowSender = react$1.useUser(showAvatarSlot ? msg.sender_external_id : null);
|
|
2877
|
+
const avatarUrl = msg.sender_external_id ? avatarFor?.(msg.sender_external_id) ?? rowSender.profile?.avatarUrl ?? null : null;
|
|
2878
|
+
const senderLabel = msg.sender_external_id ? labelFor?.(msg.sender_external_id) ?? rowSender.profile?.displayName ?? msg.sender_external_id : null;
|
|
2877
2879
|
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles17.row, { alignSelf: isSelf ? "flex-end" : "flex-start" }], children: [
|
|
2878
2880
|
showAvatarSlot ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles17.avatarSlot, children: showAvatarRender ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2879
2881
|
Avatar,
|
|
@@ -4266,8 +4268,9 @@ function DefaultConversationRow({
|
|
|
4266
4268
|
const theme = usePoolseTheme();
|
|
4267
4269
|
const isDirect = conv.type === "direct";
|
|
4268
4270
|
const otherExtId = isDirect && meExternalId ? (conv.member_external_ids ?? []).find((x) => x !== meExternalId) : null;
|
|
4269
|
-
const
|
|
4270
|
-
const
|
|
4271
|
+
const resolvedOther = react$1.useUser(isDirect ? otherExtId ?? null : null);
|
|
4272
|
+
const title = isDirect ? otherExtId ? labelFor?.(otherExtId) ?? resolvedOther.profile?.displayName ?? otherExtId : "Direct chat" : conv.name ?? "Untitled group";
|
|
4273
|
+
const avatarUrl = isDirect && otherExtId ? avatarFor?.(otherExtId) ?? resolvedOther.profile?.avatarUrl ?? null : null;
|
|
4271
4274
|
const avatarSeed = isDirect ? otherExtId ?? conv.id : conv.id;
|
|
4272
4275
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4273
4276
|
reactNative.Pressable,
|