🐛 Removing act type choose in ask documents
This commit is contained in:
parent
39cba4981f
commit
10f7f08121
@ -4,7 +4,7 @@ import CheckBox from "@Front/Components/DesignSystem/CheckBox";
|
|||||||
import Form, { IApiFormErrors } from "@Front/Components/DesignSystem/Form";
|
import Form, { IApiFormErrors } from "@Front/Components/DesignSystem/Form";
|
||||||
import InputField from "@Front/Components/DesignSystem/Form/Elements/InputField";
|
import InputField from "@Front/Components/DesignSystem/Form/Elements/InputField";
|
||||||
import Confirm from "@Front/Components/DesignSystem/Modal/Confirm";
|
import Confirm from "@Front/Components/DesignSystem/Modal/Confirm";
|
||||||
import Select, { IOption } from "@Front/Components/DesignSystem/Select";
|
import { IOption } from "@Front/Components/DesignSystem/Select";
|
||||||
import Typography, { ITypo, ITypoColor } from "@Front/Components/DesignSystem/Typography";
|
import Typography, { ITypo, ITypoColor } from "@Front/Components/DesignSystem/Typography";
|
||||||
import BackArrow from "@Front/Components/Elements/BackArrow";
|
import BackArrow from "@Front/Components/Elements/BackArrow";
|
||||||
import DefaultNotaryDashboard from "@Front/Components/LayoutTemplates/DefaultNotaryDashboard";
|
import DefaultNotaryDashboard from "@Front/Components/LayoutTemplates/DefaultNotaryDashboard";
|
||||||
@ -15,19 +15,12 @@ import classes from "./classes.module.scss";
|
|||||||
|
|
||||||
type IProps = {};
|
type IProps = {};
|
||||||
type IState = {
|
type IState = {
|
||||||
actType: IOption | null;
|
|
||||||
isCreateDocumentModalVisible: boolean;
|
isCreateDocumentModalVisible: boolean;
|
||||||
documentName: string;
|
documentName: string;
|
||||||
visibleDescription: string;
|
visibleDescription: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default class AskDocuments extends BasePage<IProps, IState> {
|
export default class AskDocuments extends BasePage<IProps, IState> {
|
||||||
private actsOptions: IOption[] = [
|
|
||||||
{ label: "Divorce", value: "divorce" },
|
|
||||||
{ label: "Succession", value: "succession" },
|
|
||||||
{ label: "Vente immobilière", value: "vente_immobiliere" },
|
|
||||||
];
|
|
||||||
|
|
||||||
private documentsType: IOption[] = [
|
private documentsType: IOption[] = [
|
||||||
{ label: "Carte d'identité", value: "carte_identite" },
|
{ label: "Carte d'identité", value: "carte_identite" },
|
||||||
{ label: "Diagnostic État Risques et Pollution", value: "diagnostic_erep" },
|
{ label: "Diagnostic État Risques et Pollution", value: "diagnostic_erep" },
|
||||||
@ -46,13 +39,11 @@ export default class AskDocuments extends BasePage<IProps, IState> {
|
|||||||
super(props);
|
super(props);
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
actType: null,
|
|
||||||
isCreateDocumentModalVisible: false,
|
isCreateDocumentModalVisible: false,
|
||||||
documentName: "",
|
documentName: "",
|
||||||
visibleDescription: "",
|
visibleDescription: "",
|
||||||
};
|
};
|
||||||
|
|
||||||
this.onActTypeChange = this.onActTypeChange.bind(this);
|
|
||||||
this.onFormSubmit = this.onFormSubmit.bind(this);
|
this.onFormSubmit = this.onFormSubmit.bind(this);
|
||||||
this.closeModal = this.closeModal.bind(this);
|
this.closeModal = this.closeModal.bind(this);
|
||||||
this.openModal = this.openModal.bind(this);
|
this.openModal = this.openModal.bind(this);
|
||||||
@ -73,38 +64,27 @@ export default class AskDocuments extends BasePage<IProps, IState> {
|
|||||||
</Typography>
|
</Typography>
|
||||||
<Form onSubmit={this.onFormSubmit}>
|
<Form onSubmit={this.onFormSubmit}>
|
||||||
<div className={classes["form-container"]}>
|
<div className={classes["form-container"]}>
|
||||||
{!this.state.actType && (
|
<div className={classes["checkbox-container"]}>
|
||||||
<Select options={this.actsOptions} placeholder={"Type d’acte"} onChange={this.onActTypeChange} />
|
{this.documentsType.map((documentType) => (
|
||||||
)}
|
<CheckBox toolTip="Checkbox with tooltip" option={documentType} key={documentType.value as string} />
|
||||||
{this.state.actType && (
|
))}
|
||||||
<>
|
</div>
|
||||||
<div className={classes["checkbox-container"]}>
|
<div className={classes["add-document-container"]}>
|
||||||
{this.documentsType.map((documentType) => (
|
<Button
|
||||||
<CheckBox
|
icon={PlusIcon}
|
||||||
toolTip="Checkbox with tooltip"
|
iconposition={"right"}
|
||||||
option={documentType}
|
iconstyle={{ transform: "rotate(180deg)", width: "22px", height: "22px" }}
|
||||||
key={documentType.value as string}
|
variant={EButtonVariant.LINE}
|
||||||
/>
|
onClick={this.openModal}>
|
||||||
))}
|
Ajouter un document
|
||||||
</div>
|
</Button>
|
||||||
<div className={classes["add-document-container"]}>
|
</div>
|
||||||
<Button
|
<div className={classes["buttons-container"]}>
|
||||||
icon={PlusIcon}
|
<Button variant={EButtonVariant.GHOST} onClick={this.cancel}>
|
||||||
iconposition={"right"}
|
Annuler
|
||||||
iconstyle={{ transform: "rotate(180deg)", width: "22px", height: "22px" }}
|
</Button>
|
||||||
variant={EButtonVariant.LINE}
|
<Button type="submit">Valider</Button>
|
||||||
onClick={this.openModal}>
|
</div>
|
||||||
Ajouter un document
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
<div className={classes["buttons-container"]}>
|
|
||||||
<Button variant={EButtonVariant.GHOST} onClick={this.cancel}>
|
|
||||||
Annuler
|
|
||||||
</Button>
|
|
||||||
<Button type="submit">Valider</Button>
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</Form>
|
</Form>
|
||||||
<Confirm
|
<Confirm
|
||||||
@ -166,7 +146,6 @@ export default class AskDocuments extends BasePage<IProps, IState> {
|
|||||||
|
|
||||||
private cancel() {
|
private cancel() {
|
||||||
this.setState({
|
this.setState({
|
||||||
actType: null,
|
|
||||||
visibleDescription: "",
|
visibleDescription: "",
|
||||||
documentName: "",
|
documentName: "",
|
||||||
});
|
});
|
||||||
@ -188,12 +167,6 @@ export default class AskDocuments extends BasePage<IProps, IState> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private onActTypeChange(selectedOption: IOption) {
|
|
||||||
this.setState({
|
|
||||||
actType: selectedOption,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private onFormSubmit(
|
private onFormSubmit(
|
||||||
e: React.FormEvent<HTMLFormElement> | null,
|
e: React.FormEvent<HTMLFormElement> | null,
|
||||||
values: {
|
values: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user