File tree Expand file tree Collapse file tree 5 files changed +14
-10
lines changed Expand file tree Collapse file tree 5 files changed +14
-10
lines changed Original file line number Diff line number Diff line change
1
+ .eslintignore
2
+ .eslintrc.js
3
+ CHANGELOG.md
4
+ CONTRIBUTING.md
5
+ src
6
+ .babelrc
Original file line number Diff line number Diff line change 1
1
# react-scrollchor (React Scrollchor)
2
2
3
3
[ ![ npm version] ( https://badge.fury.io/js/react-scrollchor.svg )] ( https://badge.fury.io/js/react-scrollchor )
4
+ [ ![ npm downloads] ( https://img.shields.io/npm/dm/react-scrollchor.svg?style=flat-square )] ( https://www.npmjs.com/package/react-scrollchor )
4
5
5
6
> A React component for scroll to ` #hash ` links with smooth animations. Scrollchor is a mix of ` Scroll ` and ` Anchor ` , a joke name for a useful component.
6
7
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " react-scrollchor" ,
3
- "version" : " 2.0.0 " ,
3
+ "version" : " 2.0.1 " ,
4
4
"description" : " A React component for scroll to #hash links with smooth animations" ,
5
5
"files" : [
6
6
" lib"
36
36
"babel-plugin-transform-class-properties" : " 6.x.x" ,
37
37
"eslint" : " 3.x.x" ,
38
38
"eslint-modules-standard-deviation" : " 1.x.x" ,
39
- "rimraf" : " * " ,
39
+ "rimraf" : " 2.x.x " ,
40
40
"mkdirp" : " *"
41
41
}
42
42
}
Original file line number Diff line number Diff line change 1
- import React from 'react' ;
1
+ import React , { PropTypes } from 'react' ;
2
2
import animateScroll from './animatescroll' ;
3
3
4
- const { object, string } = React . PropTypes ;
5
-
6
4
export default class Scrollchor extends React . Component {
7
5
static propTypes = {
8
- to : string . isRequired ,
9
- animate : object
6
+ to : PropTypes . string . isRequired ,
7
+ animate : PropTypes . object
10
8
} ;
11
9
12
- handleClick = event => {
10
+ handleClick = ( event ) => {
13
11
event . preventDefault ( ) ;
14
12
15
13
const { animate } = this . props ;
16
-
17
14
animateScroll ( this . _to , animate ) ;
18
15
} ;
19
16
Original file line number Diff line number Diff line change 1
1
export function getScrollTop ( ) {
2
- // $('html, body').scrollTop
2
+ // jQuery => $('html, body').scrollTop
3
3
return document . documentElement . scrollTop || document . body . scrollTop ;
4
4
}
5
5
You can’t perform that action at this time.
0 commit comments