✨ Add error to inputs
This commit is contained in:
parent
1dc2738ee0
commit
1d414049a8
@ -6,7 +6,7 @@ import BaseField, { IProps as IBaseFieldProps } from "../BaseField";
|
||||
import classes from "./classes.module.scss";
|
||||
import classnames from "classnames";
|
||||
import Image from "next/image";
|
||||
|
||||
import { XMarkIcon } from "@heroicons/react/24/outline";
|
||||
export type IProps = IBaseFieldProps & {
|
||||
canCopy?: boolean;
|
||||
password?: boolean;
|
||||
@ -40,11 +40,16 @@ export default class TextField extends BaseField<IProps> {
|
||||
disabled={this.props.disabled}
|
||||
type={this.props.password ? "password" : "text"}
|
||||
/>
|
||||
{this.props.canCopy && (
|
||||
{this.props.canCopy && !this.hasError() && (
|
||||
<div className={classes["copy-icon"]} onClick={this.onCopyClick}>
|
||||
<Image src={CopyIcon} alt="Copy icon" />
|
||||
</div>
|
||||
)}
|
||||
{this.hasError() && (
|
||||
<div className={classes["cross-icon"]} onClick={this.onCopyClick}>
|
||||
<XMarkIcon height="24px" width="24px" color="var(--input-error)" />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</label>
|
||||
{this.hasError() && <div className={classes["errors-container"]}>{this.renderErrors()}</div>}
|
||||
|
@ -3,7 +3,6 @@ import Folders from "@Front/Api/LeCoffreApi/Notary/Folders/Folders";
|
||||
import OfficeFolderAnchors from "@Front/Api/LeCoffreApi/Notary/OfficeFolderAnchors/OfficeFolderAnchors";
|
||||
import Button, { EButtonstyletype, EButtonVariant } from "@Front/Components/DesignSystem/Button";
|
||||
import FolderBoxInformation, { EFolderBoxInformationType } from "@Front/Components/DesignSystem/FolderBoxInformation";
|
||||
import TextAreaField from "@Front/Components/DesignSystem/Form/TextareaField";
|
||||
import Confirm from "@Front/Components/DesignSystem/OldModal/Confirm";
|
||||
import QuantityProgressBar from "@Front/Components/DesignSystem/QuantityProgressBar";
|
||||
import Typography, { ETypo, ETypoColor } from "@Front/Components/DesignSystem/Typography";
|
||||
@ -22,6 +21,7 @@ import classes from "./classes.module.scss";
|
||||
import ClientSection from "./ClientSection";
|
||||
import Loader from "@Front/Components/DesignSystem/Loader";
|
||||
import Newsletter from "@Front/Components/DesignSystem/Newsletter";
|
||||
import TextAreaField from "@Front/Components/DesignSystem/Form/TextareaField";
|
||||
|
||||
export enum AnchorStatus {
|
||||
"VERIFIED_ON_CHAIN" = "VERIFIED_ON_CHAIN",
|
||||
|
Loading…
x
Reference in New Issue
Block a user