forked from podkrepi-bg/frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added cookies consent banner (podkrepi-bg#1634)
- Loading branch information
1 parent
ca656f1
commit 06292d3
Showing
6 changed files
with
95 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import CookieConsent from 'react-cookie-consent' | ||
import { useTranslation } from 'react-i18next' | ||
|
||
type CookieConsentPopupProps = { | ||
handleAcceptCookie: () => void | ||
handleDeclineCookie: () => void | ||
} | ||
|
||
const CookieConsentPopup = ({ | ||
handleAcceptCookie, | ||
handleDeclineCookie, | ||
}: CookieConsentPopupProps) => { | ||
const { t } = useTranslation() | ||
|
||
return ( | ||
<CookieConsent | ||
enableDeclineButton | ||
onAccept={handleAcceptCookie} | ||
onDecline={handleDeclineCookie} | ||
buttonText={t('cookieConsentButton')} | ||
declineButtonText={t('cookieRejectButton')} | ||
style={{ border: '1px solid black', backgroundColor: '#fff' }} | ||
contentStyle={{ | ||
fontSize: '1rem', | ||
color: '#000', | ||
padding: '0.5rem', | ||
}} | ||
buttonStyle={{ | ||
backgroundColor: 'white', | ||
color: '#32a9fe', | ||
border: '1px solid #32a9fe', | ||
borderRadius: '5px', | ||
}} | ||
declineButtonStyle={{ | ||
backgroundColor: 'white', | ||
color: '#32a9fe', | ||
border: '1px solid #32a9fe', | ||
borderRadius: '5px', | ||
}}> | ||
{t('cookieConsent')} | ||
</CookieConsent> | ||
) | ||
} | ||
|
||
export default CookieConsentPopup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters