mirror of
https://github.com/anyproto/anytype-ts.git
synced 2025-06-09 09:35:02 +09:00
JS-5725: description updates
This commit is contained in:
parent
84ae0010d8
commit
6f2b7ed9f6
4 changed files with 19 additions and 29 deletions
5
dist/img/icon/relation/description.svg
vendored
Normal file
5
dist/img/icon/relation/description.svg
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="10" cy="10" r="7.75" stroke="#B6B6B6" stroke-width="1.5"/>
|
||||
<path d="M10.748 8.5V14.999H9.24976V8.5H10.748Z" fill="#B6B6B6"/>
|
||||
<path d="M10 7C9.44772 7 9 6.55228 9 6C9 5.44772 9.44772 5 10 5C10.5523 5 11 5.44772 11 6C11 6.55228 10.5523 7 10 7Z" fill="#B6B6B6"/>
|
||||
</svg>
|
After Width: | Height: | Size: 374 B |
|
@ -70,7 +70,6 @@ class MenuBlockLayout extends React.Component<I.Menu> {
|
|||
const { param } = this.props;
|
||||
const { data } = param;
|
||||
const { rootId } = data;
|
||||
const allowedLayout = S.Block.checkFlags(rootId, rootId, [ I.RestrictionObject.Layout ]);
|
||||
const allowedDetails = S.Block.checkFlags(rootId, rootId, [ I.RestrictionObject.Details ]);
|
||||
const object = S.Detail.get(rootId, rootId, [ 'layoutAlign' ]);
|
||||
|
||||
|
@ -84,17 +83,7 @@ class MenuBlockLayout extends React.Component<I.Menu> {
|
|||
resize = null;
|
||||
};
|
||||
|
||||
let sections = [];
|
||||
if (allowedLayout) {
|
||||
sections.push({ name: translate('menuBlockLayoutChooseLayoutType'), children: U.Menu.turnLayouts() });
|
||||
};
|
||||
|
||||
sections.push({
|
||||
children: [
|
||||
resize,
|
||||
align,
|
||||
]
|
||||
});
|
||||
let sections = [ { children: [ resize, align ] } ];
|
||||
|
||||
sections = sections.filter((section: any) => {
|
||||
section.children = section.children.filter(it => it);
|
||||
|
@ -178,10 +167,7 @@ class MenuBlockLayout extends React.Component<I.Menu> {
|
|||
};
|
||||
|
||||
onClick (e: any, item: any) {
|
||||
const { param, close } = this.props;
|
||||
const { data } = param;
|
||||
const { rootId, onLayoutSelect } = data;
|
||||
const object = S.Detail.get(rootId, rootId, []);
|
||||
const { close } = this.props;
|
||||
|
||||
if (item.arrow) {
|
||||
return;
|
||||
|
@ -193,14 +179,6 @@ class MenuBlockLayout extends React.Component<I.Menu> {
|
|||
this.onResize(e);
|
||||
|
||||
analytics.event('SetLayoutWidth');
|
||||
} else {
|
||||
U.Object.setLayout(rootId, item.id, (message: any) => {
|
||||
if (onLayoutSelect) {
|
||||
onLayoutSelect(item.id);
|
||||
};
|
||||
});
|
||||
|
||||
analytics.event('ChangeLayout', { objectType: object.type, layout: item.id });
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@ import { observer } from 'mobx-react';
|
|||
import arrayMove from 'array-move';
|
||||
import { AutoSizer, CellMeasurer, InfiniteLoader, List as VList, CellMeasurerCache } from 'react-virtualized';
|
||||
import { SortableContainer, SortableElement, SortableHandle } from 'react-sortable-hoc';
|
||||
import { Icon, Switch } from 'Component';
|
||||
import { I, C, S, J, Relation, keyboard, Dataview, translate } from 'Lib';
|
||||
import { Icon, IconObject, Switch } from 'Component';
|
||||
import { I, C, S, J, keyboard, Dataview, translate } from 'Lib';
|
||||
|
||||
const HEIGHT = 28;
|
||||
const LIMIT = 20;
|
||||
|
@ -62,7 +62,7 @@ const MenuRelationList = observer(class MenuRelationList extends React.Component
|
|||
>
|
||||
{!isReadonly ? <Handle /> : ''}
|
||||
<span className="clickable" onClick={e => this.onClick(e, item)}>
|
||||
<Icon className={`relation ${Relation.className(item.relation.format)}`} />
|
||||
<IconObject object={item.relation} />
|
||||
<div className="name">{item.relation.name}</div>
|
||||
</span>
|
||||
{canHide ? (
|
||||
|
|
|
@ -135,7 +135,7 @@ const IconObject = observer(class IconObject extends React.Component<Props> {
|
|||
const { theme } = S.Common;
|
||||
const object = this.getObject();
|
||||
const layout = Number(object.layout) || I.ObjectLayout.Page;
|
||||
const { id, name, iconEmoji, iconImage, iconOption, iconClass, done, relationFormat, isDeleted } = object || {};
|
||||
const { id, name, iconEmoji, iconImage, iconOption, iconClass, done, relationFormat, relationKey, isDeleted } = object || {};
|
||||
const cn = [ 'iconObject', 'c' + size, U.Data.layoutClass(object.id, layout) ];
|
||||
const iconSize = this.iconSize();
|
||||
const tc = S.Common.getThemeClass();
|
||||
|
@ -239,8 +239,15 @@ const IconObject = observer(class IconObject extends React.Component<Props> {
|
|||
break;
|
||||
};
|
||||
|
||||
let src = '';
|
||||
if (relationKey == 'description') {
|
||||
src = 'description';
|
||||
} else {
|
||||
src = Relation.typeName(relationFormat);
|
||||
};
|
||||
|
||||
icn = icn.concat([ 'iconCommon', 'c' + iconSize ]);
|
||||
icon = <img src={`./img/icon/relation/${Relation.typeName(relationFormat)}.svg`} className={icn.join(' ')} />;
|
||||
icon = <img src={`./img/icon/relation/${src}.svg`} className={icn.join(' ')} />;
|
||||
break;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue