Skip to content

Commit

Permalink
fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianmcli committed Feb 2, 2018
1 parent d80c0d1 commit d1129cc
Show file tree
Hide file tree
Showing 8 changed files with 403 additions and 482 deletions.
806 changes: 364 additions & 442 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
Expand Up @@ -33,11 +33,11 @@
"@storybook/react": "^3.3.11",
"@storybook/storybook-deployer": "^2.2.0",
"babel-core": "^6.26.0",
"eslint": "^3.9.1",
"eslint": "^4.16.0",
"eslint-config-airbnb": "^16.1.0",
"eslint-plugin-import": "^2.1.0",
"eslint-plugin-jsx-a11y": "^2.2.3",
"eslint-plugin-react": "^6.6.0",
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-react": "^7.6.1",
"react-build-dist": "^0.0.8",
"react-build-lib": "adrianmcli/react-build-lib"
},
Expand Down
6 changes: 5 additions & 1 deletion src/ReactRevealText.js
Expand Up @@ -4,7 +4,6 @@ import PropTypes from 'prop-types';
import { getRandoms, randomToDelay } from './utils';

class ReactRevealText extends React.Component {

constructor(props) {
super(props);
this.getDelays = this.getDelays.bind(this);
Expand Down Expand Up @@ -82,6 +81,11 @@ ReactRevealText.defaultProps = {
delayMin: 200,
delayMax: 1200,
threshold: 0.2,
text: '',
className: '',
style: {},
show: false,
children: undefined,
};

export default ReactRevealText;
2 changes: 1 addition & 1 deletion src/TestWrapper.js
@@ -1,8 +1,8 @@
/* eslint-disable react/require-default-props */
import React from 'react';
import PropTypes from 'prop-types';

class TestWrapper extends React.Component {

constructor(props) {
super(props);
this.onClick = this.onClick.bind(this);
Expand Down
20 changes: 9 additions & 11 deletions stories/demo.js
@@ -1,3 +1,4 @@
/* eslint-disable react/no-unused-state */
import React from 'react';
import { storiesOf } from '@storybook/react';
import { withInfo } from '@storybook/addon-info';
Expand All @@ -7,24 +8,21 @@ import ReactRevealText from '../src/index';

export default () =>
storiesOf('Demo', module)
.add('Revealing Text', withInfo(
{
propTables: false,
inline: true,
source: false,
text: `
.add('Revealing Text', withInfo({
propTables: false,
inline: true,
source: false,
text: `
A simple component for revealing text in a gradual way.
Each letter gets a transition applied to it with a random distribution of delays so that they come into (and out of) view sporadically.
This controlled component is great for landing pages and anywhere you need to show some kind of transition.
Inspired by Adam Schwartz's [Magic of CSS](http://adamschwartz.co/magic-of-css/chapters/6-transitions/).
`
}
)(() => {
`,
})(() => {
class Wrapper extends React.Component {

constructor() {
super();
this.state = { show: false };
Expand Down Expand Up @@ -66,4 +64,4 @@ export default () =>
return (
<Wrapper />
);
}))
}));
8 changes: 4 additions & 4 deletions stories/documentation.js
Expand Up @@ -32,7 +32,7 @@ export default () =>
**style** *(object)*
This prop allows you to pass in styles for the div surrounding the text.
`
`,
})(() => {
setOptions({ showDownPanel: true });
return (
Expand Down Expand Up @@ -76,7 +76,7 @@ export default () =>
The difference between the random numbers generated for each letter compared to the previous letter.
Setting this higher will force the delays to be very different between each letter, spreading out the effect.
Setting this lower will allow delays to be similar between letters, sometimes creating a chunking effect.
`
`,
})(() => {
setOptions({ showDownPanel: true });
const timingFnOptions = {
Expand Down Expand Up @@ -114,7 +114,7 @@ export default () =>
This page has all the properties for you to play with.
Note that you can input \`timingFunction\` as a string on the knobs tab.
`
`,
})(() => {
setOptions({ showDownPanel: true });
const thresholdOptions = {
Expand Down Expand Up @@ -146,4 +146,4 @@ export default () =>
/>
</TestWrapper>
);
}))
}));
11 changes: 4 additions & 7 deletions stories/examples.js
Expand Up @@ -42,10 +42,9 @@ export default () =>
}
}
~~~
`
`,
})(() => {
class Wrapper extends React.Component {

constructor() {
super();
this.state = { show: false };
Expand Down Expand Up @@ -120,10 +119,9 @@ export default () =>
}
}
~~~
`
`,
})(() => {
class Wrapper extends React.Component {

constructor() {
super();
this.state = { show: false };
Expand Down Expand Up @@ -209,10 +207,9 @@ export default () =>
}
}
~~~
`
`,
})(() => {
class Wrapper extends React.Component {

constructor() {
super();
this.state = { show: false };
Expand Down Expand Up @@ -251,4 +248,4 @@ export default () =>
return (
<Wrapper />
);
}))
}));
24 changes: 12 additions & 12 deletions stories/tutorial.js
Expand Up @@ -25,7 +25,7 @@ export default () =>
In this case, it's the \`show\` prop.
Click the "Knobs" tab on the bottom and try changing the state.
`
`,
})(() => {
setOptions({ showDownPanel: true });
return (
Expand All @@ -52,7 +52,7 @@ export default () =>
Or, you can also pass in a string to the \`className\` prop.
Note that the component only re-renders when the \`show\` prop is changed.
`
`,
})(() => {
setOptions({ showDownPanel: true });
return (
Expand Down Expand Up @@ -86,13 +86,13 @@ export default () =>
~~~jsx
import TestWrapper from 'react-reveal-text/lib/TextWrapper';
~~~
`
`,
})(() => {
setOptions({ showDownPanel: true });
return (
<TestWrapper
text={text('text', 'AMAZING TEXT')}
style={object('style', {
return (
<TestWrapper
text={text('text', 'AMAZING TEXT')}
style={object('style', {
color: 'tomato',
fontSize: '24px',
lineHeight: '36px',
Expand All @@ -101,8 +101,8 @@ export default () =>
letterSpacing: '1.2em',
paddingLeft: '1.2em', // to compensate for letter spacing
})}
>
<ReactRevealText />
</TestWrapper>
);
}))
>
<ReactRevealText />
</TestWrapper>
);
}));

0 comments on commit d1129cc

Please sign in to comment.