mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-25 00:36:31 +02:00
feat: refactor announcements page and layout to support sidebar slide-out functionality
- Replaced the existing announcement card and empty state components with imports from the new announcements directory. - Introduced state management for the announcements sidebar in the LayoutDataProvider. - Updated navigation items to handle announcements sidebar toggling. - Integrated AnnouncementsSidebar into the LayoutShell for both mobile and desktop views. - Enhanced sidebar handling to improve user experience when navigating announcements.
This commit is contained in:
parent
9ea9538e95
commit
e157ac9985
7 changed files with 283 additions and 152 deletions
|
|
@ -13,6 +13,7 @@ import { IconRail } from "../icon-rail";
|
|||
import {
|
||||
AllPrivateChatsSidebar,
|
||||
AllSharedChatsSidebar,
|
||||
AnnouncementsSidebar,
|
||||
InboxSidebar,
|
||||
MobileSidebar,
|
||||
MobileSidebarTrigger,
|
||||
|
|
@ -82,6 +83,10 @@ interface LayoutShellProps {
|
|||
className?: string;
|
||||
// Inbox props
|
||||
inbox?: InboxProps;
|
||||
announcementsPanel?: {
|
||||
open: boolean;
|
||||
onOpenChange: (open: boolean) => void;
|
||||
};
|
||||
isLoadingChats?: boolean;
|
||||
// All chats panel props
|
||||
allSharedChatsPanel?: {
|
||||
|
|
@ -130,6 +135,7 @@ export function LayoutShell({
|
|||
children,
|
||||
className,
|
||||
inbox,
|
||||
announcementsPanel,
|
||||
isLoadingChats = false,
|
||||
allSharedChatsPanel,
|
||||
allPrivateChatsPanel,
|
||||
|
|
@ -211,6 +217,15 @@ export function LayoutShell({
|
|||
/>
|
||||
)}
|
||||
|
||||
{/* Mobile Announcements Sidebar - only render when open to avoid scroll blocking */}
|
||||
{announcementsPanel?.open && (
|
||||
<AnnouncementsSidebar
|
||||
open={announcementsPanel.open}
|
||||
onOpenChange={announcementsPanel.onOpenChange}
|
||||
onCloseMobileSidebar={() => setMobileMenuOpen(false)}
|
||||
/>
|
||||
)}
|
||||
|
||||
{/* Mobile All Shared Chats - slide-out panel */}
|
||||
{allSharedChatsPanel && (
|
||||
<AllSharedChatsSidebar
|
||||
|
|
@ -325,6 +340,14 @@ export function LayoutShell({
|
|||
/>
|
||||
)}
|
||||
|
||||
{/* Announcements Sidebar - positioned absolutely on top of content */}
|
||||
{announcementsPanel && (
|
||||
<AnnouncementsSidebar
|
||||
open={announcementsPanel.open}
|
||||
onOpenChange={announcementsPanel.onOpenChange}
|
||||
/>
|
||||
)}
|
||||
|
||||
{/* All Shared Chats - slide-out panel */}
|
||||
{allSharedChatsPanel && (
|
||||
<AllSharedChatsSidebar
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue