forked from aws-samples/amplify-next-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: ui width in collaboration with sidebar in chatbot layout
- Loading branch information
Carsten Koch
committed
Dec 14, 2024
1 parent
bb4e6ad
commit eacea30
Showing
5 changed files
with
55 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { SidebarTrigger, useSidebar } from "@/components/ui/sidebar"; | ||
import { cn } from "@/lib/utils"; | ||
import { FC, ReactNode } from "react"; | ||
|
||
interface ConversationsPageContentProps { | ||
children?: ReactNode; | ||
} | ||
|
||
const ConversationsPageContent: FC<ConversationsPageContentProps> = ({ | ||
children, | ||
}) => { | ||
const { isMobile, open } = useSidebar(); | ||
|
||
return ( | ||
<div | ||
className={cn( | ||
"px-0 mx-0 flex flex-col items-center", | ||
isMobile || !open ? "w-full" : "w-[calc(100%-var(--sidebar-width))]" | ||
)} | ||
> | ||
<div className="w-full"> | ||
<header className="sticky left-2 top-12 md:top-16 py-1 z-40 bg-bgTransparent"> | ||
<SidebarTrigger /> | ||
</header> | ||
<div>{children}</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
export default ConversationsPageContent; |