1
0
mirror of https://github.com/oceanprotocol/ipfs synced 2024-11-22 01:36:59 +01:00

package updates

This commit is contained in:
Matthias Kretschmann 2020-04-07 19:36:56 +02:00
parent 9088501baf
commit c6df7bc99d
Signed by: m
GPG Key ID: 606EEEF3C479A91F
6 changed files with 1252 additions and 761 deletions

1966
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -12,32 +12,32 @@
"author": "Matthias Kretschmann <matthias@oceanprotocol.com>",
"license": "Apache-2.0",
"dependencies": {
"@mdx-js/loader": "^1.5.5",
"@next/mdx": "^9.2.1",
"@mdx-js/loader": "^1.5.8",
"@next/mdx": "^9.3.4",
"@oceanprotocol/art": "^2.2.0",
"@oceanprotocol/typographies": "^0.1.0",
"axios": "^0.19.2",
"ipfs-http-client": "^42.0.0",
"ipfs-http-client": "^43.0.0",
"next": "9.2.2",
"next-seo": "^4.1.0",
"next-seo": "^4.4.0",
"next-svgr": "^0.0.2",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-dropzone": "^11.0.0"
},
"devDependencies": {
"@types/next-seo": "^1.10.0",
"@types/node": "^14.0.0",
"@types/react": "^16.9.19",
"@typescript-eslint/eslint-plugin": "^2.19.1",
"@typescript-eslint/parser": "^2.19.1",
"@types/react": "^16.9.32",
"@typescript-eslint/eslint-plugin": "^2.27.0",
"@typescript-eslint/parser": "^2.27.0",
"eslint": "^6.8.0",
"eslint-config-oceanprotocol": "^1.5.0",
"eslint-config-prettier": "^6.10.0",
"eslint-config-prettier": "^6.10.1",
"eslint-plugin-prettier": "^3.1.2",
"eslint-plugin-react": "^7.18.3",
"prettier": "^1.19.1",
"typescript": "^3.7.5"
"eslint-plugin-react": "^7.19.0",
"prettier": "^2.0.4",
"typescript": "^3.8.3"
},
"repository": {
"type": "git",

View File

@ -16,11 +16,11 @@ const ipfsConfig: IpfsConfig = {
export default function Add() {
const { ipfs, isIpfsReady, ipfsError } = useIpfsApi(ipfsConfig)
const [fileHash, setFileHash] = useState()
const [fileHash, setFileHash] = useState('')
const [loading, setLoading] = useState(false)
const [message, setMessage] = useState()
const [error, setError] = useState()
const [fileSize, setFileSize] = useState()
const [message, setMessage] = useState('')
const [error, setError] = useState('')
const [fileSize, setFileSize] = useState('')
const [fileSizeReceived] = useState('')
useEffect(() => {
@ -34,7 +34,7 @@ export default function Add() {
if (!acceptedFiles[0]) return
setLoading(true)
setError(null)
setError('')
const totalSize = formatBytes(acceptedFiles[0].size, 0)
setFileSize(totalSize)
@ -54,7 +54,7 @@ export default function Add() {
<div className={styles.add}>
{loading ? (
<Spinner message={message} />
) : fileHash ? (
) : fileHash !== '' ? (
<a
target="_blank"
rel="noopener noreferrer"

View File

@ -13,7 +13,7 @@ export default function Dropzone({
multiple?: boolean
error?: string
}) {
const onDrop = useCallback(acceptedFiles => handleOnDrop(acceptedFiles), [
const onDrop = useCallback((acceptedFiles) => handleOnDrop(acceptedFiles), [
handleOnDrop
])
@ -39,7 +39,7 @@ export default function Dropzone({
`Drop it like it's hot!`
) : multiple ? (
`Drag 'n' drop some files here, or click to select files`
) : error ? (
) : error || error !== '' ? (
<div className={styles.error}>{error}</div>
) : (
`Drag 'n' drop a file here, or click to select a file`

View File

@ -13,7 +13,7 @@ export default function Footer() {
All Rights Reserved
</div>
<div>
{links.map(link => (
{links.map((link) => (
<a key={link.name} href={link.url}>
{link.name}
</a>

View File

@ -18,7 +18,7 @@ export default function useIpfsApi(config: IpfsConfig) {
useEffect(() => {
async function initIpfs() {
if (ipfs !== null) return
// eslint-disable-next-line
ipfs = await ipfsClient(config)
try {
@ -44,7 +44,6 @@ export default function useIpfsApi(config: IpfsConfig) {
}, [config])
useEffect(() => {
// just like componentWillUnmount()
return function cleanup() {
if (ipfs) {
setIpfsReady(false)