From 84c17369d97e5c606b734aca0e4a684a6d166746 Mon Sep 17 00:00:00 2001 From: Roman <30427286+barabanovro@users.noreply.github.com> Date: Tue, 22 Aug 2023 12:08:35 +0400 Subject: [PATCH] fix: multi-line warning (#16) --- src/components/Swap/Toolbar/Caption.tsx | 1 + src/components/Swap/Toolbar/index.tsx | 2 +- src/state/routing/slice.ts | 7 ++++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/Swap/Toolbar/Caption.tsx b/src/components/Swap/Toolbar/Caption.tsx index 2ab7d1124..0a5bba2a3 100644 --- a/src/components/Swap/Toolbar/Caption.tsx +++ b/src/components/Swap/Toolbar/Caption.tsx @@ -25,6 +25,7 @@ const CaptionRow = styled(Row)<{ gap: number; shrink?: number }>` flex-shrink: ${({ shrink }) => shrink ?? 1}; gap: ${({ gap }) => gap}em; height: 100%; + max-width: 100%; ` // TODO (tina): consolidate this and Expando icon diff --git a/src/components/Swap/Toolbar/index.tsx b/src/components/Swap/Toolbar/index.tsx index d820e64b8..c4fc23aa2 100644 --- a/src/components/Swap/Toolbar/index.tsx +++ b/src/components/Swap/Toolbar/index.tsx @@ -33,7 +33,7 @@ const ToolbarRow = styled(Row)<{ isExpandable?: true }>` cursor: ${({ isExpandable }) => isExpandable && 'pointer'}; flex-wrap: nowrap; gap: 0.5em; - height: ${COLLAPSED_TOOLBAR_HEIGHT_EM}em; + min-height: ${COLLAPSED_TOOLBAR_HEIGHT_EM}em; padding: 0.75em; ` diff --git a/src/state/routing/slice.ts b/src/state/routing/slice.ts index 51730ce16..84778b9b3 100644 --- a/src/state/routing/slice.ts +++ b/src/state/routing/slice.ts @@ -51,7 +51,12 @@ export const routing = createApi({ return { data: quoteResult } } catch (error: any) { console.error(`GetQuote failed on routing API: ${error?.message ?? error?.detail ?? error}`) - return { error: { status: 'CUSTOM_ERROR', error: error?.message ?? error?.detail ?? error } } + return { + error: { + status: 'CUSTOM_ERROR', + error: error?.detail && error.detail.length > 0 ? error.detail : error?.message ?? error, + }, + } } }, keepUnusedDataFor: ms`10s`,