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 import { 6 Button, 7 Loader, 8 useChat, 9 useCreateChatMessage, 10 useReplyToMessage, ··· 12 View, 13 } from "../../"; 14 import { bg, flex, gap, h, layout, mb, pl, pr, w } from "../../lib/theme/atoms"; 15 import { Textarea } from "../ui/textarea"; 16 import { RenderChatMessage } from "./chat-message"; 17 import { MentionSuggestions } from "./mention-suggestions"; ··· 36 const replyTo = useReplyToMessage(); 37 const setReplyToMessage = useSetReplyToMessage(); 38 const textAreaRef = useRef<TextInput>(null); 39 40 const authors = useMemo(() => { 41 if (!chat) return null;
··· 5 import { 6 Button, 7 Loader, 8 + Text, 9 useChat, 10 useCreateChatMessage, 11 useReplyToMessage, ··· 13 View, 14 } from "../../"; 15 import { bg, flex, gap, h, layout, mb, pl, pr, w } from "../../lib/theme/atoms"; 16 + import { usePDSAgent } from "../../streamplace-store/xrpc"; 17 import { Textarea } from "../ui/textarea"; 18 import { RenderChatMessage } from "./chat-message"; 19 import { MentionSuggestions } from "./mention-suggestions"; ··· 38 const replyTo = useReplyToMessage(); 39 const setReplyToMessage = useSetReplyToMessage(); 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 + } 51 52 const authors = useMemo(() => { 53 if (!chat) return null;