From 11517b49b7ccac7d96095f3aa0bbce879a650fb1 Mon Sep 17 00:00:00 2001 From: Klesti Selimaj Date: Sat, 29 Aug 2026 14:00:23 +0200 Subject: [PATCH] Main page --- src/app/app.ts | 3 ++- src/components/page/MainPage.tsx | 7 +++++++ src/components/page/PageView.tsx | 9 +++++++-- src/components/view/Sidebar.tsx | 7 ++++++- 4 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 src/components/page/MainPage.tsx diff --git a/src/app/app.ts b/src/app/app.ts index c1f3a8b..e8a298b 100644 --- a/src/app/app.ts +++ b/src/app/app.ts @@ -263,7 +263,8 @@ export default class Enclave

{ const page = this.page as Page | undefined; - const isInvisibleChannel = page?.channel.id !== channelId; + const isInvisibleChannel = + page?.kind === "channel" && page?.channel.id !== channelId; return messages.map((message) => { if ( diff --git a/src/components/page/MainPage.tsx b/src/components/page/MainPage.tsx new file mode 100644 index 0000000..a896d07 --- /dev/null +++ b/src/components/page/MainPage.tsx @@ -0,0 +1,7 @@ +import Enclave from "@/app/app"; + +export default function MainPage({ + appRef, +}: { + appRef: React.RefObject; +}) {} diff --git a/src/components/page/PageView.tsx b/src/components/page/PageView.tsx index 7ba5401..1969aa6 100644 --- a/src/components/page/PageView.tsx +++ b/src/components/page/PageView.tsx @@ -1,6 +1,7 @@ import Enclave from "@/app/app"; import ChannelPage from "./channel/ChannelPage"; import { Channel } from "@/lib/types"; +import MainPage from "./MainPage"; export type ChannelPageProps = { kind: "channel"; @@ -14,10 +15,14 @@ export default function Page({ }: { appRef: React.RefObject; }) { - if (!appRef.current?.page?.kind) return null; + if (!appRef.current?.page?.kind) return ; switch (appRef.current?.page?.kind) { case "channel": - return ; + return ( + | null>} + /> + ); } } diff --git a/src/components/view/Sidebar.tsx b/src/components/view/Sidebar.tsx index 5aed5af..47cdbdb 100644 --- a/src/components/view/Sidebar.tsx +++ b/src/components/view/Sidebar.tsx @@ -115,6 +115,11 @@ export function RenderChannels({ appRef: React.RefObject; channels: Channel[]; }) { + const currentChannel = + appRef.current?.page?.kind === "channel" + ? appRef.current?.page?.channel + : undefined; + return channels.map((channel) => channel.kind === "category" ? ( @@ -123,7 +128,7 @@ export function RenderChannels({

{ if (!appRef.current) {