1
0
Fork 0
mirror of https://github.com/anyproto/anytype-ts.git synced 2025-06-11 10:18:07 +09:00

JS-3618: checkbox labels

This commit is contained in:
Andrew Simachev 2023-12-29 16:51:53 +01:00
parent ab477c7e19
commit b7a0375098
No known key found for this signature in database
GPG key ID: 49A163D0D14E6FD8
11 changed files with 13 additions and 7 deletions

View file

@ -51,9 +51,12 @@
}
}
.cellContent.c-checkbox { display: flex; flex-direction: row; align-items: center; gap: 0px 2px; }
.cellContent.c-checkbox {
.icon { width: 20px; height: 20px; background-image: url('~img/icon/dataview/checkbox0.svg'); }
.icon.active { background-image: url('~img/icon/dataview/checkbox2.svg'); }
.label { line-height: 20px; }
}
.cellContent.c-checkbox.canEdit {
.icon:not(.active):hover { background-image: url('~img/icon/dataview/checkbox1.svg'); }

View file

@ -74,8 +74,9 @@
.name { text-decoration: underline; }
}
.cellContent.c-checkbox { display: inline-flex; }
.cellContent.c-checkbox {
.icon.checkbox { width: 20px; height: 20px; vertical-align: top; margin-top: 2px; }
.icon.checkbox { width: 20px; height: 20px; }
}
.cellContent.c-checkbox.canEdit { cursor: default !important; }

View file

@ -40,6 +40,7 @@
.flex { display: inline; }
.more { vertical-align: middle; background: none; }
.label { display: inline; vertical-align: middle; }
}
.cellContent.c-select {

View file

@ -1,5 +1,5 @@
import * as React from 'react';
import { Icon } from 'Component';
import { Icon, Label } from 'Component';
import { I, UtilCommon, translate } from 'Lib';
import { observer } from 'mobx-react';
@ -37,7 +37,7 @@ const CellCheckbox = observer(class CellCheckbox extends React.Component<I.Cell>
return (
<React.Fragment>
<Icon className={cn.join(' ')} />
{label ? <span className="label">{label}</span> : ''}
{label ? <Label text={label} /> : ''}
</React.Fragment>
);
};

View file

@ -18,7 +18,6 @@ interface Props extends I.Cell {
tooltipX?: I.MenuDirection.Left | I.MenuDirection.Center | I.MenuDirection.Right;
tooltipY?: I.MenuDirection.Top | I.MenuDirection.Bottom;
maxWidth?: number;
withName?: boolean;
};
const Cell = observer(class Cell extends React.Component<Props> {

View file

@ -43,6 +43,7 @@ const Card = observer(class Card extends React.Component<Props> {
tooltipX={I.MenuDirection.Left}
onClick={e => this.onCellClick(e, relation)}
iconSize={relation.relationKey == 'name' ? 20 : 18}
withName={true}
/>
))}
</div>

View file

@ -85,7 +85,7 @@ const Column = observer(class Column extends React.Component<Props> {
recordId=""
readonly={true}
arrayLimit={4}
withLabel={true}
withName={true}
placeholder={translate('commonUncategorized')}
/>
</div>

View file

@ -65,6 +65,7 @@ const Card = observer(class Card extends React.Component<Props> {
tooltipX={I.MenuDirection.Left}
iconSize={relation.relationKey == 'name' ? 20 : 18}
shortUrl={true}
withName={true}
/>
);
})}

View file

@ -51,6 +51,7 @@ const Row = observer(class Row extends React.Component<Props> {
showTooltip={true}
arrayLimit={2}
iconSize={relation.relationKey == 'name' ? 24 : 18}
withName={true}
/>
);
})}

View file

@ -209,7 +209,6 @@ const BlockFeatured = observer(class BlockFeatured extends React.Component<Props
textLimit={150}
onMouseLeave={this.onMouseLeave}
withLabel={true}
withName={true}
/>
</span>
);

View file

@ -77,7 +77,7 @@ const MenuGroupList = observer(class MenuGroupList extends React.Component<I.Men
recordId=""
readonly={true}
arrayLimit={4}
withLabel={true}
withName={true}
placeholder={translate('commonUncategorized')}
/>
</span>