Compare commits

...

4 Commits

Author SHA1 Message Date
Marvin Sextro b8eae1fb54 QR code viewer and content improvements 2021-12-29 03:29:07 +01:00
Marvin Sextro 931b0806f9 Scroll down after successful pass creation 2021-12-29 01:11:13 +01:00
Marvin Sextro 4f30b9b326 Fix greek translation 2021-12-29 00:57:06 +01:00
Marvin Sextro 3b04e24a6b Improve QR code viewer 2021-12-29 00:53:31 +01:00
5 changed files with 25 additions and 6 deletions

View File

@ -191,6 +191,9 @@ function Form(): JSX.Element {
const passBlob = new Blob([pass], {type: "application/vnd.apple.pkpass"});
saveAs(passBlob, 'covid.pkpass');
setLoading(false);
var scrollingElement = (document.scrollingElement || document.body);
scrollingElement.scrollTop = scrollingElement.scrollHeight;
} catch (e) {
setErrorMessage(e.message);
setLoading(false);

View File

@ -2,17 +2,33 @@ import {serverSideTranslations} from 'next-i18next/serverSideTranslations';
import React, {useEffect, useState} from "react";
import QRCode from "react-qr-code";
import Card from '../components/Card';
import Logo from "../components/Logo";
function Pass(): JSX.Element {
const [fragment, setFragment] = useState<string>(undefined);
function closeViewer() {
setFragment(undefined);
window.location.replace('/');
}
useEffect(() => {
const rawFragment = window.location.hash.substring(1);
const decodedFragment = Buffer.from(rawFragment, 'base64').toString();
setFragment(decodedFragment);
}, [fragment]);
document.addEventListener('visibilitychange', () => {
if (document.hidden) {
closeViewer();
}
});
window.addEventListener('blur', closeViewer);
window.addEventListener('beforeunload', closeViewer);
window.addEventListener('pagehide', closeViewer);
}, []);
return (
<div className="py-6 flex flex-col space-y-5 items-center">

View File

@ -152,7 +152,7 @@ function Privacy(): JSX.Element {
<li>
{t('privacy:appleSync')}:
&nbsp;
<a href="https://www.apple.com/legal/privacy/en-ww/privacy.tsx" className="underline">
<a href="https://www.apple.com/legal/privacy/en-ww/" className="underline">
{t('common:privacyPolicy')}
</a>
</li>

View File

@ -25,4 +25,4 @@ privacyPolicy: Πολιτική Απορρήτου
createdOnDevice: Δημιουργείται στη συσκευή σας
openSourceTransparent: Ανοιχτού κώδικα και διαφανής
hostedInEU: Φιλοξενείται στην ΕΕ
share: Συστήσει
share: Κοινοποιήστε το

View File

@ -3,9 +3,9 @@ import {Constants} from "./constants";
import {COLORS} from "./colors";
enum CertificateType {
Vaccination = 'Vaccination Card',
Test = 'Test Certificate',
Recovery = 'Recovery Certificate',
Vaccination = 'Vaccination Pass',
Test = 'Test Pass',
Recovery = 'Recovery Pass',
}
enum TextAlignment {