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

Update Cookie consent popup #1645

Merged
merged 2 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion public/locales/bg/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"see-profile": "Вижте профил",
"question": "Имате въпрос?"
},
"cookieConsent": "Подкрепи.бг не използва бисквитки, освен тези от трети страни, нужни за аналитичните компоненти Google Analytics и HotJar. Приемането на бисквитките ще ни помогне да подобрим вашето потребителско преживяване",
"cookieConsent": "Подкрепи.бг не използва бисквитки, освен тези от трети страни, нужни за аналитичните компоненти Google Analytics и HotJar. Приемането на бисквитките ще ни помогне да подобрим вашето потребителско преживяване.",
"cookieConsentButton": "Приемам",
"cookieRejectButton": "Отхвърлям"
}
39 changes: 27 additions & 12 deletions src/components/common/CookieConsentPopup.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import CookieConsent from 'react-cookie-consent'
import { useTranslation } from 'react-i18next'

import theme from 'common/theme'

type CookieConsentPopupProps = {
handleAcceptCookie: () => void
handleDeclineCookie: () => void
Expand All @@ -15,27 +17,40 @@ const CookieConsentPopup = ({
return (
<CookieConsent
enableDeclineButton
flipButtons
onAccept={handleAcceptCookie}
onDecline={handleDeclineCookie}
buttonText={t('cookieConsentButton')}
declineButtonText={t('cookieRejectButton')}
style={{ border: '1px solid black', backgroundColor: '#fff' }}
style={{
backgroundColor: '#EAF4FC',
alignItems: 'center',
justifyContent: 'space-evenly',
padding: theme.spacing(2.5),
gap: theme.spacing(2.5),
}}
contentStyle={{
fontSize: '1rem',
color: '#000',
padding: '0.5rem',
fontSize: theme.typography.pxToRem(16),
color: theme.palette.common.black,
padding: theme.spacing(0, 2),
margin: 0,
maxWidth: theme.spacing(132.5),
}}
buttonStyle={{
backgroundColor: 'white',
color: '#32a9fe',
border: '1px solid #32a9fe',
borderRadius: '5px',
color: theme.palette.primary.main,
borderRadius: theme.borders.semiRound,
padding: theme.spacing(1.125, 1.5),
backgroundColor: theme.palette.common.white,
border: `1px solid ${theme.palette.primary.main}`,
margin: theme.spacing(0, 3.75),
}}
declineButtonStyle={{
backgroundColor: 'white',
color: '#32a9fe',
border: '1px solid #32a9fe',
borderRadius: '5px',
color: theme.palette.primary.main,
borderRadius: theme.borders.semiRound,
padding: theme.spacing(1, 1.5),
backgroundColor: theme.palette.common.white,
border: `1px solid ${theme.palette.primary.main}`,
margin: theme.spacing(0, 3.75, 0, 0),
}}>
{t('cookieConsent')}
</CookieConsent>
Expand Down
Loading