Skip to content

Commit 1d16235

Browse files
committed
unallocated items UX merged
2 parents f93bee0 + 7938a92 commit 1d16235

3 files changed

Lines changed: 34 additions & 37 deletions

File tree

‎src/app/unallocatedItems/lineItems/page.tsx‎

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,22 @@ export default function UnallocatedItemsLineItemsPage() {
107107
</button>
108108
</Link>
109109
</div>
110-
<h1 className="text-2xl font-semibold">
111-
{itemParams.title}: Unique Line Items
112-
</h1>
110+
<h1 className="text-2xl font-semibold">{itemParams.title}: Unique Line Items</h1>
111+
112+
<div className="flex space-x-4 mt-4 border-b-2">
113+
<Link
114+
href={`/unallocatedItems/requests?${new URLSearchParams(itemParamsForUrl).toString()}`}
115+
className="px-2 py-1 text-md font-medium relative -mb-px transition-colors focus:outline-none text-gray-500 hover:text-black"
116+
>
117+
<div className="hover:bg-gray-100 px-2 py-1 rounded">Partner Requests</div>
118+
</Link>
119+
<button
120+
className="px-2 py-1 text-md font-medium relative -mb-px transition-colors focus:outline-none border-b-2 border-black bottom-[-1px]"
121+
>
122+
<div className="hover:bg-gray-100 px-2 py-1 rounded">Unique Line Items</div>
123+
</button>
124+
</div>
125+
113126
<h2 className="text-xl font-light text-gray-500 pt-4 pb-4">
114127
A list of all the unique items for this item.
115128
</h2>

‎src/app/unallocatedItems/requests/page.tsx‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,21 @@ export default function UnallocatedItemRequestsPage() {
141141
Partner Requests
142142
</span>
143143
</h1>
144+
145+
<div className="flex space-x-4 mt-4 border-b-2">
146+
<button
147+
className="px-2 py-1 text-md font-medium relative -mb-px transition-colors focus:outline-none border-b-2 border-black bottom-[-1px]"
148+
>
149+
<div className="hover:bg-gray-100 px-2 py-1 rounded">Partner Requests</div>
150+
</button>
151+
<Link
152+
href={`/unallocatedItems/lineItems?${new URLSearchParams(generalItemForUrl).toString()}`}
153+
className="px-2 py-1 text-md font-medium relative -mb-px transition-colors focus:outline-none text-gray-500 hover:text-black"
154+
>
155+
<div className="hover:bg-gray-100 px-2 py-1 rounded">Unique Line Items</div>
156+
</Link>
157+
</div>
158+
144159
<div className="relative w-1/3 py-4">
145160
<MagnifyingGlass
146161
className="absolute left-3 top-1/2 -translate-y-1/2 text-gray-500"

‎src/screens/AdminUnallocatedItemsScreen.tsx‎

Lines changed: 3 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
"use client";
22

33
import { useState, useEffect } from "react";
4-
import { DotsThree, Eye, MagnifyingGlass, Plus } from "@phosphor-icons/react";
4+
import { MagnifyingGlass, Plus } from "@phosphor-icons/react";
55
import { CgSpinner } from "react-icons/cg";
66
import React from "react";
77
import toast from "react-hot-toast";
88
import { useRouter } from "next/navigation";
99
import AddItemModal from "@/components/AddItemModal";
10-
import { Menu, MenuButton, MenuItem, MenuItems } from "@headlessui/react";
11-
import BaseTable, { extendTableHeader } from "@/components/BaseTable";
1210

1311
interface UnallocatedItemData {
1412
title: string;
@@ -19,6 +17,7 @@ interface UnallocatedItemData {
1917
quantityPerUnit: number;
2018
}
2119
import { useFetch } from "@/hooks/useFetch";
20+
import BaseTable from "@/components/BaseTable";
2221

2322
enum ExpirationFilterKey {
2423
ALL = "All",
@@ -217,7 +216,6 @@ export default function AdminUnallocatedItemsScreen() {
217216
"Expiration",
218217
"Unit type",
219218
"Qty/Unit",
220-
extendTableHeader("Manage", "w-12"),
221219
]}
222220
rows={items.map((item) => ({
223221
cells: [
@@ -228,36 +226,7 @@ export default function AdminUnallocatedItemsScreen() {
228226
? new Date(item.expirationDate).toLocaleDateString()
229227
: "N/A",
230228
item.unitType,
231-
item.quantityPerUnit,
232-
<div onClick={(e) => e.stopPropagation()} key={1}>
233-
<Menu as="div" className="float-right relative">
234-
<MenuButton>
235-
<DotsThree weight="bold" />
236-
</MenuButton>
237-
<MenuItems className="absolute right-0 z-10 mt-2 origin-top-right rounded-md bg-white ring-1 shadow-lg ring-black/5 w-max">
238-
<MenuItem
239-
as="button"
240-
className="flex w-full px-3 py-2 text-sm text-gray-700 hover:bg-gray-100"
241-
onClick={() => {
242-
router.push(
243-
`/unallocatedItems/lineItems?${new URLSearchParams({
244-
title: item.title,
245-
type: item.type,
246-
unitType: item.unitType,
247-
quantityPerUnit: item.quantityPerUnit.toString(),
248-
...(item.expirationDate
249-
? { expirationDate: item.expirationDate }
250-
: {}),
251-
}).toString()}`
252-
);
253-
}}
254-
>
255-
<Eye className="inline-block mr-2" size={22} />
256-
View unique items
257-
</MenuItem>
258-
</MenuItems>
259-
</Menu>
260-
</div>,
229+
item.quantityPerUnit
261230
],
262231
onClick: () => {
263232
router.push(

0 commit comments

Comments
 (0)