Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Reduce spacing between icons in sidebar and add vertical padding #648

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading