Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Cookie Management Feature for Visitor Privacy Preferences #963

Merged
merged 6 commits into from
Nov 25, 2024

Conversation

Chelakhovl
Copy link
Collaborator

This PR implements the cookie management functionality, enabling visitors to manage their cookie preferences in compliance with the acceptance criteria outlined below:

Key Features:
Cookie Banner Visibility:

A cookie banner titled "Використання файлів 'Cookies'" (Use of Cookies) is displayed at the bottom of the screen for first-time visitors.
Ensures visibility and accessibility for visitors.
Cookie Information:

The banner provides a brief explanation of the types of cookies used on the site:
Necessary
Statistic
Preferences
Marketing
Includes clear descriptions of their purposes.
Action Buttons:

"Дозволити всі" (Allow All): Enables all types of cookies.
"Налаштувати" (Configure): Opens a detailed settings modal for cookie management.
Detailed Cookie Settings Modal:

Includes:
A list of cookie categories (Necessary, Statistic, Preferences, Marketing) with descriptions.
Checkboxes for enabling/disabling specific cookie categories.

Two action buttons:
"Дозволити обрані" (Allow Selected): Saves selected preferences.
"Назад" (Back): Returns to the main banner.
Responsiveness:

The banner and modal adapt to various screen sizes and resolutions to ensure usability on both desktop and mobile devices.
Cookie Preferences Storage:

Cookie preferences are stored locally and applied on future visits unless the browser cache is cleared.
Default State:

The "Necessary" category is pre-checked and disabled, as these cookies are essential for the site's functionality.
Implementation Details:
Component - CookieMod:
Main component handling the cookie banner and modal logic.

State Management:
Local state manages modal visibility and selected preferences.
Preferences are stored using the browser's localStorage via react-cookie.

Styling:
Fully responsive styling with appropriate adjustments for screen sizes (375px, 768px, etc.).

Testing:
Unit test for:
Button visibility and functionality.
All tests pass successfully.

1
2
3
4
5
6

@Chelakhovl Chelakhovl self-assigned this Nov 23, 2024
@Chelakhovl Chelakhovl merged commit 4be84db into develop Nov 25, 2024
4 checks passed
@Chelakhovl Chelakhovl deleted the main-page-accept-cookies-875 branch November 29, 2024 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants