From 386a51b9fb0a29d385fcb4acc86fc343f6cbd42c Mon Sep 17 00:00:00 2001 From: cgrellard-ledger Date: Thu, 2 Jan 2025 17:30:07 +0100 Subject: [PATCH] :lipstick: fix(lld): update layout of the send flow error message on the confirmation step --- .changeset/chilled-coats-drive.md | 5 +++ .../Confirmation/NodeError/HelpSection.tsx | 41 +++++++++++++------ .../NodeError/TechnicalErrorSection.tsx | 41 +++++++++++++------ .../steps/Confirmation/NodeError/index.tsx | 10 ++--- 4 files changed, 66 insertions(+), 31 deletions(-) create mode 100644 .changeset/chilled-coats-drive.md diff --git a/.changeset/chilled-coats-drive.md b/.changeset/chilled-coats-drive.md new file mode 100644 index 000000000000..f201c953158a --- /dev/null +++ b/.changeset/chilled-coats-drive.md @@ -0,0 +1,5 @@ +--- +"ledger-live-desktop": minor +--- + +LLD - Fix Send StepConfirmation error message layout that was broken on some languages diff --git a/apps/ledger-live-desktop/src/renderer/modals/Send/steps/Confirmation/NodeError/HelpSection.tsx b/apps/ledger-live-desktop/src/renderer/modals/Send/steps/Confirmation/NodeError/HelpSection.tsx index f53825e73781..c6b5d1b2ce4e 100644 --- a/apps/ledger-live-desktop/src/renderer/modals/Send/steps/Confirmation/NodeError/HelpSection.tsx +++ b/apps/ledger-live-desktop/src/renderer/modals/Send/steps/Confirmation/NodeError/HelpSection.tsx @@ -7,7 +7,16 @@ type Props = { onGetHelp: () => void; }; +const Container = styled(Flex)` + --line-clamp: 2; + + &:hover { + --line-clamp: unset; + } +`; + const InteractFlex = styled(Flex)` + height: 40px; &:hover { cursor: pointer; background-color: ${({ theme }) => theme.colors.palette.opacityDefault.c10}; @@ -24,34 +33,40 @@ const InteractFlex = styled(Flex)` `; const StyledText = styled(Text)` - word-break: break-all; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: var(--line-clamp); + overflow: hidden; + text-overflow: ellipsis; + padding-right: 6px; `; const HelpSection = ({ onGetHelp }: Props) => { const { t } = useTranslation(); return ( - - - {t("errors.TransactionBroadcastError.helpCenterTitle")} - {t("errors.TransactionBroadcastError.helpCenterDesc")} - - + + + {t("errors.TransactionBroadcastError.helpCenterTitle")} + {t("errors.TransactionBroadcastError.helpCenterDesc")} + + + {t("errors.TransactionBroadcastError.getHelp")} - + ); }; diff --git a/apps/ledger-live-desktop/src/renderer/modals/Send/steps/Confirmation/NodeError/TechnicalErrorSection.tsx b/apps/ledger-live-desktop/src/renderer/modals/Send/steps/Confirmation/NodeError/TechnicalErrorSection.tsx index 7cc3520d5d76..ebc0d98f517b 100644 --- a/apps/ledger-live-desktop/src/renderer/modals/Send/steps/Confirmation/NodeError/TechnicalErrorSection.tsx +++ b/apps/ledger-live-desktop/src/renderer/modals/Send/steps/Confirmation/NodeError/TechnicalErrorSection.tsx @@ -9,7 +9,16 @@ type Props = { onSaveLogs: () => void; }; +const Container = styled(Flex)` + --line-clamp: 2; + + &:hover { + --line-clamp: unset; + } +`; + const InteractFlex = styled(Flex)` + height: 40px; &:hover { cursor: pointer; background-color: ${({ theme }) => theme.colors.palette.opacityDefault.c10}; @@ -26,11 +35,12 @@ const InteractFlex = styled(Flex)` `; const StyledText = styled(Text)` - word-break: break-all; display: -webkit-box; - -webkit-line-clamp: 3; -webkit-box-orient: vertical; + -webkit-line-clamp: var(--line-clamp); overflow: hidden; + text-overflow: ellipsis; + padding-right: 6px; `; const TechnicalErrorSection = ({ error, onSaveLogs }: Props) => { @@ -49,20 +59,25 @@ const TechnicalErrorSection = ({ error, onSaveLogs }: Props) => { }; return ( - - - {t("errors.TransactionBroadcastError.technicalErrorTitle")} - {error.message} - - - + + + + {t("errors.TransactionBroadcastError.technicalErrorTitle")} + + {error.message} + + + + {t("errors.TransactionBroadcastError.saveLogs")} @@ -70,7 +85,7 @@ const TechnicalErrorSection = ({ error, onSaveLogs }: Props) => { {icon} - + ); }; diff --git a/apps/ledger-live-desktop/src/renderer/modals/Send/steps/Confirmation/NodeError/index.tsx b/apps/ledger-live-desktop/src/renderer/modals/Send/steps/Confirmation/NodeError/index.tsx index cd2a63a82cba..0b76c8ea1642 100644 --- a/apps/ledger-live-desktop/src/renderer/modals/Send/steps/Confirmation/NodeError/index.tsx +++ b/apps/ledger-live-desktop/src/renderer/modals/Send/steps/Confirmation/NodeError/index.tsx @@ -1,5 +1,5 @@ import React, { useState } from "react"; -import { Flex, Grid, Icons, Text } from "@ledgerhq/react-ui"; +import { Flex, Icons, Text } from "@ledgerhq/react-ui"; import styled, { useTheme } from "styled-components"; import { CircleWrapper } from "~/renderer/components/CryptoCurrencyIcon"; import { useExportLogs } from "LLD/hooks/useExportLogs"; @@ -46,7 +46,7 @@ const NodeError: React.FC = ({ error }) => { @@ -72,7 +72,7 @@ const NodeError: React.FC = ({ error }) => { } /> - + {t("errors.TransactionBroadcastError.needHelp")} @@ -85,10 +85,10 @@ const NodeError: React.FC = ({ error }) => { )} {isShowMore && ( - + - + )}