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

code review

This commit is contained in:
Andrew Simachev 2023-12-31 10:46:21 +01:00
parent 1dffce6ba4
commit ee0842fe6b
No known key found for this signature in database
GPG key ID: 49A163D0D14E6FD8
3 changed files with 7 additions and 12 deletions

View file

@ -38,8 +38,6 @@ class Filter extends React.Component<Props, State> {
tooltipY: I.MenuDirection.Bottom,
};
private defaultPlaceholder = translate('commonFilterClick');
state = {
isActive: false,
};
@ -60,7 +58,7 @@ class Filter extends React.Component<Props, State> {
render () {
const { isActive } = this.state;
const { id, value, icon, tooltip, tooltipCaption, tooltipX, tooltipY, placeholder = this.defaultPlaceholder, className, inputClassName, focusOnMount, onKeyDown, onKeyUp, onClick, onIconClick } = this.props;
const { id, value, icon, tooltip, tooltipCaption, tooltipX, tooltipY, placeholder = translate('commonFilterClick'), className, inputClassName, focusOnMount, onKeyDown, onKeyUp, onClick, onIconClick } = this.props;
const cn = [ 'filter' ];
if (className) {

View file

@ -35,8 +35,6 @@ class InputWithFile extends React.Component<Props, State> {
canResize: true,
};
private defalutPlaceholder = translate('inputWithFileTextUrl');
_isMounted = false;
node: any = null;
state = {
@ -57,7 +55,7 @@ class InputWithFile extends React.Component<Props, State> {
render () {
const { focused, size } = this.state;
const { icon, textUrl = this.defalutPlaceholder, textFile, withFile, readonly } = this.props;
const { icon, textUrl = translate('inputWithFileTextUrl'), textFile, withFile, readonly } = this.props;
const cn = [ 'inputWithFile', 'resizable' ];
const or = ` ${translate('commonOr')} `;
const onBlur = focused ? this.onBlur : null;

View file

@ -59,17 +59,16 @@ const PageMainStore = observer(class PageMainStore extends React.Component<I.Pag
return null;
};
const Tabs = [
{ id: I.StoreTab.Type, name: translate('pageMainStoreTypes'), tooltipCaption: `${cmd} + T` },
{ id: I.StoreTab.Relation, name: translate('pageMainStoreRelations'), tooltipCaption: `${cmd} + ${alt} + T` },
];
const { isPopup } = this.props;
const views = this.getViews();
const items = this.getItems();
const sources = this.getSources();
const limit = this.getLimit();
const length = items.length;
const tabs = [
{ id: I.StoreTab.Type, name: translate('pageMainStoreTypes'), tooltipCaption: `${cmd} + T` },
{ id: I.StoreTab.Relation, name: translate('pageMainStoreRelations'), tooltipCaption: `${cmd} + ${alt} + T` },
];
let title = '';
let placeholder = '';
@ -215,7 +214,7 @@ const PageMainStore = observer(class PageMainStore extends React.Component<I.Pag
ref={node => this.node = node}
className={[ 'wrapper', this.tab, this.view ].join(' ')}
>
<Header component="mainStore" {...this.props} tabs={Tabs} tab={this.tab} onTab={id => this.onTab(id, true)} />
<Header component="mainStore" {...this.props} tabs={tabs} tab={this.tab} onTab={id => this.onTab(id, true)} />
<div className="body">
<div className="items">