Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default function RootLayout({
children: React.ReactNode;
}>) {
return (
<html lang="en">
<html lang="en" suppressHydrationWarning>
<body
className={`${geistSans.variable} ${geistMono.variable} ${playfair.variable} antialiased`}
>
Expand Down
3 changes: 3 additions & 0 deletions bun.lock

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

14 changes: 14 additions & 0 deletions components/app-sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ import { BarChart3, BookOpen, GraduationCap } from "lucide-react"
import Link from "next/link"
import { usePathname } from "next/navigation"

import { useMe } from "@/hooks/api/use-me"
import { NavUser } from "@/components/nav-user"
import {
Sidebar,
SidebarContent,
SidebarFooter,
SidebarGroup,
SidebarGroupLabel,
SidebarHeader,
Expand Down Expand Up @@ -46,9 +49,11 @@ const facultyNavItems: NavItem[] = [

export function AppSidebar({ ...props }: ComponentProps<typeof Sidebar>) {
const pathname = usePathname()
const { data } = useMe()
const isFaculty = pathname.startsWith("/faculty")
const roleLabel = isFaculty ? "Faculty" : "Student"
const navItems = isFaculty ? facultyNavItems : studentNavItems
const userName = data?.fullName?.trim() || data?.userName || "User"

return (
<Sidebar collapsible="icon" {...props}>
Expand Down Expand Up @@ -86,6 +91,15 @@ export function AppSidebar({ ...props }: ComponentProps<typeof Sidebar>) {
</SidebarMenu>
</SidebarGroup>
</SidebarContent>
<SidebarFooter>
<NavUser
user={{
name: userName,
email: data?.userName,
avatar: data?.userProfilePicture ?? "",
}}
/>
</SidebarFooter>
<SidebarRail />
</Sidebar>
)
Expand Down
58 changes: 31 additions & 27 deletions components/dashboard-content-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
BreadcrumbPage,
BreadcrumbSeparator,
} from "@/components/ui/breadcrumb"
import { ThemeSwitch } from "@/components/theme-switch"
import { Separator } from "@/components/ui/separator"
import { SidebarTrigger } from "@/components/ui/sidebar"

Expand All @@ -28,34 +29,37 @@ export function DashboardContentHeader() {

return (
<header className="flex h-16 shrink-0 items-center gap-2 border-b px-4 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12">
<SidebarTrigger className="-ml-1" />
<Separator
orientation="vertical"
className="mr-2 data-[orientation=vertical]:h-4"
/>
<Breadcrumb>
<BreadcrumbList>
{segments.map((segment, index) => {
const href = `/${segments.slice(0, index + 1).join("/")}`
const isLast = index === segments.length - 1
<div className="flex min-w-0 flex-1 items-center gap-2">
<SidebarTrigger className="-ml-1" />
<Separator
orientation="vertical"
className="mr-2 data-[orientation=vertical]:h-4"
/>
<Breadcrumb>
<BreadcrumbList>
{segments.map((segment, index) => {
const href = `/${segments.slice(0, index + 1).join("/")}`
const isLast = index === segments.length - 1

return (
<Fragment key={href}>
<BreadcrumbItem>
{!isLast ? (
<BreadcrumbLink asChild>
<Link href={href}>{formatSegment(segment)}</Link>
</BreadcrumbLink>
) : (
<BreadcrumbPage>{formatSegment(segment)}</BreadcrumbPage>
)}
</BreadcrumbItem>
{!isLast && <BreadcrumbSeparator />}
</Fragment>
)
})}
</BreadcrumbList>
</Breadcrumb>
return (
<Fragment key={href}>
<BreadcrumbItem>
{!isLast ? (
<BreadcrumbLink asChild>
<Link href={href}>{formatSegment(segment)}</Link>
</BreadcrumbLink>
) : (
<BreadcrumbPage>{formatSegment(segment)}</BreadcrumbPage>
)}
</BreadcrumbItem>
{!isLast && <BreadcrumbSeparator />}
</Fragment>
)
})}
</BreadcrumbList>
</Breadcrumb>
</div>
<ThemeSwitch />
</header>
)
}
73 changes: 0 additions & 73 deletions components/nav-main.tsx

This file was deleted.

89 changes: 0 additions & 89 deletions components/nav-projects.tsx

This file was deleted.

Loading