Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update side nav with new ui #184

Merged
merged 3 commits into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions dashboard/15-final/app/dashboard/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import SideNav from '@/app/ui/dashboard/sidenav';

export default function Layout({ children }: { children: React.ReactNode }) {
return (
<div className="flex h-screen overflow-hidden">
<div className="w-14 md:w-64">
<div className="flex h-screen flex-col md:flex-row md:overflow-hidden">
<div className="w-full flex-none md:w-64">
<SideNav />
</div>
<div className="flex-grow overflow-y-auto p-4 sm:p-10 md:p-20">
<div className="flex-grow p-4 sm:p-10 md:overflow-y-auto md:p-20">
{children}
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion dashboard/15-final/app/ui/dashboard/log-out-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default function LogOutButton() {
return (
<button
onClick={() => signOut()}
className="flex gap-2 rounded p-2 font-semibold hover:text-blue-600"
className="my-2 flex grow items-center justify-center gap-2 rounded-md bg-gray-50 p-3 hover:bg-sky-100 hover:text-blue-600 md:flex-none md:justify-start md:p-2"
>
<PowerIcon className="w-6" />
<div className="hidden md:block">Sign Out</div>
Expand Down
4 changes: 2 additions & 2 deletions dashboard/15-final/app/ui/dashboard/nav-links.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ export default function NavLinks() {
key={link.name}
href={link.href}
className={clsx(
'mt-2 flex gap-2 rounded-md p-2 font-semibold hover:bg-gray-50 hover:text-blue-600',
'my-2 flex grow items-center justify-center gap-2 rounded-md bg-gray-50 p-3 hover:bg-sky-100 hover:text-blue-600 md:flex-none md:justify-start md:p-2',
{
'bg-gray-50 text-blue-600': pathname === link.href,
'bg-sky-100 text-blue-600': pathname === link.href,
},
)}
>
Expand Down
27 changes: 15 additions & 12 deletions dashboard/15-final/app/ui/dashboard/sidenav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,23 @@ import LogOutButton from './log-out-button';

export default function SideNav() {
return (
<div className="flex h-full flex-col justify-between border-r px-2 py-4">
<div>
<Link href="/">
<Image
src="/logo.png"
alt="The Next.js Symbol, a white N inside a black circle"
className="mb-4 ml-1"
width={32}
height={32}
/>
</Link>
<div className="flex h-full flex-col border-r px-2 py-4">
<Link
className="flex h-20 items-end rounded-md bg-blue-600 p-4 md:h-40"
href="/"
>
<Image
src="/acme-logo.svg"
alt="The Next.js Symbol, a white N inside a black circle"
width={100}
height={100}
StephDietz marked this conversation as resolved.
Show resolved Hide resolved
/>
</Link>
<div className="flex grow flex-row justify-between space-x-2 md:flex-col">
<NavLinks />
<div className="hidden h-auto w-full grow rounded-md bg-gray-50 md:block"></div>
<LogOutButton />
</div>
<LogOutButton />
</div>
);
}
120 changes: 120 additions & 0 deletions dashboard/15-final/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions dashboard/15-final/public/acme-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading