mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
feat: forced file naming format (#2270)
This commit is contained in:
27
packages/component/src/ui/tooltip/tooltip.tsx
Normal file
27
packages/component/src/ui/tooltip/tooltip.tsx
Normal file
@@ -0,0 +1,27 @@
|
||||
import type { TooltipProps } from '@mui/material';
|
||||
|
||||
import { styled } from '../../styles';
|
||||
import { Popper, type PopperProps } from '../popper';
|
||||
import StyledPopperContainer from '../shared/container';
|
||||
const StyledTooltip = styled(StyledPopperContainer)(() => {
|
||||
return {
|
||||
maxWidth: '320px',
|
||||
boxShadow: 'var(--affine-float-button-shadow)',
|
||||
padding: '4px 12px',
|
||||
backgroundColor: 'var(--affine-tooltip)',
|
||||
color: 'var(--affine-white)',
|
||||
fontSize: 'var(--affine-font-sm)',
|
||||
};
|
||||
});
|
||||
|
||||
export const Tooltip = (props: PopperProps & Omit<TooltipProps, 'title'>) => {
|
||||
const { content, placement = 'top-start', children } = props;
|
||||
return (
|
||||
<Popper
|
||||
{...props}
|
||||
content={<StyledTooltip placement={placement}>{content}</StyledTooltip>}
|
||||
>
|
||||
{children}
|
||||
</Popper>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user