mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
fix: show lock icon for private channels in chat header (#198)
This commit is contained in:
@@ -668,6 +668,7 @@ export function AppShell() {
|
||||
) : null
|
||||
}
|
||||
channelType={activeChannel?.channelType}
|
||||
visibility={activeChannel?.visibility}
|
||||
description={channelDescription}
|
||||
statusBadge={
|
||||
activeChannel?.channelType === "dm" &&
|
||||
|
||||
@@ -1,22 +1,33 @@
|
||||
import { Bot, CircleDot, FileText, Hash, Home, Settings2 } from "lucide-react";
|
||||
import {
|
||||
Bot,
|
||||
CircleDot,
|
||||
FileText,
|
||||
Hash,
|
||||
Home,
|
||||
Lock,
|
||||
Settings2,
|
||||
} from "lucide-react";
|
||||
import type * as React from "react";
|
||||
|
||||
import type { ChannelType } from "@/shared/api/types";
|
||||
import type { ChannelType, ChannelVisibility } from "@/shared/api/types";
|
||||
|
||||
type ChatHeaderProps = {
|
||||
actions?: React.ReactNode;
|
||||
title: string;
|
||||
description: string;
|
||||
channelType?: ChannelType;
|
||||
visibility?: ChannelVisibility;
|
||||
mode?: "home" | "channel" | "settings" | "agents";
|
||||
statusBadge?: React.ReactNode;
|
||||
};
|
||||
|
||||
function ChannelIcon({
|
||||
channelType,
|
||||
visibility,
|
||||
mode = "channel",
|
||||
}: {
|
||||
channelType?: ChannelType;
|
||||
visibility?: ChannelVisibility;
|
||||
mode?: "home" | "channel" | "settings" | "agents";
|
||||
}) {
|
||||
if (mode === "home") {
|
||||
@@ -35,6 +46,10 @@ function ChannelIcon({
|
||||
return <CircleDot className="h-5 w-5 text-primary" />;
|
||||
}
|
||||
|
||||
if (visibility === "private") {
|
||||
return <Lock className="h-5 w-5 text-primary" />;
|
||||
}
|
||||
|
||||
if (channelType === "forum") {
|
||||
return <FileText className="h-5 w-5 text-primary" />;
|
||||
}
|
||||
@@ -47,6 +62,7 @@ export function ChatHeader({
|
||||
title,
|
||||
description,
|
||||
channelType,
|
||||
visibility,
|
||||
mode = "channel",
|
||||
statusBadge,
|
||||
}: ChatHeaderProps) {
|
||||
@@ -58,7 +74,11 @@ export function ChatHeader({
|
||||
>
|
||||
<div className="min-w-0 flex-1">
|
||||
<div className="flex min-w-0 items-center gap-2">
|
||||
<ChannelIcon channelType={channelType} mode={mode} />
|
||||
<ChannelIcon
|
||||
channelType={channelType}
|
||||
mode={mode}
|
||||
visibility={visibility}
|
||||
/>
|
||||
<h1
|
||||
className="truncate text-lg font-semibold tracking-tight"
|
||||
data-testid="chat-title"
|
||||
|
||||
Reference in New Issue
Block a user