-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Dynamic Cryptocurrency Selection and Display #46
base: master
Are you sure you want to change the base?
Add Dynamic Cryptocurrency Selection and Display #46
Conversation
}; | ||
|
||
try { | ||
const response = await fetch(`http://localhost:3000/v1/${endpoints[period]}`); // TODO: Update to use the deployed API (maybe use a config file to store the base URL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙄
<div class="toggle-switch text-center mb+"> | ||
<label> <input type="radio" name="crypto" value="bitcoin" checked /> Bitcoin </label> | ||
<label> <input type="radio" name="crypto" value="ethereum" /> Ethereum </label> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see your point, and I tend to like it at one side, but on another - I prefer much more to see this in the future #54 , instead as a playable call-to-action here.
@@ -9,7 +9,7 @@ | |||
|
|||
<meta | |||
name="description" | |||
content="Replace your browser New Tab page with a Bitcoin price chart" | |||
content="Replace your browser New Tab page with a Crypto price chart" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be great to display Bitcoin or Ethereum in here.
<h2 class="chart-period mb text-center"> | ||
Bitcoin price is | ||
<span id="crypto-type">Crypto</span> price is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -123,6 +128,7 @@ <h2 class="chart-period mb text-center"> | |||
<a href="https://github.com/superKalo/crypto-tab">Open Source</a> | |||
| | |||
<a href="https://github.com/cmihaylov/bitcoin-price-api">API</a> | |||
<!-- TODO: Change the source to the new API --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new API is in another repo?
@@ -104,58 +139,61 @@ window.App.Bitcoin = { | |||
const storageSetting = | |||
App.ENV.platform === 'EXTENSION' ? 'BROWSER_STORAGE' : 'LOCAL_STORAGE'; | |||
|
|||
Object.keys(this.PERIODS).forEach((period) => { | |||
this.repositories[period] = new SuperRepo({ | |||
['bitcoin', 'ethereum'].forEach((cryptoType) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's kind of a two-sided performance problem. First, SuperRepo instances are created for both tokens (although only one could be active at a time), and second (more importantly) - the inactive one will still tick-tack and fire API calls for both - the currently active and the inactive tokens.
On HODL until the API problems are resolved and it is deployed LIVE. |
Introduces a feature to dynamically select and display cryptocurrency data (Bitcoin and Ethereum) on the page.
!!! TODO: Inside background.js we need to update to the deployed API url