2019-02-07 12:39:55 +03:00
|
|
|
import FormHeader from '../components/FormHeader';
|
|
|
|
import PasswordInput from '../components/PasswordInput';
|
|
|
|
import FormSubmit from '../components/FormSubmit';
|
|
|
|
import Form from '../components/Form';
|
|
|
|
|
|
|
|
const getTokenData = frameLocation => {
|
|
|
|
const params = new URLSearchParams(frameLocation.query);
|
|
|
|
const token = params.get('token') || '';
|
|
|
|
return { token };
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2019-02-15 11:35:03 +03:00
|
|
|
export default ({ error, frameLocation, handleSubmit }) => (
|
|
|
|
<div>
|
|
|
|
<FormHeader title="Reset password" error={error} errorText="Unable to reset password" />
|
|
|
|
<Form includeData={getTokenData(frameLocation)} onSubmit={handleSubmit}>
|
|
|
|
<PasswordInput bindTo="password" />
|
|
|
|
<FormSubmit label="Set password" />
|
|
|
|
</Form>
|
2019-02-07 12:39:55 +03:00
|
|
|
</div>
|
|
|
|
);
|