From d3806f7d5b810a350b31bda73af51fc9f751d506 Mon Sep 17 00:00:00 2001 From: Ben Phelps Date: Mon, 12 Sep 2022 11:55:01 +0300 Subject: [PATCH] better handle non-clickable service tiles --- src/components/services/item.jsx | 63 ++++++++++++++++++++------------ 1 file changed, 39 insertions(+), 24 deletions(-) diff --git a/src/components/services/item.jsx b/src/components/services/item.jsx index df0caf677..11bc56d2d 100644 --- a/src/components/services/item.jsx +++ b/src/components/services/item.jsx @@ -22,43 +22,58 @@ function resolveIcon(icon) { } export default function Item({ service }) { + const handleOnClick = () => { + if (service.href && service.href !== "#") { + window.open(service.href, "_blank").focus(); + } + }; + + const hasLink = service.href && service.href !== "#"; + return (
  • -
    - {service.icon && ( +
    + {service.icon && + (hasLink ? ( + + ) : ( +
    + logo +
    + ))} + + {hasLink ? ( + ) : ( +
    +
    + {service.name} +

    {service.description}

    +
    +
    )} - {service.container && (