1
0
Fork 0
mirror of https://github.com/anyproto/anytype-ts.git synced 2025-06-08 05:57:02 +09:00

fix clipboard button

This commit is contained in:
Andrew Simachev 2024-03-13 09:59:53 +01:00
parent 10c90b462c
commit 6ee21d2460
No known key found for this signature in database
GPG key ID: 49A163D0D14E6FD8
2 changed files with 17 additions and 9 deletions

View file

@ -37,6 +37,9 @@
.item.hover:before {
content: ''; position: absolute; z-index: 0; width: 100%; height: 100%; left: 0px; top: 0px; background: var(--color-shape-highlight-light);
}
.item.clipboard { opacity: 0.5; }
.item.clipboard.active { opacity: 1; }
}
.menu.menuQuickCapture.isExpanded {

View file

@ -96,6 +96,10 @@ class MenuQuickCapture extends React.Component<I.Menu, State> {
cn.push('isDefault');
};
if (item.className) {
cn.push(item.className);
};
if ([ SystemIds.Search, SystemIds.Add, SystemIds.Clipboard ].includes(item.itemId)) {
icon = <Icon className={item.itemId} />;
} else {
@ -251,6 +255,8 @@ class MenuQuickCapture extends React.Component<I.Menu, State> {
const { isExpanded } = this.state;
const { space, type } = commonStore;
const pinnedIds = Storage.getPinnedTypes();
const hasClipboard = this.clipboardItems && this.clipboardItems.length;
const cmd = keyboard.cmdSymbol();
let sections: any[] = [];
let items: any[] = [];
@ -315,15 +321,14 @@ class MenuQuickCapture extends React.Component<I.Menu, State> {
caption: '0',
});
if (this.clipboardItems && this.clipboardItems.length) {
items.push({
id: SystemIds.Clipboard,
icon: 'clipboard',
name: '',
tooltip: translate('menuQuickCaptureTooltipClipboard'),
caption: '0',
});
};
items.push({
id: SystemIds.Clipboard,
icon: 'clipboard',
name: '',
tooltip: translate('menuQuickCaptureTooltipClipboard'),
caption: `${cmd} + V`,
className: [ 'clipboard', (hasClipboard ? 'active' : '') ].join(' '),
});
sections.push({ id: 'collapsed', children: items });
};