Enhance MenuButton component in WindowAppMenu
All checks were successful
farmcontrol/farmcontrol-ui/pipeline/head This commit looks good
All checks were successful
farmcontrol/farmcontrol-ui/pipeline/head This commit looks good
- Added a new `logo` prop to the `MenuButton` component to conditionally adjust padding and margin based on the presence of a logo. - Updated the `MenuButton` prop types to include the new `logo` boolean, improving flexibility in rendering menu items with logos.
This commit is contained in:
parent
557c334aa0
commit
7d79e0d206
@ -49,7 +49,7 @@ const mapSidebarItemsToMenuItems = (items = [], navigate) =>
|
||||
})
|
||||
.filter(Boolean)
|
||||
|
||||
const MenuButton = ({ label, items }) => (
|
||||
const MenuButton = ({ label, items, logo }) => (
|
||||
<Dropdown menu={{ items }} trigger={['click']} placement='bottomLeft'>
|
||||
<Button
|
||||
type='text'
|
||||
@ -57,7 +57,8 @@ const MenuButton = ({ label, items }) => (
|
||||
className='electrobun-webkit-app-region-no-drag'
|
||||
style={{
|
||||
height: '28px',
|
||||
paddingInline: '8px',
|
||||
paddingInline: logo ? '6px' : '8px',
|
||||
marginRight: logo ? '1px' : '0',
|
||||
fontWeight: 500
|
||||
}}
|
||||
>
|
||||
@ -68,7 +69,8 @@ const MenuButton = ({ label, items }) => (
|
||||
|
||||
MenuButton.propTypes = {
|
||||
label: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).isRequired,
|
||||
items: PropTypes.array.isRequired
|
||||
items: PropTypes.array.isRequired,
|
||||
logo: PropTypes.bool
|
||||
}
|
||||
|
||||
const WindowAppMenu = () => {
|
||||
@ -233,6 +235,7 @@ const WindowAppMenu = () => {
|
||||
return (
|
||||
<MenuButton
|
||||
key={menu.key}
|
||||
logo={true}
|
||||
label={
|
||||
<FarmControlLogoSmall
|
||||
style={{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user