Commit ab58dd04 authored by joe beuckman's avatar joe beuckman Committed by GitHub

allow override containerStyle (#16)

* allow override containerStyle

* revert formatting

* add prepare script so unpublished module can install

* remove trailing comma package.json

* fix up lint and prepare script
parent d062e220
......@@ -8,7 +8,8 @@
"dev": "webpack-dev-server",
"pretest": "rimraf dist && tslint --project . && tsc -p .",
"test": "jest --config=jestconfig.json",
"prepublish": "npm test"
"prepublish": "npm test",
"prepare": "rimraf dist && tsc -p ."
},
"repository": {
"type": "git",
......
......@@ -9,6 +9,7 @@ export interface PullToRefreshProps {
onRefresh: () => Promise<any>;
triggerHeight?: number | "auto";
backgroundColor?: string;
containerStyle?: React.CSSProperties;
startInvisible?: boolean;
}
......@@ -206,6 +207,12 @@ export class PullToRefresh extends React.Component<PullToRefreshProps, PullToRef
zIndex: 1,
};
if (this.props.containerStyle) {
Object.keys(this.props.containerStyle).forEach((key: string) => {
containerStyle[key] = this.props.containerStyle[key];
});
}
if (backgroundColor) {
containerStyle.backgroundColor = backgroundColor;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment