From f632bf761c3462a0902fbdd1f05d0e65484e7782 Mon Sep 17 00:00:00 2001 From: thetek Date: Sun, 19 May 2024 15:56:20 +0200 Subject: [PATCH] style map threat info element --- index.html | 3 ++ .../Element/Complex/MapThreatInfoElement.tsx | 39 ++++++++++++++++++- src/components/Widget/MapWarningWidget.tsx | 17 +++++++- tailwind.config.js | 8 +++- 4 files changed, 64 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index b5fae3d..08b6d6e 100644 --- a/index.html +++ b/index.html @@ -4,6 +4,9 @@ + + + React Redux App diff --git a/src/components/Element/Complex/MapThreatInfoElement.tsx b/src/components/Element/Complex/MapThreatInfoElement.tsx index ed674fe..32756fd 100644 --- a/src/components/Element/Complex/MapThreatInfoElement.tsx +++ b/src/components/Element/Complex/MapThreatInfoElement.tsx @@ -6,9 +6,12 @@ import { capitalizeFirstLetter as cfl } from 'src/utils/helpers'; type Props = { element: InformationElement; + inGaze: boolean; }; -const MapThreatInfoElement = ({ element }: Props) => { +const M_HEIGHT = 60; + +const MapThreatInfoElement = ({ element, inGaze }: Props) => { const dispatch = useAppDispatch(); // could also fetch messages from redux // provided there is a conversation number @@ -105,6 +108,40 @@ const MapThreatInfoElement = ({ element }: Props) => { }; return <>{renderElement()}; +// return ( +//
+//
+// {title} +//
+// {inGaze ? : <>} +//
+// ); +}; + +const GazeHighlight = () => { + return ( + <> +
+
+ + + +
+ + ); }; export default MapThreatInfoElement; diff --git a/src/components/Widget/MapWarningWidget.tsx b/src/components/Widget/MapWarningWidget.tsx index 12ea977..d24bc00 100644 --- a/src/components/Widget/MapWarningWidget.tsx +++ b/src/components/Widget/MapWarningWidget.tsx @@ -11,7 +11,6 @@ import { import { useEffect, useState } from 'react'; import type { IconElement as IconElementType, - TextElement as TextElementType, InformationElement as InformationElementType, } from 'src/types/element'; import IconElement from 'src/components/Element/Simple/IconElement'; @@ -44,6 +43,22 @@ const MapWarningWidget = ({ widget }: MapWarningWidgetProps) => { } }, [inGaze, dispatch, iconElement, threatInfoElement, widget]); + const handleInGaze = () => { + if (threatInfoElement) { + return ( + <> +
+ + + ); + } + + return null; + }; + return (