feat: add new page button (#2417)

This commit is contained in:
Whitewater
2023-05-18 13:07:05 -07:00
committed by GitHub
parent 11370bc07e
commit 530dd5ff7f
16 changed files with 378 additions and 116 deletions

View File

@@ -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>
}

View File

@@ -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 }) => {

View File

@@ -37,7 +37,6 @@ export const StyledTableCell = styled('td')<
return {
width,
height: '52px',
lineHeight: '52px',
padding: '0 30px',
boxSizing: 'border-box',
textAlign: align,