Skip to content

Commit faaceaa

Browse files
committed
show pay period data
1 parent 9248b73 commit faaceaa

1 file changed

Lines changed: 49 additions & 38 deletions

File tree

src/components/PayPeriodCalendar.tsx

Lines changed: 49 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -413,47 +413,58 @@ export const PayPeriodCalendar: React.FC<PayPeriodCalendarProps> = () => {
413413
)}
414414

415415
{/* Edit modal */}
416-
{selectedPeriod !== null && (
417-
<div className="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50">
418-
<div className="bg-white dark:bg-zinc-800 rounded-lg p-6 w-80">
419-
<h3 className="text-lg font-semibold mb-4 text-zinc-900 dark:text-white">
420-
Edit Gross Taxable Amount
421-
</h3>
422-
<div className="space-y-4">
423-
<div>
424-
<label className="block text-sm font-medium text-zinc-700 dark:text-zinc-300 mb-1">
425-
Amount ($)
426-
</label>
427-
<input
428-
type="number"
429-
step="0.01"
430-
className="w-full px-3 py-2 border border-zinc-300 dark:border-zinc-600 rounded-md bg-white dark:bg-zinc-700 text-zinc-900 dark:text-white"
431-
value={editingAmount}
432-
onChange={(e) => setEditingAmount(e.target.value)}
433-
autoFocus
434-
/>
435-
</div>
436-
<div className="flex gap-2">
437-
<button
438-
onClick={handleSaveAmount}
439-
className="flex-1 bg-blue-600 text-white px-4 py-2 rounded-md hover:bg-blue-700"
440-
>
441-
Save
442-
</button>
443-
<button
444-
onClick={() => {
445-
setSelectedPeriod(null);
446-
setEditingAmount('');
447-
}}
448-
className="flex-1 bg-zinc-300 dark:bg-zinc-600 text-zinc-700 dark:text-zinc-300 px-4 py-2 rounded-md hover:bg-zinc-400 dark:hover:bg-zinc-500"
449-
>
450-
Cancel
451-
</button>
416+
{selectedPeriod !== null && (() => {
417+
const selectedPayPeriod = formData.payPeriods?.find(p => p.id === selectedPeriod);
418+
return (
419+
<div className="fixed inset-0 bg-black/75 flex items-center justify-center z-50">
420+
<div className="bg-white dark:bg-zinc-800 rounded-lg p-6 w-80">
421+
<h3 className="text-lg font-semibold mb-2 text-zinc-900 dark:text-white">
422+
Edit Gross Taxable Amount
423+
</h3>
424+
{selectedPayPeriod && (
425+
<div className="mb-4 p-3 bg-zinc-50 dark:bg-zinc-700 rounded-md">
426+
<p className="text-sm font-medium text-zinc-700 dark:text-zinc-300">Pay Period:</p>
427+
<p className="text-sm text-zinc-600 dark:text-zinc-400">
428+
{selectedPayPeriod.payPeriodStart} to {selectedPayPeriod.payPeriodEnd}
429+
</p>
430+
</div>
431+
)}
432+
<div className="space-y-4">
433+
<div>
434+
<label className="block text-sm font-medium text-zinc-700 dark:text-zinc-300 mb-1">
435+
Amount ($)
436+
</label>
437+
<input
438+
type="number"
439+
step="0.01"
440+
className="w-full px-3 py-2 border border-zinc-300 dark:border-zinc-600 rounded-md bg-white dark:bg-zinc-700 text-zinc-900 dark:text-white"
441+
value={editingAmount}
442+
onChange={(e) => setEditingAmount(e.target.value)}
443+
autoFocus
444+
/>
445+
</div>
446+
<div className="flex gap-2">
447+
<button
448+
onClick={handleSaveAmount}
449+
className="flex-1 bg-blue-600 text-white px-4 py-2 rounded-md hover:bg-blue-700"
450+
>
451+
Save
452+
</button>
453+
<button
454+
onClick={() => {
455+
setSelectedPeriod(null);
456+
setEditingAmount('');
457+
}}
458+
className="flex-1 bg-zinc-300 dark:bg-zinc-600 text-zinc-700 dark:text-zinc-300 px-4 py-2 rounded-md hover:bg-zinc-400 dark:hover:bg-zinc-500"
459+
>
460+
Cancel
461+
</button>
462+
</div>
452463
</div>
453464
</div>
454465
</div>
455-
</div>
456-
)}
466+
);
467+
})()}
457468
</div>
458469
);
459470
};

0 commit comments

Comments
 (0)