Skip to content

Commit

Permalink
fixup! fix(trade): last transactions design
Browse files Browse the repository at this point in the history
  • Loading branch information
adderpositive committed Nov 28, 2024
1 parent 9bdc342 commit 5138fd1
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ interface CoinmarketIconProps {

export const CoinmarketIcon = ({ iconUrl }: CoinmarketIconProps) => {
const currentTheme = useSelector(state => state.suite.settings.theme.variant);
const iconWrapperSize = iconSizes.mediumLarge + 4;
const SIDE_PADDING = 2;
const iconWrapperSize = iconSizes.mediumLarge + 2 * SIDE_PADDING;

return (
<CoinmarketIconWrapper $isDark={currentTheme === 'dark'}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ export const CoinmarketProviderInfo = ({ exchange, providers }: CoinmarketProvid
{provider.brandName ?? provider.companyName}
</>
) : (
<Row margin={{ left: spacings.xl }}>
<Text margin={{ left: spacings.xs }}>{exchange}</Text>
</Row>
<Text margin={{ left: spacings.xxl }}>{exchange}</Text>
)}
</Row>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@ export const CoinmarketTransactionContainer = ({
return (
<Card fillType="none" margin={{ bottom: spacings.lg }}>
<Row flexWrap={isBelowDesktop ? 'wrap' : undefined}>
<Column
alignItems="stretch"
flex="auto"
width={isBelowDesktop ? 'calc(100% - 180px)' : '100%'}
>
<Column flex="auto" width={isBelowDesktop ? 'calc(100% - 180px)' : '100%'}>
{TradeDetail}
</Column>
<Column
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Row, Text } from '@trezor/components';
import { InfoPair, Row, Text } from '@trezor/components';
import { spacings } from '@trezor/theme';

import { FormattedDate } from 'src/components/suite';
Expand Down Expand Up @@ -28,8 +28,15 @@ export const CoinmarketTransactionInfo = ({ trade }: CoinmarketTransactionInfoPr
return (
<Text margin={{ top: spacings.xs }} variant="tertiary" typographyStyle="label" as="div">
<Row alignItems="center" flexWrap="wrap">
{tradeType}<FormattedDate value={date} date time />{' '}
<CoinmarketTransactionStatus trade={trade} />
<InfoPair
leftContent={
<InfoPair
leftContent={tradeType}
rightContent={<FormattedDate value={date} date time />}
/>
}
rightContent={<CoinmarketTransactionStatus trade={trade} />}
/>
</Row>
</Text>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { DefaultTheme, useTheme } from 'styled-components';
import { BuyTradeStatus, ExchangeTradeStatus, SellTradeStatus } from 'invity-api';

import { Icon, Row, Text } from '@trezor/components';
import { spacings } from '@trezor/theme';

import { Translation } from 'src/components/suite';
import { getStatusMessage as getBuyStatusMessage } from 'src/utils/wallet/coinmarket/buyUtils';
Expand Down Expand Up @@ -131,7 +130,7 @@ export const CoinmarketTransactionStatus = ({ trade }: CoinmarketTransactionStat
if (!data) return null;

return (
<Row margin={{ left: spacings.xxs }}>
<Row>
<Icon color={data.color} size={10} name={data.icon} margin={{ right: 4 }} />
<Text color={data.color} data-testid="@coinmarket/transaction/status">
<Translation id={data.statusMessageId} />
Expand Down

0 comments on commit 5138fd1

Please sign in to comment.