belaczek / hodlwatch

Simple, yet powerful web app for automatic cryptocurrency portfolio tracking
https://hodl.watch
MIT License
120 stars 26 forks source link

Possibility to hide an exchange #50

Open LucBerge opened 2 years ago

LucBerge commented 2 years ago

In my web interface, I've saved multiple portfolios. I would like to be able to hide the ones I want.

At the bottom of the interface, in the "exchanges" section, we can add a "hide/show" button next to the "edit" button.

LucBerge commented 2 years ago

In the store, add a hide boolean (default : false)

{
  [exchangeId]: {
    loading: boolean
    error: object|string
    lastUpdated: number
    data: {
      [symbol]: number - amount of target symbol in account
    }
  }
}

In the portfolio.js file, in the fetchAllPortfolioData constant, filter the exchanges which have the hide value to false.

In the ExchangesListContainer/index.js file, line 113, add:

<td className="u-textCenter">
  <Button
    isOutlined
    isSize="small"
    isColor="black"
    onClick={() => togglePortfolioData(id)}
    >
  hide
  </Button>
</td>

The togglePortfolioData function should: