diff --git a/labman/src/app/(auth)/login/page.tsx b/labman/src/app/(auth)/login/page.tsx index e0d1443..1a9e0b3 100644 --- a/labman/src/app/(auth)/login/page.tsx +++ b/labman/src/app/(auth)/login/page.tsx @@ -45,7 +45,11 @@ export default function Home() { +

{version}-{env}

+ All icons by Icons8 + + diff --git a/labman/src/app/(main)/globals.css b/labman/src/app/(main)/globals.css index 6440177..fe4a317 100644 --- a/labman/src/app/(main)/globals.css +++ b/labman/src/app/(main)/globals.css @@ -109,4 +109,12 @@ input:invalid { .card-attributes-value { @apply text-2xl text-gray-300 font-bold +} + +.rounded-button { + @apply rounded-full hover:cursor-pointer +} + +.rounded-button:hover { + @apply brightness-90 transition-all duration-500 scale-105 ease-in-out } \ No newline at end of file diff --git a/labman/src/components/core/Ellipsis.tsx b/labman/src/components/core/Ellipsis.tsx index b2a4b8f..cecf108 100644 --- a/labman/src/components/core/Ellipsis.tsx +++ b/labman/src/components/core/Ellipsis.tsx @@ -1,16 +1,17 @@ import {useState} from "react"; import {Equipment} from "@/types/inventory"; +import {useSideView} from "@/app/sideViewContext"; interface EllipsisProps { equipment: Equipment; setSelectedEquipment: (equipment: Equipment | null) => void; - setSideView: (view: string) => void; deleteEquipment: (name: string) => void; } -export default function Ellipsis({equipment, setSelectedEquipment, setSideView, deleteEquipment}: EllipsisProps) { +export default function Ellipsis({equipment, setSelectedEquipment, deleteEquipment}: EllipsisProps) { const [isOpen, setIsOpen] = useState(false); const toggle = () => setIsOpen(!isOpen); + const {setSideView} = useSideView(); // TODO: Find a way to ensure that only one dropdown is open at a time diff --git a/labman/src/components/core/SideView/SideView.tsx b/labman/src/components/core/SideView/SideView.tsx index a45e17f..8957486 100644 --- a/labman/src/components/core/SideView/SideView.tsx +++ b/labman/src/components/core/SideView/SideView.tsx @@ -41,7 +41,7 @@ export default function SideView( { children, title, equipmentData, itemList} : {/* Right side of panel */} -
+
{(sideView === "loanView" || sideView === "eqInfo") && diff --git a/labman/src/components/inventory/EquipmentClient.tsx b/labman/src/components/inventory/EquipmentClient.tsx index 1a7eaad..8efb5f1 100644 --- a/labman/src/components/inventory/EquipmentClient.tsx +++ b/labman/src/components/inventory/EquipmentClient.tsx @@ -135,12 +135,16 @@ export default function EquipmentClient({equipmentList}: EquipmentClientProps) { setAllEquipment={setAllEquipment} setSelectedEquipment={setSelectedEquipment} />} -
- setName(e.target.value)} type="text" name="name" placeholder="Name" className="bg-white rounded-md p-2 m-2 placeholder-black text-black" /> - setCategory(e.target.value)} type="text" name="category" placeholder="Category" className="bg-white rounded-md p-2 m-2 placeholder-black text-black" /> - {/* setImage(e.target.value)} type="text" name="image" placeholder="Image" className="bg-white rounded-md p-2 m-2 placeholder-black text-black" /> */} - -
+
+

Add equipment

+
+ setName(e.target.value)} type="text" name="name" placeholder="Name" className="bg-white rounded-md p-2 m-2 placeholder-black text-black" /> + setCategory(e.target.value)} type="text" name="category" placeholder="Category" className="bg-white rounded-md p-2 m-2 placeholder-black text-black" /> + {/* setImage(e.target.value)} type="text" name="image" placeholder="Image" className="bg-white rounded-md p-2 m-2 placeholder-black text-black" /> */} + +
+
+
e.category.name))]} selected={selectedFilter} onSelect={setSelectedFilter} /> @@ -165,7 +169,6 @@ export default function EquipmentClient({equipmentList}: EquipmentClientProps) { category={equipment.category.name} creationDate={equipment.createdAt} setSelectedEquipment={setSelectedEquipment} - setSideView={setSideView} deleteEquipment={handleDeleteEquipment} /> ); diff --git a/labman/src/components/inventory/Item.tsx b/labman/src/components/inventory/Item.tsx index 5501d6c..9cb1f64 100644 --- a/labman/src/components/inventory/Item.tsx +++ b/labman/src/components/inventory/Item.tsx @@ -3,6 +3,7 @@ import Ellipsis from "@/components/core/Ellipsis"; import {Equipment} from "@/types/inventory"; import {loanCount} from "@/utils/inventoryUtils"; +import {useSideView} from "@/app/sideViewContext"; type Unit = { id: number; @@ -20,14 +21,14 @@ interface ItemProps { creationDate: Date; units?: Unit[]; setSelectedEquipment: (equipment: Equipment | null) => void; - setSideView: (view: string) => void; deleteEquipment: (name: string) => void; } -export default function Item({ equipment, name, category, creationDate, setSelectedEquipment, setSideView, deleteEquipment }: ItemProps) { +export default function Item({ equipment, name, category, creationDate, setSelectedEquipment, deleteEquipment }: ItemProps) { // CreationDate is not an actual type of Date, so it needs to be converted to a Date object. const date = new Date(creationDate); + const {sideView, setSideView} = useSideView(); return( @@ -35,16 +36,35 @@ export default function Item({ equipment, name, category, creationDate, setSelec

{setSelectedEquipment(equipment); setSideView("loanView")}}>{name}

-

{category}

-

{equipment.items.length - loanCount(equipment)}/{equipment.items.length}

-

{date.toLocaleDateString("no")}

- +

{category}

+

{equipment.items.length - loanCount(equipment)}/{equipment.items.length}

+

{date.toLocaleDateString("no")}

+
+ + +
+ +
+ +