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
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22
3 changes: 0 additions & 3 deletions app/auth/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -17,8 +16,6 @@ export default function LoginPage() {
const [password, setPassword] = useState("")
const [error, setError] = useState<string | null>(null)
const [isLoading, setIsLoading] = useState(false)
const router = useRouter()

const handleLogin = async (e: React.FormEvent) => {
e.preventDefault()
setIsLoading(true)
Expand Down
2 changes: 2 additions & 0 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
19 changes: 9 additions & 10 deletions components/customer-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion components/timesheet-entries-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ export function TimesheetEntriesContent({ customer, timesheet, initialEntries, u
<Alert className="mb-6 border-green-200 bg-green-50 text-green-800">
<Lock className="h-4 w-4" />
<AlertDescription>
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 &quot;Reopen for Editing&quot; to make changes.
</AlertDescription>
</Alert>
)}
Expand Down
5 changes: 1 addition & 4 deletions components/ui/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<div
Expand Down
1 change: 1 addition & 0 deletions components/ui/use-toast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ type ToasterToast = ToastProps & {
action?: ToastActionElement
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const actionTypes = {
ADD_TOAST: 'ADD_TOAST',
UPDATE_TOAST: 'UPDATE_TOAST',
Expand Down
1 change: 1 addition & 0 deletions hooks/use-toast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ type ToasterToast = ToastProps & {
action?: ToastActionElement
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const actionTypes = {
ADD_TOAST: 'ADD_TOAST',
UPDATE_TOAST: 'UPDATE_TOAST',
Expand Down
2 changes: 1 addition & 1 deletion lib/calculations.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { TimeEntry, CustomerWithStats } from "./types"
import type { CustomerWithStats } from "./types"

interface HoursEntry {
hours: number | string
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "hourtracker",
"version": "0.1.0",
"private": true,
"packageManager": "pnpm@10.27.0",
"scripts": {
"build": "next build",
"dev": "next dev",
Expand Down
Loading