Skip to content

Commit

Permalink
fix preload logos
Browse files Browse the repository at this point in the history
  • Loading branch information
1oannis committed Oct 6, 2024
1 parent bdd9d93 commit 751c022
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ import type { Metadata } from "next"

export const metadata: Metadata = {
title: "Homepage",
description: "This is the homepage",
description: "This is the homepage of Ioannis Theodosiadis",
}

export default function Home() {
return (
<>
<h1 className="text-4xl font-bold">Welcome to the homepage</h1>
</>
)
}
6 changes: 3 additions & 3 deletions components/ui/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ function SidebarItem({ icon, label, isOpen }: SidebarItemProps) {
}

export default function Sidebar({ children }: Readonly<{ children: React.ReactNode }>) {
const [isSidebarOpen, setIsSidebarOpen] = useState(true)
const [isSidebarOpen, setIsSidebarOpen] = useState(false)
const toggleSidebar = () => setIsSidebarOpen(!isSidebarOpen)

return (
<div className="flex h-screen bg-background">
{/* Sidebar */}
<aside className={cn("bg-muted/40 p-4 transition-all duration-300 ease-in-out flex flex-col", isSidebarOpen ? "w-52" : "w-16")}>
<div className={cn("flex items-center", isSidebarOpen ? "justify-between" : "justify-center", "mb-8")}>
{isSidebarOpen && <Image src="/logo.svg" alt="Logo" width={120} height={32} />}
{isSidebarOpen && <Image src="/logo.svg" alt="Logo" width={120} height={32} priority={true} />}
<Button variant="ghost" size="icon" onClick={toggleSidebar}>
{isSidebarOpen ? <PanelRightClose className="h-4 w-4" /> : <Image src="/logo-minimal.svg" alt="Logo-minimal" width={40} height={40} />}
{isSidebarOpen ? <PanelRightClose className="h-4 w-4" /> : <Image src="/logo-minimal.svg" alt="Logo-minimal" width={32} height={32} priority={true} />}
</Button>
</div>
<nav className="space-y-2">
Expand Down

0 comments on commit 751c022

Please sign in to comment.