2021-09-02 03:20:11 +02:00
|
|
|
import {useTranslation} from 'next-i18next';
|
|
|
|
import {serverSideTranslations} from 'next-i18next/serverSideTranslations';
|
|
|
|
|
|
|
|
import Page from '../components/Page'
|
|
|
|
import Card from '../components/Card'
|
|
|
|
|
2021-10-15 16:32:49 +02:00
|
|
|
interface link{
|
|
|
|
url: string;
|
|
|
|
text: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
function linkToJSX(link: link): JSX.Element {
|
|
|
|
return <div style={{ display: 'inline' }} dangerouslySetInnerHTML={{ __html: `<a href="${link.url}" target="_blank" class="underline">${link.text}</a>` }}></div>
|
|
|
|
}
|
|
|
|
|
|
|
|
function urlParse(text: string, links: link[]): JSX.Element[] {
|
|
|
|
const el = text.split(/(%s)/).map(s => {
|
|
|
|
if (s.includes("%s")) {
|
2021-10-15 16:51:46 +02:00
|
|
|
return linkToJSX(links.shift());
|
2021-10-15 16:32:49 +02:00
|
|
|
} else {
|
|
|
|
return <>{s}</>
|
|
|
|
}
|
|
|
|
});
|
|
|
|
return el;
|
|
|
|
}
|
|
|
|
|
2021-10-15 16:51:46 +02:00
|
|
|
|
|
|
|
const CONSTANTS = {
|
|
|
|
grassrootsEmail: { url: 'mailto:grassroots@vaccine-ontario.ca', text: 'grassroots@vaccine-ontario.ca' },
|
|
|
|
verifier: { url: 'https://verifier.vaccine-ontario.ca/', text: 'verifier.vaccine-ontario.ca' },
|
|
|
|
twitter: { url: 'https://twitter.com/grassroots_team', text: '@grassroots_team' },
|
|
|
|
booking: { url: 'https://vaccine-ontario.ca/', text: 'vaccine-ontario.ca' },
|
|
|
|
verifyOntarioApp: { url: 'https://covid-19.ontario.ca/verify', text: 'Verify Ontario app' },
|
|
|
|
vaxHunters: { url: 'https://vaccinehunters.ca/', text: 'Vaccine Hunters Canada' },
|
2021-10-21 18:09:21 +02:00
|
|
|
googlePayApp: { url: 'https://pay.app.goo.gl/gettheapp-en-ca', text: 'Google Play Store' }
|
2021-10-15 16:51:46 +02:00
|
|
|
}
|
|
|
|
|
2021-09-02 03:20:11 +02:00
|
|
|
function Faq(): JSX.Element {
|
|
|
|
const { t } = useTranslation(['common', 'index', 'faq']);
|
|
|
|
const questionList = [
|
2021-10-21 18:09:21 +02:00
|
|
|
{description: t('faq:iosSupportQ'), answer: t('faq:iosSupportA')},
|
|
|
|
{description: t('faq:androidSupportQ'), answer: t('faq:androidSupportA')},
|
|
|
|
{description: t('faq:olderIPhoneQ'), answer: t('faq:olderIPhoneA')},
|
|
|
|
{description: t('faq:qrSmallQ'), answer: t('faq:qrSmallA')},
|
|
|
|
{description: t('faq:browsersQ'), answer: t('faq:browsersA')},
|
|
|
|
{description: t('faq:privateInfoQ'), answer: t('faq:privateInfoA')},
|
|
|
|
{description: t('faq:samsungQ'), answer: urlParse(t('faq:samsungA'), [CONSTANTS.googlePayApp])},
|
|
|
|
{description: t('faq:redWhiteQ'), answer: t('faq:redWhiteA')},
|
|
|
|
{description: t('faq:noOhipQ'), answer: t('faq:noOhipA')},
|
|
|
|
{description: t('faq:colourQ'), answer: t('faq:colourA')},
|
|
|
|
{description: t('faq:dataQ'), answer: t('faq:dataA')},
|
|
|
|
{description: t('faq:verifyQ'), answer: urlParse(t('faq:verifyA'),[CONSTANTS.verifyOntarioApp])},
|
|
|
|
{description: t('faq:familyQ'), answer: t('faq:familyA')},
|
|
|
|
{description: t('faq:freeQ'), answer: urlParse(t('faq:freeA'),[CONSTANTS.vaxHunters])},
|
|
|
|
{description: t('faq:otherProvincesQ'), answer: urlParse(t('faq:otherProvincesA'), [CONSTANTS.grassrootsEmail])},
|
|
|
|
{description: t('faq:appleWatchQ'), answer: t('faq:appleWatchA')},
|
|
|
|
{description: t('faq:whyQ'), answer: t('faq:whyA')},
|
|
|
|
{description: t('faq:whoQ'), answer: urlParse(t('faq:whoA'), [CONSTANTS.booking])},
|
|
|
|
{description: t('faq:updatesQ'), answer: urlParse(t('faq:updatesA'), [CONSTANTS.twitter])},
|
|
|
|
{description: t('faq:moreQuestionsQ'), answer: urlParse(t('faq:moreQuestionsA'), [CONSTANTS.grassrootsEmail]) }
|
2021-09-02 03:20:11 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Page content={
|
2021-09-24 02:11:50 +02:00
|
|
|
<Card step="?" heading={t('common:faq')} content={
|
2021-09-02 03:20:11 +02:00
|
|
|
<div className="space-y-3">
|
|
|
|
<p className="font-bold">{t('faq:heading')}</p>
|
|
|
|
<ol>
|
2021-09-23 22:49:23 +02:00
|
|
|
{questionList.map((question, i) => {
|
2021-09-02 03:20:11 +02:00
|
|
|
return (
|
|
|
|
<div>
|
2021-09-23 22:49:23 +02:00
|
|
|
<li key={i}><b>{i+1}. {question.description}</b></li>
|
|
|
|
<li key={i}>{question.answer}</li>
|
2021-09-02 03:20:11 +02:00
|
|
|
<br></br>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
})}
|
|
|
|
</ol>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
}/>
|
|
|
|
}/>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export async function getStaticProps({ locale }) {
|
|
|
|
return {
|
|
|
|
props: {
|
|
|
|
...(await serverSideTranslations(locale, ['index', 'faq', 'common']))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default Faq;
|