1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-06-30 22:01:44 +02:00

error fixes

This commit is contained in:
Matthias Kretschmann 2020-10-15 14:16:38 +02:00
parent d70ebba20d
commit 823513d4ee
Signed by: m
GPG Key ID: 606EEEF3C479A91F
3 changed files with 10 additions and 5 deletions

View File

@ -15,14 +15,15 @@
.error { .error {
display: inline-block; display: inline-block;
font-size: var(--font-size-mini); font-size: var(--font-size-mini);
line-height: 1.2;
font-weight: var(--font-weight-bold); font-weight: var(--font-weight-bold);
color: var(--brand-white); color: var(--brand-white);
background: var(--brand-alert-red); background: var(--brand-alert-red);
border-radius: var(--border-radius); border-radius: var(--border-radius);
padding: 0 0.4rem; padding: 0.2rem 0.4rem;
position: absolute; position: absolute;
right: 0; right: 0;
bottom: -0.75rem; top: 85%;
z-index: 1; z-index: 1;
} }
@ -31,7 +32,10 @@
} }
.hasError input, .hasError input,
.hasError input:focus,
.hasError select, .hasError select,
.hasError textarea { .hasError textarea,
.hasError [class*='prefix'],
.hasError [class*='postfix'] {
border-color: var(--brand-alert-red); border-color: var(--brand-alert-red);
} }

View File

@ -71,7 +71,7 @@ export default function Input(props: Partial<InputProps>): ReactElement {
</Label> </Label>
<InputElement small={small} {...field} {...props} /> <InputElement small={small} {...field} {...props} />
{field && field.name !== 'price' && ( {field && field.name !== 'price' && hasError && (
<div className={styles.error}> <div className={styles.error}>
<ErrorMessage name={field.name} /> <ErrorMessage name={field.name} />
</div> </div>

View File

@ -179,7 +179,7 @@ export default function Add({
</div> </div>
<Field name="amount"> <Field name="amount">
{({ field }: { field: any }) => ( {({ field, form }: { field: any; form: any }) => (
<Input <Input
type="number" type="number"
max={amountMax} max={amountMax}
@ -196,6 +196,7 @@ export default function Add({
} }
placeholder="0" placeholder="0"
field={field} field={field}
form={form}
/> />
)} )}
</Field> </Field>