Add NarrativeCard close button

This commit is contained in:
Franc Camps-Febrer
2018-12-05 12:03:42 +00:00
parent 38eca7110c
commit b53e4876da
2 changed files with 13 additions and 0 deletions

View File

@@ -107,6 +107,7 @@ class Dashboard extends React.Component {
/>
<NarrativeCard
onSelect={this.handleSelect}
actions={this.props.actions}
/>
<Notification
isNotification={this.props.ui.flags.isNotification}

View File

@@ -30,6 +30,17 @@ class NarrativeCard extends React.Component {
}
}
renderClose() {
return (
<button
className="side-menu-burg is-active"
onClick={() => { this.props.actions.updateNarrative(null); }}
>
<span></span>
</button>
)
}
render() {
if (this.props.narrative !== null) {
const steps = this.props.narrative.steps;
@@ -37,6 +48,7 @@ class NarrativeCard extends React.Component {
return (
<div className="narrative-info">
{this.renderClose()}
<h6>{this.props.narrative.label}</h6>
<p>{this.props.narrative.description}</p>
<h3>{this.state.step + 1}/{steps.length}. {step.location}</h3>