Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ $ npm i react-scrollspy
## Usage

```js
var Scrollspy = require('react-scrollspy').Scrollspy;
import Scrollspy from 'react-scrollspy'

...

Expand Down
11 changes: 10 additions & 1 deletion __test__/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import test from 'ava'
import React from 'react'
import { shallow, mount, render } from 'enzyme'
import { Scrollspy } from '../src/js/lib/Scrollspy'
import Scrollspy from '../src/js/lib/Scrollspy'

test('renders correct children length', (t) => {
const wrapper = shallow(
Expand All @@ -22,3 +22,12 @@ test('renders children with correct props', (t) => {
)
t.is(wrapper.find('li').prop('randomProp'), 'someText')
})

test('renders expected html tag', (t) => {
const defaultTag = shallow(<Scrollspy></Scrollspy>)
const customTag = shallow(<Scrollspy componentTag={ 'div' }></Scrollspy>)

t.is(defaultTag.type(), 'ul')
t.is(customTag.type(), 'div')
})

2 changes: 1 addition & 1 deletion docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ mkdir gh_pages
ls -la
cd gh_pages

cp -r ../build/* .
cp -r ../dist/* .

git init
git config user.name "${GIT_COMITTER_NAME}"
Expand Down
85 changes: 0 additions & 85 deletions gulpfile.js

This file was deleted.

4 changes: 2 additions & 2 deletions src/js/app.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import ReactDOM from 'react-dom'
import { Scrollspy } from './lib/Scrollspy.jsx'
import Scrollspy from './lib/Scrollspy.jsx'
import Highlight from 'react-highlight'

import 'style-loader!css-loader!postcss-loader!sass-loader!../scss/app.scss'
Expand Down Expand Up @@ -64,7 +64,7 @@ const App = React.createClass({
</pre>
<p className="c-paragraph">Then, import this library in your JS.</p>
<pre className="c-code">
<Highlight className="c-code__inner">{'import { Scrollspy } from \'react-scrollspy\''}</Highlight>
<Highlight className="c-code__inner">{'import Scrollspy from \'react-scrollspy\''}</Highlight>
</pre>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/js/lib/Scrollspy.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react'
import classNames from 'classnames'
import throttle from './throttle'

export class Scrollspy extends React.Component {
export default class Scrollspy extends React.Component {

static get PropTypes () {
return {
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default {
plugins: [
new HtmlWebpackPlguin({
filename: 'index.html',
inject: true,
inject: false,
template: './src/templates/index.ejs',
}),
new webpack.LoaderOptionsPlugin({
Expand Down