Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix/649-design-bug-payment-address-needs-to-be-copyablereadable #1096

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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<TooltipProps, "children">;
Expand Down Expand Up @@ -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" ||
Expand All @@ -131,7 +132,7 @@ export const GovernanceActionCardElement = ({
</Typography>
{isCopyButton && (
<Box ml={1}>
<CopyButton text={text} variant="blueThin" />
<CopyButton text={text.toString()} variant="blueThin" />
</Box>
)}
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ import {
DataMissingInfoBox,
GovernanceActionDetailsCardHeader,
GovernanceActionsDatesBox,
GovernanceActionDetailsCardOnChainData,
} from "@molecules";
import { useScreenDimension, useTranslation } from "@hooks";
import { getProposalTypeNoEmptySpaces } from "@utils";
import { getProposalTypeNoEmptySpaces, testIdFromLabel } from "@utils";
import { MetadataValidationStatus } from "@models";

type GovernanceActionDetailsCardDataProps = {
Expand Down Expand Up @@ -120,9 +119,16 @@ export const GovernanceActionDetailsCardData = ({
textVariant="longText"
dataTestId="rationale"
/>
{details && Object.keys(details).length !== 0 && (
<GovernanceActionDetailsCardOnChainData data={details} />
)}
{details &&
Object.keys(details).length !== 0 &&
Object.entries(details).map(([label, content]) => (
<GovernanceActionCardElement
isCopyButton={label.toLowerCase().includes("address")}
label={label}
text={content}
dataTestId={testIdFromLabel(label)}
/>
))}
<GovernanceActionDetailsCardLinks links={links} />
</Box>
);
Expand Down
Loading