diff --git a/src/app.test.js b/src/app.test.js
index 29df13af..a06a30bd 100644
--- a/src/app.test.js
+++ b/src/app.test.js
@@ -43,8 +43,7 @@ describe('Application', () => {
'/u/1234': 'Profile page with display name: 1234',
'/login': 'Login',
'/signup': 'Sign up',
- '/password': 'Request new password',
- '/password/forgotten': 'Request new password',
+ '/recover-password': 'Request a new password',
'/this-url-should-not-be-found': 'Page not found',
'/reset-password?t=token&e=email': 'Reset password',
};
diff --git a/src/components/TextInputField/TextInputField.js b/src/components/TextInputField/TextInputField.js
index 6039ab0c..7ff8a1a6 100644
--- a/src/components/TextInputField/TextInputField.js
+++ b/src/components/TextInputField/TextInputField.js
@@ -17,6 +17,7 @@ class TextInputFieldComponent extends Component {
rootClassName,
className,
clearOnUnmount,
+ customErrorText,
id,
label,
type,
@@ -33,9 +34,13 @@ class TextInputFieldComponent extends Component {
const { valid, invalid, touched, error } = meta;
const isTextarea = type === 'textarea';
+ const errorText = customErrorText || error;
+
// Error message and input error styles are only shown if the
// field has been touched and the validation has failed.
- const hasError = touched && invalid && error;
+ const hasError = touched && invalid && errorText;
+
+ const fieldMeta = { touched, error: errorText };
const inputClasses = classNames(css.input, {
[css.inputSuccess]: valid,
@@ -50,7 +55,7 @@ class TextInputFieldComponent extends Component {
{label ? : null}
{isTextarea ? : }
-
+
);
}
@@ -60,6 +65,7 @@ TextInputFieldComponent.defaultProps = {
rootClassName: null,
className: null,
clearOnUnmount: false,
+ customErrorText: null,
id: null,
label: null,
};
@@ -72,6 +78,10 @@ TextInputFieldComponent.propTypes = {
clearOnUnmount: bool,
+ // Error message that can be manually passed to input field,
+ // overrides default validation message
+ customErrorText: string,
+
// Label is optional, but if it is given, an id is also required so
// the label can reference the input in the `for` attribute
id: string,
diff --git a/src/containers/LoginForm/LoginForm.css b/src/containers/LoginForm/LoginForm.css
index 1b17d7aa..98c11d52 100644
--- a/src/containers/LoginForm/LoginForm.css
+++ b/src/containers/LoginForm/LoginForm.css
@@ -10,17 +10,23 @@
.password {
margin-top: 24px;
+ margin-bottom: 24px;
@media (--viewportMedium) {
margin-top: 30px;
}
}
-.button {
- margin-top: 24px;
- align-self: stretch;
-
- @media (--viewportMedium) {
- margin-top: 72px;
- }
+.bottomWrapper {
+ margin-top: auto;
+ text-align: center;
+}
+
+.recoveryLink {
+ @apply --marketplaceH5FontStyles;
+ color: var(--matterColor);
+}
+
+.recoveryLinkHelp {
+ color: var(--matterColorAnti);
}
diff --git a/src/containers/LoginForm/LoginForm.js b/src/containers/LoginForm/LoginForm.js
index 6f48781b..3699ddc4 100644
--- a/src/containers/LoginForm/LoginForm.js
+++ b/src/containers/LoginForm/LoginForm.js
@@ -3,7 +3,7 @@ import { compose } from 'redux';
import { FormattedMessage, injectIntl, intlShape } from 'react-intl';
import { reduxForm, propTypes as formPropTypes } from 'redux-form';
import classNames from 'classnames';
-import { Button, TextInputField } from '../../components';
+import { Button, TextInputField, NamedLink } from '../../components';
import * as validators from '../../util/validators';
import css from './LoginForm.css';
@@ -68,6 +68,15 @@ const LoginFormComponent = props => {
validate={passwordRequired}
/>
+
+
+
+ {' '}
+
+
+
+
+
diff --git a/src/containers/LoginForm/LoginForm.test.js b/src/containers/LoginForm/LoginForm.test.js
index bffa3a3b..c7aa9db3 100644
--- a/src/containers/LoginForm/LoginForm.test.js
+++ b/src/containers/LoginForm/LoginForm.test.js
@@ -1,10 +1,18 @@
import React from 'react';
import { renderDeep } from '../../util/test-helpers';
+import { RoutesProvider } from '../../components';
+import routesConfiguration from '../../routesConfiguration';
+import { flattenRoutes } from '../../util/routes';
import LoginForm from './LoginForm';
describe('LoginForm', () => {
it('matches snapshot', () => {
- const tree = renderDeep();
+ const flattenedRoutes = flattenRoutes(routesConfiguration);
+ const tree = renderDeep(
+
+
+
+ );
expect(tree).toMatchSnapshot();
});
});
diff --git a/src/containers/LoginForm/__snapshots__/LoginForm.test.js.snap b/src/containers/LoginForm/__snapshots__/LoginForm.test.js.snap
index 72311e2c..9bba618b 100644
--- a/src/containers/LoginForm/__snapshots__/LoginForm.test.js.snap
+++ b/src/containers/LoginForm/__snapshots__/LoginForm.test.js.snap
@@ -42,6 +42,26 @@ exports[`LoginForm matches snapshot 1`] = `
value="" />
+
+
+
+ Forgot your password?
+
+
+
+
+ No problem.
+
+
+
+