-
Notifications
You must be signed in to change notification settings - Fork 17
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
CentrifugeApp: Portfolio page Overview graph #1670
Conversation
1ccbf50
to
a7c1c21
Compare
e7d8833
to
7aeb3c6
Compare
7d7a0a1
to
93be3b7
Compare
8c13ae4
to
fc494f5
Compare
@jpangelle Looks great let's merge it and I create a follow up ticket for the spacing. |
Some minor UI improvements that are a not in line with the design yet.
Apart from that, looks great! |
Regarding the USD bit, this was a suggestion from Dennis in order to signify what the y-axis represents. Is there a position we can place it that would look cleaner? |
@jpangelle that was Tim's suggestion for a cleaner look |
aa6ae35
to
a0a7719
Compare
@@ -55,11 +55,13 @@ const sorter = <T extends Record<string, any>>(data: Array<T>, order: OrderBy, s | |||
if (order === 'asc') { | |||
return data.sort((a, b) => { | |||
if (sortKey === 'nftIdSortKey') return new BN(a[sortKey]).gt(new BN(b[sortKey])) ? 1 : -1 | |||
if (sortKey === 'position') return a[sortKey].gt(b[sortKey]) ? 1 : -1 |
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.
this feels kinda weird to have in here
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 think the table sorting requires the sortable value to be a number, maybe you could adapt this so that the sorter checks first if the value is a Dec/BN and sort accordingly? Then you would probs be able to remove the line above it as well
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.
Done!
) { | ||
const today = new Date() | ||
|
||
return Array(rangeValue + 1) |
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.
instead of calculating the range after fetching the data, would it be possible to use graphQL filters to only fetch only the range you actually need? I think you could edit the getDailyTrancheStates
and in the filters to do something like
query($trancheId: String!) {
trancheSnapshots(
orderBy: BLOCK_NUMBER_ASC,
filter: {
trancheId: { includes: $trancheId },
timestamp: { greaterThanOrEqualTo: <date to fetch from> }
}) {
nodes {
timestamp
trancheId
...
}
}
}
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.
Hm I think so but if the user toggles the selection to another range, it require another call to the subquery to get the data rather than having all of the data already. Might feel sluggish.
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.
Dec-05-2023.21-13-10.mp4
Yeah, unfortunately it is a bit janky when implementing it this way.
3443e09
to
f0349e6
Compare
PR deployed in Google Cloud |
Description
This pull request portfolio overview graph on the
/portfolio
page.Closes #1593
Approvals
Screenshots
Impact
Portfolio page