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

This reverts commit 969da3c809.
This commit is contained in:
Rick van Lieshout 2019-02-26 14:01:17 +01:00
parent 49f275b3cd
commit 9baff03191
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;