Skip to content
Snippets Groups Projects
Commit fd382922 authored by Daniel Sandu's avatar Daniel Sandu
Browse files

fix(ValidatedField): UI issues Checkbox for Agree with Terms and Conditions in Sign-up

parent 96a86f36
No related branches found
No related tags found
2 merge requests!110Sprint 21 Features,!86fix(ValidatedField): UI issues Checkbox for Agree with Terms and Conditions in Sign-up
...@@ -4,6 +4,7 @@ import { reduxForm } from 'redux-form' ...@@ -4,6 +4,7 @@ import { reduxForm } from 'redux-form'
import { get, isUndefined } from 'lodash' import { get, isUndefined } from 'lodash'
import { required as requiredValidator } from 'xpub-validators' import { required as requiredValidator } from 'xpub-validators'
import { Menu, Button, Checkbox, TextField, ValidatedField } from '@pubsweet/ui' import { Menu, Button, Checkbox, TextField, ValidatedField } from '@pubsweet/ui'
import styled from 'styled-components'
import { import {
Row, Row,
...@@ -16,7 +17,7 @@ import { ...@@ -16,7 +17,7 @@ import {
} from 'pubsweet-component-faraday-ui' } from 'pubsweet-component-faraday-ui'
const AgreeCheckbox = ({ value, onChange }) => ( const AgreeCheckbox = ({ value, onChange }) => (
<Row alignItems="center" justify="flex-start" mb={4} mt={3}> <Row alignItems="center" justify="flex-start" mb={3} mt={3}>
<Checkbox checked={value} onChange={onChange} value={value} /> <Checkbox checked={value} onChange={onChange} value={value} />
<Text> <Text>
I agree with the{' '} I agree with the{' '}
...@@ -26,6 +27,9 @@ const AgreeCheckbox = ({ value, onChange }) => ( ...@@ -26,6 +27,9 @@ const AgreeCheckbox = ({ value, onChange }) => (
</Text> </Text>
</Row> </Row>
) )
const ValidationRow = styled(Row)`
justify-content: left;
`
const Step0 = ({ const Step0 = ({
type, type,
...@@ -98,11 +102,13 @@ const Step0 = ({ ...@@ -98,11 +102,13 @@ const Step0 = ({
</Item> </Item>
</Row> </Row>
<ValidatedField <ValidationRow mb={2}>
component={AgreeCheckbox} <ValidatedField
name="agreeTC" component={AgreeCheckbox}
validate={[requiredValidator]} name="agreeTC"
/> validate={[requiredValidator]}
/>
</ValidationRow>
<Row> <Row>
<Text secondary small> <Text secondary small>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment