Clean store fields, add narrative cards and some changes to toolbar

This commit is contained in:
Franc Camps-Febrer
2018-12-03 16:40:27 +00:00
parent 051620a49e
commit 62b8908d03
4 changed files with 55 additions and 3 deletions

View File

@@ -109,6 +109,9 @@ class Dashboard extends React.Component {
onSelect={this.handleSelect}
actions={this.props.actions}
/>
<NarrativeCard
onSelect={this.handleSelect}
/>
<Notification
isNotification={this.props.app.flags.isNotification}
notifications={this.props.domain.notifications}

View File

@@ -113,8 +113,8 @@ class Toolbar extends React.Component {
<div className="toolbar-header"><p>{title}</p></div>
<div className="toolbar-tabs">
{/*this.renderToolbarTab(0, 'search')*/}
{this.renderToolbarTab(0, 'Narratives')}
{(isTags) ? this.renderToolbarTab(1, 'Explore by tag') : ''}
{this.renderToolbarTab(0, 'Focus stories')}
{this.renderToolbarTab(1, 'Explore freely')}
</div>
<ToolbarBottomActions
actions={this.props.actions}
@@ -137,6 +137,39 @@ class Toolbar extends React.Component {
)
}
renderToolbarNavs() {
if (this.props.narratives) {
return this.props.narratives.map((nar, idx) => {
const isActive = (idx === this.state.tab);
let classes = (isActive) ? 'toolbar-tab active' : 'toolbar-tab';
return (
<div className={classes} onClick={() => { this.toggleTab(idx); }}>
<div className="tab-caption">{nar.label}</div>
</div>
);
})
}
return '';
}
renderToolbarTabs() {
const title = copy[this.props.language].toolbar.title;
return (
<div className="toolbar">
<div className="toolbar-header"><p>{title}</p></div>
<div className="toolbar-tabs">
{/*this.renderToolbarTab(0, 'search')*/}
{(this.props.isModeGuided)
? this.renderToolbarNavs()
: this.renderToolbarTagRoot()}
</div>
{/* {this.renderBottomActions()} */}
</div>
)
}
render() {
return (
<div id="toolbar-wrapper" className="toolbar-wrapper">