From 7d840993ca57732d5654c069b511231b14500d67 Mon Sep 17 00:00:00 2001 From: Mathias Schopmans Date: Mon, 26 Feb 2024 09:07:58 +0100 Subject: [PATCH] feat: add hint if item was not updated within the last 3 releases --- .../ItemDetail/ItemDetail.module.css | 15 ++++++++++++ src/components/ItemDetail/ItemDetail.tsx | 23 +++++++++++++++++++ src/icons/attention.svg | 1 + 3 files changed, 39 insertions(+) create mode 100644 src/icons/attention.svg diff --git a/src/components/ItemDetail/ItemDetail.module.css b/src/components/ItemDetail/ItemDetail.module.css index 4fdb602..a7f2433 100644 --- a/src/components/ItemDetail/ItemDetail.module.css +++ b/src/components/ItemDetail/ItemDetail.module.css @@ -20,6 +20,13 @@ margin: -15px 0 0 -60px; } +.icon { + fill: currentColor; + width: 24px; + height: 24px; + margin: 8px auto; +} + .ring { float: left; margin: -45px 0 0 0; @@ -69,3 +76,11 @@ margin-top: -20px; } } + +.revision.hint { + .content { + font-size: 14px; + background: var(--border); + color: var(--foreground); + } +} diff --git a/src/components/ItemDetail/ItemDetail.tsx b/src/components/ItemDetail/ItemDetail.tsx index aa439e6..e182acb 100644 --- a/src/components/ItemDetail/ItemDetail.tsx +++ b/src/components/ItemDetail/ItemDetail.tsx @@ -1,9 +1,17 @@ import styles from "./ItemDetail.module.css"; import { RingBadge } from "@/components/Badge/Badge"; +import Attention from "@/components/Icons/Attention"; +import { getReleases } from "@/lib/data"; import { Item } from "@/lib/types"; import { cn } from "@/lib/utils"; +const latestReleases = getReleases().slice(-3); + +function isNotMaintained(release: string) { + return !latestReleases.includes(release); +} + interface ItemProps { item: Item; } @@ -13,6 +21,21 @@ export function ItemDetail({ item }: ItemProps) { <>

{item.title}

+ {isNotMaintained(item.release) && ( +
+ + + +
+ This item was not updated in last three versions of the Radar. + Should it have appeared in one of the more recent editions, there + is a good chance it remains pertinent. However, if the item dates + back further, its relevance may have diminished and our current + evaluation could vary. Regrettably, our capacity to consistently + revisit items from past Radar editions is limited. +
+
+ )} {item.revisions?.map((revision, index) => ( diff --git a/src/icons/attention.svg b/src/icons/attention.svg new file mode 100644 index 0000000..866126f --- /dev/null +++ b/src/icons/attention.svg @@ -0,0 +1 @@ + \ No newline at end of file