-
-
Notifications
You must be signed in to change notification settings - Fork 259
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
fix(trade): last transactions design #15502
Conversation
packages/suite/src/views/wallet/coinmarket/common/CoinmarketPaymentType.tsx
Outdated
Show resolved
Hide resolved
</> | ||
) : ( | ||
<Row margin={{ left: spacings.xl }}> |
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.
Why the margins on both Row and Text? Why not use the gap on the parent Row?
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 margin is the same as the width of a missing icon. With a gap, it would not work. I guess.
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.
And why not have it in Text
without Row
?
Like:
<Text margin={{ left: spacings.xxl }}>{exchange}</Text>
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, that's possible!
|
||
export const CoinmarketIcon = ({ iconUrl }: CoinmarketIconProps) => { | ||
const currentTheme = useSelector(state => state.suite.settings.theme.variant); | ||
const iconWrapperSize = iconSizes.mediumLarge + 4; |
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.
what is this magical number 4? :D Maybe it's easier to set iconWrapperSize manually like:
const ICON_WRAPPER_SIZE = 123
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.
It is total padding in the wrapper. (2px left - mediumLarge
size of image - 2px right)
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.
OK, then I suggest to use it this way:
const iconWrapperSize = iconSizes.mediumLarge + 2 * SIDE_PADDING;
<Row flexWrap={isBelowDesktop ? 'wrap' : undefined}> | ||
<Column | ||
alignItems="flex-start" | ||
alignItems="stretch" |
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 can delete alignItems
here. Yesterday we switched Column
default value to normal
which is basically the same like stretch
.
@@ -27,8 +27,10 @@ export const CoinmarketTransactionInfo = ({ trade }: CoinmarketTransactionInfoPr | |||
|
|||
return ( | |||
<Text margin={{ top: spacings.xs }} variant="tertiary" typographyStyle="label" as="div"> | |||
{tradeType} • <FormattedDate value={date} date time /> •{' '} | |||
<CoinmarketTransactionStatus trade={trade} /> | |||
<Row alignItems="center" flexWrap="wrap"> |
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.
alignItems="center"
for Row
is the default value, so you can delete this prop
{tradeType} • <FormattedDate value={date} date time /> •{' '} | ||
<CoinmarketTransactionStatus trade={trade} /> | ||
<Row alignItems="center" flexWrap="wrap"> | ||
{tradeType} • <FormattedDate value={date} date time /> •{' '} |
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 use new InfoPair
component here 🙏
See here: https://dev.suite.sldev.cz/components/develop/?path=/story/infopair--info-pair
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.
It would be lovely to have it dynamic, not only to the left and right parts. :) But it is nice anyway.
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.
We hear you :D
Please wait for merging this (should be soon) and refactor it to InfoSegments
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.
It's merged
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.
Updated
6c5c69f
to
5138fd1
Compare
@jvaclavik fixes are in this commit 5138fd1. I needed to rebase to use features according to your feedback. Thanks for your review |
5138fd1
to
1b69294
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.
Two last comments and ready to merge 💪
const SIDE_PADDING = 2; | ||
const iconWrapperSize = iconSizes.mediumLarge + 2 * SIDE_PADDING; |
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.
Ideally these two could be extracted to top level. not to have it directly in CoinmarketIcon
component (it's rerendering)
|
||
return ( | ||
<CoinmarketIconWrapper $isDark={currentTheme === 'dark'}> | ||
<Row |
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.
Why do you need Row
here if there is only one element?
You can use new component Box
for this use case. It's an universal building block with many styling props.
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.
😁 updated in 83d97a7
1b69294
to
83d97a7
Compare
/rebase |
Start rebasing: https://github.com/trezor/trezor-suite/actions/runs/12109678481 |
83d97a7
to
f454923
Compare
Description
Related Issue
Resolve #15501
Screenshots
Before
After