[DE PE SSE] Fix render FilterOptionsController and refactoring

This commit is contained in:
ShimaginAndrey 2021-09-20 15:10:54 +03:00
parent 21e84003c4
commit 858c2e2483
4 changed files with 9 additions and 14 deletions

View file

@ -150,9 +150,7 @@ class MainPage extends Component {
!this.state.collaborationVisible ? null :
<Collaboration onclosed={this.handleOptionsViewClosed.bind(this, 'coauth')} page={this.state.collaborationPage} />
}
{!appOptions.isDocReady ? null :
<ContextMenu openOptions={this.handleClickToOpenOptions.bind(this)} />
}
{appOptions.isDocReady && <ContextMenu openOptions={this.handleClickToOpenOptions.bind(this)} /> }
</Page>
)
}

View file

@ -142,9 +142,7 @@ class MainPage extends Component {
!this.state.collaborationVisible ? null :
<CollaborationView onclosed={this.handleOptionsViewClosed.bind(this, 'coauth')} />
}
{!appOptions.isDocReady ? null :
<ContextMenu openOptions={this.handleClickToOpenOptions.bind(this)} />
}
{appOptions.isDocReady && <ContextMenu openOptions={this.handleClickToOpenOptions.bind(this)} />}
</Page>
</Fragment>

View file

@ -1,10 +1,10 @@
import React, { useEffect,useRef,useState } from 'react';
import React, { memo, useEffect,useRef,useState } from 'react';
import FilterView from '../../src/view/FilterOptions';
import { f7,Sheet,Popover } from 'framework7-react';
import { Device } from '../../../../common/mobile/utils/device';
import { useTranslation } from 'react-i18next';
const FilterOptionsController = () => {
const FilterOptionsController = memo( () => {
const { t } = useTranslation();
const _t = t('View.Edit', {returnObjects: true});
const configRef = useRef();
@ -126,6 +126,6 @@ const FilterOptionsController = () => {
<FilterView onSort={onSort} listVal={listVal} checkSort={checkSort} isValid={isValid} onUpdateCell={onUpdateCell}
onDeleteFilter={onDeleteFilter} onClearFilter={onClearFilter}/>
)
};
});
export default FilterOptionsController;

View file

@ -1,4 +1,4 @@
import React, { Component } from 'react';
import React, { Component, Fragment } from 'react';
import { Page, View, Navbar, Subnavbar, Icon } from 'framework7-react';
import { observer, inject } from "mobx-react";
import { Device } from '../../../../common/mobile/utils/device';
@ -130,17 +130,16 @@ class MainPage extends Component {
<CollaborationView onclosed={this.handleOptionsViewClosed.bind(this, 'coauth')} />
}
{!appOptions.isDocReady ? null :
<>
{appOptions.isDocReady &&
<Fragment key='filter-context'>
<FilterOptionsController />
<ContextMenu openOptions={this.handleClickToOpenOptions.bind(this)} />
</>
</Fragment>
}
<Statusbar />
<FunctionGroups /> {/* hidden component*/}
</Page>
)
}