-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(#1600): add support for list of withdrawals in treasury gov action
- Loading branch information
1 parent
ac6ba3d
commit 7eda954
Showing
11 changed files
with
162 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
102 changes: 102 additions & 0 deletions
102
govtool/frontend/src/components/molecules/GovernanceActionCardTreasuryWithdrawalElement.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
import { Box } from "@mui/material"; | ||
import { useTranslation } from "react-i18next"; | ||
|
||
import { Typography, CopyButton } from "@atoms"; | ||
import { correctAdaFormat } from "@utils"; | ||
|
||
import { useScreenDimension } from "@/hooks"; | ||
|
||
type Props = { | ||
receivingAddress: string; | ||
amount: number; | ||
}; | ||
|
||
export const GovernanceActionCardTreasuryWithdrawalElement = ({ | ||
receivingAddress, | ||
amount, | ||
}: Props) => { | ||
const { t } = useTranslation(); | ||
const { isMobile } = useScreenDimension(); | ||
return ( | ||
<Box | ||
sx={{ | ||
display: "flex", | ||
mb: "4px", | ||
flexDirection: "column", | ||
}} | ||
> | ||
<Box sx={{ display: "flex", flexDirection: isMobile ? "column" : "row" }}> | ||
<Typography | ||
data-testid="receiving-address-label" | ||
sx={{ | ||
width: "160px", | ||
fontSize: 14, | ||
fontWeight: 600, | ||
lineHeight: "20px", | ||
color: "neutralGray", | ||
}} | ||
> | ||
{t("govActions.receivingAddress")} | ||
</Typography> | ||
<Box | ||
sx={{ | ||
display: "flex", | ||
alignItems: "center", | ||
overflow: "hidden", | ||
flexDirection: "row", | ||
}} | ||
> | ||
<Typography | ||
data-testid="receiving-address" | ||
sx={{ | ||
ml: isMobile ? 0 : 8, | ||
color: "primaryBlue", | ||
fontSize: 16, | ||
fontWeight: 400, | ||
lineHeight: "20px", | ||
whiteSpace: "nowrap", | ||
overflow: "hidden", | ||
textOverflow: "ellipsis", | ||
}} | ||
> | ||
{receivingAddress} | ||
</Typography> | ||
<Box ml={1}> | ||
<CopyButton text={receivingAddress} variant="blueThin" /> | ||
</Box> | ||
</Box> | ||
</Box> | ||
<Box | ||
sx={{ | ||
display: "flex", | ||
flexDirection: isMobile ? "column" : "row", | ||
mt: "6px", | ||
}} | ||
> | ||
<Typography | ||
sx={{ | ||
width: "160px", | ||
fontSize: 14, | ||
fontWeight: 600, | ||
lineHeight: "20px", | ||
color: "neutralGray", | ||
}} | ||
data-testid="amount-label" | ||
> | ||
{t("govActions.amount")} | ||
</Typography> | ||
<Typography | ||
data-testid="amount" | ||
sx={{ | ||
ml: isMobile ? 0 : 8, | ||
fontSize: 16, | ||
fontWeight: 400, | ||
lineHeight: "20px", | ||
}} | ||
> | ||
₳ {correctAdaFormat(amount) ?? 0} | ||
</Typography> | ||
</Box> | ||
</Box> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters