From 2a3419f3d8a4a76f3766647aa42cb1a409894a03 Mon Sep 17 00:00:00 2001 From: arunachalam Date: Tue, 11 Jun 2024 11:41:09 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20svg=20styles=20override=20uninte?= =?UTF-8?q?ntionally?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/Sights/SightCard/SightCard.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/documentation/src/components/Sights/SightCard/SightCard.tsx b/documentation/src/components/Sights/SightCard/SightCard.tsx index 88d9e1157..3dd2f6f9d 100644 --- a/documentation/src/components/Sights/SightCard/SightCard.tsx +++ b/documentation/src/components/Sights/SightCard/SightCard.tsx @@ -5,6 +5,7 @@ import { Sight, VehicleDetails, VehicleModel } from '@monkvision/types'; import { CopyPopup, CopyPopupHandle } from '@site/src/components'; import { DynamicSVG } from '../../domOnly'; import styles from './SightCard.module.css'; +import { DynamicSVGCustomizationFunctions } from '@monkvision/common-ui-web'; const vehicleModelDisplayOverlays: Record, string> = { [VehicleModel.AUDIA7]: sights['audia7-WKJlxkiF'].overlay, @@ -53,11 +54,11 @@ export function SightCard({ item }: SightCardProps) { copyPopupRef.current?.open(); }; - const getOverlayAttributes = () => ({ - style: { - stroke: isDarkTheme ? '#ffffff' : '#000000', - }, - }); + const getOverlayAttributes: DynamicSVGCustomizationFunctions['getAttributes'] = (element) => { + element.attributeStyleMap.forEach(console.log); + element.attributeStyleMap.set('stroke', isDarkTheme ? '#ffffff' : '#000000') + return null; + }; return ( <>