Skip to content
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

Merged
merged 3 commits into from
Sep 19, 2024
Merged

Set Chart to full width #54

merged 3 commits into from
Sep 19, 2024

Conversation

JasonMHasperhoven
Copy link
Contributor

@JasonMHasperhoven JasonMHasperhoven commented Sep 18, 2024

Fixes the issue that the chart doesnt span the full width:

image

@JasonMHasperhoven JasonMHasperhoven changed the title Chart full width Set Chart to full width Sep 18, 2024
@JasonMHasperhoven JasonMHasperhoven requested review from philipjames44 and a team September 18, 2024 13:55
@grod220
Copy link
Contributor

grod220 commented Sep 18, 2024

Can you provide a screenshot of the change and a description on the PR? 🙏

@JasonMHasperhoven
Copy link
Contributor Author

Can you provide a screenshot of the change and a description on the PR? 🙏

Apologies, added 👍

Copy link
Contributor

@grod220 grod220 left a 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]]
Copy link
Contributor

@grod220 grod220 Sep 18, 2024

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.

Comment on lines +44 to +52
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;
Copy link
Contributor

@grod220 grod220 Sep 18, 2024

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.

@conorsch conorsch merged commit 9898273 into main Sep 19, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants