Skip to content

Commit b453dc2

Browse files
author
Lucas
authored
[LW-10533] Assets list on the transaction summary page is broken (#1145)
* fix: style and add story * fix: asset info overflow
1 parent 6af17d6 commit b453dc2

File tree

3 files changed

+75
-2
lines changed

3 files changed

+75
-2
lines changed

packages/core/src/ui/components/OutputSummary/OutputSummary.module.scss

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,19 @@
77
display: flex;
88
}
99

10+
@mixin right-align {
11+
@include half-display;
12+
text-align: right;
13+
display: flex;
14+
flex-direction: column;
15+
}
16+
17+
.assetInfo {
18+
overflow-wrap: break-word;
19+
word-break: break-word;
20+
max-width: 100%;
21+
}
22+
1023
.container {
1124
display: flex;
1225
flex-direction: column;
@@ -32,7 +45,7 @@
3245
}
3346

3447
.assetList {
35-
@include half-display;
48+
@include right-align;
3649
gap: size_unit(4);
3750
}
3851

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import type { Meta, StoryObj } from '@storybook/react';
2+
3+
import { OutputSummary } from './OutputSummary';
4+
import { ComponentProps } from 'react';
5+
import { Wallet } from '@lace/cardano';
6+
7+
const meta: Meta<typeof OutputSummary> = {
8+
title: 'OutputSummary',
9+
component: OutputSummary,
10+
parameters: {
11+
layout: 'centered'
12+
}
13+
};
14+
15+
export default meta;
16+
type Story = StoryObj<typeof OutputSummary>;
17+
18+
const ownAddress = Wallet.Cardano.PaymentAddress(
19+
'addr_test1qq585l3hyxgj3nas2v3xymd23vvartfhceme6gv98aaeg9muzcjqw982pcftgx53fu5527z2cj2tkx2h8ux2vxsg475q2g7k3g'
20+
);
21+
22+
const data: ComponentProps<typeof OutputSummary> = {
23+
list: [
24+
{
25+
assetAmount: '1 ADA',
26+
fiatAmount: '1000 USD'
27+
},
28+
{
29+
assetAmount: '1 NFT',
30+
fiatAmount: '-'
31+
},
32+
{
33+
assetAmount: '1234 FT',
34+
fiatAmount: '100 USD'
35+
},
36+
{
37+
assetAmount: '648823ffdad1610b4162f4dbc87bd47f6f9cf45d772ddef661eff198775348494241 FT',
38+
fiatAmount: '1 USD'
39+
}
40+
],
41+
recipientAddress: ownAddress,
42+
recipientName: 'My Address',
43+
translations: {
44+
recipientAddress: 'Recipient address',
45+
sending: 'Sending'
46+
}
47+
};
48+
49+
export const Overview: Story = {
50+
args: {
51+
...data
52+
}
53+
};
54+
55+
export const OwnAddress: Story = {
56+
args: {
57+
ownAddresses: [ownAddress],
58+
...data
59+
}
60+
};

packages/core/src/ui/components/OutputSummary/OutputSummaryUtils.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const RowContainer = (props: { children: React.ReactNode; key?: string })
1212
);
1313

1414
export const renderAmountInfo = (amount: string, fiat: string, key?: string): JSX.Element => (
15-
<Flex key={key} w="$fill" flexDirection="column" alignItems="flex-end">
15+
<Flex key={key} className={styles.assetInfo} w="$fill" flexDirection="column" alignItems="flex-end">
1616
<Text.Body.Normal weight="$medium" data-testid="asset-info-amount">
1717
{amount}
1818
</Text.Body.Normal>

0 commit comments

Comments
 (0)