Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
"react-router": "^7.10.1",
"react-router-dom": "^7.10.1",
"react-scan": "^0.4.3",
"react-virtuoso": "^4.18.3",
"rehype-raw": "^7.0.0",
"remark-gfm": "^4.0.1",
"sonner": "^2.0.3",
Expand Down
2 changes: 2 additions & 0 deletions apps/web/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import WorkspaceList from "@pages/settings/Workspaces/WorkspaceList"
import { SearchLayout } from "@components/layout/SearchLayout"
import CustomEmojiList from "@pages/settings/CustomEmojiList/CustomEmojiList"
import { ManageChannels } from "@pages/settings/Channels/ManageChannels"
import { Toaster } from "@components/ui/sonner"

const isDesktop = window.innerWidth > 768

Expand Down Expand Up @@ -88,6 +89,7 @@ function App() {
</Route>
</Route>
</Routes>
<Toaster richColors />
</BrowserRouter>
</FrappeProvider>
)
Expand Down
68 changes: 34 additions & 34 deletions apps/web/src/components/app-sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as React from "react"
import { Label } from "@components/ui/label"
import {
SidebarContent,
Expand All @@ -14,9 +13,10 @@ import { ChannelListItem } from "@raven/types/common/ChannelListItem"
import { useActiveWorkspace } from "../contexts/ActiveWorkspaceContext"
import { SidebarShell } from "@components/layout/SidebarShell"
import _ from "@lib/translate"
import { useState } from "react"

export function AppSidebar(props: React.ComponentProps<typeof SidebarShell>) {
const [activeChannel, setActiveChannel] = React.useState<{ id: string; name: string; type: string; unread: number } | null>(null)
const [activeChannel, setActiveChannel] = useState<{ id: string; name: string; type: string; unread: number } | null>(null)
const navigate = useNavigate()
const location = useLocation()
const { activeWorkspaceName } = useActiveWorkspace()
Expand All @@ -43,40 +43,40 @@ export function AppSidebar(props: React.ComponentProps<typeof SidebarShell>) {
return (
<SidebarShell collapsible="icon" className="overflow-hidden h-full" {...props}>
<div className="flex-1 flex flex-col overflow-hidden">
{location.pathname === "/threads" || location.pathname === "/notifications" ? null : location.pathname.startsWith("/dm-channel") || activeWorkspaceName === "Direct Messages" ? (
<DMSidebar
workspaceName="Direct Messages"
activeDMChannelId={null}
onDMClick={(dmChannelId) =>
navigate(`/dm-channel/${encodeURIComponent(dmChannelId)}`)
}
/>
) : (
<>
<SidebarHeader className="h-[36px] gap-2 px-3 border-b flex items-center">
<div className="flex items-center justify-between w-full">
<div className="text-sm font-medium text-foreground truncate">
{activeWorkspaceName}
{location.pathname === "/threads" || location.pathname === "/notifications" ? null : location.pathname.startsWith("/dm-channel") || activeWorkspaceName === "Direct Messages" ? (
<DMSidebar
workspaceName="Direct Messages"
activeDMChannelId={null}
onDMClick={(dmChannelId) =>
navigate(`/dm-channel/${encodeURIComponent(dmChannelId)}`)
}
/>
) : (
<>
<SidebarHeader className="h-[36px] gap-2 px-3 border-b flex items-center">
<div className="flex items-center justify-between w-full">
<div className="text-sm font-medium text-foreground truncate">
{activeWorkspaceName}
</div>
<Label className="flex items-center gap-2 text-[12px]">
<span>{_("Unreads")}</span>
<Switch className="shadow-none" />
</Label>
</div>
<Label className="flex items-center gap-2 text-[12px]">
<span>{_("Unreads")}</span>
<Switch className="shadow-none" />
</Label>
</div>
</SidebarHeader>
</SidebarHeader>

<SidebarContent>
<SidebarGroup className="p-0">
<SidebarGroupContent>
<ChannelSidebar
activeChannelId={activeChannel?.name}
onChannelClick={handleChannelClick}
/>
</SidebarGroupContent>
</SidebarGroup>
</SidebarContent>
</>
)}
<SidebarContent className="overflow-hidden">
<SidebarGroup className="p-0 flex-1 min-h-0">
<SidebarGroupContent className="flex-1 min-h-0 flex flex-col">
<ChannelSidebar
activeChannelId={activeChannel?.name}
onChannelClick={handleChannelClick}
/>
</SidebarGroupContent>
</SidebarGroup>
</SidebarContent>
</>
)}
</div>
</SidebarShell>
)
Expand Down
Loading
Loading