diff --git a/src/modules/nestedMenu/components/nestedMenu.component.tsx b/src/modules/nestedMenu/components/nestedMenu.component.tsx index 46ebf69..09b5032 100644 --- a/src/modules/nestedMenu/components/nestedMenu.component.tsx +++ b/src/modules/nestedMenu/components/nestedMenu.component.tsx @@ -11,14 +11,23 @@ const styles = { } } +function getBrowserStyle(){ + let style = `background: linear-gradient(0deg, rgb(44, 102, 147) 0%, rgb(44, 102, 147) 100%)!important`; + if (window.navigator.appVersion.includes('Mac')) style = `outline: 1px solid rgb(44, 102, 147);` + return `select:focus option:checked{ + ${style} + }` +} + export function NestedMenu({menuJson}:{menuJson:NestedMenuObject}):ReactElement{ let rand = randomInteger(); return <> - + } \ No newline at end of file diff --git a/src/modules/nestedMenu/components/nestedMenu.css b/src/modules/nestedMenu/components/nestedMenu.css index 0d65b09..8c89f33 100644 --- a/src/modules/nestedMenu/components/nestedMenu.css +++ b/src/modules/nestedMenu/components/nestedMenu.css @@ -3,9 +3,9 @@ } option.analyticsLink::after { - content: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAQElEQVR42qXKwQkAIAxDUUdxtO6/RBQkQZvSi8I/pL4BoGw/XPkh4XigPmsUgh0626AjRsgxHTkUThsG2T/sIlzdTsp52kSS1wAAAABJRU5ErkJggg==); + content: "↗"; position: relative; - left: 5px; + left: 3px; } option:checked{ @@ -13,6 +13,6 @@ option:checked{ } select:focus option:checked{ - background: linear-gradient(0deg, rgb(44, 102, 147) 0%, rgb(44, 102, 147) 100%)!important; - color: white!important; -} \ No newline at end of file + /*background: linear-gradient(0deg, rgb(44, 102, 147) 0%, rgb(44, 102, 147) 100%)!important;*/ + /*outline: 1px solid rgb(44, 102, 147);*/ +} diff --git a/src/modules/nestedMenu/components/nestedSubMenu.component.tsx b/src/modules/nestedMenu/components/nestedSubMenu.component.tsx index a52eae0..17750da 100644 --- a/src/modules/nestedMenu/components/nestedSubMenu.component.tsx +++ b/src/modules/nestedMenu/components/nestedSubMenu.component.tsx @@ -2,7 +2,7 @@ import React, {CSSProperties, ReactElement, useState} from "react"; import {ListItem, styled} from "@mui/material"; import {NestedMenuContent} from "../../shared/services/content.service"; import {randomInteger} from "../services/randomInteger"; -import {createStyleElement} from "../services/createStyleElement"; +import {createStyleElement, checkStyle, removeStyle} from "../services/createStyleElement"; const styles = { subMenu: { @@ -24,29 +24,21 @@ const generateLink = (link:string)=>{ } const AnalyticsLink = ({link,name}:{link:string, name:string})=>{ + let id = `nestedMenuItem_${randomInteger()}` + checkStyle(id,name); + name = removeStyle(name) return } -function Item({category, selected, onClick}:{category:string, selected:boolean, onClick: ()=>void}){ +function Item({category, onClick}:{category:string, onClick: ()=>void}){ let id = `nestedMenuItem_${randomInteger()}` - if (/\{.+\}/.test(category)) { - try { - let r = category.match(/\{.+\}/); - let css = r&&r[0] - ?.replace(/(\{|\})/g,"") - ?.replace(/\|/g,":") - ?.replace(/\$/g,"#") - createStyleElement(id,css); - }catch(e){ - - } - category = category.replace(/\{.+\}/, '') - } + checkStyle(id,category); + category = removeStyle(category) return <>