-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show instructions if analytics is adblocked and clicks privacy settings
- Loading branch information
Showing
5 changed files
with
102 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
Analytics: integrate matomo with UI (using matomo cookies for storage) | ||
Integrate matomo analytics |
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 @@ | ||
Integrate matomo analytics |
70 changes: 70 additions & 0 deletions
70
src/app/components/AnalyticsConsent/AnalyticsIsBlocked.tsx
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,70 @@ | ||
import Snackbar from '@mui/material/Snackbar' | ||
import Typography from '@mui/material/Typography' | ||
import { styled } from '@mui/material/styles' | ||
import Button from '@mui/material/Button' | ||
import Link from '@mui/material/Link' | ||
import { Trans, useTranslation } from 'react-i18next' | ||
import Card from '@mui/material/Card' | ||
import CardContent from '@mui/material/CardContent' | ||
import CardActions from '@mui/material/CardActions' | ||
import { useScreenSize } from 'app/hooks/useScreensize' | ||
import { legalDocuments } from '../../utils/externalLinks' | ||
|
||
const StyledButton = styled(Button)(({ theme }) => ({ | ||
paddingLeft: theme.spacing(5), | ||
paddingRight: theme.spacing(5), | ||
})) | ||
|
||
export const AnalyticsIsBlocked = (props: { isOpen: boolean; onReload: () => void; onClose: () => void }) => { | ||
const { t } = useTranslation() | ||
const { isMobile } = useScreenSize() | ||
return ( | ||
<> | ||
<Snackbar | ||
anchorOrigin={{ | ||
vertical: 'bottom', | ||
horizontal: 'right', | ||
}} | ||
sx={{ | ||
maxWidth: '450px', | ||
}} | ||
open={props.isOpen} | ||
> | ||
<Card elevation={4}> | ||
<CardContent> | ||
<Typography | ||
fontSize="14px" | ||
sx={{ | ||
paddingBottom: '12px', | ||
lineHeight: '1.25', | ||
}} | ||
align="center" | ||
> | ||
<Trans | ||
i18nKey="analyticsConsent.blockedText" | ||
t={t} | ||
components={{ | ||
PrivacyPolicyLink: ( | ||
<Link | ||
href={legalDocuments.privacyPolicy} | ||
target="_blank" | ||
sx={{ fontWeight: 400, textDecoration: 'underline' }} | ||
/> | ||
), | ||
}} | ||
/> | ||
</Typography> | ||
</CardContent> | ||
<CardActions sx={{ justifyContent: 'center', paddingBottom: isMobile ? '16px' : '32px' }}> | ||
<StyledButton onClick={() => props.onReload()} color="secondary" variant="outlined"> | ||
{t('analyticsConsent.reloadButtonLabel')} | ||
</StyledButton> | ||
<StyledButton onClick={() => props.onClose()} color="secondary" variant="outlined"> | ||
{t('analyticsConsent.closeButtonLabel')} | ||
</StyledButton> | ||
</CardActions> | ||
</Card> | ||
</Snackbar> | ||
</> | ||
) | ||
} |
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