From e438c389ce1aa49de7d2b79b35370d2858456847 Mon Sep 17 00:00:00 2001
From: esikkala <esko.ikkala@aalto.fi>
Date: Sun, 5 Dec 2021 15:55:07 +0200
Subject: [PATCH] Update slider duration config

---
 src/client/components/facet_results/TemporalMap.js    |  1 +
 .../components/facet_results/TemporalMapTimeSlider.js | 11 ++++-------
 src/client/containers/SemanticPortal.js               |  2 ++
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/client/components/facet_results/TemporalMap.js b/src/client/components/facet_results/TemporalMap.js
index d81b6b10..6a0b2116 100644
--- a/src/client/components/facet_results/TemporalMap.js
+++ b/src/client/components/facet_results/TemporalMap.js
@@ -212,6 +212,7 @@ class TemporalMap extends Component {
             dates={dates}
             animateMap={animateMap}
             initialValue={this.props.animationValue[0]}
+            sliderDuration={this.props.sliderDuration}
           />
           {this._renderTooltip()}
         </ReactMapGL>
diff --git a/src/client/components/facet_results/TemporalMapTimeSlider.js b/src/client/components/facet_results/TemporalMapTimeSlider.js
index d334e597..0385ad80 100644
--- a/src/client/components/facet_results/TemporalMapTimeSlider.js
+++ b/src/client/components/facet_results/TemporalMapTimeSlider.js
@@ -2,11 +2,8 @@ import React from 'react'
 import { withStyles } from '@material-ui/core/styles'
 import PropTypes from 'prop-types'
 import Slider from '@material-ui/core/Slider'
-import { SLIDER_DURATION } from '../../configs/sampo/GeneralConfig'
 import { BaseControl } from 'react-map-gl'
 import moment from 'moment'
-// import iconImg from './icon.png';
-// import BarChart from './TemporalMapBarChart';
 
 const blue = 'rgb(0, 126, 230)'
 const iOSBoxShadow =
@@ -56,7 +53,7 @@ class TemporalMapTimeSlider extends BaseControl {
     currentDay: null,
     hideContainer: '',
     value: 0,
-    sliderDuration: SLIDER_DURATION.normalSpeed,
+    sliderDuration: this.props.sliderDuration.normalSpeed,
     intervalSetter: null,
     isPlaying: false,
     playOrPause: 'play',
@@ -143,7 +140,7 @@ class TemporalMapTimeSlider extends BaseControl {
     if (type === 'half') {
       this.setState(
         {
-          sliderDuration: SLIDER_DURATION.halfSpeed,
+          sliderDuration: this.props.sliderDuration.halfSpeed,
           halfSpeedEnabled: true,
           regularSpeedEnabled: false,
           doubleSpeedEnabled: false
@@ -156,7 +153,7 @@ class TemporalMapTimeSlider extends BaseControl {
     } else if (type === 'regular') {
       this.setState(
         {
-          sliderDuration: SLIDER_DURATION.normalSpeed,
+          sliderDuration: this.props.sliderDuration.normalSpeed,
           halfSpeedEnabled: false,
           regularSpeedEnabled: true,
           doubleSpeedEnabled: false
@@ -169,7 +166,7 @@ class TemporalMapTimeSlider extends BaseControl {
     } else if (type === 'double') {
       this.setState(
         {
-          sliderDuration: SLIDER_DURATION.doubleSpeed,
+          sliderDuration: this.props.sliderDuration.doubleSpeed,
           halfSpeedEnabled: false,
           regularSpeedEnabled: false,
           doubleSpeedEnabled: true
diff --git a/src/client/containers/SemanticPortal.js b/src/client/containers/SemanticPortal.js
index 4f0ba9b6..3d651b09 100644
--- a/src/client/containers/SemanticPortal.js
+++ b/src/client/containers/SemanticPortal.js
@@ -59,6 +59,7 @@ const {
   layoutConfig,
   MAPBOX_ACCESS_TOKEN,
   MAPBOX_STYLE,
+  SLIDER_DURATION,
   yasguiBaseUrl,
   yasguiParams
 } = await import(`../configs/${portalID}/GeneralConfig`)
@@ -420,6 +421,7 @@ const SemanticPortal = props => {
                                 networkConfig={networkConfig}
                                 yasguiBaseUrl={yasguiBaseUrl}
                                 yasguiParams={yasguiParams}
+                                sliderDuration={SLIDER_DURATION}
                               />
                             </Grid>
                           </Grid>
-- 
GitLab