Skip to content

Commit 2429da8

Browse files
authored
Merge pull request #47 from PathOnAI/treefrontend-ui
#23 1.2.3.5 done
2 parents 65ea334 + eaafa7b commit 2429da8

File tree

4 files changed

+309
-224
lines changed

4 files changed

+309
-224
lines changed

visual-tree-search-app/components/Footer.tsx

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,7 @@
11
const Footer = () => {
22
return (
3-
<footer className="relative px-4 py-6 bg-white dark:bg-gray-500 overflow-hidden">
4-
{/* Background Text */}
5-
<div
6-
className="absolute inset-0 flex items-center justify-center text-6xl font-bold text-gray-200 dark:text-gray-700"
7-
style={{
8-
zIndex: -1,
9-
opacity: 0.1, // Subtle background text
10-
whiteSpace: "nowrap", // Prevent text wrapping
11-
}}
12-
>
13-
© {new Date().getFullYear()} - Built with NextJS
14-
</div>
15-
16-
{/* Foreground Content */}
17-
<div
18-
className="text-center text-sm text-gray-800 dark:text-gray-400"
19-
style={{
20-
marginTop: `1.3rem`,
21-
marginRight: `2.2rem`,
22-
paddingBottom: "0.3rem",
23-
float: "right",
24-
}}
25-
>
3+
<footer className="px-4 py-2 bg-white dark:bg-gray-500 border-t flex justify-end items-center">
4+
<div className="text-sm text-gray-800 dark:text-gray-400">
265
© {new Date().getFullYear()}, Built with
276
{` `}
287
<a

visual-tree-search-app/components/Header.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@ const Header = () => {
1212

1313
return (
1414
<header>
15-
<div className="px-4 py-6 flex justify-end items-center bg-white dark:bg-gray-500 overflow-hidden">
15+
<div className="px-4 py-2 flex justify-end items-center bg-white dark:bg-gray-500 shadow-sm">
1616
{mounted && (
1717
theme === "dark" ? (
1818
<HiSun
19-
className="w-10 h-10 text-yellow-500"
19+
className="w-6 h-6 text-yellow-500"
2020
role="button"
2121
onClick={() => setTheme('light')}
2222
/>
2323
) : (
2424
<HiMoon
25-
className="w-10 h-10 text-gray-900"
25+
className="w-6 h-6 text-gray-900"
2626
role="button"
2727
onClick={() => setTheme('dark')}
2828
/>

visual-tree-search-app/components/Sidebar.tsx

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import Link from 'next/link';
22
import { useRouter } from 'next/router';
3-
import { Home, LayoutDashboard, Network, Search } from 'lucide-react';
3+
import { Home, LayoutDashboard, Network, Search, ChevronLeft, ChevronRight } from 'lucide-react';
44
import { Button } from "@/components/ui/button";
55
import { ScrollArea } from "@/components/ui/scroll-area";
6+
import { useState } from 'react';
67

78
const Sidebar = () => {
89
const router = useRouter();
10+
const [collapsed, setCollapsed] = useState(false);
911

1012
const menuItems = [
1113
{
@@ -36,12 +38,24 @@ const Sidebar = () => {
3638
}
3739
return router.pathname.startsWith(path);
3840
};
41+
42+
const toggleSidebar = () => {
43+
setCollapsed(!collapsed);
44+
};
3945

4046
return (
41-
<div className="h-full min-h-screen w-64 border-r">
47+
<div className={`h-full min-h-screen ${collapsed ? 'w-16' : 'w-64'} border-r transition-all duration-300 relative`}>
4248
<div className="space-y-4 py-4">
43-
<div className="px-4 py-2">
44-
<h2 className="text-xl font-semibold tracking-tight">VisualTreeSearch</h2>
49+
<div className={`px-4 py-2 flex ${collapsed ? 'justify-center' : 'justify-between'} items-center`}>
50+
{!collapsed && <h2 className="text-xl font-semibold tracking-tight">VisualTreeSearch</h2>}
51+
<Button
52+
variant="ghost"
53+
size="icon"
54+
className="absolute -right-3 top-5 bg-white dark:bg-gray-800 border shadow-sm z-10"
55+
onClick={toggleSidebar}
56+
>
57+
{collapsed ? <ChevronRight className="h-4 w-4" /> : <ChevronLeft className="h-4 w-4" />}
58+
</Button>
4559
</div>
4660
<ScrollArea className="h-[calc(100vh-8rem)]">
4761
<nav className="grid gap-1 px-2">
@@ -50,11 +64,12 @@ const Sidebar = () => {
5064
key={item.name}
5165
asChild
5266
variant={isActive(item.href) ? "secondary" : "ghost"}
53-
className="w-full justify-start"
67+
className={`w-full ${collapsed ? 'justify-center' : 'justify-start'}`}
68+
title={collapsed ? item.name : ''}
5469
>
5570
<Link href={item.href}>
56-
<item.icon className="mr-2 h-4 w-4" />
57-
{item.name}
71+
<item.icon className={`${collapsed ? '' : 'mr-2'} h-4 w-4`} />
72+
{!collapsed && item.name}
5873
</Link>
5974
</Button>
6075
))}

0 commit comments

Comments
 (0)