1
0
mirror of https://github.com/oceanprotocol/commons.git synced 2023-03-15 18:03:00 +01:00

Merge pull request #19 from oceanprotocol/feature/frontpage

Front-page tweaks & user asset list
This commit is contained in:
Jernej Pregelj 2019-03-20 15:59:34 +01:00 committed by GitHub
commit 853b78e1d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 224 additions and 122 deletions

236
client/package-lock.json generated
View File

@ -21842,22 +21842,22 @@
"dev": true
},
"web3": {
"version": "1.0.0-beta.49",
"resolved": "https://registry.npmjs.org/web3/-/web3-1.0.0-beta.49.tgz",
"integrity": "sha512-8CzCmvaLsm4VCmPrp3l1zSoovJD2EmMKCpgaGLXU5i3x0TYzLU99GW6dmxg8k/OAdP8jd6TGwwUWL5d5RRLUPg==",
"version": "1.0.0-beta.50",
"resolved": "https://registry.npmjs.org/web3/-/web3-1.0.0-beta.50.tgz",
"integrity": "sha512-N4YqT1jl2tZYNWiLk5gA5BMchHJaG76d65z899DT9UTR4iI6mfqe1QIE+1YLII1x+uE8ohFzBq/aaZ8praLeoA==",
"requires": {
"@babel/runtime": "^7.3.1",
"@types/node": "^10.12.18",
"web3-bzz": "1.0.0-beta.49",
"web3-core": "1.0.0-beta.49",
"web3-core-helpers": "1.0.0-beta.49",
"web3-core-method": "1.0.0-beta.49",
"web3-eth": "1.0.0-beta.49",
"web3-eth-personal": "1.0.0-beta.49",
"web3-net": "1.0.0-beta.49",
"web3-providers": "1.0.0-beta.49",
"web3-shh": "1.0.0-beta.49",
"web3-utils": "1.0.0-beta.49"
"web3-bzz": "1.0.0-beta.50",
"web3-core": "1.0.0-beta.50",
"web3-core-helpers": "1.0.0-beta.50",
"web3-core-method": "1.0.0-beta.50",
"web3-eth": "1.0.0-beta.50",
"web3-eth-personal": "1.0.0-beta.50",
"web3-net": "1.0.0-beta.50",
"web3-providers": "1.0.0-beta.50",
"web3-shh": "1.0.0-beta.50",
"web3-utils": "1.0.0-beta.50"
},
"dependencies": {
"@types/node": {
@ -21981,9 +21981,9 @@
"integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w="
},
"web3-bzz": {
"version": "1.0.0-beta.49",
"resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.0.0-beta.49.tgz",
"integrity": "sha512-rZRES/evLwZlAg4Hamhobu6LyA5vOatGqCtO7PbsTIYsNEXHFf4AtG9+/BNsyBSmVDZnZy/NlHZ08e43RWp/pw==",
"version": "1.0.0-beta.50",
"resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.0.0-beta.50.tgz",
"integrity": "sha512-0jD4/g+apH7t87cA9gXoZpvvVW7OqQtbu+X+olFKPrS9pKbkwfaKPdRwc1BNbjqvrRYN0K7koT9xV+Lzvyah6w==",
"requires": {
"@babel/runtime": "^7.3.1",
"@types/node": "^10.12.18",
@ -21992,31 +21992,31 @@
}
},
"web3-core": {
"version": "1.0.0-beta.49",
"resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.0.0-beta.49.tgz",
"integrity": "sha512-EO+xXiJpRmrQrKU4cs2sfzMoo8RRLCQFo8g/NDsp75kpJrPvYq9h8PTwo8Nx/YA0fsbGJt8AjvHAwDhV3V3apg==",
"version": "1.0.0-beta.50",
"resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.0.0-beta.50.tgz",
"integrity": "sha512-edOHdSnkRREi0vUXXNUsrbkTvXftCDroiF2tEvbPVyiBv0U6/VDYClFdHuZKdrrTRUcn/rUbvBqw8qCt3xgcuQ==",
"requires": {
"@babel/runtime": "^7.3.1",
"@types/node": "^10.12.18",
"lodash": "^4.17.11",
"web3-utils": "1.0.0-beta.49"
"web3-utils": "1.0.0-beta.50"
}
},
"web3-core-helpers": {
"version": "1.0.0-beta.49",
"resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.0.0-beta.49.tgz",
"integrity": "sha512-9XDlDxZUzD83HUEWm8evwkZDMkzr1nh8FlGzQpFdotfWNIpoP5rZXzamxhskVEkpSavd6rtz2b3wcl9iK0KAXg==",
"version": "1.0.0-beta.50",
"resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.0.0-beta.50.tgz",
"integrity": "sha512-B1LMrlC9c5HEJYmBWUhsxHdJ78w5YGop/ptF1cFL8cHLwTCQqCFFKLgYUg+dax/554TP1xgJ2w/ArLpnPJ8dBg==",
"requires": {
"@babel/runtime": "^7.3.1",
"lodash": "^4.17.11",
"web3-eth-iban": "1.0.0-beta.49",
"web3-utils": "1.0.0-beta.49"
"web3-eth-iban": "1.0.0-beta.50",
"web3-utils": "1.0.0-beta.50"
}
},
"web3-core-method": {
"version": "1.0.0-beta.49",
"resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.0.0-beta.49.tgz",
"integrity": "sha512-PIkL8dpMtLBB8QInh0zf4W6Tt4cRJ3s9MRVDUPdrZwZGqcuMm94NIIV3omYFxh62EU4Xn5Ls3vLkcCtc8Ec1LQ==",
"version": "1.0.0-beta.50",
"resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.0.0-beta.50.tgz",
"integrity": "sha512-0+L37KDT90DD1fcTye/ZWMyGOLiw0ZxX2vaC8qDSFvAV3scTEuZyEQuR+tCM2aGyUVihy8LdmZwioRwnTXgLwg==",
"requires": {
"@babel/runtime": "^7.3.1",
"eventemitter3": "3.1.0",
@ -22024,9 +22024,9 @@
}
},
"web3-core-subscriptions": {
"version": "1.0.0-beta.49",
"resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.0.0-beta.49.tgz",
"integrity": "sha512-Eay1IxmOOf+zjtSEpbO++PmGVJvIfTwMdjFauw0RppDEAt5IKvJvQxPSPqQ+x55ztEFN/IiEFe1IA03JFQ+o+g==",
"version": "1.0.0-beta.50",
"resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.0.0-beta.50.tgz",
"integrity": "sha512-q2Jmuy/BCwcKCFjR6kc03hPbdC6sR0n3IhPVg98Sk7ewgRLur/v3lLDz0fQpY4xE6U0XOqrjxwzlqISkOcP5Kw==",
"requires": {
"@babel/runtime": "^7.3.1",
"eventemitter3": "^3.1.0",
@ -22034,26 +22034,26 @@
}
},
"web3-eth": {
"version": "1.0.0-beta.49",
"resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.0.0-beta.49.tgz",
"integrity": "sha512-ozXjnMNblMbAwoTXsh/IoR64v9t/lTwbI5O7rt//vqsD8CrbqGPgyjxAQOECV1O64AHodtf5mVISmZyCEeM/Ng==",
"version": "1.0.0-beta.50",
"resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.0.0-beta.50.tgz",
"integrity": "sha512-ojsddEclIdu+C3hfRrLVJK0rcxt2O+Yj7c3b4YEzZQ9+Kd/HaSZfeSpUgKojgmFhUUiCCRTEc2holWtQ+Lx4gQ==",
"requires": {
"@babel/runtime": "^7.3.1",
"eth-lib": "0.2.8",
"rxjs": "^6.4.0",
"web3-core": "1.0.0-beta.49",
"web3-core-helpers": "1.0.0-beta.49",
"web3-core-method": "1.0.0-beta.49",
"web3-core-subscriptions": "1.0.0-beta.49",
"web3-eth-abi": "1.0.0-beta.49",
"web3-eth-accounts": "1.0.0-beta.49",
"web3-eth-contract": "1.0.0-beta.49",
"web3-eth-ens": "1.0.0-beta.49",
"web3-eth-iban": "1.0.0-beta.49",
"web3-eth-personal": "1.0.0-beta.49",
"web3-net": "1.0.0-beta.49",
"web3-providers": "1.0.0-beta.49",
"web3-utils": "1.0.0-beta.49"
"web3-core": "1.0.0-beta.50",
"web3-core-helpers": "1.0.0-beta.50",
"web3-core-method": "1.0.0-beta.50",
"web3-core-subscriptions": "1.0.0-beta.50",
"web3-eth-abi": "1.0.0-beta.50",
"web3-eth-accounts": "1.0.0-beta.50",
"web3-eth-contract": "1.0.0-beta.50",
"web3-eth-ens": "1.0.0-beta.50",
"web3-eth-iban": "1.0.0-beta.50",
"web3-eth-personal": "1.0.0-beta.50",
"web3-net": "1.0.0-beta.50",
"web3-providers": "1.0.0-beta.50",
"web3-utils": "1.0.0-beta.50"
},
"dependencies": {
"eth-lib": {
@ -22069,20 +22069,20 @@
}
},
"web3-eth-abi": {
"version": "1.0.0-beta.49",
"resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.0.0-beta.49.tgz",
"integrity": "sha512-Ly7bpD0OKg+bI+ddMAn8005JLEibRcn6W5ye/uT0fh8e1Z/4g4EwcxF29xWoUbQYgaLcxR8UtQWK9EiS4y+OxA==",
"version": "1.0.0-beta.50",
"resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.0.0-beta.50.tgz",
"integrity": "sha512-Nwm1HL3xBbrs43j/9V3gH1CJWWR7jyTDSE7PIkjYVjwgygAjlHPMHzuzGffoFMp2tSQ2DywCGmXAY5I5+vznZw==",
"requires": {
"@babel/runtime": "^7.3.1",
"ethers": "^4.0.27",
"lodash": "^4.17.11",
"web3-utils": "1.0.0-beta.49"
"web3-utils": "1.0.0-beta.50"
}
},
"web3-eth-accounts": {
"version": "1.0.0-beta.49",
"resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.0.0-beta.49.tgz",
"integrity": "sha512-WHiEdR/iq/7vDdQhakI+lvWs1lyb5JWi2rw6simluCRVa+Prdbk74AGzO+N1ojjFn2ANrcXquSkqU3w8cRWi5w==",
"version": "1.0.0-beta.50",
"resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.0.0-beta.50.tgz",
"integrity": "sha512-cUuYxKhymob87zCUYgw7ieZY6aVStMhClocblI3FKNdI1I8dczhdhZ97qMj5iavOganN7/OxLzeji7ksAoNAhg==",
"requires": {
"@babel/runtime": "^7.3.1",
"crypto-browserify": "3.12.0",
@ -22090,11 +22090,11 @@
"lodash": "^4.17.11",
"scrypt.js": "0.2.0",
"uuid": "3.3.2",
"web3-core": "1.0.0-beta.49",
"web3-core-helpers": "1.0.0-beta.49",
"web3-core-method": "1.0.0-beta.49",
"web3-providers": "1.0.0-beta.49",
"web3-utils": "1.0.0-beta.49"
"web3-core": "1.0.0-beta.50",
"web3-core-helpers": "1.0.0-beta.50",
"web3-core-method": "1.0.0-beta.50",
"web3-providers": "1.0.0-beta.50",
"web3-utils": "1.0.0-beta.50"
},
"dependencies": {
"eth-lib": {
@ -22115,97 +22115,97 @@
}
},
"web3-eth-contract": {
"version": "1.0.0-beta.49",
"resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.0.0-beta.49.tgz",
"integrity": "sha512-/Bbky2yxTllMbRTOBOdMzUwxAPXFw/bEODDNezz/gilSy4Ctc75rVLriSxWQmYNzj4e4wEIqGVCxONvYejmNlw==",
"version": "1.0.0-beta.50",
"resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.0.0-beta.50.tgz",
"integrity": "sha512-X8R1+qIeD4Dbz1RmQa5m3K1suVFigNgd7EFMp6vVC3ULDjt4R6T0cRmFw/x51v3MQoT7s6Yd1KiEWIAt9IYG6w==",
"requires": {
"@babel/runtime": "^7.3.1",
"lodash": "^4.17.11",
"web3-core": "1.0.0-beta.49",
"web3-core-helpers": "1.0.0-beta.49",
"web3-core-method": "1.0.0-beta.49",
"web3-core-subscriptions": "1.0.0-beta.49",
"web3-eth-abi": "1.0.0-beta.49",
"web3-eth-accounts": "1.0.0-beta.49",
"web3-providers": "1.0.0-beta.49",
"web3-utils": "1.0.0-beta.49"
"web3-core": "1.0.0-beta.50",
"web3-core-helpers": "1.0.0-beta.50",
"web3-core-method": "1.0.0-beta.50",
"web3-core-subscriptions": "1.0.0-beta.50",
"web3-eth-abi": "1.0.0-beta.50",
"web3-eth-accounts": "1.0.0-beta.50",
"web3-providers": "1.0.0-beta.50",
"web3-utils": "1.0.0-beta.50"
}
},
"web3-eth-ens": {
"version": "1.0.0-beta.49",
"resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.0.0-beta.49.tgz",
"integrity": "sha512-rptYDsUds3QPEsuR84Vjl8B/rAXreKXlv6yYDk9sq5Wv+mzCwMHV7ZpdNDHrSbdG7XpCWDMFOqrCO3A4FR0hnA==",
"version": "1.0.0-beta.50",
"resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.0.0-beta.50.tgz",
"integrity": "sha512-UnhYcNuSNRBOBcbD5y8cTyRh5ENn65/GfZkxCDXAKBY6sD4GzMZNkD7kq+37/34cnZEzzQPPGd9jLZNLXOklyg==",
"requires": {
"@babel/runtime": "^7.3.1",
"eth-ens-namehash": "2.0.8",
"lodash": "^4.17.11",
"web3-core": "1.0.0-beta.49",
"web3-core-helpers": "1.0.0-beta.49",
"web3-core-method": "1.0.0-beta.49",
"web3-eth-abi": "1.0.0-beta.49",
"web3-eth-contract": "1.0.0-beta.49",
"web3-net": "1.0.0-beta.49",
"web3-providers": "1.0.0-beta.49",
"web3-utils": "1.0.0-beta.49"
"web3-core": "1.0.0-beta.50",
"web3-core-helpers": "1.0.0-beta.50",
"web3-core-method": "1.0.0-beta.50",
"web3-eth-abi": "1.0.0-beta.50",
"web3-eth-contract": "1.0.0-beta.50",
"web3-net": "1.0.0-beta.50",
"web3-providers": "1.0.0-beta.50",
"web3-utils": "1.0.0-beta.50"
}
},
"web3-eth-iban": {
"version": "1.0.0-beta.49",
"resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.0.0-beta.49.tgz",
"integrity": "sha512-rV8uMcNPJgzTIYGVd7KFz4ITdGIG9n0AOwerYw2oiVZTNcWhmvaz1ufXZVPMh2rfkTF+ndMJWM8pyqaaYXaiWQ==",
"version": "1.0.0-beta.50",
"resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.0.0-beta.50.tgz",
"integrity": "sha512-rW5fpUUW3WaToPxBXNnqTfj5dh2BJ+9uognYAfThh2WWR1+EwWZethsKS/PyU6Jn9uA5p/kQoUIP0JKaeBm80Q==",
"requires": {
"@babel/runtime": "^7.3.1",
"bn.js": "4.11.8",
"web3-utils": "1.0.0-beta.49"
"web3-utils": "1.0.0-beta.50"
}
},
"web3-eth-personal": {
"version": "1.0.0-beta.49",
"resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.0.0-beta.49.tgz",
"integrity": "sha512-L/HEaUIJGzcipAzwa3P2/dNPKotPQUFirvc7gZ6eS7EIDNpRWeSQ6fKXUtVaQnR3EbAowXSEuTnWWswOFr+M+Q==",
"version": "1.0.0-beta.50",
"resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.0.0-beta.50.tgz",
"integrity": "sha512-52dS24YfJxx/Uy21RKj2m5rjag1kktdy5rY/R9vDwWZRrJkxfDf058CvtRF+QsD7A6QVxkHCZ9YwEWnLCLW9Cw==",
"requires": {
"@babel/runtime": "^7.3.1",
"web3-core": "1.0.0-beta.49",
"web3-core-helpers": "1.0.0-beta.49",
"web3-core-method": "1.0.0-beta.49",
"web3-net": "1.0.0-beta.49",
"web3-providers": "1.0.0-beta.49",
"web3-utils": "1.0.0-beta.49"
"web3-core": "1.0.0-beta.50",
"web3-core-helpers": "1.0.0-beta.50",
"web3-core-method": "1.0.0-beta.50",
"web3-net": "1.0.0-beta.50",
"web3-providers": "1.0.0-beta.50",
"web3-utils": "1.0.0-beta.50"
}
},
"web3-net": {
"version": "1.0.0-beta.49",
"resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.0.0-beta.49.tgz",
"integrity": "sha512-A64A0AY8TG4D9CKZSPuFhu1z9Fi8GbskrdRfSZoNr6LflBXOA/kmo4iRqxhqQAdQASQsIZko3WnWEU3wZYn64w==",
"version": "1.0.0-beta.50",
"resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.0.0-beta.50.tgz",
"integrity": "sha512-T9aBrWYzCeqZTTJlljonTm8x1tEjHT1uBqcdvEYZoyCS1Xxc+zCNBqP4SBfdcfwCeGohhI7bRx9qX1JjYH3cRA==",
"requires": {
"@babel/runtime": "^7.3.1",
"lodash": "^4.17.11",
"web3-core": "1.0.0-beta.49",
"web3-core-helpers": "1.0.0-beta.49",
"web3-core-method": "1.0.0-beta.49",
"web3-providers": "1.0.0-beta.49",
"web3-utils": "1.0.0-beta.49"
"web3-core": "1.0.0-beta.50",
"web3-core-helpers": "1.0.0-beta.50",
"web3-core-method": "1.0.0-beta.50",
"web3-providers": "1.0.0-beta.50",
"web3-utils": "1.0.0-beta.50"
}
},
"web3-shh": {
"version": "1.0.0-beta.49",
"resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.0.0-beta.49.tgz",
"integrity": "sha512-NlPfzPIZwXryfVZg+oKKo5KmGFqMibwgqIczX0g/ac8Yge1VZswQrRy8a2fhUKc9X+XFtlJ3HMwm1PNZLihzbw==",
"version": "1.0.0-beta.50",
"resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.0.0-beta.50.tgz",
"integrity": "sha512-a46Gz/YQdF3HJ4XK7rZh6bJiP3IEq+BDAvdxD1jW54yKM2k3RGarOY8hanC1crxKE7E9Q1UUkrp1Vjrj8XSQuQ==",
"requires": {
"@babel/runtime": "^7.3.1",
"web3-core": "1.0.0-beta.49",
"web3-core-helpers": "1.0.0-beta.49",
"web3-core-method": "1.0.0-beta.49",
"web3-core-subscriptions": "1.0.0-beta.49",
"web3-net": "1.0.0-beta.49",
"web3-providers": "1.0.0-beta.49",
"web3-utils": "1.0.0-beta.49"
"web3-core": "1.0.0-beta.50",
"web3-core-helpers": "1.0.0-beta.50",
"web3-core-method": "1.0.0-beta.50",
"web3-core-subscriptions": "1.0.0-beta.50",
"web3-net": "1.0.0-beta.50",
"web3-providers": "1.0.0-beta.50",
"web3-utils": "1.0.0-beta.50"
}
},
"web3-utils": {
"version": "1.0.0-beta.49",
"resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.0.0-beta.49.tgz",
"integrity": "sha512-dNJK22wqUraEC74aLHCyrpXf1VsFfHgEAzbXheE4b7V7vGtfE1Vlv/Rr/gINPIWz+xoOWT5//2kyqFSum/Jb+A==",
"version": "1.0.0-beta.50",
"resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.0.0-beta.50.tgz",
"integrity": "sha512-xGhM/YkepK2x0iMYUl/sws58LzTbodjMGlhZxrCZLZxJ0DoaDyk3UdmZ6aCSCwVTFg4hlVj3doaIhWnwGfhhpQ==",
"requires": {
"@babel/runtime": "^7.3.1",
"@types/bn.js": "^4.11.4",
@ -22440,9 +22440,9 @@
}
},
"web3-providers": {
"version": "1.0.0-beta.49",
"resolved": "https://registry.npmjs.org/web3-providers/-/web3-providers-1.0.0-beta.49.tgz",
"integrity": "sha512-li8k1GCBLgTnorBf6DNxc3CNvQ+VnHfy9UrLmqXd94/EjnDKe5glWKWAwMtvPxbvJ3aAJ4AwVBQSHHhtYGaSgg==",
"version": "1.0.0-beta.50",
"resolved": "https://registry.npmjs.org/web3-providers/-/web3-providers-1.0.0-beta.50.tgz",
"integrity": "sha512-p2xtr6N72pdXvND5dLdK1G9T/9qCQiKC2EYDPmimnqvoHWixmM3tlBl042swkHspHHVL60vXPKxB4UDaQE2hWQ==",
"requires": {
"@babel/runtime": "^7.3.1",
"@types/node": "^10.12.18",

View File

@ -0,0 +1,34 @@
@import '../../styles/variables';
.assetsUser {
margin-top: $spacer * 3;
margin-bottom: $spacer;
> div {
text-align: center;
margin-top: $spacer;
margin-bottom: $spacer;
}
}
.assets {
display: grid;
grid-template-columns: 1fr;
grid-gap: $spacer;
max-width: 100%;
@media (min-width: $break-point--small) {
grid-template-columns: 2fr 2fr;
}
@media (min-width: $break-point--medium) {
grid-template-columns: 2fr 2fr 2fr;
}
}
.subTitle {
font-size: $font-size-h4;
color: $brand-grey-light;
border-bottom: 1px solid $brand-grey-lighter;
padding-bottom: $spacer / 2;
}

View File

@ -0,0 +1,66 @@
import React, { PureComponent } from 'react'
import { Link } from 'react-router-dom'
import { User } from '../../context/User'
import Spinner from '../atoms/Spinner'
import Asset from '../molecules/Asset'
import styles from './AssetsUser.module.scss'
import { Logger } from '@oceanprotocol/squid'
export default class AssetsUser extends PureComponent {
public state = { results: [], isLoading: true }
public componentDidMount() {
this.searchOcean()
}
private async searchOcean() {
this.context.ocean.keeper.didRegistry.contract.getPastEvents(
'DIDAttributeRegistered',
{
filter: { _owner: this.context.account },
fromBlock: 0,
toBlock: 'latest'
},
async (error: any, events: any) => {
if (error) {
Logger.log('error retrieving', error)
this.setState({ isLoading: false })
} else {
const results = []
for (const event of events) {
const ddo = await this.context.ocean.resolveDID(
`did:op:${event.returnValues._did.substring(2)}`
)
results.push(ddo)
}
this.setState({ results, isLoading: false })
}
}
)
}
public render() {
return (
<div className={styles.assetsUser}>
<h2 className={styles.subTitle}>Your Data Sets</h2>
{this.state.isLoading ? (
<Spinner />
) : this.state.results.length ? (
<div className={styles.assets}>
{this.state.results.map((asset, index) => (
<Asset key={index} asset={asset} />
))}
</div>
) : (
<div>
<p>None yet.</p>
<Link to="/publish">+ Publish A Data Set</Link>
</div>
)}
</div>
)
}
}
AssetsUser.contextType = User

View File

@ -3,8 +3,9 @@
.home {
display: block;
form {
margin-top: $spacer * 2;
margin-bottom: $spacer * 4;
label {
height: 0;
margin: 0;
visibility: hidden;
}
}

View File

@ -1,9 +1,9 @@
import React, { ChangeEvent, Component, FormEvent } from 'react'
import { Link } from 'react-router-dom'
import Button from '../components/atoms/Button'
import Form from '../components/atoms/Form/Form'
import Input from '../components/atoms/Form/Input'
import Route from '../components/templates/Route'
import AssetsUser from '../components/molecules/AssetsUser'
import styles from './Home.module.scss'
import meta from '../data/meta.json'
@ -41,6 +41,7 @@ class Home extends Component<HomeProps, HomeState> {
}
/>
</Form>
<AssetsUser />
</Route>
)
}