From 3b7c2b1dab1e6caef333c49157350f03a9cb9a30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Sworze=C5=84?= Date: Mon, 27 May 2024 11:29:02 +0200 Subject: [PATCH 1/2] add posibility to copy address from Treasury GA --- .../molecules/GovernanceActionCardElement.tsx | 5 +++-- .../organisms/GovernanceActionDetailsCardData.tsx | 15 +++++++++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/govtool/frontend/src/components/molecules/GovernanceActionCardElement.tsx b/govtool/frontend/src/components/molecules/GovernanceActionCardElement.tsx index 83aa5f585..e8481fcce 100644 --- a/govtool/frontend/src/components/molecules/GovernanceActionCardElement.tsx +++ b/govtool/frontend/src/components/molecules/GovernanceActionCardElement.tsx @@ -5,7 +5,7 @@ import { Typography, Tooltip, CopyButton, TooltipProps } from "@atoms"; type BaseProps = { label: string; - text?: string; + text?: string | number; dataTestId?: string; isSliderCard?: boolean; tooltipProps?: Omit; @@ -109,6 +109,7 @@ export const GovernanceActionCardElement = ({ sx={{ fontSize: isSliderCard ? 14 : 16, fontWeight: 400, + maxWidth: textVariant === "oneLine" ? "283px" : "auto", lineHeight: isSliderCard ? "20px" : "24px", ...(textVariant === "oneLine" && { whiteSpace: "nowrap" }), ...((textVariant === "oneLine" || @@ -131,7 +132,7 @@ export const GovernanceActionCardElement = ({ {isCopyButton && ( - + )} diff --git a/govtool/frontend/src/components/organisms/GovernanceActionDetailsCardData.tsx b/govtool/frontend/src/components/organisms/GovernanceActionDetailsCardData.tsx index 51f6e087d..a77ec844c 100644 --- a/govtool/frontend/src/components/organisms/GovernanceActionDetailsCardData.tsx +++ b/govtool/frontend/src/components/organisms/GovernanceActionDetailsCardData.tsx @@ -10,7 +10,7 @@ import { GovernanceActionDetailsCardOnChainData, } from "@molecules"; import { useScreenDimension, useTranslation } from "@hooks"; -import { getProposalTypeNoEmptySpaces } from "@utils"; +import { getProposalTypeNoEmptySpaces, testIdFromLabel } from "@utils"; import { MetadataValidationStatus } from "@models"; type GovernanceActionDetailsCardDataProps = { @@ -120,9 +120,16 @@ export const GovernanceActionDetailsCardData = ({ textVariant="longText" dataTestId="rationale" /> - {details && Object.keys(details).length !== 0 && ( - - )} + {details && + Object.keys(details).length !== 0 && + Object.entries(details).map(([label, content]) => ( + + ))} ); From 2fd2bf0f385dc7445def498e6022ba13f018e2bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Sworze=C5=84?= Date: Mon, 27 May 2024 11:31:45 +0200 Subject: [PATCH 2/2] fix lint --- .../src/components/organisms/GovernanceActionDetailsCardData.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/govtool/frontend/src/components/organisms/GovernanceActionDetailsCardData.tsx b/govtool/frontend/src/components/organisms/GovernanceActionDetailsCardData.tsx index a77ec844c..61d37d1fa 100644 --- a/govtool/frontend/src/components/organisms/GovernanceActionDetailsCardData.tsx +++ b/govtool/frontend/src/components/organisms/GovernanceActionDetailsCardData.tsx @@ -7,7 +7,6 @@ import { DataMissingInfoBox, GovernanceActionDetailsCardHeader, GovernanceActionsDatesBox, - GovernanceActionDetailsCardOnChainData, } from "@molecules"; import { useScreenDimension, useTranslation } from "@hooks"; import { getProposalTypeNoEmptySpaces, testIdFromLabel } from "@utils";