1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-11-14 09:14:52 +01:00

Allowing urls without proceeding http or https (#493)

* allowing urls without proceeding http or https

* Installing package: valid-url-utf8

* removing pre-submit URL validation

* removing new package

* updating package-lock.json
This commit is contained in:
Jamie Hewitt 2021-04-15 11:18:48 +03:00 committed by GitHub
parent 67cdd62718
commit 2826df8287
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 13 deletions

7
package-lock.json generated
View File

@ -16704,7 +16704,7 @@
} }
}, },
"ethereumjs-abi": { "ethereumjs-abi": {
"version": "git+https://github.com/ethereumjs/ethereumjs-abi.git#1ce6a1d64235fabe2aaf827fd606def55693508f", "version": "git+https://github.com/ethereumjs/ethereumjs-abi.git#1a27c59c15ab1e95ee8e5c4ed6ad814c49cc439e",
"from": "git+https://github.com/ethereumjs/ethereumjs-abi.git", "from": "git+https://github.com/ethereumjs/ethereumjs-abi.git",
"requires": { "requires": {
"bn.js": "^4.11.8", "bn.js": "^4.11.8",
@ -22312,11 +22312,6 @@
"resolved": "https://registry.npmjs.org/is-url/-/is-url-1.2.4.tgz", "resolved": "https://registry.npmjs.org/is-url/-/is-url-1.2.4.tgz",
"integrity": "sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==" "integrity": "sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww=="
}, },
"is-url-superb": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/is-url-superb/-/is-url-superb-5.0.0.tgz",
"integrity": "sha512-jGkG59ra7/JlcV8ap3dsc0M79IgpuFU/obfsSf6X5D0z1NVvFTFuzt4ob7nfBTZEPbTwjGXVKNQDfWfPghapKQ=="
},
"is-utf8": { "is-utf8": {
"version": "0.2.1", "version": "0.2.1",
"resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz",

View File

@ -62,7 +62,6 @@
"gatsby-transformer-remark": "^2.14.0", "gatsby-transformer-remark": "^2.14.0",
"gatsby-transformer-sharp": "^2.10.1", "gatsby-transformer-sharp": "^2.10.1",
"intersection-observer": "^0.12.0", "intersection-observer": "^0.12.0",
"is-url-superb": "^5.0.0",
"jwt-decode": "^3.1.2", "jwt-decode": "^3.1.2",
"lodash.debounce": "^4.0.8", "lodash.debounce": "^4.0.8",
"lodash.omit": "^4.5.0", "lodash.omit": "^4.5.0",

View File

@ -1,5 +1,4 @@
import React, { ReactElement } from 'react' import React, { ReactElement } from 'react'
import isUrl from 'is-url-superb'
import Button from '../../../atoms/Button' import Button from '../../../atoms/Button'
import { FieldInputProps, useField } from 'formik' import { FieldInputProps, useField } from 'formik'
import Loader from '../../../atoms/Loader' import Loader from '../../../atoms/Loader'
@ -29,11 +28,7 @@ export default function FileInput({
style="primary" style="primary"
size="small" size="small"
onClick={(e: React.SyntheticEvent) => handleButtonClick(e, field.value)} onClick={(e: React.SyntheticEvent) => handleButtonClick(e, field.value)}
disabled={ disabled={!field.value}
!field.value ||
// weird static page build fix so is-url-superb won't error
!isUrl(typeof field.value === 'string' ? field.value : '')
}
> >
{isLoading ? <Loader /> : 'Add File'} {isLoading ? <Loader /> : 'Add File'}
</Button> </Button>