@@ -8,8 +8,10 @@ import { ButtonStyles } from "../../atoms/constants/button-styles";
88// #region Constants
99// -------------------------------------------------------------------------------------------------
1010
11+ const BUTTON_CLASS = "c-button" ;
1112const COMPONENT_CLASS = "c-dropdown-button" ;
1213const COMPONENT_LIST_CLASS = `${ COMPONENT_CLASS } __list` ;
14+ const COMPONENT_LIST_ITEM_CLASS = `${ COMPONENT_LIST_CLASS } __item` ;
1315
1416// #endregion Constants
1517
@@ -24,10 +26,10 @@ export interface DropdownItem {
2426
2527export interface DropdownButtonProps {
2628 buttonClassName ?: string ;
29+ buttonContents : string | React . ReactNode | React . ReactNodeArray ;
2730 menuItems : Array < DropdownItem > ;
2831 size ?: ButtonSizes ;
2932 style ?: ButtonStyles ;
30- buttonContents : string | React . ReactNode | React . ReactNodeArray ;
3133}
3234
3335// #endregion Interfaces
@@ -41,7 +43,7 @@ const DropdownButton: React.FC<DropdownButtonProps> = (
4143) => {
4244 const { buttonClassName, menuItems, buttonContents, size, style } = props ;
4345
44- const classNames = [ "c-button" , COMPONENT_CLASS ] ;
46+ const classNames = [ BUTTON_CLASS , COMPONENT_CLASS ] ;
4547
4648 if ( buttonClassName != null ) {
4749 classNames . push ( buttonClassName ) ;
@@ -63,9 +65,9 @@ const DropdownButton: React.FC<DropdownButtonProps> = (
6365 < MenuList className = { COMPONENT_LIST_CLASS } >
6466 { menuItems . map ( ( item : DropdownItem ) => (
6567 < MenuItem
68+ className = { COMPONENT_LIST_ITEM_CLASS }
6669 key = { uuid . v4 ( ) }
67- onSelect = { item . onSelect }
68- className = { `${ COMPONENT_LIST_CLASS } __item` } >
70+ onSelect = { item . onSelect } >
6971 { item . component }
7072 </ MenuItem >
7173 ) ) }
0 commit comments