title: How to set loading screen until transaction confirmed on react web3js
body: <p>I'm quite new to Web3 and React development. I want to call the contract function and get a loading screen until the transaction is minted:</p>
  <pre class="lang-js prettyprint-override"><code>let transactions = await TokenContract.methods.buy().send({
      from: account,
      value: web3.utils.toWei(inputBuyQty, 'ether')
  }, function (err, transactionHash) {
      if (!err) {
          console.log(transactionHash);
          setLoadingScreen(1);
          let receipt = web3.eth.getTransactionReceipt(transactionHash);
          console.log(receipt);
          setLoadingScreen(0);
      }
  });
  </code></pre>
  <p>How would I call <code>setLoadingScreen(1)</code> after the request is submitted, and <code>setLoadingScreen(0)</code> after the transaction has been minted?</p>