-
setJoinGuildNodeId(e.target.value)} placeholder="Guild nodeId" />
-
+
+
+
+
+
+
+
+ {currentChannel ? (
+
+ #
+ {currentChannel.name}
+
+ ) : (
+ Select a channel
+ )}
+
+
+
+
+
+ {loading ?
Loading…
: null}
+ {!loading && !messages.length ? (
+
+ {currentChannel ? `This is the start of #${currentChannel.name}` : 'No channel selected'}
+
+ ) : null}
+ {messages.map((m) => (
+
+
{initials(authorLabel(m.authorUserId))}
+
+
+ {authorLabel(m.authorUserId)}
+ {timeOf(m.createdAt)} · #{m.seq}
+
+
{m.content}
+
+
+ ))}
-
-
Channels
-
-
-
-
- {channels.map((c) => (
- -
-
-
- ))}
-
-
-
-
-
-
Messages
- {loading ?
Loading...
: null}
-
- {messages.map((m) => (
- -
-
- #{m.seq} {m.content}
-
-
- ))}
-
-
-
- setContent(e.target.value)} placeholder="Type a message" />
-
-
-
-
-
-
Members
-
- {members.map((m) => (
- -
-
- {m.name || m.email}
- {m.userId === session?.user.id ? ' (you)' : ''}
-
-
- ))}
-
-
-
-
-
-
-
-
-
-
-
+
setContent(e.target.value)}
+ placeholder={currentChannel ? `Message #${currentChannel.name}` : 'Select a channel first'}
+ disabled={!currentChannel}
+ />
+
+
+
+
+ {showMembers ? (
+
+ ) : null}
+
+ {showAddGuildModal ? (
+
setShowAddGuildModal(false)}>
+
e.stopPropagation()}>
+
Add guild
+
Enter the guild node id to join.
+
setJoinGuildNodeId(e.target.value)}
+ placeholder="e.g. test-guild1"
+ />
+
+
+
+
+
+
+ ) : null}
{showCreateChannelModal ? (
setShowCreateChannelModal(false)}>
e.stopPropagation()}>
Create channel
-
setNewChannelName(e.target.value)} placeholder="Channel name" />
-