Skip to content

Commit 0303b09

Browse files
committed
Popup implementation for editing user inventory item (base framework)
1 parent f0725fa commit 0303b09

1 file changed

Lines changed: 86 additions & 0 deletions

File tree

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
// src/components/popups/user_groups_select_popup.tsx
2+
3+
import Link from "next/link";
4+
import React from "react";
5+
6+
type InventoryItem = {
7+
id: number;
8+
name: string;
9+
date: string;
10+
};
11+
12+
type ItemModalProps = {
13+
isOpen: boolean;
14+
item: InventoryItem | null;
15+
onClose: () => void;
16+
};
17+
18+
function UserInventoryEditPopup({ isOpen, item, onClose }: ItemModalProps) {
19+
if (!isOpen || !item) return null;
20+
return (
21+
<div
22+
className="fixed inset-0 z-50 flex items-center justify-center bg-black/40"
23+
onClick={onClose}
24+
>
25+
<div className="w-full max-w-md rounded-xl bg-white p-6 shadow-lg">
26+
{/* Header */}
27+
<div className="mb-3 flex items-center justify-between">
28+
<div className="relative flex h-24 w-24 items-center justify-center overflow-hidden rounded-full bg-blue-500">
29+
<div className="absolute top-5 h-12 w-12 rounded-full bg-blue-200"></div>
30+
<div className="absolute -bottom-2 left-1/2 h-12 w-16 -translate-x-1/2 rounded-full bg-blue-200"></div>
31+
</div>
32+
{/* Body */}
33+
<div className="space-y-2 py-4">
34+
<Link href="/user_inventory">
35+
<h2 className="cursor-pointer text-2xl font-bold hover:text-gray-900 hover:underline">
36+
{item.name} LOL
37+
</h2>
38+
</Link>
39+
<div className="mb-3 flex items-center justify-between">
40+
<p className="text-gray-500">Edit: {item.id} </p> &nbsp; &nbsp;{" "}
41+
{/* Unique Profile Identifier */}
42+
<p className="cursor-pointer text-gray-500 hover:text-gray-900 hover:underline">
43+
Owned By: {item.id}
44+
</p>{" "}
45+
{/* Add link/popup here? */}
46+
</div>
47+
</div>
48+
<div></div>
49+
<button
50+
onClick={onClose}
51+
className="-translate-y-10 text-gray-500 hover:text-gray-800"
52+
>
53+
54+
</button>
55+
{/* </div> */}
56+
</div>
57+
58+
{/* Body */}
59+
<div className="space-y-2 py-4">
60+
<p>
61+
<strong>Description:</strong> (description here) {item.id}
62+
</p>
63+
<p>
64+
<strong>Date Due:</strong> {item.date}
65+
</p>
66+
</div>
67+
68+
{/* Footer */}
69+
<div className="flex justify-end gap-3 border-t pt-4">
70+
<Link href="/user_inventory">
71+
<button className="rounded bg-blue-600 px-4 py-2 text-white hover:bg-blue-700">
72+
Edit
73+
</button>
74+
</Link>
75+
<button
76+
onClick={onClose}
77+
className="rounded bg-gray-200 px-4 py-2 hover:bg-gray-300"
78+
>
79+
X Close
80+
</button>
81+
</div>
82+
</div>
83+
</div>
84+
);
85+
}
86+
export default UserInventoryEditPopup;

0 commit comments

Comments
 (0)