feat(frontend): closed-channel read-only UI
Closed channels: composer replaced by a read-only banner; history still viewable; GuildChannel carries closed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -34,7 +34,7 @@ function timeOf(iso?: string): string {
|
||||
const X_TYPES = ['general', 'work', 'report', 'discuss', 'triage', 'custom'] as const
|
||||
type XType = (typeof X_TYPES)[number]
|
||||
|
||||
type GuildChannel = { id: string; name: string; guildId?: string; xType?: XType; isMember?: boolean; isPublic?: boolean }
|
||||
type GuildChannel = { id: string; name: string; guildId?: string; xType?: XType; isMember?: boolean; isPublic?: boolean; closed?: boolean }
|
||||
type MemberItem = { userId: string; email: string; name: string; status: string }
|
||||
|
||||
export default function ChatPage() {
|
||||
@@ -500,24 +500,28 @@ export default function ChatPage() {
|
||||
))}
|
||||
</div>
|
||||
|
||||
<form
|
||||
className="dc-composer"
|
||||
onSubmit={(e) => {
|
||||
e.preventDefault()
|
||||
void sendMessage()
|
||||
}}
|
||||
>
|
||||
<input
|
||||
className="input"
|
||||
value={content}
|
||||
onChange={(e) => setContent(e.target.value)}
|
||||
placeholder={currentChannel ? `Message #${currentChannel.name}` : 'Select a channel first'}
|
||||
disabled={!currentChannel}
|
||||
/>
|
||||
<button className="btn" type="submit" disabled={!currentChannel || !content.trim()}>
|
||||
Send
|
||||
</button>
|
||||
</form>
|
||||
{currentChannel?.closed ? (
|
||||
<div className="dc-closed-banner">This channel is closed — history is read-only.</div>
|
||||
) : (
|
||||
<form
|
||||
className="dc-composer"
|
||||
onSubmit={(e) => {
|
||||
e.preventDefault()
|
||||
void sendMessage()
|
||||
}}
|
||||
>
|
||||
<input
|
||||
className="input"
|
||||
value={content}
|
||||
onChange={(e) => setContent(e.target.value)}
|
||||
placeholder={currentChannel ? `Message #${currentChannel.name}` : 'Select a channel first'}
|
||||
disabled={!currentChannel}
|
||||
/>
|
||||
<button className="btn" type="submit" disabled={!currentChannel || !content.trim()}>
|
||||
Send
|
||||
</button>
|
||||
</form>
|
||||
)}
|
||||
</main>
|
||||
|
||||
{showMembers ? (
|
||||
|
||||
Reference in New Issue
Block a user