-
-
Notifications
You must be signed in to change notification settings - Fork 275
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
feat(suite): change assets table #14625
Conversation
11ee733
to
4230c28
Compare
910cf23
to
1c9500a
Compare
packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetTableHeader.tsx
Outdated
Show resolved
Hide resolved
packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetTableHeader.tsx
Outdated
Show resolved
Hide resolved
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 table should behave the same as before 😢
Before:
Screen.Recording.2024-09-30.at.19.48.41.mov
Now:
Screen.Recording.2024-09-30.at.19.49.23.mov
scrolling is broken
Screen.Recording.2024-09-30.at.19.45.55.mov
90c8ae5
to
dc9e6cf
Compare
The change in color on row hover is something we would have to add to the Table component. Not sure if by default, or activated by a prop? |
Maybe activate by prop? But I like it, I would add it also for tokens table |
Should I then add it as additional styling for now or should I add the prop functionality/wait for it to be added? |
dc9e6cf
to
a300c52
Compare
a300c52
to
87903a8
Compare
Feel free to add it yourself. Something like highlightRows? As it will be a Table prop, you'd have to create a context so that the Row can reach it, though. |
87903a8
to
5e55b21
Compare
I will add it myself, yes, by the way on develop hover didn't work on light theme, I will try to fix that as well |
@@ -0,0 +1,25 @@ | |||
import React, { createContext, useContext } from 'react'; |
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 it's not necessary to have a separate file. I'd do it the same way it's done in TableHeader for such a simple context.
backgroundColor={mapElevationToBackgroundToken({ $elevation: parentElevation })} | ||
/> | ||
</ShadowContainer> | ||
<HighlightProvider highlightRowOnHover={hightlightRowOnHover}> |
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'd just name it TableContext.Provider and useTable
<Header /> {/* Logo */} | ||
<Header> | ||
<Table.Header> | ||
<Table.Cell colSpan={3}> |
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 is missing Table.Row. You probably deleted it because you don't want it to be highlighted? You can use the existing context hook from TableHeader to get info if the row is in header or not.
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.
Yes, I didn't want it to be affected by the styling, okay, thank you, I will use the hook
7058104
to
040476c
Compare
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 button and arrow should change color on row hover because on hover of buttons itself, the background is not visible
On click of row the same action is done as on on click of arrow button, maybe it should become active?
There is cursor pointer on tokens table but you cannot click it so the cursor pointer should not be there
So you should probably set it only if onClick
is available
Zero balance row does not occupy whole width so it does not change color of whole row. I recommend adding empty <td></td>
s
packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetTableHeader.tsx
Outdated
Show resolved
Hide resolved
packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetRow.tsx
Outdated
Show resolved
Hide resolved
f94d796
to
de8c1f5
Compare
This is fixed, zero balance row occupies the whole row, also the hover and cursor pointer is applied only to the rows that have an onClick property. |
Done✅ |
de8c1f5
to
d24bb9a
Compare
AFAIK buttons have only 2 states: normal one and the change of the appearance on hover, but not on click, do you mean that the button will behave the same as the row, which means it will be hovered when the row is hovered? Or do you mean that it should have an entirely new state when clicked, the "active" state. If you mean that it should react to the onClick, I would approach it generically and make all the buttons reactive to the onClick, then we could use it here as well instead of making just one button behave differently. As discussed before, this button has a purely "hinting" purpose, for the user to understand that it's possible to click on the row. |
As discussed before, I'm creating an issue for this. This problem occurs because elevation colors are repeating themselves. |
|
d24bb9a
to
579a111
Compare
})}; | ||
|
||
& > td:first-child { | ||
background: linear-gradient( |
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.
Perhaps make a const or func out of this so you can use it here and in the Cell? I'll try to figure out if there's a better way to do this, but I think it's good enough for now:)
579a111
to
db0f5d6
Compare
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.
Last small nits and lets merge it
@@ -221,28 +117,28 @@ export const AssetRowSkeleton = (props: { animate?: boolean }) => { | |||
const animate = props.animate ?? shouldAnimate; |
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.
Please move AssetRowSkeleton
into a new file. It does not use styled components anymore, so no need to have it here
Please also improve (props: { animate?: boolean })
so that it is unified with other components
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
}; | ||
|
||
export const Table = ({ children, margin, colWidths }: TableProps) => { | ||
export const Table = ({ children, margin, colWidths, highlightRowOnHover = false }: TableProps) => { |
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.
Please add highlightRowOnHover
to storybook
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
d882fe9
to
850042f
Compare
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.
You have type check error
btw you can unify usage of isAnimating
, animate
, isAnimated
,.. to something like shouldAnimate
850042f
to
ee3fc07
Compare
shouldAnimate is a hookFunction so I can't use that again, but I agree that it's odd with these similar namings, not sure how to tackle it here though |
ee3fc07
to
c31ee1a
Compare
c31ee1a
to
68bf7be
Compare
Description
Changed the cards grid to the new Table component
Related Issue
Resolve #13152
Screenshots: