Live video on the AT Protocol

move useLivestreamStore up the stack as it crashes in mobile

+23 -4
+13 -2
js/components/src/components/chat/chat-message.tsx
··· 173 173 author={item.author} 174 174 badges={item.badges} 175 175 > 176 - <Text> 176 + <View 177 + style={ 178 + { 179 + // display: inline is a no-op on mobile 180 + display: "inline", 181 + alignItems: "center", 182 + justifyContent: "flex-end", 183 + flexDirection: "row", 184 + marginBottom: -6.25, 185 + } as any 186 + } 187 + > 177 188 <BadgeDisplayRow badges={item.badges} /> 178 189 <Text 179 190 weight="bold" ··· 184 195 > 185 196 {formatHandleWithAt(item.author)} 186 197 </Text> 187 - </Text> 198 + </View> 188 199 </UserProfileCard> 189 200 <Text weight="bold" color="default"> 190 201 {": "}
+10 -2
js/components/src/components/chat/user-profile-card.tsx
··· 70 70 }; 71 71 72 72 const BadgeRow = ({ 73 + streamer, 73 74 badge, 74 75 serviceDid, 75 76 }: { 76 77 badge: NonNullable<ChatMessageViewHydrated["badges"]>[number]; 77 78 serviceDid: string; 79 + streamer?: ProfileViewBasic; 78 80 }) => { 79 - const streamer = useLivestreamStore((x) => x.livestream?.author); 80 81 const isServiceIssued = badge.issuer === serviceDid; 81 82 const issuerDids = useMemo( 82 83 () => (isServiceIssued ? [] : [badge.issuer]), ··· 140 141 const serviceDid = nodeUrl 141 142 ? `did:web:${nodeUrl.replace(/^https?:\/\//, "")}` 142 143 : null; 144 + 145 + const streamer = useLivestreamStore((x) => x.livestream?.author); 143 146 144 147 const { openUri, setOpenUri } = useContext(OpenCardContext); 145 148 const isOpen = openUri === uri; ··· 264 267 }} 265 268 > 266 269 {serviceBadges.map((badge, i) => ( 267 - <BadgeRow key={i} badge={badge} serviceDid={serviceDid} /> 270 + <BadgeRow 271 + key={i} 272 + badge={badge} 273 + serviceDid={serviceDid} 274 + streamer={streamer} 275 + /> 268 276 ))} 269 277 </View> 270 278 ) : null}