Fixed classes of sidebar to make it more like the main page
This commit is contained in:
parent
ee705b548f
commit
bb6578e0a5
5 changed files with 31 additions and 20 deletions
|
|
@ -17,7 +17,7 @@ const SideBarButtonsComponent = ({
|
||||||
pathname,
|
pathname,
|
||||||
}: SideBarButtonsComponentProps) => {
|
}: SideBarButtonsComponentProps) => {
|
||||||
return (
|
return (
|
||||||
<>
|
<div className="flex gap-2 overflow-auto lg:h-[70vh] lg:flex-col">
|
||||||
{items.map((item) => (
|
{items.map((item) => (
|
||||||
<Link to={item.href!}>
|
<Link to={item.href!}>
|
||||||
<div
|
<div
|
||||||
|
|
@ -28,15 +28,17 @@ const SideBarButtonsComponent = ({
|
||||||
pathname === item.href
|
pathname === item.href
|
||||||
? "border border-border bg-muted hover:bg-muted"
|
? "border border-border bg-muted hover:bg-muted"
|
||||||
: "border border-transparent hover:border-border hover:bg-transparent",
|
: "border border-transparent hover:border-border hover:bg-transparent",
|
||||||
"w-full justify-start gap-3",
|
"flex w-full shrink-0 justify-start gap-4",
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{item.icon}
|
{item.icon}
|
||||||
|
<span className="block max-w-full truncate opacity-100">
|
||||||
{item.title}
|
{item.title}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
))}
|
))}
|
||||||
</>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
export default SideBarButtonsComponent;
|
export default SideBarButtonsComponent;
|
||||||
|
|
|
||||||
|
|
@ -175,11 +175,11 @@ const SideBarFoldersButtonsComponent = ({
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}}
|
}}
|
||||||
className="flex w-full items-center gap-2"
|
className="flex w-full items-center gap-4"
|
||||||
>
|
>
|
||||||
<IconComponent
|
<IconComponent
|
||||||
name={"folder"}
|
name={"folder"}
|
||||||
className="mr-2 w-4 flex-shrink-0 justify-start stroke-[1.5] opacity-100"
|
className="w-4 flex-shrink-0 justify-start stroke-[1.5] opacity-100"
|
||||||
/>
|
/>
|
||||||
{editFolderName?.edit ? (
|
{editFolderName?.edit ? (
|
||||||
<div>
|
<div>
|
||||||
|
|
|
||||||
|
|
@ -41,9 +41,12 @@ export default function SidebarNav({
|
||||||
return (
|
return (
|
||||||
<nav className={cn(className)} {...props}>
|
<nav className={cn(className)} {...props}>
|
||||||
<HorizontalScrollFadeComponent>
|
<HorizontalScrollFadeComponent>
|
||||||
|
{items.length > 0 ? (
|
||||||
<SideBarButtonsComponent items={items} pathname={pathname} />
|
<SideBarButtonsComponent items={items} pathname={pathname} />
|
||||||
|
) : (
|
||||||
{!loadingFolders && folders?.length > 0 && isFolderPath && (
|
!loadingFolders &&
|
||||||
|
folders?.length > 0 &&
|
||||||
|
isFolderPath && (
|
||||||
<SideBarFoldersButtonsComponent
|
<SideBarFoldersButtonsComponent
|
||||||
folders={folders}
|
folders={folders}
|
||||||
pathname={pathname}
|
pathname={pathname}
|
||||||
|
|
@ -51,6 +54,7 @@ export default function SidebarNav({
|
||||||
handleEditFolder={handleEditFolder}
|
handleEditFolder={handleEditFolder}
|
||||||
handleDeleteFolder={handleDeleteFolder}
|
handleDeleteFolder={handleDeleteFolder}
|
||||||
/>
|
/>
|
||||||
|
)
|
||||||
)}
|
)}
|
||||||
</HorizontalScrollFadeComponent>
|
</HorizontalScrollFadeComponent>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ const buttonVariants = cva(
|
||||||
"border border-muted bg-muted text-secondary-foreground hover:bg-secondary-foreground/5",
|
"border border-muted bg-muted text-secondary-foreground hover:bg-secondary-foreground/5",
|
||||||
ghost: "hover:bg-accent hover:text-accent-foreground",
|
ghost: "hover:bg-accent hover:text-accent-foreground",
|
||||||
link: "underline-offset-4 hover:underline text-primary",
|
link: "underline-offset-4 hover:underline text-primary",
|
||||||
|
none: "",
|
||||||
},
|
},
|
||||||
size: {
|
size: {
|
||||||
default: "h-10 py-2 px-4",
|
default: "h-10 py-2 px-4",
|
||||||
|
|
@ -27,6 +28,7 @@ const buttonVariants = cva(
|
||||||
xs: "py-0.5 px-3 rounded-md",
|
xs: "py-0.5 px-3 rounded-md",
|
||||||
lg: "h-11 px-8 rounded-md",
|
lg: "h-11 px-8 rounded-md",
|
||||||
icon: "py-1 px-1 rounded-md",
|
icon: "py-1 px-1 rounded-md",
|
||||||
|
none: "",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
defaultVariants: {
|
defaultVariants: {
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ export default function SettingsPage(): JSX.Element {
|
||||||
icon: (
|
icon: (
|
||||||
<ForwardedIconComponent
|
<ForwardedIconComponent
|
||||||
name="SlidersHorizontal"
|
name="SlidersHorizontal"
|
||||||
className="mx-[0.08rem] w-[1.1rem] stroke-[1.5]"
|
className="w-4 flex-shrink-0 justify-start stroke-[1.5]"
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|
@ -32,7 +32,7 @@ export default function SettingsPage(): JSX.Element {
|
||||||
icon: (
|
icon: (
|
||||||
<ForwardedIconComponent
|
<ForwardedIconComponent
|
||||||
name="Globe"
|
name="Globe"
|
||||||
className="mx-[0.08rem] w-[1.1rem] stroke-[1.5]"
|
className="w-4 flex-shrink-0 justify-start stroke-[1.5]"
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|
@ -40,7 +40,10 @@ export default function SettingsPage(): JSX.Element {
|
||||||
title: "Shortcuts",
|
title: "Shortcuts",
|
||||||
href: "/settings/shortcuts",
|
href: "/settings/shortcuts",
|
||||||
icon: (
|
icon: (
|
||||||
<ForwardedIconComponent name="Keyboard" className="w-5 stroke-[1.5]" />
|
<ForwardedIconComponent
|
||||||
|
name="Keyboard"
|
||||||
|
className="w-4 flex-shrink-0 justify-start stroke-[1.5]"
|
||||||
|
/>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
@ -50,7 +53,7 @@ export default function SettingsPage(): JSX.Element {
|
||||||
description="Manage the general settings for Langflow."
|
description="Manage the general settings for Langflow."
|
||||||
>
|
>
|
||||||
<div className="flex h-full w-full space-y-8 lg:flex-row lg:space-x-8 lg:space-y-0">
|
<div className="flex h-full w-full space-y-8 lg:flex-row lg:space-x-8 lg:space-y-0">
|
||||||
<aside className="flex h-full flex-col space-y-6 lg:w-1/5">
|
<aside className="flex h-full shrink-0 flex-col space-y-6 lg:w-[20vw]">
|
||||||
<SidebarNav items={sidebarNavItems} />
|
<SidebarNav items={sidebarNavItems} />
|
||||||
</aside>
|
</aside>
|
||||||
<div className="h-full w-full flex-1 pb-8">
|
<div className="h-full w-full flex-1 pb-8">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue