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';
|
|
|
|
|
2019-05-07 11:29:07 +03:00
|
|
|
const getTokenData = (frameLocation) => {
|
2019-02-07 12:39:55 +03:00
|
|
|
const params = new URLSearchParams(frameLocation.query);
|
|
|
|
const token = params.get('token') || '';
|
2019-05-07 11:29:07 +03:00
|
|
|
return {token};
|
2019-02-07 12:39:55 +03:00
|
|
|
};
|
|
|
|
|
2019-05-07 11:29:07 +03:00
|
|
|
export default ({error, frameLocation, handleSubmit}) => (
|
2019-02-15 20:16:30 +03:00
|
|
|
<div className="gm-modal-form">
|
2019-02-15 11:35:03 +03:00
|
|
|
<FormHeader title="Reset password" error={error} errorText="Unable to reset password" />
|
|
|
|
<Form includeData={getTokenData(frameLocation)} onSubmit={handleSubmit}>
|
2019-02-26 06:09:16 +03:00
|
|
|
<PasswordInput bindTo="password" className="single" />
|
2019-02-15 11:35:03 +03:00
|
|
|
<FormSubmit label="Set password" />
|
|
|
|
</Form>
|
2019-02-07 12:39:55 +03:00
|
|
|
</div>
|
|
|
|
);
|