From 06cc52bb7e0516c91ac97fafc9335399b4af39b0 Mon Sep 17 00:00:00 2001 From: Jon Eugster Date: Wed, 24 Apr 2024 17:01:33 +0200 Subject: [PATCH] mark tabs with new theorems --- client/src/components/inventory.tsx | 7 ++++--- client/src/css/inventory.css | 8 ++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/client/src/components/inventory.tsx b/client/src/components/inventory.tsx index a249289..b26ecf1 100644 --- a/client/src/components/inventory.tsx +++ b/client/src/components/inventory.tsx @@ -76,9 +76,10 @@ function InventoryList({items, docType, openDoc, tab=null, setTab=undefined, lev return <> {categories.length > 1 &&
- {categories.map((cat) => -
{ setTab(cat) }}>{cat}
)} + {categories.map((cat) => { + let hasNew = modifiedItems.filter(item => item.new && (cat == item.category)).length > 0 + return
{ setTab(cat) }}>{cat}
})}
}
{[...modifiedItems].sort( diff --git a/client/src/css/inventory.css b/client/src/css/inventory.css index fb6fb0f..d3fc5b6 100644 --- a/client/src/css/inventory.css +++ b/client/src/css/inventory.css @@ -72,6 +72,14 @@ border-bottom: 0.3em solid var(--clr-primary); } +.inventory .tab.new { + background-image: linear-gradient(to bottom, rgba(255,0,0,0), rgb(255, 242, 190)); +} + +.inventory .tab.new:not(.active) { + border-bottom: 0.3em solid rgb(255, 242, 190); +} + .tab.active { color: black; border-bottom: 0.3em solid #999;