feat: add new page button (#2417)

This commit is contained in:
Whitewater
2023-05-18 13:07:05 -07:00
committed by himself65
parent 341b18ded7
commit 48ef60cb0a
16 changed files with 378 additions and 116 deletions
+13 -2
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>
}
+4 -1
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 }) => {