mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
Feat/sidebar&top bar (#1454)
This commit is contained in:
@@ -10,17 +10,19 @@ import { StyledArrow, StyledMenuItem } from './styles';
|
||||
export type IconMenuProps = PropsWithChildren<{
|
||||
isDir?: boolean;
|
||||
icon?: ReactElement;
|
||||
iconSize?: [number, number];
|
||||
}> &
|
||||
HTMLAttributes<HTMLButtonElement>;
|
||||
|
||||
export const MenuItem = forwardRef<HTMLButtonElement, IconMenuProps>(
|
||||
({ isDir = false, icon, children, ...props }, ref) => {
|
||||
({ isDir = false, icon, iconSize, children, ...props }, ref) => {
|
||||
const [iconWidth, iconHeight] = iconSize || [16, 16];
|
||||
return (
|
||||
<StyledMenuItem ref={ref} {...props}>
|
||||
{icon &&
|
||||
cloneElement(icon, {
|
||||
width: 16,
|
||||
height: 16,
|
||||
width: iconWidth,
|
||||
height: iconHeight,
|
||||
style: {
|
||||
marginRight: 14,
|
||||
...icon.props?.style,
|
||||
|
||||
Reference in New Issue
Block a user