Skip to content

Commit cfd3c85

Browse files
authored
Merge pull request #3831 from IntersectMBO/3828-misplaced-and-clipped-receiving-address-and-amount-in-treasury-withdrawal-governance-action
(fix#3828): unification of sections 'Receiving Address' and 'Amount' in Treasury Withdrawal Governance Action
2 parents 4945122 + 4c94ce2 commit cfd3c85

File tree

2 files changed

+18
-85
lines changed

2 files changed

+18
-85
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ changes.
2525

2626
### Changed
2727
- Adjust top menu (navbar) layout when wallet is not connected [Issue-3682](https://github.com/IntersectMBO/govtool/issues/3682)
28+
- Unification of sections 'Receiving Address' and 'Amount' in Treasury Withdrawal Governance Action [Issue-3828](https://github.com/IntersectMBO/govtool/issues/3828)
2829

2930
### Removed
3031

Lines changed: 17 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
import { Box } from "@mui/material";
21
import { useTranslation } from "react-i18next";
32

4-
import { Typography, CopyButton } from "@atoms";
53
import { correctVoteAdaFormat } from "@utils";
6-
7-
import { useScreenDimension } from "@/hooks";
4+
import { GovernanceActionCardElement } from "./GovernanceActionCardElement";
85

96
type Props = {
107
receivingAddress: string;
@@ -16,87 +13,22 @@ export const GovernanceActionCardTreasuryWithdrawalElement = ({
1613
amount,
1714
}: Props) => {
1815
const { t } = useTranslation();
19-
const { isMobile } = useScreenDimension();
16+
2017
return (
21-
<Box
22-
sx={{
23-
display: "flex",
24-
mb: "4px",
25-
flexDirection: "column",
26-
}}
27-
>
28-
<Box sx={{ display: "flex", flexDirection: isMobile ? "column" : "row" }}>
29-
<Typography
30-
data-testid="receiving-address-label"
31-
sx={{
32-
width: "160px",
33-
fontSize: 14,
34-
fontWeight: 600,
35-
lineHeight: "20px",
36-
color: "neutralGray",
37-
}}
38-
>
39-
{t("govActions.receivingAddress")}
40-
</Typography>
41-
<Box
42-
sx={{
43-
display: "flex",
44-
alignItems: "center",
45-
overflow: "hidden",
46-
flexDirection: "row",
47-
}}
48-
>
49-
<Typography
50-
data-testid="receiving-address"
51-
sx={{
52-
ml: isMobile ? 0 : 8,
53-
color: "primaryBlue",
54-
fontSize: 16,
55-
fontWeight: 400,
56-
lineHeight: "20px",
57-
whiteSpace: "nowrap",
58-
overflow: "hidden",
59-
textOverflow: "ellipsis",
60-
}}
61-
>
62-
{receivingAddress}
63-
</Typography>
64-
<Box ml={1}>
65-
<CopyButton text={receivingAddress} variant="blueThin" />
66-
</Box>
67-
</Box>
68-
</Box>
69-
<Box
70-
sx={{
71-
display: "flex",
72-
flexDirection: isMobile ? "column" : "row",
73-
mt: "6px",
74-
}}
75-
>
76-
<Typography
77-
sx={{
78-
width: "160px",
79-
fontSize: 14,
80-
fontWeight: 600,
81-
lineHeight: "20px",
82-
color: "neutralGray",
83-
}}
84-
data-testid="amount-label"
85-
>
86-
{t("govActions.amount")}
87-
</Typography>
88-
<Typography
89-
data-testid="amount"
90-
sx={{
91-
ml: isMobile ? 0 : 8,
92-
fontSize: 16,
93-
fontWeight: 400,
94-
lineHeight: "20px",
95-
}}
96-
>
97-
{correctVoteAdaFormat(amount) ?? 0}
98-
</Typography>
99-
</Box>
100-
</Box>
18+
<>
19+
<GovernanceActionCardElement
20+
label={t("govActions.receivingAddress")}
21+
text={receivingAddress}
22+
textVariant="oneLine"
23+
dataTestId="receiving-address-label"
24+
isCopyButton
25+
/>
26+
<GovernanceActionCardElement
27+
label={t("govActions.amount")}
28+
text={`₳ ${correctVoteAdaFormat(amount) ?? 0}`}
29+
textVariant="oneLine"
30+
dataTestId="amount"
31+
/>
32+
</>
10133
);
10234
};

0 commit comments

Comments
 (0)