From ec5afe2d66d17cf456977ef57a3d27b18a2b3a8e Mon Sep 17 00:00:00 2001 From: Bogdan Cochior <bogdan.cochior@thinslices.com> Date: Wed, 4 Jul 2018 13:21:41 +0300 Subject: [PATCH] style(forms): fix UI on edit/add user --- .../src/components/Admin/EditUserForm.js | 3 +++ .../src/components/SignUp/SignUpStep0.js | 8 ++++---- .../src/components/UIComponents/FormItems.js | 2 ++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/components-faraday/src/components/Admin/EditUserForm.js b/packages/components-faraday/src/components/Admin/EditUserForm.js index 20971b7fa..04c6d7804 100644 --- a/packages/components-faraday/src/components/Admin/EditUserForm.js +++ b/packages/components-faraday/src/components/Admin/EditUserForm.js @@ -108,6 +108,9 @@ const Row = styled.div` display: flex; flex-direction: row; margin: calc(${th('subGridUnit')}*3) 0; + div[role='alert'] { + margin-top: 0; + } ` const RowItem = styled.div` diff --git a/packages/components-faraday/src/components/SignUp/SignUpStep0.js b/packages/components-faraday/src/components/SignUp/SignUpStep0.js index fb342d2ad..f3741135b 100644 --- a/packages/components-faraday/src/components/SignUp/SignUpStep0.js +++ b/packages/components-faraday/src/components/SignUp/SignUpStep0.js @@ -12,7 +12,7 @@ const Step0 = ({ journal, handleSubmit, initialValues, error }) => !isUndefined(initialValues) ? ( <FormContainer onSubmit={handleSubmit}> <Row> - <RowItem vertical> + <RowItem vertical withMargin> <Label>First name*</Label> <ValidatedField component={TextField} @@ -20,7 +20,7 @@ const Step0 = ({ journal, handleSubmit, initialValues, error }) => validate={[required]} /> </RowItem> - <RowItem vertical> + <RowItem vertical withMargin> <Label>Last name*</Label> <ValidatedField component={TextField} @@ -30,7 +30,7 @@ const Step0 = ({ journal, handleSubmit, initialValues, error }) => </RowItem> </Row> <Row> - <RowItem vertical> + <RowItem vertical withMargin> <Label>Affiliation*</Label> <ValidatedField component={TextField} @@ -39,7 +39,7 @@ const Step0 = ({ journal, handleSubmit, initialValues, error }) => /> </RowItem> - <RowItem vertical> + <RowItem vertical withMargin> <Label>Title*</Label> <ValidatedField component={input => <Menu {...input} options={journal.title} />} diff --git a/packages/components-faraday/src/components/UIComponents/FormItems.js b/packages/components-faraday/src/components/UIComponents/FormItems.js index fc91cd922..a617750b0 100644 --- a/packages/components-faraday/src/components/UIComponents/FormItems.js +++ b/packages/components-faraday/src/components/UIComponents/FormItems.js @@ -67,6 +67,8 @@ export const RowItem = styled.div` & > div { flex: 1; } + margin-right: ${({ withMargin }) => + withMargin ? css`calc(${th('subGridUnit')} * 3)` : 0}; ` export const Label = styled.div` -- GitLab