mirror of
https://github.com/Mastermindzh/react-cookie-consent.git
synced 2025-01-20 18:41:44 +01:00
Revert "reverted PascalCase to camelCase, thanks again for the contribution @charlyx !"
This reverts commit 969da3c809
.
This commit is contained in:
parent
49f275b3cd
commit
9baff03191
@ -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
2
build/index.d.ts
vendored
@ -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, {}> {}
|
||||
|
@ -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
2
src/index.d.ts
vendored
@ -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, {}> {}
|
||||
|
10
src/index.js
10
src/index.js
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user