diff --git a/dist/img/icon/default/bookmark.svg b/dist/img/icon/default/bookmark.svg new file mode 100644 index 0000000000..18457c6548 --- /dev/null +++ b/dist/img/icon/default/bookmark.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/dist/img/icon/default/chat.svg b/dist/img/icon/default/chat.svg new file mode 100644 index 0000000000..ab09768bcb --- /dev/null +++ b/dist/img/icon/default/chat.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/dist/img/icon/default/page.svg b/dist/img/icon/default/page.svg new file mode 100644 index 0000000000..8dc0182a1b --- /dev/null +++ b/dist/img/icon/default/page.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/dist/img/icon/default/set.svg b/dist/img/icon/default/set.svg new file mode 100644 index 0000000000..1f4e2e9598 --- /dev/null +++ b/dist/img/icon/default/set.svg @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/dist/img/icon/default/tag.svg b/dist/img/icon/default/tag.svg new file mode 100644 index 0000000000..faa240f673 --- /dev/null +++ b/dist/img/icon/default/tag.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/dist/img/icon/default/type.svg b/dist/img/icon/default/type.svg new file mode 100644 index 0000000000..88be9faabd --- /dev/null +++ b/dist/img/icon/default/type.svg @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/dist/img/icon/object/big/bookmark.svg b/dist/img/icon/object/big/bookmark.svg deleted file mode 100644 index 91264540d1..0000000000 --- a/dist/img/icon/object/big/bookmark.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/dist/img/icon/object/big/chat.svg b/dist/img/icon/object/big/chat.svg deleted file mode 100644 index 39c518e249..0000000000 --- a/dist/img/icon/object/big/chat.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/dist/img/icon/object/big/page.svg b/dist/img/icon/object/big/page.svg deleted file mode 100644 index d1acfce456..0000000000 --- a/dist/img/icon/object/big/page.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/dist/img/icon/object/big/set.svg b/dist/img/icon/object/big/set.svg deleted file mode 100644 index 09c54f8319..0000000000 --- a/dist/img/icon/object/big/set.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/dist/img/icon/object/big/tag.svg b/dist/img/icon/object/big/tag.svg deleted file mode 100644 index 9d326ca154..0000000000 --- a/dist/img/icon/object/big/tag.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/dist/img/icon/object/big/type.svg b/dist/img/icon/object/big/type.svg deleted file mode 100644 index 2aed77f13d..0000000000 --- a/dist/img/icon/object/big/type.svg +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dist/img/icon/object/small/bookmark.svg b/dist/img/icon/object/small/bookmark.svg deleted file mode 100644 index c7311dc9a9..0000000000 --- a/dist/img/icon/object/small/bookmark.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/dist/img/icon/object/small/chat.svg b/dist/img/icon/object/small/chat.svg deleted file mode 100644 index b152243030..0000000000 --- a/dist/img/icon/object/small/chat.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/dist/img/icon/object/small/page.svg b/dist/img/icon/object/small/page.svg deleted file mode 100644 index 489c23389b..0000000000 --- a/dist/img/icon/object/small/page.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/dist/img/icon/object/small/set.svg b/dist/img/icon/object/small/set.svg deleted file mode 100644 index 1cf05091d4..0000000000 --- a/dist/img/icon/object/small/set.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/dist/img/icon/object/small/tag.svg b/dist/img/icon/object/small/tag.svg deleted file mode 100644 index eb105754da..0000000000 --- a/dist/img/icon/object/small/tag.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/dist/img/icon/object/small/type.svg b/dist/img/icon/object/small/type.svg deleted file mode 100644 index e3ac6717d3..0000000000 --- a/dist/img/icon/object/small/type.svg +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/scss/component/iconObject.scss b/src/scss/component/iconObject.scss index db6963d0a6..4b8f21284a 100644 --- a/src/scss/component/iconObject.scss +++ b/src/scss/component/iconObject.scss @@ -95,9 +95,6 @@ } .iconObject.c40.isRelation, .iconObject.c48.isRelation { border-radius: 8px; background-color: var(--color-shape-tertiary); } -.iconObject.c40.withDefault, .iconObject.c48.withDefault { border-radius: 8px; } - -.iconObject.withDefault { background-color: var(--color-shape-tertiary); } .iconObject.withImage { border-radius: 2px !important; background-color: unset !important; } .iconObject.withImage.c64, diff --git a/src/ts/component/block/chat/attachment/index.tsx b/src/ts/component/block/chat/attachment/index.tsx index 403fea2cee..e8346db830 100644 --- a/src/ts/component/block/chat/attachment/index.tsx +++ b/src/ts/component/block/chat/attachment/index.tsx @@ -130,7 +130,7 @@ const ChatAttachment = observer(class ChatAttachment extends React.Component - +
@@ -147,7 +147,7 @@ const ChatAttachment = observer(class ChatAttachment extends React.Component
- +
{U.Common.shortUrl(object.source)}
diff --git a/src/ts/component/menu/block/link.tsx b/src/ts/component/menu/block/link.tsx index 3951e217a4..05c3b06801 100644 --- a/src/ts/component/menu/block/link.tsx +++ b/src/ts/component/menu/block/link.tsx @@ -96,7 +96,6 @@ const MenuBlockLink = observer(class MenuBlockLink extends React.Component ); diff --git a/src/ts/component/menu/item/vertical.tsx b/src/ts/component/menu/item/vertical.tsx index 6d269accd4..0294c00363 100644 --- a/src/ts/component/menu/item/vertical.tsx +++ b/src/ts/component/menu/item/vertical.tsx @@ -57,7 +57,7 @@ class MenuItemVertical extends React.Component { }; if (object) { - iconMainElement = ; + iconMainElement = ; if (object.isHidden) { cn.push('isHidden'); diff --git a/src/ts/component/menu/search/object.tsx b/src/ts/component/menu/search/object.tsx index 4eaa61ab04..32376c2257 100644 --- a/src/ts/component/menu/search/object.tsx +++ b/src/ts/component/menu/search/object.tsx @@ -93,7 +93,6 @@ const MenuSearchObject = observer(class MenuSearchObject extends React.Component if (isBig && !item.isAdd) { props.withDescription = true; - props.withDefault = true; props.iconSize = 40; } else { props.caption = (type ? type.name : undefined); diff --git a/src/ts/component/menu/select.tsx b/src/ts/component/menu/select.tsx index 2c6d905aa0..a4b8d27cea 100644 --- a/src/ts/component/menu/select.tsx +++ b/src/ts/component/menu/select.tsx @@ -98,7 +98,6 @@ const MenuSelect = observer(class MenuSelect extends React.Component { onClick={e => this.onClick(e, item)} onMouseEnter={e => this.onMouseEnter(e, item)} style={item.style} - withDefault={withDefault} /> ); }; diff --git a/src/ts/component/page/elements/head/simple.tsx b/src/ts/component/page/elements/head/simple.tsx index be5babdab0..9426363966 100644 --- a/src/ts/component/page/elements/head/simple.tsx +++ b/src/ts/component/page/elements/head/simple.tsx @@ -128,7 +128,6 @@ const HeadSimple = observer(class Controls extends React.Component { size={32} iconSize={32} object={object} - withDefault={true} canEdit={canEditIcon} /> ) : ''} diff --git a/src/ts/component/page/main/empty.tsx b/src/ts/component/page/main/empty.tsx index c16a400e7d..1f8a11ed85 100644 --- a/src/ts/component/page/main/empty.tsx +++ b/src/ts/component/page/main/empty.tsx @@ -30,7 +30,7 @@ const PageMainEmpty = observer(class PageMainEmpty extends React.Component
- + <Label text={translate('pageMainEmptyDescription')} /> diff --git a/src/ts/component/page/main/navigation.tsx b/src/ts/component/page/main/navigation.tsx index f9d2df4352..16f08c2b0e 100644 --- a/src/ts/component/page/main/navigation.tsx +++ b/src/ts/component/page/main/navigation.tsx @@ -76,7 +76,7 @@ const PageMainNavigation = observer(class PageMainNavigation extends React.Compo onMouseLeave={() => this.unsetActive()} > <div className="inner" onClick={e => this.onClick(e, item)}> - <IconObject object={item} withDefault={true} size={48} iconSize={iconSize} /> + <IconObject object={item} size={48} iconSize={iconSize} /> <div className="info"> <ObjectName object={item} /> {description} @@ -130,7 +130,7 @@ const PageMainNavigation = observer(class PageMainNavigation extends React.Compo return ( <div id={`item-${id}`} className={cn.join(' ')}> - <IconObject object={item} withDefault={true} size={48} iconSize={iconSize} /> + <IconObject object={item} size={48} iconSize={iconSize} /> <ObjectName object={item} /> {description} diff --git a/src/ts/component/popup/page/settings/space/create.tsx b/src/ts/component/popup/page/settings/space/create.tsx index 1f15b902b8..e92b20e583 100644 --- a/src/ts/component/popup/page/settings/space/create.tsx +++ b/src/ts/component/popup/page/settings/space/create.tsx @@ -52,7 +52,6 @@ const PopupSettingsSpaceIndex = observer(class PopupSettingsSpaceIndex extends R id="spaceIcon" size={96} object={space} - withDefault={true} canEdit={false} menuParam={{ horizontal: I.MenuDirection.Center }} /> diff --git a/src/ts/component/popup/page/settings/space/index.tsx b/src/ts/component/popup/page/settings/space/index.tsx index 77c9d8cef5..6d626f1908 100644 --- a/src/ts/component/popup/page/settings/space/index.tsx +++ b/src/ts/component/popup/page/settings/space/index.tsx @@ -103,7 +103,6 @@ const PopupSettingsSpaceIndex = observer(class PopupSettingsSpaceIndex extends R id="spaceIcon" size={96} object={space} - withDefault={true} canEdit={canWrite} menuParam={{ horizontal: I.MenuDirection.Center }} onSelect={this.onSelect} diff --git a/src/ts/component/popup/settings.tsx b/src/ts/component/popup/settings.tsx index 626f3986f6..0fa4ff84db 100644 --- a/src/ts/component/popup/settings.tsx +++ b/src/ts/component/popup/settings.tsx @@ -144,7 +144,7 @@ const PopupSettings = observer(class PopupSettings extends React.Component<I.Pop if (action.id == 'account') { if (participant) { name = participant?.globalName || participant?.name; - icon = <IconObject object={{ ...participant, name }} size={36} iconSize={36} withDefault={true} />; + icon = <IconObject object={{ ...participant, name }} size={36} iconSize={36} />; }; cn.push('itemAccount'); diff --git a/src/ts/component/sidebar/object/item.tsx b/src/ts/component/sidebar/object/item.tsx index 2caa40b5d7..f37f9be8d4 100644 --- a/src/ts/component/sidebar/object/item.tsx +++ b/src/ts/component/sidebar/object/item.tsx @@ -29,10 +29,10 @@ const ObjectItem = observer(class ObjectItem extends React.Component<Props> { if (U.Object.isTypeOrRelationLayout(item.layout)) { const size = U.Object.isTypeLayout(item.layout) ? 18 : 20; - iconSmall = <IconObject object={item} size={size} iconSize={18} withDefault={true} />; + iconSmall = <IconObject object={item} size={size} iconSize={18} />; } else { const iconSize = isFile ? 48 : null; - iconLarge = <IconObject object={item} size={48} iconSize={iconSize} withDefault={true} />; + iconLarge = <IconObject object={item} size={48} iconSize={iconSize} />; }; if (item.id == rootId) { diff --git a/src/ts/component/util/iconObject.tsx b/src/ts/component/util/iconObject.tsx index bd4a496f4c..92645873fb 100644 --- a/src/ts/component/util/iconObject.tsx +++ b/src/ts/component/util/iconObject.tsx @@ -21,7 +21,6 @@ interface Props { tooltip?: string; tooltipY?: I.MenuDirection.Top | I.MenuDirection.Bottom; color?: string; - withDefault?: boolean; noGallery?: boolean; noUpload?: boolean; noRemove?: boolean; @@ -133,7 +132,7 @@ const IconObject = observer(class IconObject extends React.Component<Props> { }; render () { - const { className, size, canEdit, withDefault, style } = this.props; + const { className, size, canEdit, style } = this.props; const { theme } = S.Common; const object = this.getObject(); const layout = Number(object.layout) || I.ObjectLayout.Page; @@ -153,6 +152,10 @@ const IconObject = observer(class IconObject extends React.Component<Props> { let icn = []; const defaultIcon = (type: string) => { + if (!DefaultIcons.includes(type)) { + return; + }; + cn.push('withDefault'); icn = icn.concat([ 'iconCommon', 'c' + iconSize ]); icon = <img src={this.defaultIcon(type)} className={icn.join(' ')} />; @@ -167,8 +170,7 @@ const IconObject = observer(class IconObject extends React.Component<Props> { if (iconEmoji || iconImage || iconClass) { icon = <IconEmoji {...this.props} className={icn.join(' ')} iconClass={iconClass} size={iconSize} icon={iconEmoji} objectId={iconImage} />; - } else - if (withDefault) { + } else { defaultIcon('page'); }; break; @@ -181,8 +183,7 @@ const IconObject = observer(class IconObject extends React.Component<Props> { if (iconEmoji || iconImage || iconClass) { icon = <IconEmoji {...this.props} className={icn.join(' ')} iconClass={iconClass} size={iconSize} icon={iconEmoji} objectId={iconImage} />; - } else - if (withDefault) { + } else { defaultIcon('chat'); }; break; @@ -195,8 +196,7 @@ const IconObject = observer(class IconObject extends React.Component<Props> { if (iconEmoji || iconImage) { icon = <IconEmoji {...this.props} className={icn.join(' ')} iconClass={iconClass} size={iconSize} icon={iconEmoji} objectId={iconImage} />; - } else - if (withDefault) { + } else { defaultIcon('set'); }; break; @@ -226,17 +226,14 @@ const IconObject = observer(class IconObject extends React.Component<Props> { }; case I.ObjectLayout.Note: { - if (withDefault) { - defaultIcon('page'); - }; + defaultIcon('page'); break; }; case I.ObjectLayout.Type: { if (iconEmoji) { icon = <IconEmoji {...this.props} className={icn.join(' ')} iconClass={iconClass} size={iconSize} icon={iconEmoji} objectId={iconImage} />; - } else - if (withDefault) { + } else { defaultIcon('type'); }; break; @@ -260,8 +257,7 @@ const IconObject = observer(class IconObject extends React.Component<Props> { if (iconImage) { icn = icn.concat([ 'iconCommon', 'c' + iconSize ]); icon = <img src={S.Common.imageUrl(iconImage, iconSize * 2)} className={icn.join(' ')} />; - } else - if (withDefault) { + } else { defaultIcon('bookmark'); }; break; @@ -450,9 +446,9 @@ const IconObject = observer(class IconObject extends React.Component<Props> { }; iconSize () { - const { size, iconSize, withDefault } = this.props; + const { size, iconSize } = this.props; const object = this.getObject(); - const { layout, iconImage, iconEmoji, isDeleted } = object; + const { layout, iconImage, isDeleted } = object; let s = IconSize[size]; @@ -463,7 +459,7 @@ const IconObject = observer(class IconObject extends React.Component<Props> { if ((size == 18) && (U.Object.isTaskLayout(layout))) { s = 16; } else - if ((size == 48) && (U.Object.isRelationLayout(layout) || withDefault)) { + if ((size == 48) && U.Object.isRelationLayout(layout)) { s = 28; } else if (size >= 40) { @@ -556,14 +552,7 @@ const IconObject = observer(class IconObject extends React.Component<Props> { }; defaultIcon (type: string) { - const iconSize = this.iconSize(); - const key = iconSize < 28 ? 'small' : 'big'; - - if (DefaultIcons.includes(type)) { - return require(`img/icon/object/${key}/${type}.svg`).default; - }; - - return ''; + return require(`img/icon/default/${type}.svg`).default; }; }); diff --git a/src/ts/component/vault/item.tsx b/src/ts/component/vault/item.tsx index c4b3f85495..3ca1ba38cc 100644 --- a/src/ts/component/vault/item.tsx +++ b/src/ts/component/vault/item.tsx @@ -22,7 +22,7 @@ const VaultItem = observer(class Vault extends React.Component<Props> { if (!isButton) { const object = U.Menu.getVaultItems().find(it => it.id == id); - icon = <IconObject object={object} size={36} iconSize={36} withDefault={true} />; + icon = <IconObject object={object} size={36} iconSize={36} />; } else { cn.push(`isButton ${id}`); }; diff --git a/src/ts/component/widget/space.tsx b/src/ts/component/widget/space.tsx index 3948f736b4..d4d9b52ca5 100644 --- a/src/ts/component/widget/space.tsx +++ b/src/ts/component/widget/space.tsx @@ -24,7 +24,6 @@ const WidgetSpace = observer(class WidgetSpace extends React.Component<I.WidgetC <IconObject id="widget-space-icon" object={{ ...space, layout: I.ObjectLayout.SpaceView }} - withDefault={true} size={28} iconSize={28} menuParam={{ className: 'fixed' }}