Skip to content

Commit 8b395e5

Browse files
committed
chore: remove postcss-js dependency from package.json
- Removed the postcss-js dependency from package.json to streamline the project and reduce unnecessary bloat. - Updated ContextMenuItem component to use React.memo for performance optimization, preventing unnecessary re-renders. Signed-off-by: Innei <tukon479@gmail.com>
1 parent 08740d4 commit 8b395e5

File tree

2 files changed

+27
-26
lines changed

2 files changed

+27
-26
lines changed

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@
6565
"lint-staged": "16.1.5",
6666
"postcss": "8.5.6",
6767
"postcss-import": "16.1.1",
68-
"postcss-js": "4.0.1",
6968
"prettier": "3.6.2",
7069
"simple-git-hooks": "2.13.1",
7170
"tailwind-scrollbar": "4.0.2",
@@ -90,4 +89,4 @@
9089
"eslint --fix"
9190
]
9291
}
93-
}
92+
}

src/components/ui/context-menu/context-menu.tsx

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -90,31 +90,33 @@ const ContextMenuContent = ({
9090
)
9191
ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName
9292

93-
const ContextMenuItem = ({
94-
ref,
95-
className,
96-
inset,
97-
hasIcon,
98-
...props
99-
}: React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item> & {
100-
inset?: boolean
101-
hasIcon?: boolean
102-
} & {
103-
ref?: React.Ref<React.ElementRef<typeof ContextMenuPrimitive.Item> | null>
104-
}) => (
105-
<ContextMenuPrimitive.Item
106-
ref={ref}
107-
className={clsxm(
108-
'cursor-menu focus:bg-accent focus:text-white text-sm text-foreground relative flex select-none items-center rounded-[5px] px-2.5 py-1 outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
109-
'data-[highlighted]:bg-accent data-[highlighted]:text-white focus-within:outline-transparent',
110-
'h-[28px]',
111-
inset && 'pl-8',
112-
hasIcon ? 'px-8' : 'pr-8',
93+
const ContextMenuItem = React.memo(
94+
({
95+
ref,
96+
className,
97+
inset,
98+
hasIcon,
99+
...props
100+
}: React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item> & {
101+
inset?: boolean
102+
hasIcon?: boolean
103+
} & {
104+
ref?: React.Ref<React.ElementRef<typeof ContextMenuPrimitive.Item> | null>
105+
}) => (
106+
<ContextMenuPrimitive.Item
107+
ref={ref}
108+
className={clsxm(
109+
'cursor-menu focus:bg-accent focus:text-white text-sm text-foreground relative flex select-none items-center rounded-[5px] px-2.5 py-1 outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
110+
'data-[highlighted]:bg-accent data-[highlighted]:text-white focus-within:outline-transparent',
111+
'h-[28px]',
112+
inset && 'pl-8',
113+
hasIcon ? 'px-8' : 'pr-8',
113114

114-
className,
115-
)}
116-
{...props}
117-
/>
115+
className,
116+
)}
117+
{...props}
118+
/>
119+
),
118120
)
119121
ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName
120122

0 commit comments

Comments
 (0)