mirror of
https://github.com/Mastermindzh/react-cookie-consent.git
synced 2025-01-20 18:41:44 +01:00
Mastermindzh
a64cbc28f9
- extracted code which handles setting/getting cookies. - added correct implementation of the legacy cookie fix according to the provided url - added cookieSecurity attribute with default value based on runtime environment - updated README - ran builds
43 lines
1.2 KiB
TypeScript
43 lines
1.2 KiB
TypeScript
import * as React from "react";
|
|
import Cookies from "js-cookie";
|
|
|
|
export interface CookieConsentProps {
|
|
location?: "top" | "bottom" | "none";
|
|
sameSite?: "strict" | "lax" | "none";
|
|
cookieSecurity?: boolean;
|
|
style?: object;
|
|
buttonStyle?: object;
|
|
declineButtonStyle?: object;
|
|
contentStyle?: object;
|
|
children?: React.ReactNode;
|
|
disableStyles?: boolean;
|
|
hideOnAccept?: boolean;
|
|
onAccept?: ({ acceptedByScrolling }: { acceptedByScrolling?: boolean }) => void;
|
|
onDecline?: Function;
|
|
buttonText?: Function | React.ReactNode;
|
|
declineButtonText?: Function | React.ReactNode;
|
|
cookieName?: string;
|
|
cookieValue?: string | boolean | number;
|
|
declineCookieValue?: string | boolean | number;
|
|
setDeclineCookie?: boolean;
|
|
debug?: boolean;
|
|
expires?: number;
|
|
containerClasses?: string;
|
|
contentClasses?: string;
|
|
buttonClasses?: string;
|
|
declineButtonClasses?: string;
|
|
buttonId?: string;
|
|
declineButtonId?: string;
|
|
acceptOnScroll?: boolean;
|
|
acceptOnScrollPercentage?: number;
|
|
extraCookieOptions?: object;
|
|
disableButtonStyles?: boolean;
|
|
enableDeclineButton?: boolean;
|
|
flipButtons?: boolean;
|
|
ButtonComponent?: React.ElementType;
|
|
}
|
|
|
|
export default class CookieConsent extends React.Component<CookieConsentProps, {}> {}
|
|
|
|
export { Cookies };
|