Skip to content

Commit

Permalink
feat: Reduce spacing between icons in sidebar and add vertical padding (
Browse files Browse the repository at this point in the history
  • Loading branch information
maciaszczykm authored Oct 4, 2024
1 parent b353792 commit a185b03
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 3 deletions.
18 changes: 18 additions & 0 deletions src/components/Menu.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Menu as HonorableMenu } from 'honorable'
import type { MenuProps as HonorableMenuProps } from 'honorable'
import { type MutableRefObject, forwardRef } from 'react'

export type MenuProps = HonorableMenuProps

function MenuRef({ ...props }: MenuProps, ref: MutableRefObject<any>) {
return (
<HonorableMenu
ref={ref}
{...props}
/>
)
}

const Menu = forwardRef(MenuRef)

export default Menu
18 changes: 18 additions & 0 deletions src/components/MenuItem.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { MenuItem as HonorableMenuItem } from 'honorable'
import type { MenuItemProps as HonorableMenuItemProps } from 'honorable'
import { type MutableRefObject, forwardRef } from 'react'

export type MenuItemProps = HonorableMenuItemProps

function MenuItemRef({ ...props }: MenuItemProps, ref: MutableRefObject<any>) {
return (
<HonorableMenuItem
ref={ref}
{...props}
/>
)
}

const MenuItem = forwardRef(MenuItemRef)

export default MenuItem
2 changes: 1 addition & 1 deletion src/components/SidebarItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const ItemSC = styled.div<{
textDecoration: 'none',
whiteSpace: 'nowrap',
width: $isHorizontal ? undefined : '100%',
height: $isHorizontal ? undefined : 32,
height: $isHorizontal ? undefined : 39,
flexGrow: 0,
padding: $isHorizontal ? undefined : theme.spacing.small,
borderRadius: '3px',
Expand Down
2 changes: 1 addition & 1 deletion src/components/SidebarSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function SidebarSectionRef(
align="center"
ref={ref}
borderBottom={isHorizontal ? '' : '1px solid border'}
gap={isHorizontal ? 'medium' : 'xsmall'}
gap={isHorizontal ? 'medium' : 'xxsmall'}
padding={12}
width={isHorizontal ? 'auto' : '100%'}
{...styles}
Expand Down
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export { Avatar, Menu, MenuItem } from 'honorable'
export { Avatar } from 'honorable'

// Icons
export * from './icons'
Expand Down Expand Up @@ -35,6 +35,8 @@ export { default as IconFrame } from './components/IconFrame'
export { default as Input } from './components/Input'
export { default as Input2 } from './components/Input2'
export { default as Markdown } from './components/Markdown'
export { default as Menu } from './components/Menu'
export { default as MenuItem } from './components/MenuItem'
export type { PageCardProps } from './components/PageCard'
export { default as PageCard } from './components/PageCard'
export { default as PageTitle } from './components/PageTitle'
Expand Down

0 comments on commit a185b03

Please sign in to comment.