mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-11 07:06:28 +08:00
feat: update pendant add button
This commit is contained in:
@@ -4,7 +4,10 @@ import {
|
||||
Popover,
|
||||
type PopoverProps,
|
||||
PopperHandler,
|
||||
Tag,
|
||||
} from '@toeverything/components/ui';
|
||||
import { TagsIcon } from '@toeverything/components/icons';
|
||||
|
||||
import { CreatePendantPanel } from './pendant-operation-panel';
|
||||
import { IconButton } from './StyledComponent';
|
||||
import { AsyncBlock } from '../editor';
|
||||
@@ -13,11 +16,13 @@ type Props = {
|
||||
block: AsyncBlock;
|
||||
onSure?: () => void;
|
||||
iconStyle?: CSSProperties;
|
||||
useAddIcon?: boolean;
|
||||
} & Omit<PopoverProps, 'content'>;
|
||||
export const AddPendantPopover = ({
|
||||
block,
|
||||
onSure,
|
||||
iconStyle,
|
||||
useAddIcon = true,
|
||||
...popoverProps
|
||||
}: Props) => {
|
||||
const popoverHandlerRef = useRef<PopperHandler>();
|
||||
@@ -38,9 +43,25 @@ export const AddPendantPopover = ({
|
||||
style={{ padding: 0 }}
|
||||
{...popoverProps}
|
||||
>
|
||||
<IconButton style={{ marginRight: 12, ...iconStyle }}>
|
||||
<Add sx={{ fontSize: 14 }} />
|
||||
</IconButton>
|
||||
{useAddIcon ? (
|
||||
<IconButton style={{ marginRight: 12, ...iconStyle }}>
|
||||
<Add sx={{ fontSize: 14 }} />
|
||||
</IconButton>
|
||||
) : (
|
||||
<Tag
|
||||
style={{
|
||||
background: '#F5F7F8',
|
||||
color: '#98ACBD',
|
||||
marginRight: 12,
|
||||
marginBottom: 8,
|
||||
}}
|
||||
startElement={
|
||||
<TagsIcon style={{ fontSize: 14, marginRight: 4 }} />
|
||||
}
|
||||
>
|
||||
Tag App
|
||||
</Tag>
|
||||
)}
|
||||
</Popover>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -33,6 +33,7 @@ export const PendantPopover = (
|
||||
}}
|
||||
offset={[0, -30]}
|
||||
trigger="click"
|
||||
useAddIcon={false}
|
||||
/>
|
||||
}
|
||||
onClose={() => {
|
||||
|
||||
Reference in New Issue
Block a user