-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pretend we have consent for now, and expose Matomo env variables to t…
…he frontend app
- Loading branch information
Thomas Parisot
committed
Dec 1, 2021
1 parent
5e6e4ec
commit 1403af1
Showing
6 changed files
with
80 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React, { useCallback } from 'react' | ||
import { useSelector, useDispatch } from 'react-redux' | ||
import { Switch, Route, Link } from 'react-router-dom' | ||
|
||
import styles from './header.module.scss' | ||
|
||
function Footer () { | ||
const dispatch = useDispatch() | ||
const userHasConsent = useSelector(state => state.userPreferences.trackingConsent) | ||
const toggleConsent = useCallback(() => dispatch({ type: 'USER_PREFERENCES_TOGGLE', key: 'trackingConsent' }), []) | ||
|
||
return ( | ||
<footer className={styles.footerContainer}> | ||
<ul className={styles.footerList}> | ||
<li>Stylo</li> | ||
<li> | ||
<a href="https://github.com/EcrituresNumeriques/stylo/releases" rel="noopener noreferrer" target="_blank"> | ||
Changelog | ||
</a> | ||
</li> | ||
<li><Link to="/privacy">Privacy</Link></li> | ||
{ import.meta.env.SNOWPACK_MATOMO_URL && (<li> | ||
<label className={styles.consentLabel}> | ||
<input type="checkbox" checked={userHasConsent} onChange={toggleConsent} disabled={true} /> | ||
I accept to share my navigation stats | ||
</label> | ||
</li>) } | ||
</ul> | ||
</footer> | ||
) | ||
} | ||
|
||
export default Footer |
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