Skip to content

Commit ebdc5aa

Browse files
committed
Apply fixes from Laravel Starter Kit
1 parent e4a040f commit ebdc5aa

File tree

8 files changed

+14
-13
lines changed

8 files changed

+14
-13
lines changed

app/frontend/components/app-logo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default function AppLogo() {
77
<AppLogoIcon className="size-5 fill-current text-white" />
88
</div>
99
<div className="ml-1 grid flex-1 text-left text-sm">
10-
<span className="mb-0.5 truncate leading-none font-semibold">
10+
<span className="mb-0.5 truncate leading-tight font-semibold">
1111
Inertia Rails Starter Kit
1212
</span>
1313
</div>

app/frontend/components/nav-main.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export function NavMain({ items = [] }: { items: NavItem[] }) {
1919
<SidebarMenuItem key={item.title}>
2020
<SidebarMenuButton
2121
asChild
22-
isActive={item.href === page.url}
22+
isActive={page.url.startsWith(item.href)}
2323
tooltip={{ children: item.title }}
2424
>
2525
<Link href={item.href} prefetch>

app/frontend/components/ui/sidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ function SidebarInset({ className, ...props }: React.ComponentProps<"main">) {
310310
<main
311311
data-slot="sidebar-inset"
312312
className={cn(
313-
"bg-background relative flex w-full flex-1 flex-col",
313+
"bg-background relative flex min-h-svh max-w-full flex-1 flex-col",
314314
"md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",
315315
className,
316316
)}

app/frontend/components/user-menu-content.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Link } from "@inertiajs/react"
1+
import { Link, router } from "@inertiajs/react"
22
import { LogOut, Settings } from "lucide-react"
33

44
import {
@@ -25,6 +25,11 @@ export function UserMenuContent({ auth }: UserMenuContentProps) {
2525
const { session, user } = auth
2626
const cleanup = useMobileNavigation()
2727

28+
const handleLogout = () => {
29+
cleanup()
30+
router.flushAll()
31+
}
32+
2833
return (
2934
<>
3035
<DropdownMenuLabel className="p-0 font-normal">
@@ -54,7 +59,7 @@ export function UserMenuContent({ auth }: UserMenuContentProps) {
5459
method="delete"
5560
href={sessionPath({ id: session.id })}
5661
as="button"
57-
onClick={cleanup}
62+
onClick={handleLogout}
5863
>
5964
<LogOut className="mr-2" />
6065
Log out
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useCallback } from "react"
22

33
export function useInitials() {
4-
const getInitials = useCallback((fullName: string): string => {
4+
return useCallback((fullName: string): string => {
55
const names = fullName.trim().split(" ")
66

77
if (names.length === 0) return ""
@@ -12,6 +12,4 @@ export function useInitials() {
1212

1313
return `${firstInitial}${lastInitial}`.toUpperCase()
1414
}, [])
15-
16-
return getInitials
1715
}
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import { useCallback } from "react"
22

33
export function useMobileNavigation() {
4-
const cleanup = useCallback(() => {
4+
return useCallback(() => {
55
// Remove pointer-events style from body...
66
document.body.style.removeProperty("pointer-events")
77
}, [])
8-
9-
return cleanup
108
}

app/frontend/layouts/app/app-sidebar-layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default function AppSidebarLayout({
1515
return (
1616
<AppShell variant="sidebar">
1717
<AppSidebar />
18-
<AppContent variant="sidebar">
18+
<AppContent variant="sidebar" className="overflow-x-hidden">
1919
<AppSidebarHeader breadcrumbs={breadcrumbs} />
2020
{children}
2121
</AppContent>

app/frontend/pages/dashboard/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default function Dashboard() {
1616
return (
1717
<AppLayout breadcrumbs={breadcrumbs}>
1818
<Head title="Dashboard" />
19-
<div className="flex h-full flex-1 flex-col gap-4 rounded-xl p-4">
19+
<div className="flex h-full flex-1 flex-col gap-4 overflow-x-auto rounded-xl p-4">
2020
<div className="grid auto-rows-min gap-4 md:grid-cols-3">
2121
<div className="border-sidebar-border/70 dark:border-sidebar-border relative aspect-video overflow-hidden rounded-xl border">
2222
<PlaceholderPattern className="absolute inset-0 size-full stroke-neutral-900/20 dark:stroke-neutral-100/20" />

0 commit comments

Comments
 (0)