A JavaScript library for handling cookie consent dialogs in web applications.
You can install waulter-test1
using npm or yarn:
npm install waulter-test1 --save
To use the CookieConsentDialog
component, follow these steps:
- Import the
CookieConsentDialog
component into your application:
import {CookieConsentDialog} from 'waulter-test1';
- Create a callback function to handle user choices. This function will be called when the user interacts with the dialog:
const handleChoice = (choice) => {
// Handle the user's choice here (e.g., store it in a cookie)
};
- Use the
CookieConsentDialog
component in your application:
import React, { useState } from 'react';
import CookieConsentDialog from 'waulter-test1';
function App() {
const [consentGiven, setConsentGiven] = useState(false);
const handleChoice = (choice) => {
// Handle user's choice here (e.g., store it in a cookie)
};
return (
<div>
<CookieConsentDialog onChoice={handleChoice} />
{/* Your app content */}
</div>
);
}
export default App;
- Customize the appearance and behavior of the dialog by passing props to the CookieConsentDialog component.
onChoice
: A callback function that is called when the user makes a choice in the dialog. It receives the selected option as an argument.