Skip to content

Commit

Permalink
license field hides when invite role is not first_responder
Browse files Browse the repository at this point in the history
  • Loading branch information
javtran committed Aug 19, 2024
1 parent 795dfc9 commit 2b03e7f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion client/src/pages/register/RegisterForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const registerFormProps = {
onSubmit: PropTypes.func.isRequired,
setShowLicenseHelper: PropTypes.func.isRequired,
formState: PropTypes.number.isRequired,
showLicenseField: PropTypes.string.isRequired,
};

/**
Expand All @@ -33,6 +34,7 @@ export function RegisterForm({
onSubmit,
setShowLicenseHelper,
formState,
showLicenseField,
}) {
return (
<>
Expand All @@ -43,7 +45,7 @@ export function RegisterForm({
}}
>
<Container size="25rem" className={classes.form}>
{formState !== 3 && (
{formState !== 3 && showLicenseField && (
<>
<TextInput
disabled={isLoading || formState === 2}
Expand Down
3 changes: 3 additions & 0 deletions client/src/pages/register/register.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ function Register() {
setShowLicenseHelper(!showLicenseHelper);
}}
formState={formState}
showLicenseField={
!inviteId || (inviteId && user.role == 'FIRST_RESPONDER')
}
/>
</Flex>
</div>
Expand Down

0 comments on commit 2b03e7f

Please sign in to comment.