Live video on the AT Protocol

Show login prompt if user is not authenticated

+12
+12
js/components/src/components/chat/chat-box.tsx
··· 5 5 import { 6 6 Button, 7 7 Loader, 8 + Text, 8 9 useChat, 9 10 useCreateChatMessage, 10 11 useReplyToMessage, ··· 12 13 View, 13 14 } from "../../"; 14 15 import { bg, flex, gap, h, layout, mb, pl, pr, w } from "../../lib/theme/atoms"; 16 + import { usePDSAgent } from "../../streamplace-store/xrpc"; 15 17 import { Textarea } from "../ui/textarea"; 16 18 import { RenderChatMessage } from "./chat-message"; 17 19 import { MentionSuggestions } from "./mention-suggestions"; ··· 36 38 const replyTo = useReplyToMessage(); 37 39 const setReplyToMessage = useSetReplyToMessage(); 38 40 const textAreaRef = useRef<TextInput>(null); 41 + 42 + // are we logged in? 43 + 44 + let agent = usePDSAgent(); 45 + 46 + if (!agent?.did) { 47 + <View style={[layout.flex.row, layout.flex.alignCenter, gap.all[2]]}> 48 + <Text>Log in to chat.</Text> 49 + </View>; 50 + } 39 51 40 52 const authors = useMemo(() => { 41 53 if (!chat) return null;