tangled
alpha
login
or
join now
stream.place
/
streamplace
Live video on the AT Protocol
74
fork
atom
overview
issues
1
pulls
pipelines
Show login prompt if user is not authenticated
Natalie B.
7 months ago
bcdf61c8
a4669121
+12
1 changed file
expand all
collapse all
unified
split
js
components
src
components
chat
chat-box.tsx
+12
js/components/src/components/chat/chat-box.tsx
···
5
5
import {
6
6
Button,
7
7
Loader,
8
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
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
41
+
42
42
+
// are we logged in?
43
43
+
44
44
+
let agent = usePDSAgent();
45
45
+
46
46
+
if (!agent?.did) {
47
47
+
<View style={[layout.flex.row, layout.flex.alignCenter, gap.all[2]]}>
48
48
+
<Text>Log in to chat.</Text>
49
49
+
</View>;
50
50
+
}
39
51
40
52
const authors = useMemo(() => {
41
53
if (!chat) return null;