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

fix(trade): last transactions design #15502

Merged
merged 1 commit into from
Dec 1, 2024
Merged

Conversation

adderpositive
Copy link
Contributor

@adderpositive adderpositive commented Nov 21, 2024

Description

  • fix alignment of payment status
  • fix alignment of payment methods and provider
  • fix transaction margin

Related Issue

Resolve #15501

Screenshots

Before

image

After

image

@tomasklim tomasklim self-assigned this Nov 22, 2024
</>
) : (
<Row margin={{ left: spacings.xl }}>
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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>

Copy link
Contributor Author

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;
Copy link
Contributor

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

Copy link
Contributor Author

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)

Copy link
Contributor

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"
Copy link
Contributor

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">
Copy link
Contributor

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 /> •{' '}
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's merged

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

@adderpositive adderpositive self-assigned this Nov 28, 2024
@adderpositive adderpositive force-pushed the fix/last-transactions-design branch from 6c5c69f to 5138fd1 Compare November 28, 2024 12:20
@adderpositive
Copy link
Contributor Author

adderpositive commented Nov 28, 2024

@jvaclavik fixes are in this commit 5138fd1. I needed to rebase to use features according to your feedback. Thanks for your review

@adderpositive adderpositive force-pushed the fix/last-transactions-design branch from 5138fd1 to 1b69294 Compare November 28, 2024 15:41
Copy link
Contributor

@jvaclavik jvaclavik left a 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 💪

Comment on lines 19 to 20
const SIDE_PADDING = 2;
const iconWrapperSize = iconSizes.mediumLarge + 2 * SIDE_PADDING;
Copy link
Contributor

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
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😁 updated in 83d97a7

@adderpositive adderpositive force-pushed the fix/last-transactions-design branch from 1b69294 to 83d97a7 Compare November 29, 2024 12:47
@tomasklim
Copy link
Member

/rebase

Copy link

github-actions bot commented Dec 1, 2024

@trezor-ci trezor-ci force-pushed the fix/last-transactions-design branch from 83d97a7 to f454923 Compare December 1, 2024 22:41
@tomasklim tomasklim enabled auto-merge (rebase) December 1, 2024 22:41
@tomasklim tomasklim merged commit 10e5bc4 into develop Dec 1, 2024
21 checks passed
@tomasklim tomasklim deleted the fix/last-transactions-design branch December 1, 2024 22:48
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.

Trade - Last transactions design bugs
4 participants