-
Notifications
You must be signed in to change notification settings - Fork 2
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
Set Chart to full width #54
Conversation
Can you provide a screenshot of the change and a description on the PR? 🙏 |
Apologies, added 👍 |
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.
Minor comments for later, not actionable now. LGTM.
const [chartData, setChartData] = useState< | ||
[string, number, number, number, number][] | ||
>([]); // [[date, open, close, low, high]] | ||
const [chartData, setChartData] = useState<[string, number, number, number, number][]>([]); // [[date, open, close, low, high]] |
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.
(note for later)
At some point, would be great to convert this data structure to an object versus ordered array.
const startBlock = await fetch('/api/blocks/1') | ||
.then(res => res.json()) | ||
.then(data => { | ||
const currentBlock = data[0].height; | ||
console.log(currentBlock); | ||
const startBlock = | ||
currentBlock - Math.trunc((daysLookback * 24 * 60 * 60) / blockTimeSeconds); | ||
console.log('Start block: ', startBlock); | ||
return startBlock; |
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.
(note for later)
Would be nice to stick with async/await or then()'s and not mix.
Fixes the issue that the chart doesnt span the full width: