reverted PascalCase to camelCase, thanks again for the contribution @charlyx !

This commit is contained in:
Rick van Lieshout 2019-02-26 13:27:13 +01:00
parent ee24754fc8
commit 969da3c809
5 changed files with 12 additions and 12 deletions

View File

@ -98,7 +98,7 @@ One of the props (onAccept) is a function, this function will be called after th
| buttonStyle | object | [look at source][buttonStyle] | React styling object for the button. |
| contentStyle | object | [look at source][contentStyle] | React styling object for the content. |
| disableButtonStyles | boolean | false | If enabled the button will have no default style. (you can still supply style through props) |
| ButtonComponent | React component | button | React Component to render as a button.
| buttonComponent | React component | button | React Component to render as a button.
## Debugging it

2
build/index.d.ts vendored
View File

@ -23,7 +23,7 @@ export interface CookieConsentProps {
acceptOnScrollPercentage?: number;
extraCookieOptions?: object;
disableButtonStyles ?: boolean;
ButtonComponent?: Function | React.ReactElement;
buttonComponent?: Function | React.ReactElement;
}
export default class CookieConsent extends React.Component<CookieConsentProps, {}> {}

View File

@ -681,7 +681,7 @@ var CookieConsent = function (_Component) {
buttonClasses = _props3.buttonClasses,
buttonId = _props3.buttonId,
disableButtonStyles = _props3.disableButtonStyles,
ButtonComponent = _props3.ButtonComponent;
buttonComponent = _props3.buttonComponent;
var myStyle = {};
@ -728,7 +728,7 @@ var CookieConsent = function (_Component) {
this.props.children
),
_react2.default.createElement(
ButtonComponent,
"buttonComponent",
{
style: myButtonStyle,
className: buttonClasses,
@ -770,7 +770,7 @@ CookieConsent.propTypes = {
acceptOnScrollPercentage: _propTypes2.default.number,
extraCookieOptions: _propTypes2.default.object,
disableButtonStyles: _propTypes2.default.bool,
ButtonComponent: _propTypes2.default.oneOfType([_propTypes2.default.func, _propTypes2.default.element])
buttonComponent: _propTypes2.default.oneOfType([_propTypes2.default.func, _propTypes2.default.element])
};
CookieConsent.defaultProps = {
@ -791,7 +791,7 @@ CookieConsent.defaultProps = {
buttonId: "",
extraCookieOptions: {},
disableButtonStyles: false,
ButtonComponent: function ButtonComponent(_ref) {
buttonComponent: function buttonComponent(_ref) {
var children = _ref.children,
props = _objectWithoutProperties(_ref, ["children"]);

2
src/index.d.ts vendored
View File

@ -23,7 +23,7 @@ export interface CookieConsentProps {
acceptOnScrollPercentage?: number;
extraCookieOptions?: object;
disableButtonStyles ?: boolean;
ButtonComponent?: Function | React.ReactElement;
buttonComponent?: Function | React.ReactElement;
}
export default class CookieConsent extends React.Component<CookieConsentProps, {}> {}

View File

@ -122,7 +122,7 @@ class CookieConsent extends Component {
buttonClasses,
buttonId,
disableButtonStyles,
ButtonComponent
buttonComponent
} = this.props;
let myStyle = {};
@ -166,7 +166,7 @@ class CookieConsent extends Component {
<div style={myContentStyle} className={contentClasses}>
{this.props.children}
</div>
<ButtonComponent
<buttonComponent
style={myButtonStyle}
className={buttonClasses}
id={buttonId}
@ -175,7 +175,7 @@ class CookieConsent extends Component {
}}
>
{buttonText}
</ButtonComponent>
</buttonComponent>
</div>
);
}
@ -211,7 +211,7 @@ CookieConsent.propTypes = {
acceptOnScrollPercentage: PropTypes.number,
extraCookieOptions: PropTypes.object,
disableButtonStyles: PropTypes.bool,
ButtonComponent: PropTypes.oneOfType([
buttonComponent: PropTypes.oneOfType([
PropTypes.func,
PropTypes.element
]),
@ -235,7 +235,7 @@ CookieConsent.defaultProps = {
buttonId: "",
extraCookieOptions: {},
disableButtonStyles: false,
ButtonComponent: ({ children, ...props }) => <button {...props}>{children}</button>,
buttonComponent: ({ children, ...props }) => <button {...props}>{children}</button>,
};
export default CookieConsent;