/react-app-cryptocurrency

:clipboard: Shows prices of cryptocurrencies via an API. Uses the React library

Primary LanguageJavaScript

⚡ React App Cryptocurrency

  • Crypto currency app using React
  • Note: to open web links in a new window use: ctrl+click on link

GitHub repo size GitHub pull requests GitHub Repo stars GitHub last commit

📄 Table of contents

📚 General info

  • Lists prices of cryptocurrencies against the US dollar - setup can be changed via http request.

📷 Screenshots

Example screenshot.

📶 Technologies

💾 Setup

  • API does not require an API key.
  • npm start Runs the app in the development mode. Open http://localhost:3000 to view it in the browser.
  • npm run build Builds the app for production to the build folder. It correctly bundles React in production mode and optimizes the build for the best performance. The build is minified and the filenames include the hashes.

💻 Code Examples

  • extract of App.js - axios http asynchronous call to cryptocurrency API.
/*
function will be carried out once app loads
axios is promise-based so then function used
cryptocompare returns price of 3 bitcoins compared to the US $.
*/
componentDidMount() {
  const fsymsList = 'BTC,XRP,BCH,ETH,ZEC,EOS,XMR,ETC,LTC,DASH,QTUM,NEO,XLM,TRX,ADA,BTS,USDT,XUC,PAX,IOT'
    axios
      .get('https://min-api.cryptocompare.com/data/pricemulti?fsyms=' + fsymsList + '&tsyms=USD')
      .then(res => {
      const cryptos = res.data;
      console.log(cryptos);
      this.setState({cryptos: cryptos});
    });
}

📋 Status & To-Do List

  • Status: Working. Deployed to Guthub-Pages
  • To-Do: Nothing

👏 Inspiration

📁 License

  • This project is licensed under the terms of the MIT license.

✉️ Contact