Skip to content

Commit 95196ea

Browse files
committed
minor cleanup
1 parent 37a072d commit 95196ea

File tree

5 files changed

+14
-10
lines changed

5 files changed

+14
-10
lines changed

.npmignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.eslintignore
2+
.eslintrc.js
3+
CHANGELOG.md
4+
CONTRIBUTING.md
5+
src
6+
.babelrc

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# react-scrollchor (React Scrollchor)
22

33
[![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)
45

56
> 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.
67

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-scrollchor",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "A React component for scroll to #hash links with smooth animations",
55
"files": [
66
"lib"
@@ -36,7 +36,7 @@
3636
"babel-plugin-transform-class-properties": "6.x.x",
3737
"eslint": "3.x.x",
3838
"eslint-modules-standard-deviation": "1.x.x",
39-
"rimraf": "*",
39+
"rimraf": "2.x.x",
4040
"mkdirp": "*"
4141
}
4242
}

src/scrollchor.js renamed to src/scrollchor.jsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
1-
import React from 'react';
1+
import React, { PropTypes } from 'react';
22
import animateScroll from './animatescroll';
33

4-
const { object, string } = React.PropTypes;
5-
64
export default class Scrollchor extends React.Component {
75
static propTypes = {
8-
to: string.isRequired,
9-
animate: object
6+
to: PropTypes.string.isRequired,
7+
animate: PropTypes.object
108
};
119

12-
handleClick = event => {
10+
handleClick = (event) => {
1311
event.preventDefault();
1412

1513
const { animate } = this.props;
16-
1714
animateScroll(this._to, animate);
1815
};
1916

src/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export function getScrollTop() {
2-
// $('html, body').scrollTop
2+
// jQuery => $('html, body').scrollTop
33
return document.documentElement.scrollTop || document.body.scrollTop;
44
}
55

0 commit comments

Comments
 (0)