From a2cbc8691148a56bf6cd402714f82254c9f9bf08 Mon Sep 17 00:00:00 2001 From: Adam Antal Date: Wed, 3 Apr 2024 14:56:39 +0200 Subject: [PATCH] Make articles always show as available in the availability labels --- .../availability-label/availability-label.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/components/availability-label/availability-label.tsx b/src/components/availability-label/availability-label.tsx index 3b02b5fd1d..7208539d2f 100644 --- a/src/components/availability-label/availability-label.tsx +++ b/src/components/availability-label/availability-label.tsx @@ -11,6 +11,7 @@ import { } from "../../core/dbc-gateway/generated/graphql"; import AvailabilityLabelInside from "./availability-label-inside"; import { FaustId } from "../../core/utils/types/ids"; +import { ManifestationMaterialType } from "../../core/utils/types/material-type"; export interface AvailabilityLabelProps { manifestText: string; @@ -47,9 +48,13 @@ export const AvailabilityLabel: React.FC = ({ isbn: isbns ? isbns[0] : null }); - const availabilityText = isAvailable + let availabilityText = isAvailable ? t("availabilityAvailableText") : t("availabilityUnavailableText"); + // Articles are always available + if (manifestText === ManifestationMaterialType.article) { + availabilityText = t("availabilityAvailableText"); + } useDeepCompareEffect(() => { // Track material availability (status) if the button is active - also meaning @@ -71,7 +76,12 @@ export const AvailabilityLabel: React.FC = ({