toolbar and zoom control fixes

This commit is contained in:
Lachlan Kermode
2020-06-08 19:17:10 +02:00
parent a8d04f39a7
commit f6fb40d4be
4 changed files with 26 additions and 7 deletions

View File

@@ -152,13 +152,18 @@ class Toolbar extends React.Component {
const filtersLabel = copy[this.props.language].toolbar.filters_label
const categoriesLabel = 'Categories' // TODO:
const narrativesIdx = 0
const categoriesIdx = features.USE_NARRATIVES ? 1 : 0
const filtersIdx = (features.USE_NARRATIVES && features.CATEGORIES_AS_FILTERS) ? 2 : (
features.USE_NARRATIVES || features.CATEGORIES_AS_FILTERS ? 1 : 0
)
return (
<div className='toolbar'>
<div className='toolbar-header'onClick={this.props.methods.onTitle}><p>{title}</p></div>
<div className='toolbar-tabs'>
{features.USE_NARRATIVES ? this.renderToolbarTab(0, narrativesLabel, 'timeline') : null}
{features.CATEGORIES_AS_FILTERS ? this.renderToolbarTab(1, categoriesLabel, 'widgets') : null}
{features.USE_FILTERS ? this.renderToolbarTab(features.CATEGORIES_AS_FILTERS ? 2 : 1, filtersLabel, 'filter_list') : null}
{features.USE_NARRATIVES ? this.renderToolbarTab(narrativesIdx, narrativesLabel, 'timeline') : null}
{features.CATEGORIES_AS_FILTERS ? this.renderToolbarTab(categoriesIdx, categoriesLabel, 'widgets') : null}
{features.USE_FILTERS ? this.renderToolbarTab(filtersIdx, filtersLabel, 'filter_list') : null}
</div>
<BottomActions
info={{