-
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 f90ce35
Showing
9 changed files
with
113 additions
and
16 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,36 @@ | ||
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 (<Switch> | ||
<Route path="*/preview" /> | ||
<Route path="*"> | ||
<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> | ||
</Route> | ||
</Switch>) | ||
} | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React from 'react' | ||
|
||
import styles from '../components/Write/write.module.scss' | ||
|
||
export default function Privacy () { | ||
return ( | ||
<section className={styles.container}> | ||
<article className={styles.simplePage}> | ||
<h2>Privacy Terms</h2> | ||
|
||
<p>Coming soon…</p> | ||
</article> | ||
</section> | ||
) | ||
} |
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
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