mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
feat: add new page button (#2417)
This commit is contained in:
@@ -6,16 +6,27 @@ import { StyledMenuWrapper } from './styles';
|
||||
|
||||
export type MenuProps = {
|
||||
width?: CSSProperties['width'];
|
||||
menuStyles?: CSSProperties;
|
||||
} & PopperProps &
|
||||
Omit<TooltipProps, 'title' | 'content' | 'placement'>;
|
||||
export const Menu = (props: MenuProps) => {
|
||||
const { width, content, placement = 'bottom-start', children } = props;
|
||||
const {
|
||||
width,
|
||||
menuStyles,
|
||||
content,
|
||||
placement = 'bottom-start',
|
||||
children,
|
||||
} = props;
|
||||
return content ? (
|
||||
<Popper
|
||||
{...props}
|
||||
showArrow={false}
|
||||
content={
|
||||
<StyledMenuWrapper width={width} placement={placement}>
|
||||
<StyledMenuWrapper
|
||||
width={width}
|
||||
placement={placement}
|
||||
style={menuStyles}
|
||||
>
|
||||
{content}
|
||||
</StyledMenuWrapper>
|
||||
}
|
||||
|
||||
@@ -3,7 +3,10 @@ import type { CSSProperties } from 'react';
|
||||
import { displayFlex, styled, textEllipsis } from '../../styles';
|
||||
import StyledPopperContainer from '../shared/container';
|
||||
|
||||
export const StyledMenuWrapper = styled(StyledPopperContainer)<{
|
||||
export const StyledMenuWrapper = styled(StyledPopperContainer, {
|
||||
shouldForwardProp: propName =>
|
||||
!['width', 'height'].includes(propName as string),
|
||||
})<{
|
||||
width?: CSSProperties['width'];
|
||||
height?: CSSProperties['height'];
|
||||
}>(({ width, height }) => {
|
||||
|
||||
@@ -37,7 +37,6 @@ export const StyledTableCell = styled('td')<
|
||||
return {
|
||||
width,
|
||||
height: '52px',
|
||||
lineHeight: '52px',
|
||||
padding: '0 30px',
|
||||
boxSizing: 'border-box',
|
||||
textAlign: align,
|
||||
|
||||
Reference in New Issue
Block a user