File tree Expand file tree Collapse file tree 5 files changed +64
-7
lines changed
Expand file tree Collapse file tree 5 files changed +64
-7
lines changed Original file line number Diff line number Diff line change 44 "browser": true,
55 "node": true,
66 "es6": true,
7- "mocha": true,
7+ "mocha": true
88 },
99 "plugins": ["react"],
10-
10+ "extends": [
11+ "plugin:react/recommended"
12+ ],
13+ // eslint > 2.x
14+ "parserOptions": {
15+ "ecmaFeatures": {
16+ "arrowFunctions": true,
17+ "binaryLiterals": true,
18+ "blockBindings": true,
19+ "classes": true,
20+ "defaultParams": true,
21+ "destructuring": true,
22+ "forOf": true,
23+ "generators": true,
24+ "modules": true,
25+ "objectLiteralComputedProperties": true,
26+ "objectLiteralDuplicateProperties": true,
27+ "objectLiteralShorthandMethods": true,
28+ "objectLiteralShorthandProperties": true,
29+ "octalLiterals": true,
30+ "regexUFlag": true,
31+ "regexYFlag": true,
32+ "spread": true,
33+ "superInFunctions": true,
34+ "templateStrings": true,
35+ "unicodeCodePointEscapes": true,
36+ "globalReturn": true,
37+ "jsx": true
38+ }
39+ },
40+ // eslint 1.x
1141 "ecmaFeatures": {
1242 "arrowFunctions": true,
1343 "binaryLiterals": true,
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ class BackToTop extends Component {
4747 return (
4848 < Motion style = { { x : spring ( showBackButton ? 0 : 120 , presets . stiff ) } } >
4949 {
50- ( { x} ) =>
50+ ( { x} ) => (
5151 < BackToTopButton
5252 position = { 'bottom-right' }
5353 onClick = { this . handlesOnBackButtonClick }
@@ -56,6 +56,7 @@ class BackToTop extends Component {
5656 transform : `translate3d(${ x } px, 0, 0)`
5757 } }
5858 />
59+ )
5960 }
6061 </ Motion >
6162 ) ;
Original file line number Diff line number Diff line change 1- // @flow weak
2-
31import React from 'react' ;
42import PropTypes from 'prop-types' ;
53
Original file line number Diff line number Diff line change 1- // @flow weak
2-
31import { isBrowserSide } from '../../../services/universal' ;
42
53export const smoothScroll = {
Original file line number Diff line number Diff line change 1+ // @flow weak
2+
3+ import React , {
4+ PureComponent
5+ } from 'react' ;
6+ import PropTypes from 'prop-types' ;
7+
8+ class ScrollToTop extends PureComponent {
9+ static propTypes = {
10+ children : PropTypes . node ,
11+ location : PropTypes . string
12+ } ;
13+
14+ componentDidUpdate ( prevProps ) {
15+ if ( this . props . location !== prevProps . location ) {
16+ window . scrollTo ( 0 , 0 ) ;
17+ }
18+ }
19+
20+ render ( ) {
21+ const { children } = this . props ;
22+ return (
23+ < div >
24+ { children }
25+ </ div >
26+ ) ;
27+ }
28+ }
29+
30+ export default ScrollToTop ;
You can’t perform that action at this time.
0 commit comments