diff options
Diffstat (limited to 'web/src/siteFooter.js')
| -rw-r--r-- | web/src/siteFooter.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/web/src/siteFooter.js b/web/src/siteFooter.js index 1d5139e..eef193b 100644 --- a/web/src/siteFooter.js +++ b/web/src/siteFooter.js @@ -39,7 +39,7 @@ async function share(result) { /// `result` is optional: with one, Share offers the score just achieved; /// without, it offers the site. -export function renderSiteFooter(root, { result, onShowPrivacy } = {}) { +export function renderSiteFooter(root, { result, onShowPrivacy, onShowContribute } = {}) { const wrap = document.createElement('div'); wrap.className = 'site-footer'; wrap.innerHTML = ` @@ -47,6 +47,8 @@ export function renderSiteFooter(root, { result, onShowPrivacy } = {}) { <span class="site-footer-sep">·</span> <a class="site-footer-link" href="${LINKS.github}" target="_blank" rel="noopener noreferrer" data-tooltip="Source on GitHub">GitHub</a> <span class="site-footer-sep">·</span> + <button class="site-footer-link" data-action="contribute" data-tooltip="Submit a passage for other people to type">Contribute</button> + <span class="site-footer-sep">·</span> <button class="site-footer-link" data-action="privacy" data-tooltip="What this site stores">Privacy</button> <span class="site-footer-sep">·</span> <span class="site-footer-version">v0.1.0</span> @@ -61,6 +63,7 @@ export function renderSiteFooter(root, { result, onShowPrivacy } = {}) { setTimeout(() => { shareBtn.textContent = 'Share'; }, 1800); }); wrap.querySelector('[data-action="privacy"]').addEventListener('click', () => onShowPrivacy?.()); + wrap.querySelector('[data-action="contribute"]').addEventListener('click', () => onShowContribute?.()); return () => wrap.remove(); } |