Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WAITP-1292 & WAITP-1285: Web Frontend changes from dev #4730

Merged
merged 2 commits into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/tupaia-web/src/components/CheckboxField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const StyledCheckbox = styled(Checkbox)`
interface CheckboxProps extends MuiCheckboxProps {
options?: any; // options is type RegisterOptions from react-hook-form, but ts-lint can not find that export
name: string;
label?: string;
label?: React.ReactNode;
helperText?: string | null;
}

Expand All @@ -31,7 +31,7 @@ export const CheckboxField = ({ name, label, required, options = {}, ...props }:
return (
<StyledCheckbox
name={name}
label={label as string}
label={label}
required={required}
color="primary"
error={!!errors[name]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const ActionLink = styled(Button)`
text-transform: none;
font-size: 0.975rem;
line-height: 1.5;
padding: 1em;
padding: 0.77rem 1rem;
border-radius: 0.6em;
text-decoration: none;
${ExtendedTitle} + & {
Expand All @@ -55,7 +55,7 @@ const ActionLink = styled(Button)`
}
@media screen and (min-width: ${({ theme }) =>
theme.breakpoints.values.sm}px) and (min-height: 600px) {
font-size: 1rem;
font-size: 1.0625rem;
}
`;

Expand Down
25 changes: 24 additions & 1 deletion packages/tupaia-web/src/views/RegisterModal/RegisterModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ const LinkText = styled(Typography)`
}
`;

const TermsText = styled.span`
color: ${props => props.theme.palette.common.white};

a {
color: ${props => props.theme.palette.common.white};
}
`;

const FullWidthColumn = styled.div`
grid-column: 1/-1;
`;
Expand Down Expand Up @@ -101,7 +109,22 @@ export const RegisterModal = () => {
/>
<TextField name="employer" label="Employer" required />
<TextField name="position" label="Position" required />
<CheckboxField name="hasAgreed" label="I agree to the terms and conditions" required />
<CheckboxField
name="hasAgreed"
label={
<TermsText>
I agree to the{' '}
<a
href="https://www.bes.au/terms-and-conditions"
target="_blank"
rel="noreferrer noopener"
>
terms and conditions
</a>
</TermsText>
}
required
/>
<FullWidthColumn>
<AuthModalButton type="submit" isLoading={isLoading}>
Register account
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-components/src/components/Inputs/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const FormHelperText = styled(MuiFormHelperText)`
`;

interface CheckboxProps extends MuiCheckboxProps {
label?: string;
label?: React.ReactNode;
error?: boolean;
className?: string;
helperText?: string;
Expand Down