diff --git a/govtool/frontend/src/components/molecules/DataMissingHeader.tsx b/govtool/frontend/src/components/molecules/DataMissingHeader.tsx index f4f566d1b..7e19844e9 100644 --- a/govtool/frontend/src/components/molecules/DataMissingHeader.tsx +++ b/govtool/frontend/src/components/molecules/DataMissingHeader.tsx @@ -1,4 +1,4 @@ -import { Box } from "@mui/material"; +import { Box, SxProps } from "@mui/material"; import { Typography } from "@atoms"; import { Share } from "@molecules"; @@ -9,12 +9,14 @@ type DataMissingHeaderProps = { isDataMissing: MetadataValidationStatus | null; shareLink?: string; title?: string; + titleStyle?: SxProps; }; export const DataMissingHeader = ({ title, isDataMissing, shareLink, + titleStyle, }: DataMissingHeaderProps) => ( diff --git a/govtool/frontend/src/components/molecules/DelegationAction.tsx b/govtool/frontend/src/components/molecules/DelegationAction.tsx index 2132a7bed..8ba7e6c97 100644 --- a/govtool/frontend/src/components/molecules/DelegationAction.tsx +++ b/govtool/frontend/src/components/molecules/DelegationAction.tsx @@ -3,6 +3,7 @@ import ArrowForwardIosIcon from "@mui/icons-material/ArrowForwardIos"; import { Typography } from "@atoms"; import { gray } from "@consts"; +import { ellipsizeText } from "@utils"; import { Card } from "./Card"; import { DirectVoterActionProps } from "./types"; @@ -31,7 +32,7 @@ export const DelegationAction = ({ > - {drepName} + {ellipsizeText(drepName, 25)} {metadataStatus ? getMetadataDataMissingStatusTranslation(metadataStatus) - : dRepName} + : ellipsizeText(dRepName ?? "", 25)} { title={dRepName ?? undefined} isDataMissing={metadataStatus} shareLink={!isMe ? window.location.href : undefined} + titleStyle={{ wordBreak: "break-word", whiteSpace: "wrap" }} /> {metadataStatus && (