From 230da3d2ebddb9031f601a871a7483430500617f Mon Sep 17 00:00:00 2001 From: DamitusThyYeetus123 <108782125+DamitusThyYeetus123@users.noreply.github.com> Date: Thu, 28 Nov 2024 14:45:30 +1100 Subject: [PATCH] Enhancement: support hrefs for info widgets (#4347) Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com> --- src/components/widgets/widget/container.jsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/components/widgets/widget/container.jsx b/src/components/widgets/widget/container.jsx index c9240dd3b..4a1fdd375 100644 --- a/src/components/widgets/widget/container.jsx +++ b/src/components/widgets/widget/container.jsx @@ -1,10 +1,13 @@ import classNames from "classnames"; +import { useContext } from "react"; import WidgetIcon from "./widget_icon"; import PrimaryText from "./primary_text"; import SecondaryText from "./secondary_text"; import Raw from "./raw"; +import { SettingsContext } from "utils/contexts/settings"; + export function getAllClasses(options, additionalClassNames = "") { if (options?.style?.header === "boxedWidgets") { if (options?.style?.cardBlur !== undefined) { @@ -56,7 +59,17 @@ export function getBottomBlock(children) { } export default function Container({ children = [], options, additionalClassNames = "" }) { - return ( + const { settings } = useContext(SettingsContext); + return options.href ? ( + + {getInnerBlock(children)} + {getBottomBlock(children)} + + ) : (
{getInnerBlock(children)} {getBottomBlock(children)}