From c7b272b00ab42262c1c0193c6c3e09e01da00590 Mon Sep 17 00:00:00 2001 From: Johan Girod Date: Thu, 26 Apr 2018 15:41:18 +0200 Subject: [PATCH] =?UTF-8?q?rends=20le=20bandeau=20"comprendre=20mes=20r?= =?UTF-8?q?=C3=A9sultats"=20cliquable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/components/Explanation.js | 57 ++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 22 deletions(-) diff --git a/source/components/Explanation.js b/source/components/Explanation.js index deadb70d1..1ca22faeb 100644 --- a/source/components/Explanation.js +++ b/source/components/Explanation.js @@ -7,7 +7,7 @@ import Rule from 'Components/rule/Rule' import './Explanation.css' import { pluck } from 'ramda' import { connect } from 'react-redux' - +import { scroller, Element } from 'react-scroll' import SearchButton from './SearchButton' import withColours from './withColours' @@ -17,32 +17,45 @@ import withColours from './withColours' analysis: state.analysis })) export default class Explanation extends Component { + handleScrollToResults = () => { + scroller.scrollTo('resultsScrollElement', { + smooth: true, + duration: 200, + delay: 0 + }) + } render() { let targetRules = path(['analysis', 'targets'], this.props) if (!targetRules) return null return ( -
-

-