feat: forced file naming format (#2270)

This commit is contained in:
Himself65
2023-05-09 06:37:07 +08:00
committed by GitHub
parent 95bc5cac49
commit 4f99ad2db4
132 changed files with 208 additions and 100 deletions
@@ -0,0 +1,39 @@
import { CloseIcon } from '@blocksuite/icons';
import type { HTMLAttributes } from 'react';
import { styled } from '../../styles';
import type { IconButtonProps } from '../button/icon-button';
import { IconButton } from '../button/icon-button';
export type ModalCloseButtonProps = {
top?: number;
right?: number;
absolute?: boolean;
} & Omit<IconButtonProps, 'children'> &
HTMLAttributes<HTMLButtonElement>;
const StyledIconButton = styled(IconButton)<
Pick<ModalCloseButtonProps, 'top' | 'right'>
>(({ top, right }) => {
return {
position: 'absolute',
top: top ?? 24,
right: right ?? 40,
};
});
export const ModalCloseButton = ({
absolute = true,
...props
}: ModalCloseButtonProps) => {
return absolute ? (
<StyledIconButton {...props}>
<CloseIcon />
</StyledIconButton>
) : (
<IconButton {...props}>
<CloseIcon />
</IconButton>
);
};
export default ModalCloseButton;