diff --git a/packages/concordia-app/package.json b/packages/concordia-app/package.json index 2f32cee..a783ded 100644 --- a/packages/concordia-app/package.json +++ b/packages/concordia-app/package.json @@ -40,6 +40,8 @@ "react-router-dom": "5.2.0", "react-scripts": "3.4.3", "redux-saga": "1.1.3", + "semantic-ui-css": "2.4.1", + "semantic-ui-react": "1.2.1", "web3": "1.2.11" }, "devDependencies": { diff --git a/packages/concordia-app/src/assets/css/loading-container.css b/packages/concordia-app/src/assets/css/loading-container.css index 1aa4ac5..95dda93 100644 --- a/packages/concordia-app/src/assets/css/loading-container.css +++ b/packages/concordia-app/src/assets/css/loading-container.css @@ -1,12 +1,21 @@ +html { + overflow: hidden; +} + .loading-screen { text-align: center; + font-size: large; } .loading-img { - margin-bottom: 30px; - height: 100px; + margin-bottom: 3em; + height: 12em; } ul { list-style-position: inside; } + +.bar { + margin-top: 5em; +} diff --git a/packages/concordia-app/src/components/App.jsx b/packages/concordia-app/src/components/App.jsx index e7e95e8..79f0777 100644 --- a/packages/concordia-app/src/components/App.jsx +++ b/packages/concordia-app/src/components/App.jsx @@ -3,6 +3,9 @@ import { Provider } from 'react-redux' import { BrowserRouter as Router, Route, Switch } from 'react-router-dom' import LoadingContainer from './LoadingContainer' import PropTypes from 'prop-types' + +import 'semantic-ui-css/semantic.min.css' + import NotFound from '../components/NotFound'; const App = ({ store }) => ( diff --git a/packages/concordia-app/src/components/LoadingContainer.jsx b/packages/concordia-app/src/components/LoadingContainer.jsx index 612b5da..b7c5b89 100644 --- a/packages/concordia-app/src/components/LoadingContainer.jsx +++ b/packages/concordia-app/src/components/LoadingContainer.jsx @@ -1,6 +1,11 @@ import React, { Children, Component } from 'react'; import { connect } from 'react-redux'; +import { Progress } from 'semantic-ui-react' + +// CSS import '../assets/css/loading-container.css'; + +// Images import ethereum_logo from '../assets/images/ethereum_logo.svg'; import ipfs_logo from '../assets/images/ipfs_logo.svg'; import orbitdb_logo from '../assets/images/orbitdb_logo.png'; @@ -8,31 +13,56 @@ import logo from '../assets/images/logo.png'; class LoadingContainer extends Component { render() { - if (this.props.web3.status === 'failed' || !this.props.web3.networkId) { + if (this.props.web3.status === 'initializing') { + return ( +
+
+ ethereum_logo +

Connecting to the Ethereum network...

+

Please make sure to unlock MetaMask.

+ +
+
+ ); + } + + if (this.props.web3.status === 'failed' || this.props.web3.networkFailed) { return (
-
-
+
ethereum_logo -

This browser has no connection to the Ethereum network

+

No connection to the Ethereum network!

Please make sure that:
  • MetaMask is unlocked and pointed to the correct network
  • The app has been granted the right to connect to your account
+
-
); } - if (this.props.web3.status === 'initialized' && Object.keys(this.props.accounts).length === 0) { + if (this.props.web3.status === 'initialized' && this.props.web3.accountsFailed) { return (
-
+
ethereum_logo

We can't find any Ethereum accounts!

Please make sure that MetaMask is unlocked.

+ +
+
+ ); + } + + if (!this.props.contractInitialized) { + return ( +
+
+ ethereum_logo +

Initializing contracts...

+

); @@ -41,48 +71,64 @@ class LoadingContainer extends Component { if (!this.props.contractDeployed) { return (
-
+
ethereum_logo

No contracts found on the current network!

Please make sure that you are connected to the correct network and the contracts are deployed.

+
); } - if (!this.props.contractInitialized) { + if (!this.props.ipfsInitialized && !this.props.ipfsFailed) { return (
-
- ethereum_logo -

Initializing contracts...

+
+ ipfs_logo +

Initializing IPFS...

+

); } - if (!this.props.ipfsInitialized) { + if (this.props.ipfsFailed) { return (
-
+
ipfs_logo -

Initializing IPFS...

+

IPFS initialization failed!

+

); } - if (!this.props.orbitInitialized) { + if (!this.props.orbitInitialized && !this.props.orbitFailed) { const message = process.env.NODE_ENV === 'development' ? 'If needed, please sign the transaction in MetaMask to create the databases.' : 'Please sign the transaction in MetaMask to create the databases.'; return (
-
+
orbitdb_logo

Preparing OrbitDB...

{message}

+ +
+
+ ); + } + + if (this.props.orbitFailed) { + return ( +
+
+ orbitdb_logo +

OrbitDB initialization failed!

+

); @@ -92,9 +138,10 @@ class LoadingContainer extends Component { return (
-
+
app_logo -

Loading dapp...

+

Loading dapp...

+

); @@ -109,7 +156,9 @@ const mapStateToProps = (state) => ({ contractInitialized: state.contracts.Forum.initialized, contractDeployed: state.contracts.Forum.deployed, ipfsInitialized: state.ipfs.initialized, + ipfsFailed: state.ipfs.failed, orbitInitialized: state.orbit.initialized, + orbitFailed: state.orbit.failed }); export default connect(mapStateToProps)(LoadingContainer); diff --git a/packages/concordia-app/src/options/breezeOptions.js b/packages/concordia-app/src/options/breezeOptions.js index 90efe85..a3b9e75 100644 --- a/packages/concordia-app/src/options/breezeOptions.js +++ b/packages/concordia-app/src/options/breezeOptions.js @@ -13,17 +13,16 @@ const breezeOptions = { // Use local signaling server (see also rendezvous script in package.json) // For more information: https://github.com/libp2p/js-libp2p-webrtc-star '/ip4/127.0.0.1/tcp/9090/wss/p2p-webrtc-star' - ], + ] }, }, preload: { - enabled: false, + enabled: false }, init: { - emptyRepo: true, + emptyRepo: true } }, - web3, orbit: { identityProvider: EthereumIdentityProvider, databases: [ diff --git a/yarn.lock b/yarn.lock index 01973ee..d6bf27f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1182,9 +1182,9 @@ "@ethersproject/strings" ">=5.0.0-beta.130" "@ethersproject/abi@^5.0.3": - version "5.0.3" - resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.0.3.tgz#27280ff9d44b94b5ac83064db81deb8d1b87dab1" - integrity sha512-fSSs4sgaf5R1955QSpYXW2YkrYBgyOSyENyyMEyJwxTsKJKQPaReTQXafyeRc8ZLi3/2uzeqakH09r0S1hlFng== + version "5.0.4" + resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.0.4.tgz#92d603307ad343f9465d5e0f546df3cf72709862" + integrity sha512-T8woaIQHCJMZDAQim1vSp8ycsP2h1/TlnBHzQqR9atKknoqLiT26Wxr9AkhW1aufexkWrZTHbf2837469uS6Eg== dependencies: "@ethersproject/address" "^5.0.3" "@ethersproject/bignumber" "^5.0.6" @@ -1724,9 +1724,9 @@ "@hapi/validate" "1.x.x" "@hapi/shot@^5.0.1": - version "5.0.3" - resolved "https://registry.yarnpkg.com/@hapi/shot/-/shot-5.0.3.tgz#bc54913ee112dd4a30311d813c2a28cab28a69c9" - integrity sha512-qbccs8KL4YSL9x0J/17Z6Udmtrrn32ieGbrCW8iivl2ha8YzlDy9Wvv1pFKh3mzbTsomWHGLF3UsKcQFk/BqPg== + version "5.0.4" + resolved "https://registry.yarnpkg.com/@hapi/shot/-/shot-5.0.4.tgz#6c978314f21a054c041f4becc50095dd78d3d775" + integrity sha512-PcEz0WJgFDA3xNSMeONgQmothFr7jhbbRRSAKaDh7chN7zOXBlhl13bvKZW6CMb2xVfJUmt34CW3e/oExMgBhQ== dependencies: "@hapi/hoek" "9.x.x" "@hapi/validate" "1.x.x" @@ -2557,9 +2557,9 @@ acorn-globals@^4.1.0, acorn-globals@^4.3.0: acorn-walk "^6.0.1" acorn-jsx@^5.0.0, acorn-jsx@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.2.0.tgz#4c66069173d6fdd68ed85239fc256226182b2ebe" - integrity sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ== + version "5.3.1" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.1.tgz#fc8661e11b7ac1539c47dbfea2e72b3af34d267b" + integrity sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng== acorn-walk@^6.0.1: version "6.2.0" @@ -4878,9 +4878,9 @@ ee-first@1.1.1: integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= electron-to-chromium@^1.3.378, electron-to-chromium@^1.3.562: - version "1.3.562" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.562.tgz#79c20277ee1c8d0173a22af00e38433b752bc70f" - integrity sha512-WhRe6liQ2q/w1MZc8mD8INkenHivuHdrr4r5EQHNomy3NJux+incP6M6lDMd0paShP3MD0WGe5R1TWmEClf+Bg== + version "1.3.563" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.563.tgz#9da4e4f0d76c4b221784cc9ca81a8464e8180408" + integrity sha512-JkEjRFmuSegdTBCPG+RS1zw9csObHoN4el+X9EfEALO0UT7us8swxspJx7cRsrMkjd8bmmRTAd0xuUhvvb5DLg== elliptic@6.5.3, elliptic@^6.4.0, elliptic@^6.5.2, elliptic@^6.5.3: version "6.5.3" @@ -5498,9 +5498,9 @@ ethereumjs-util@^6.0.0: rlp "^2.2.3" ethers@^5.0.8: - version "5.0.11" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.0.11.tgz#af1175f0bb82fe6feef77b49db3cd7fd91034b56" - integrity sha512-cYUxf0IvGkJtvRaSOlmjoA07pqREN3bFw4yKJHmO3UhJAfDQlk4hQyyjHnROaNKB7YYBFFsE6FmDmOx057KQTA== + version "5.0.12" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.0.12.tgz#8986cf53a425d1a00af6bda886e9098b0448d1fb" + integrity sha512-mgF1ZLd1y5r+hS1IPATKwKx5k/PCSqz4PEQjMR+er+Hhu6IefVVcoYATUMjmK4FG+3PAkorRMA9rJ4Y/fdW0UA== dependencies: "@ethersproject/abi" "^5.0.3" "@ethersproject/abstract-provider" "^5.0.3" @@ -9069,9 +9069,9 @@ multicodec@^1.0.0: varint "^5.0.0" multicodec@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/multicodec/-/multicodec-2.0.0.tgz#e0c41d99ce29d5f92a9406a6a31169a3802a1ca3" - integrity sha512-2SLsdTCXqOpUfoSHkTaVzxnjjl5fsSO283Idb9rAYgKGVu188NFP5KncuZ8Ifg8H2gc5GOi2rkuhLumqv9nweQ== + version "2.0.1" + resolved "https://registry.yarnpkg.com/multicodec/-/multicodec-2.0.1.tgz#0971bbef83fcb354315c837c9a3f3e2e422af371" + integrity sha512-YDYeWn9iGa76hOHAyyZa0kbt3tr5FLg1ZXUHrZUJltjnxxdbTIbHnxWLd2zTcMOjdT3QyO+Xs4bQgJUcC2RWUA== dependencies: uint8arrays "1.0.0" varint "^5.0.0" @@ -13810,9 +13810,9 @@ whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.3, whatwg-encoding@^1.0.5: iconv-lite "0.4.24" whatwg-fetch@^3.0.0: - version "3.4.0" - resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.4.0.tgz#e11de14f4878f773fbebcde8871b2c0699af8b30" - integrity sha512-rsum2ulz2iuZH08mJkT0Yi6JnKhwdw4oeyMjokgxd+mmqYSd9cPpOQf01TIWgjxG/U4+QR+AwKq6lSbXVxkyoQ== + version "3.4.1" + resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.4.1.tgz#e5f871572d6879663fa5674c8f833f15a8425ab3" + integrity sha512-sofZVzE1wKwO+EYPbWfiwzaKovWiZXf4coEzjGP9b2GBVgQRLQUZ2QcuPpQExGDAW5GItpEm6Tl4OU5mywnAoQ== whatwg-mimetype@^2.1.0, whatwg-mimetype@^2.2.0, whatwg-mimetype@^2.3.0: version "2.3.0"