🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@fc-components/menu

Package Overview
Dependencies
Maintainers
4
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fc-components/menu - npm Package Compare versions

Comparing version
1.1.21
to
1.1.22
+1
-1
package.json
{
"name": "@fc-components/menu",
"version": "1.1.21",
"version": "1.1.22",
"description": "The Menu component used for flashcat.",

@@ -5,0 +5,0 @@ "main": "src/index.tsx",

@@ -58,10 +58,23 @@ import React, { useState, useEffect, useRef } from 'react';

const [starActiveIndex, setStarActiveIndex] = useState(-1);
const displayMenus = menus.filter(
(menu) =>
const displayMenus = menus.filter((menu) => {
const label =
typeof menu.label === 'string'
? menu.label
: typeof (menu.label as React.ReactElement).props?.text === 'string'
? (menu.label as React.ReactElement).props?.text
: '';
const primaryLabel =
typeof menu.primaryLabel === 'string'
? menu.primaryLabel
: typeof (menu.primaryLabel as React.ReactElement).props?.text === 'string'
? (menu.primaryLabel as React.ReactElement).props?.text
: '';
return (
!search ||
match(menu.label, search) ||
match(menu.primaryLabel, search) ||
menu.label.includes(search) ||
menu.primaryLabel.includes(search),
);
match(label, search) ||
match(primaryLabel, search) ||
label.includes(search) ||
primaryLabel.includes(search)
);
});
const staredMenus = menus.filter((item) => item.stared);

@@ -68,0 +81,0 @@ const handleMenuStar = (key, v, e) => {