From 62b8908d03aef805811b5fffd69df39d8ad4924e Mon Sep 17 00:00:00 2001 From: Franc Camps-Febrer Date: Mon, 3 Dec 2018 16:40:27 +0000 Subject: [PATCH] Clean store fields, add narrative cards and some changes to toolbar --- src/actions/index.js | 16 ++++++++++++++++ src/components/Dashboard.jsx | 3 +++ src/components/Toolbar.jsx | 37 ++++++++++++++++++++++++++++++++++-- webpack.config.js | 2 +- 4 files changed, 55 insertions(+), 3 deletions(-) diff --git a/src/actions/index.js b/src/actions/index.js index 0d3b0c4..06c7f68 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -180,6 +180,14 @@ export function updateTimeRange(timerange) { } } +export const UPDATE_NARRATIVE = 'UPDATE_NARRATIVE'; +export function updateNarrative(narrative) { + return { + type: UPDATE_NARRATIVE, + narrative + } +} + export const RESET_ALLFILTERS = 'RESET_ALLFILTERS' export function resetAllFilters() { return { @@ -256,3 +264,11 @@ export function fetchSourceError(msg) { msg } } + +export const TOGGLE_MAPVIEW = 'TOGGLE_MAPVIEW'; +export function toggleMapView(layer) { + return { + type: TOGGLE_MAPVIEW, + layer + } +} diff --git a/src/components/Dashboard.jsx b/src/components/Dashboard.jsx index 4d6ac44..401d2a3 100644 --- a/src/components/Dashboard.jsx +++ b/src/components/Dashboard.jsx @@ -109,6 +109,9 @@ class Dashboard extends React.Component { onSelect={this.handleSelect} actions={this.props.actions} /> +

{title}

{/*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')}
{ + const isActive = (idx === this.state.tab); + + let classes = (isActive) ? 'toolbar-tab active' : 'toolbar-tab'; + + return ( +
{ this.toggleTab(idx); }}> +
{nar.label}
+
+ ); + }) + } + return ''; + } + + renderToolbarTabs() { + const title = copy[this.props.language].toolbar.title; + return ( +
+

{title}

+
+ {/*this.renderToolbarTab(0, 'search')*/} + {(this.props.isModeGuided) + ? this.renderToolbarNavs() + : this.renderToolbarTagRoot()} +
+ {/* {this.renderBottomActions()} */} +
+ ) + } + render() { return (
diff --git a/webpack.config.js b/webpack.config.js index 4706f03..ba1c538 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,7 +1,7 @@ const webpack = require('webpack'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin'); -const userConfig = require('./config'); +const userConfig = require('./dev.config'); const userConfigJSON = {}; const devMode = process.env.NODE_ENV !== 'production';