@@ -11,7 +11,11 @@ import type { RequiredReactNode } from '../types';
1111import type { DropdownProps } from './Dropdown' ;
1212import { Dropdown as BaseDropdown } from './Dropdown' ;
1313
14- const MenuItem : FC < LinkProps & { active ?: boolean } > = ( { className, active, ...props } ) => (
14+ type ItemProps = {
15+ active ?: boolean ;
16+ } ;
17+
18+ const MenuItem : FC < LinkProps & ItemProps > = ( { className, active, ...props } ) => (
1519 < li role = "menuitem" className = "tw:w-full tw:flex" >
1620 < Link
1721 className = { clsx (
@@ -29,18 +33,22 @@ const MenuItem: FC<LinkProps & { active?: boolean }> = ({ className, active, ...
2933 </ li >
3034) ;
3135
32- const Dropdown : FC < Omit < DropdownProps , 'menuAlignment' | 'buttonVariant' | 'menuOffset' > > = (
33- { containerClassName, buttonClassName, menuClassName, ...props } ,
36+ const Dropdown : FC < Omit < DropdownProps , 'menuAlignment' | 'buttonVariant' | 'menuOffset' > & ItemProps > = (
37+ { containerClassName, buttonClassName, menuClassName, active , ...props } ,
3438) => {
3539 return (
3640 < li role = "menuitem" className = "tw:w-full tw:flex" >
3741 < BaseDropdown
3842 containerClassName = { clsx ( 'tw:max-md:w-full' , containerClassName ) }
3943 buttonVariant = "text"
4044 buttonClassName = { clsx (
41- 'tw:text-white tw:opacity-60 tw:highlight:opacity-100 tw:transition-opacity' ,
4245 'tw:px-2 tw:py-3' ,
4346 'tw:max-md:w-full tw:max-md:px-3 tw:max-md:py-2' ,
47+ 'tw:text-white tw:highlight:opacity-100 tw:transition-opacity' ,
48+ {
49+ 'tw:opacity-60' : ! active ,
50+ 'tw:opacity-100' : active ,
51+ } ,
4452 buttonClassName ,
4553 ) }
4654 menuAlignment = "right"
0 commit comments