Skip to content

Commit

Permalink
Clean code + setup prettier on precommit
Browse files Browse the repository at this point in the history
  • Loading branch information
mantovanig committed Oct 23, 2017
1 parent d105b34 commit 270618e
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 21 deletions.
46 changes: 25 additions & 21 deletions compare/src/components/App.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,34 @@
import React from 'react';
import styled from 'styled-components';
import { StickyContainer, Sticky } from 'react-sticky';
import React from 'react'
import styled from 'styled-components'
import { StickyContainer, Sticky } from 'react-sticky'

import Header from './ecosystems/Header';
import List from './ecosystems/List';
import Header from './ecosystems/Header'
import List from './ecosystems/List'

const Wrapper = styled.section`
padding: 0 30px;
`;
`

export default class App extends React.Component {
render () {
render() {
return (
<StickyContainer>
<Sticky topOffset={200}>
{
({ isSticky, wasSticky, style, distanceFromTop, distanceFromBottom, calculatedHeight }) => {
console.log({ isSticky, wasSticky, style, distanceFromTop, distanceFromBottom, calculatedHeight });
return <Header style={style} />
}
}
</Sticky>
<Wrapper>
<List />
</Wrapper>
</StickyContainer>
);
<StickyContainer>
<Sticky topOffset={200}>
{({
isSticky,
wasSticky,
style,
distanceFromTop,
distanceFromBottom,
calculatedHeight
}) => {
return <Header style={style} />
}}
</Sticky>
<Wrapper>
<List />
</Wrapper>
</StickyContainer>
)
}
}
10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,17 @@
"openReport": "node ./cli/index.js openReport",
"echo": "node ./cli/index.js echo",
"unit-test": "mocha --reporter spec --recursive test/",
"precommit": "lint-staged",
"build-compare": "webpack --config ./compare/webpack.config.js",
"dev-compare": "webpack-dev-server --content-base ./compare/output --config ./compare/webpack.config.js",
"integration-test": "rm -rf newdir && mkdir newdir && cd newdir && node ../cli/index.js genConfig && node ../cli/index.js reference && node ../cli/index.js test && node -e \"require('../')('test')\""
},
"lint-staged": {
"compare/**/*.js": [
"node_modules/.bin/prettier --single-quote --no-semi --write",
"git add"
]
},
"repository": {
"type": "git",
"url": "https://github.com/garris/backstopjs.git"
Expand All @@ -39,8 +46,11 @@
"eslint-plugin-standard": "^2.0.0",
"file-loader": "^0.11.2",
"gulp": "^3.9.1",
"husky": "^0.14.3",
"lint-staged": "^4.3.0",
"mocha": "^1.21.5",
"mockery": "^1.4.0",
"prettier": "^1.7.4",
"url-loader": "^0.5.9"
},
"dependencies": {
Expand Down

0 comments on commit 270618e

Please sign in to comment.