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
import {
6
Button,
7
Loader,
0
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";
0
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);
0
0
0
0
0
0
0
0
0
0
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;