diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..2bd5a0a --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +22 diff --git a/app/auth/login/page.tsx b/app/auth/login/page.tsx index d5d6f0b..95822c7 100644 --- a/app/auth/login/page.tsx +++ b/app/auth/login/page.tsx @@ -8,7 +8,6 @@ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/com import { Input } from "@/components/ui/input" import { Label } from "@/components/ui/label" import Link from "next/link" -import { useRouter } from "next/navigation" import { useState } from "react" import { Clock } from "lucide-react" @@ -17,8 +16,6 @@ export default function LoginPage() { const [password, setPassword] = useState("") const [error, setError] = useState(null) const [isLoading, setIsLoading] = useState(false) - const router = useRouter() - const handleLogin = async (e: React.FormEvent) => { e.preventDefault() setIsLoading(true) diff --git a/app/layout.tsx b/app/layout.tsx index a0da94b..b7192c5 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -4,7 +4,9 @@ import { Geist, Geist_Mono } from "next/font/google" import { ThemeProvider } from "@/components/theme-provider" import "./globals.css" +// eslint-disable-next-line @typescript-eslint/no-unused-vars const _geist = Geist({ subsets: ["latin"] }) +// eslint-disable-next-line @typescript-eslint/no-unused-vars const _geistMono = Geist_Mono({ subsets: ["latin"] }) export const metadata: Metadata = { diff --git a/components/customer-dialog.tsx b/components/customer-dialog.tsx index 1286960..bd24ae2 100644 --- a/components/customer-dialog.tsx +++ b/components/customer-dialog.tsx @@ -2,7 +2,7 @@ import type React from "react" -import { useState, useEffect } from "react" +import { useState } from "react" import { Button } from "@/components/ui/button" import { Dialog, @@ -27,16 +27,15 @@ interface CustomerDialogProps { export function CustomerDialog({ open, onOpenChange, onSave, customer, isLoading }: CustomerDialogProps) { const [name, setName] = useState("") const [bookedHours, setBookedHours] = useState("") + const [prevOpen, setPrevOpen] = useState(false) - useEffect(() => { - if (customer) { - setName(customer.name) - setBookedHours(customer.booked_hours.toString()) - } else { - setName("") - setBookedHours("") - } - }, [customer, open]) + if (open && !prevOpen) { + setName(customer?.name ?? "") + setBookedHours(customer?.booked_hours.toString() ?? "") + } + if (open !== prevOpen) { + setPrevOpen(open) + } const handleSubmit = async (e: React.FormEvent) => { e.preventDefault() diff --git a/components/timesheet-entries-content.tsx b/components/timesheet-entries-content.tsx index 360d6df..46624a6 100644 --- a/components/timesheet-entries-content.tsx +++ b/components/timesheet-entries-content.tsx @@ -285,7 +285,7 @@ export function TimesheetEntriesContent({ customer, timesheet, initialEntries, u - This timesheet is marked as completed and is locked for editing. Click "Reopen for Editing" to make changes. + This timesheet is marked as completed and is locked for editing. Click "Reopen for Editing" to make changes. )} diff --git a/components/ui/sidebar.tsx b/components/ui/sidebar.tsx index ee74343..6589cf3 100644 --- a/components/ui/sidebar.tsx +++ b/components/ui/sidebar.tsx @@ -606,10 +606,7 @@ function SidebarMenuSkeleton({ }: React.ComponentProps<'div'> & { showIcon?: boolean }) { - // Random width between 50 to 90%. - const width = React.useMemo(() => { - return `${Math.floor(Math.random() * 40) + 50}%` - }, []) + const width = '70%' return (