Skip to content
Snippets Groups Projects
Commit c851b780 authored by Jonas Braathen's avatar Jonas Braathen
Browse files

Fix consent step button styling and text

parent 47781ab3
No related branches found
No related tags found
1 merge request!173Consents
Pipeline #101445 passed
......@@ -53,7 +53,6 @@
"top": "Welcome to Guest Registration.",
"body": "You are not registered as a host or guest. To become a guest, request an invite from your host. If you should have host access, contact support."
},
"loading": "Loading...",
"termsHeader": "Terms",
"staging": "Staging",
......@@ -110,7 +109,8 @@
"backToFrontPage": "Go to front page",
"cancelInvitation": "Cancel",
"resendInvitation": "Send",
"ok": "OK"
"ok": "OK",
"finishRegistration": "Finish registration"
},
"registerWizardText": {
"registerPage": "Enter the contact information for the guest below. All fields are mandatory.",
......
......@@ -109,7 +109,8 @@
"backToFrontPage": "Tilbake til forsiden",
"resendInvitation": "Send",
"cancelInvitation": "Kanseller",
"ok": "OK"
"ok": "OK",
"finishRegistration": "Fullfør registrering"
},
"registerWizardText": {
"registerPage": "Fyll inn kontaktinformasjonen til gjesten under. Alle feltene er obligatoriske.",
......
......@@ -110,7 +110,8 @@
"backToFrontPage": "Tilbake til forsida",
"resendInvitation": "Send",
"cancelInvitation": "Kanseller",
"ok": "OK"
"ok": "OK",
"finishRegistration": "Fullfør registrering"
},
"registerWizardText": {
"registerPage": "Fyll inn kontaktinformasjonen til gjesten under. Alle feltene er obligatoriske.",
......
......@@ -71,6 +71,7 @@ export default function GuestRegister() {
const history = useHistory()
const guestRegisterRef = useRef<GuestRegisterCallableMethods>(null)
const guestConsentRef = useRef<GuestRegisterCallableMethods>(null)
// TODO On submit successful the user should be directed to some page telling
// eslint-disable-next-line @typescript-eslint/no-unused-vars
......@@ -180,6 +181,11 @@ export default function GuestRegister() {
guestRegisterRef.current.doSubmit()
}
}
if (activeStep === Step.ConsentStep) {
if (guestConsentRef.current) {
guestConsentRef.current.doSubmit()
}
}
}
const handleBack = () => {
......@@ -304,7 +310,7 @@ export default function GuestRegister() {
<Suspense fallback={<CircularProgress />}>
<GuestConsentStep
nextHandler={handleForwardFromConsent}
ref={guestRegisterRef}
ref={guestConsentRef}
/>
</Suspense>
</Box>
......@@ -333,10 +339,16 @@ export default function GuestRegister() {
{t('button.next')}
</Button>
)}
{activeStep === Step.ConsentStep && (
<Button onClick={handleNext} sx={{ mr: 1 }}>
{t('button.finishRegistration')}
</Button>
)}
{activeStep === Step.ConsentStep && (
<Button
data-testid="button-black"
sx={{ color: 'theme.palette.secondary', mr: 1 }}
color="secondary"
sx={{ mr: 1 }}
onClick={handleBack}
>
{t('button.back')}
......
......@@ -4,7 +4,6 @@ import { SubmitHandler, useForm, useFieldArray } from 'react-hook-form'
import { useTranslation } from 'react-i18next'
import {
Box,
Button,
FormControl,
FormGroup,
FormHelperText,
......@@ -167,7 +166,6 @@ const GuestConsentStep = forwardRef(
</Box>
)
})}
<Button onClick={onSubmit}>{t('button.save')}</Button>
</form>
</Box>
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment