tangled
alpha
login
or
join now
stream.place
/
streamplace
77
fork
atom
Live video on the AT Protocol
77
fork
atom
overview
issues
1
pulls
pipelines
clean up
Natalie B.
3 weeks ago
1fe05f07
78fc519d
+15
-28
2 changed files
expand all
collapse all
unified
split
js
components
src
components
chat
badge.tsx
user-profile-card.tsx
+3
-3
js/components/src/components/chat/badge.tsx
···
14
14
badgeType: string;
15
15
size?: number;
16
16
}) => {
17
17
-
const source =
18
18
-
BADGE_IMAGES[badgeType] ?? BADGE_IMAGES["place.stream.badge.defs#vip"];
17
17
+
const source = BADGE_IMAGES[badgeType];
18
18
+
if (!source) return null;
19
19
return (
20
20
<Image
21
21
source={source}
···
38
38
return (
39
39
<>
40
40
{badges.map((badge, index) => (
41
41
-
<Badge key={`badge-${index}`} badgeType={badge.badgeType} />
41
41
+
<Badge key={index} badgeType={badge.badgeType} />
42
42
))}
43
43
</>
44
44
);
+12
-25
js/components/src/components/chat/user-profile-card.tsx
···
27
27
interface BadgeMeta {
28
28
label: string;
29
29
description: string;
30
30
-
issuedBy?: string; // Optional template for issuer display
30
30
+
issuedBy?: string;
31
31
}
32
32
33
33
const BADGE_META: Record<string, BadgeMeta> = {
···
76
76
badge: NonNullable<ChatMessageViewHydrated["badges"]>[number];
77
77
serviceDid: string;
78
78
}) => {
79
79
-
const { theme } = useTheme();
80
79
const streamer = useLivestreamStore((x) => x.livestream?.author);
81
80
const isServiceIssued = badge.issuer === serviceDid;
82
81
const issuerDids = useMemo(
···
93
92
: issuerProfiles[badge.issuer]?.handle
94
93
? `@${issuerProfiles[badge.issuer].handle}`
95
94
: badge.issuer;
96
96
-
console.log("meta", meta);
97
95
if (meta.issuedBy) {
98
98
-
console.log("issued by");
99
96
issuerLabel = meta.issuedBy
100
97
.replace("{issuer}", issuerLabel)
101
98
.replace(
···
179
176
onHoverOut: () => setHovered(false),
180
177
}
181
178
: {})}
182
182
-
style={
183
183
-
Platform.OS === "web" && hovered
184
184
-
? {
185
185
-
backgroundColor: "rgba(255,255,255,0.15)",
186
186
-
borderRadius: 6,
187
187
-
paddingHorizontal: 3,
188
188
-
flexDirection: "row",
189
189
-
gap: 4,
190
190
-
marginLeft: -3,
191
191
-
paddingLeft: 3,
192
192
-
marginRight: -2,
193
193
-
}
194
194
-
: {
195
195
-
paddingHorizontal: 3,
196
196
-
flexDirection: "row",
197
197
-
gap: 4,
198
198
-
marginLeft: -3,
199
199
-
paddingLeft: 3,
200
200
-
marginRight: -2,
201
201
-
}
202
202
-
}
179
179
+
style={{
180
180
+
paddingHorizontal: 3,
181
181
+
flexDirection: "row",
182
182
+
gap: 4,
183
183
+
marginLeft: -3,
184
184
+
paddingLeft: 3,
185
185
+
marginRight: -2,
186
186
+
...(Platform.OS === "web" && hovered
187
187
+
? { backgroundColor: "rgba(255,255,255,0.15)", borderRadius: 6 }
188
188
+
: {}),
189
189
+
}}
203
190
>
204
191
{children}
205
192
</Pressable>