Add pin message

This commit is contained in:
TeamAbron
2025-01-18 15:06:06 +03:30
parent c1771da8cc
commit e3f5a01f2e
10 changed files with 896 additions and 163 deletions

View File

@@ -26,6 +26,7 @@ import { PageHeader } from "../../components/ui/Header";
import { useClient } from "../../controllers/client/ClientController";
import ChannelHeader from "./ChannelHeader";
import { MessageArea } from "./messaging/MessageArea";
import PinnedMessage from "../../components/common/messaging/bars/PinnedMessage";
const ChannelMain = styled.div.attrs({ "data-component": "channel" })`
flex-grow: 1;
@@ -99,7 +100,7 @@ export const Channel = observer(
const client = useClient();
const state = useApplicationState();
if (!client.channels.exists(id) && client.servers.get(server_id)) {
if (!client.channels.exists(id) && server_id) {
if (server_id) {
const server = client.servers.get(server_id);
if (server && server.channel_ids.length > 0) {
@@ -110,7 +111,7 @@ export const Channel = observer(
target_id = last_id;
}
}
return (
<Redirect
to={`/server/${server_id}/channel/${target_id}`}
@@ -188,6 +189,7 @@ const TextChannel = observer(({ channel }: { channel: ChannelI }) => {
<ErrorBoundary section="renderer">
<ChannelContent>
<NewMessages channel={channel} last_id={lastId} />
<PinnedMessage channel={channel} />
<MessageArea channel={channel} last_id={lastId} />
<TypingIndicator channel={channel} />
<JumpToBottom channel={channel} />