FEAT: Sidebar update to include followed streamers & categories;
FEAT: Sidebar now alters page width on open/close (DynamicPageContent); FIX: Properly disallow shortcut keys when typing in an input field;
This commit is contained in:
30
frontend/src/components/Layout/DynamicPageContent.tsx
Normal file
30
frontend/src/components/Layout/DynamicPageContent.tsx
Normal file
@@ -0,0 +1,30 @@
|
||||
import React from "react";
|
||||
import Navbar from "../Navigation/Navbar";
|
||||
import { useSidebar } from "../../context/SidebarContext";
|
||||
|
||||
interface DynamicPageContentProps {
|
||||
children: React.ReactNode;
|
||||
navbarVariant?: "home" | "default";
|
||||
className?: string;
|
||||
style?: React.CSSProperties;
|
||||
}
|
||||
|
||||
const DynamicPageContent: React.FC<DynamicPageContentProps> = ({
|
||||
children,
|
||||
navbarVariant = "default",
|
||||
className = "",
|
||||
style
|
||||
}) => {
|
||||
const { showSideBar } = useSidebar();
|
||||
|
||||
return (
|
||||
<div className={className} style={style}>
|
||||
<Navbar variant={navbarVariant} />
|
||||
<div id="content" className={`${showSideBar ? "w-[85vw] translate-x-[15vw]" : "w-[100vw]"} transition-all duration-[500ms] ease-in-out`}>
|
||||
{children}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default DynamicPageContent;
|
||||
@@ -44,7 +44,7 @@ const ListRow: React.FC<ListRowProps> = ({
|
||||
|
||||
return (
|
||||
<div
|
||||
className={`flex flex-col space-y-4 py-6 bg-black/50 text-white px-5 mx-2 mt-5 rounded-[1.5rem] ${extraClasses}`}
|
||||
className={`flex flex-col w-full space-y-4 py-6 bg-black/50 text-white px-5 mx-2 mt-5 rounded-[1.5rem] transition-all ${extraClasses}`}
|
||||
>
|
||||
<div className="space-y-1">
|
||||
<h2 className="text-2xl font-bold">{title}</h2>
|
||||
|
||||
Reference in New Issue
Block a user