Skip to content
Open
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
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "react-accordion-with-header",
"author":
"Jake Foraker <jakeforaker83@gmail.com> (https://github.com/jforaker)",
"author": "Jake Foraker <jakeforaker83@gmail.com> (https://github.com/jforaker)",
"version": "0.0.9",
"repository": {
"type": "git",
Expand All @@ -28,8 +27,9 @@
"lint:watch": "npm run lint -- --watch",
"demo": "webpack-dev-server --config ./tools/webpack.config.demo.js",
"bundle-demo": "webpack --config ./tools/webpack.config.demo.js",
"bundle-lib": "webpack --config ./tools/webpack.config.dist.js",
"deploy": "git subtree push --prefix demo origin gh-pages"
"bundle-lib": "webpack --config /Users/brayan/Documents/git-repos/dev-react-js/Finery/frontend-v2/node_modules/react-accordion-with-header/tools/webpack.config.dist.js",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello. This is not a change that belongs in the repo. Also what is the purpose of this pull request? What does it do?

"deploy": "git subtree push --prefix demo origin gh-pages",
"postinstall": "npm run bundle-lib"
},
"dependencies": {
"classnames": "^2.2.5",
Expand Down Expand Up @@ -67,4 +67,4 @@
"react": "^0.14.0 || ^15.0.0",
"react-dom": "^0.14 || ^15.0"
}
}
}
7 changes: 5 additions & 2 deletions src/AccordionWithHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import classNames from 'classnames';

const defaultProps = {
multipleOkay: false,
firstOpen: false
firstOpen: false,
isOpen: undefined
};

export default class AccordionWithHeader extends Component {
Expand Down Expand Up @@ -38,6 +39,7 @@ export default class AccordionWithHeader extends Component {
mountingProps(props) {
let active = [];
if (props.firstOpen) active.push(0);
if (props.isOpen !== undefined) active.push(props.isOpen);
this.setState({ active: active });
}

Expand Down Expand Up @@ -95,6 +97,7 @@ export default class AccordionWithHeader extends Component {
AccordionWithHeader.propTypes = {
firstOpen: PropTypes.bool,
multipleOkay: PropTypes.bool,
actionCallback: PropTypes.func
actionCallback: PropTypes.func,
isOpen: PropTypes.number
};
AccordionWithHeader.defaultProps = defaultProps;