1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

Attempt fix issue

This commit is contained in:
KY Lau 2021-06-09 18:39:50 +08:00
parent 0c1dea91b6
commit e3d916fe61
3 changed files with 14 additions and 8 deletions

View File

@ -27,19 +27,25 @@ export default function Credential(props: InputProps) {
helpers.setValue(newInput)
}
function handleAddValue(e: FormEvent<HTMLButtonElement>) {
e.preventDefault()
function isCredentialValid(): boolean {
if (!isAddress(value)) {
toast.error('Wallet address is invalid')
return
return false
}
if (arrayInput.includes(value)) {
toast.error('Wallet address already added into list')
return
return false
}
return true
}
function handleAddValue(e: FormEvent<HTMLButtonElement>) {
e.preventDefault()
if (isCredentialValid()) {
setArrayInput((arrayInput) => [...arrayInput, value])
setValue('')
}
}
return (
<div className={styles.credential}>

View File

@ -123,7 +123,7 @@ export default function EditAdvanceSettings({
{({ isSubmitting, values, initialValues }) =>
isSubmitting || hasFeedback ? (
<MetadataFeedback
title="Updating Data Set"
title="Updating Advance Settings"
error={error}
success={success}
setError={setError}

View File

@ -1,5 +1,5 @@
import React, { ChangeEvent, ReactElement } from 'react'
import styles from './FormEditMetadata.module.css' // TODO
import styles from './FormEditMetadata.module.css'
import { Field, Form, FormikContextType, useFormikContext } from 'formik'
import Button from '../../../atoms/Button'
import Input from '../../../atoms/Input'