Finish the majority of work on vendors page to add/delete/edit.
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import { Button, Form, Input, notification } from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { selectCurrentUser } from "../../redux/user/user.selectors";
|
||||
import AlertComponent from "../alert/alert.component";
|
||||
import { Form, Input, notification, Button } from "antd";
|
||||
import { updateUserDetails } from "../../redux/user/user.actions";
|
||||
import { selectCurrentUser } from "../../redux/user/user.selectors";
|
||||
import ResetForm from "../form-items-formatted/reset-form-item.component";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
currentUser: selectCurrentUser
|
||||
@@ -47,33 +47,26 @@ export default connect(
|
||||
|
||||
return (
|
||||
<div>
|
||||
{isFieldsTouched() ? (
|
||||
//TODO: Appropriate Error
|
||||
<AlertComponent
|
||||
message={t("jobs.errors.validation")}
|
||||
onClick={() => resetFields()}
|
||||
/>
|
||||
) : null}
|
||||
{isFieldsTouched() ? <ResetForm resetFields={resetFields} /> : null}
|
||||
|
||||
<Form onSubmit={handleSubmit} autoComplete={"no"}>
|
||||
<Form.Item label={t("user.fields.displayname")}>
|
||||
{getFieldDecorator("displayname", {
|
||||
initialValue: currentUser.displayName,
|
||||
rules: [{ required: true }]
|
||||
})(<Input name="displayname" />)}
|
||||
})(<Input name='displayname' />)}
|
||||
</Form.Item>
|
||||
<Form.Item label={t("user.fields.photourl")}>
|
||||
{getFieldDecorator("photoURL", {
|
||||
initialValue: currentUser.photoURL
|
||||
})(<Input name="photoURL" />)}
|
||||
})(<Input name='photoURL' />)}
|
||||
</Form.Item>
|
||||
|
||||
<Button
|
||||
type="primary"
|
||||
key="submit"
|
||||
htmlType="submit"
|
||||
onClick={handleSubmit}
|
||||
>
|
||||
type='primary'
|
||||
key='submit'
|
||||
htmlType='submit'
|
||||
onClick={handleSubmit}>
|
||||
{t("user.actions.updateprofile")}
|
||||
</Button>
|
||||
</Form>
|
||||
|
||||
Reference in New Issue
Block a user