diff --git a/components/Form.tsx b/components/Form.tsx index ef4b83a..490e2d9 100644 --- a/components/Form.tsx +++ b/components/Form.tsx @@ -1,5 +1,5 @@ import {saveAs} from 'file-saver'; -import React, {FormEvent, useEffect, useRef, useState} from "react"; +import React, {FormEvent, useEffect, useRef, useState, Component} from "react"; import {BrowserQRCodeReader, IScannerControls} from "@zxing/browser"; import {Result} from "@zxing/library"; import {useTranslation} from 'next-i18next'; @@ -15,7 +15,19 @@ import {Photo} from "../src/photo"; import {isIOS, isMacOs, isSafari, osVersion, getUA, browserName, browserVersion} from 'react-device-detect'; import * as Sentry from '@sentry/react'; import Bullet from './Bullet'; +import Select from 'react-select' +const options = [ + { label: 'Alberta', value: 'https://covidrecords.alberta.ca/form'}, + { label: 'British Columbia', value: 'https://www.healthgateway.gov.bc.ca/vaccinecard'}, + { label: 'Ontario', value: 'https://covid19.ontariohealth.ca'}, + { label: 'Northern Territories', value: 'https://www.gov.nt.ca/covid-19/en/request/proof-vaccination'}, + { label: 'Nova Scotia', value: 'https://novascotia.flow.canimmunize.ca/en/portal'}, + { label: 'Québec', value: 'https://covid19.quebec.ca/PreuveVaccinale'}, + { label: 'Saskatchewan', value: 'https://services.saskatchewan.ca/#/login'}, + { label: 'Yukon', value: 'https://service.yukon.ca/forms/en/get-covid19-proof-of-vaccination'} + +] function Form(): JSX.Element { const {t} = useTranslation(['index', 'errors', 'common']); @@ -44,6 +56,9 @@ function Form(): JSX.Element { const [fileErrorMessages, _setFileErrorMessages] = useState>([]); const [showDoseOption, setShowDoseOption] = useState(false); + + const [selectedOption, setSelectedOption] = useState(null); + // const [warningMessages, _setWarningMessages] = useState>([]); const hitcountHost = 'https://stats.vaccine-ontario.ca'; @@ -433,27 +448,42 @@ function Form(): JSX.Element { // } } + function gotoLink(option) { + window.location.href = option.value; + } + + function promptTextCreator(value) { + return 'Select province...'; + } + return (

- {t('index:visit')}  +