mirror of
https://github.com/Mastermindzh/react-cookie-consent.git
synced 2025-01-21 02:50:58 +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. |
|
| buttonStyle | object | [look at source][buttonStyle] | React styling object for the button. |
|
||||||
| contentStyle | object | [look at source][contentStyle] | React styling object for the content. |
|
| 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) |
|
| 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
|
## Debugging it
|
||||||
|
|
||||||
|
2
build/index.d.ts
vendored
2
build/index.d.ts
vendored
@ -23,7 +23,7 @@ export interface CookieConsentProps {
|
|||||||
acceptOnScrollPercentage?: number;
|
acceptOnScrollPercentage?: number;
|
||||||
extraCookieOptions?: object;
|
extraCookieOptions?: object;
|
||||||
disableButtonStyles ?: boolean;
|
disableButtonStyles ?: boolean;
|
||||||
buttonComponent?: Function | React.ReactElement;
|
ButtonComponent?: Function | React.ReactElement;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class CookieConsent extends React.Component<CookieConsentProps, {}> {}
|
export default class CookieConsent extends React.Component<CookieConsentProps, {}> {}
|
||||||
|
@ -681,7 +681,7 @@ var CookieConsent = function (_Component) {
|
|||||||
buttonClasses = _props3.buttonClasses,
|
buttonClasses = _props3.buttonClasses,
|
||||||
buttonId = _props3.buttonId,
|
buttonId = _props3.buttonId,
|
||||||
disableButtonStyles = _props3.disableButtonStyles,
|
disableButtonStyles = _props3.disableButtonStyles,
|
||||||
buttonComponent = _props3.buttonComponent;
|
ButtonComponent = _props3.ButtonComponent;
|
||||||
|
|
||||||
|
|
||||||
var myStyle = {};
|
var myStyle = {};
|
||||||
@ -728,7 +728,7 @@ var CookieConsent = function (_Component) {
|
|||||||
this.props.children
|
this.props.children
|
||||||
),
|
),
|
||||||
_react2.default.createElement(
|
_react2.default.createElement(
|
||||||
"buttonComponent",
|
ButtonComponent,
|
||||||
{
|
{
|
||||||
style: myButtonStyle,
|
style: myButtonStyle,
|
||||||
className: buttonClasses,
|
className: buttonClasses,
|
||||||
@ -770,7 +770,7 @@ CookieConsent.propTypes = {
|
|||||||
acceptOnScrollPercentage: _propTypes2.default.number,
|
acceptOnScrollPercentage: _propTypes2.default.number,
|
||||||
extraCookieOptions: _propTypes2.default.object,
|
extraCookieOptions: _propTypes2.default.object,
|
||||||
disableButtonStyles: _propTypes2.default.bool,
|
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 = {
|
CookieConsent.defaultProps = {
|
||||||
@ -791,7 +791,7 @@ CookieConsent.defaultProps = {
|
|||||||
buttonId: "",
|
buttonId: "",
|
||||||
extraCookieOptions: {},
|
extraCookieOptions: {},
|
||||||
disableButtonStyles: false,
|
disableButtonStyles: false,
|
||||||
buttonComponent: function buttonComponent(_ref) {
|
ButtonComponent: function ButtonComponent(_ref) {
|
||||||
var children = _ref.children,
|
var children = _ref.children,
|
||||||
props = _objectWithoutProperties(_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;
|
acceptOnScrollPercentage?: number;
|
||||||
extraCookieOptions?: object;
|
extraCookieOptions?: object;
|
||||||
disableButtonStyles ?: boolean;
|
disableButtonStyles ?: boolean;
|
||||||
buttonComponent?: Function | React.ReactElement;
|
ButtonComponent?: Function | React.ReactElement;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class CookieConsent extends React.Component<CookieConsentProps, {}> {}
|
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,
|
buttonClasses,
|
||||||
buttonId,
|
buttonId,
|
||||||
disableButtonStyles,
|
disableButtonStyles,
|
||||||
buttonComponent
|
ButtonComponent
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
let myStyle = {};
|
let myStyle = {};
|
||||||
@ -166,7 +166,7 @@ class CookieConsent extends Component {
|
|||||||
<div style={myContentStyle} className={contentClasses}>
|
<div style={myContentStyle} className={contentClasses}>
|
||||||
{this.props.children}
|
{this.props.children}
|
||||||
</div>
|
</div>
|
||||||
<buttonComponent
|
<ButtonComponent
|
||||||
style={myButtonStyle}
|
style={myButtonStyle}
|
||||||
className={buttonClasses}
|
className={buttonClasses}
|
||||||
id={buttonId}
|
id={buttonId}
|
||||||
@ -175,7 +175,7 @@ class CookieConsent extends Component {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{buttonText}
|
{buttonText}
|
||||||
</buttonComponent>
|
</ButtonComponent>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -211,7 +211,7 @@ CookieConsent.propTypes = {
|
|||||||
acceptOnScrollPercentage: PropTypes.number,
|
acceptOnScrollPercentage: PropTypes.number,
|
||||||
extraCookieOptions: PropTypes.object,
|
extraCookieOptions: PropTypes.object,
|
||||||
disableButtonStyles: PropTypes.bool,
|
disableButtonStyles: PropTypes.bool,
|
||||||
buttonComponent: PropTypes.oneOfType([
|
ButtonComponent: PropTypes.oneOfType([
|
||||||
PropTypes.func,
|
PropTypes.func,
|
||||||
PropTypes.element
|
PropTypes.element
|
||||||
]),
|
]),
|
||||||
@ -235,7 +235,7 @@ CookieConsent.defaultProps = {
|
|||||||
buttonId: "",
|
buttonId: "",
|
||||||
extraCookieOptions: {},
|
extraCookieOptions: {},
|
||||||
disableButtonStyles: false,
|
disableButtonStyles: false,
|
||||||
buttonComponent: ({ children, ...props }) => <button {...props}>{children}</button>,
|
ButtonComponent: ({ children, ...props }) => <button {...props}>{children}</button>,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default CookieConsent;
|
export default CookieConsent;
|
||||||
|
Loading…
Reference in New Issue
Block a user