From 26c42cdb0ed802d8080417dc9aea43d82954744c Mon Sep 17 00:00:00 2001 From: Liviu Ciulinaru Date: Thu, 11 Jul 2024 13:04:20 +0300 Subject: [PATCH] fix: Exchange tab named replaced by Swap. fix: Tab font size reduced adjust margins for cards chore: rm comments fix: target account fix: spacing --- .../Swap2/Form/FormSelectors/FormInputs.tsx | 21 ++++++++----------- .../Swap2/Form/FormSummary/SummaryValue.tsx | 1 + .../screens/exchange/Swap2/Form/index.tsx | 13 ++++++------ .../screens/exchange/Swap2/Navbar/index.tsx | 8 +++---- .../screens/exchange/Swap2/Navbar/routes.json | 2 +- .../static/i18n/en/app.json | 2 +- 6 files changed, 22 insertions(+), 25 deletions(-) diff --git a/apps/ledger-live-desktop/src/renderer/screens/exchange/Swap2/Form/FormSelectors/FormInputs.tsx b/apps/ledger-live-desktop/src/renderer/screens/exchange/Swap2/Form/FormSelectors/FormInputs.tsx index b9d807265a45..70c7a28d3e2f 100644 --- a/apps/ledger-live-desktop/src/renderer/screens/exchange/Swap2/Form/FormSelectors/FormInputs.tsx +++ b/apps/ledger-live-desktop/src/renderer/screens/exchange/Swap2/Form/FormSelectors/FormInputs.tsx @@ -1,17 +1,17 @@ +import { + SwapDataType, + SwapSelectorStateType, + SwapTransactionType, +} from "@ledgerhq/live-common/exchange/swap/types"; import React from "react"; +import styled from "styled-components"; +import { track } from "~/renderer/analytics/segment"; import Box from "~/renderer/components/Box"; import Button from "~/renderer/components/Button"; import ArrowsUpDown from "~/renderer/icons/ArrowsUpDown"; -import styled from "styled-components"; -import { track } from "~/renderer/analytics/segment"; +import { useGetSwapTrackingProperties } from "../../utils/index"; import FromRow from "./FromRow"; import ToRow from "./ToRow"; -import { - SwapSelectorStateType, - SwapTransactionType, - SwapDataType, -} from "@ledgerhq/live-common/exchange/swap/types"; -import { useGetSwapTrackingProperties } from "../../utils/index"; type FormInputsProps = { fromAccount: SwapSelectorStateType["account"]; @@ -49,10 +49,7 @@ const Main = styled.section` display: flex; flex-direction: column; margin-bottom: 5px; - row-gap: 5px; - @media screen and (min-height: 800px) { - row-gap: 12px; - } + row-gap: 12px; `; function SwapButton({ onClick, disabled }: SwapButtonProps): JSX.Element { diff --git a/apps/ledger-live-desktop/src/renderer/screens/exchange/Swap2/Form/FormSummary/SummaryValue.tsx b/apps/ledger-live-desktop/src/renderer/screens/exchange/Swap2/Form/FormSummary/SummaryValue.tsx index d932e09c612e..ec69ad21e9dc 100644 --- a/apps/ledger-live-desktop/src/renderer/screens/exchange/Swap2/Form/FormSummary/SummaryValue.tsx +++ b/apps/ledger-live-desktop/src/renderer/screens/exchange/Swap2/Form/FormSummary/SummaryValue.tsx @@ -10,6 +10,7 @@ export const Container = styled.div` column-gap: 0.375rem; align-items: center; color: ${p => p.theme.colors.palette.text.shade100}; + justify-content: flex-end; `; export const Text = styled(TextBase).attrs(() => ({ ff: "Inter", diff --git a/apps/ledger-live-desktop/src/renderer/screens/exchange/Swap2/Form/index.tsx b/apps/ledger-live-desktop/src/renderer/screens/exchange/Swap2/Form/index.tsx index 8099d91bab0b..cece4d172c09 100644 --- a/apps/ledger-live-desktop/src/renderer/screens/exchange/Swap2/Form/index.tsx +++ b/apps/ledger-live-desktop/src/renderer/screens/exchange/Swap2/Form/index.tsx @@ -8,9 +8,9 @@ import { useSwapTransaction, } from "@ledgerhq/live-common/exchange/swap/hooks/index"; import { + maybeKeepTronAccountAlive, maybeTezosAccountUnrevealedAccount, maybeTronEmptyAccount, - maybeKeepTronAccountAlive, } from "@ledgerhq/live-common/exchange/swap/index"; import { OnNoRatesCallback } from "@ledgerhq/live-common/exchange/swap/types"; import { getProviderName } from "@ledgerhq/live-common/exchange/swap/utils/index"; @@ -52,12 +52,11 @@ const Wrapper = styled.div` display: flex; flex-direction: column; max-width: 37rem; - padding: 12px 20px 0; - row-gap: 0.75rem; - @media screen and (min-height: 800px) { - row-gap: 2rem; - margin-top: 12px; - padding: 20px; + padding: 0.75rem ${({ theme }) => theme.space[4]}px 0; + row-gap: 1rem; + @media screen and (min-height: 1200px) { + padding-top: 1rem; + row-gap: 1.5rem; } `; diff --git a/apps/ledger-live-desktop/src/renderer/screens/exchange/Swap2/Navbar/index.tsx b/apps/ledger-live-desktop/src/renderer/screens/exchange/Swap2/Navbar/index.tsx index ec08d849029c..8ed2a77d40f9 100644 --- a/apps/ledger-live-desktop/src/renderer/screens/exchange/Swap2/Navbar/index.tsx +++ b/apps/ledger-live-desktop/src/renderer/screens/exchange/Swap2/Navbar/index.tsx @@ -1,9 +1,9 @@ import React, { useMemo } from "react"; -import { useLocation, useHistory } from "react-router-dom"; -import { track } from "~/renderer/analytics/segment"; -import TabBar, { TabBarRootStyled } from "~/renderer/components/TabBar"; import { useTranslation } from "react-i18next"; +import { useHistory, useLocation } from "react-router-dom"; import styled from "styled-components"; +import { track } from "~/renderer/analytics/segment"; +import TabBar, { TabBarRootStyled } from "~/renderer/components/TabBar"; import { useGetSwapTrackingProperties } from "~/renderer/screens/exchange/Swap2/utils"; // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore @@ -55,7 +55,7 @@ const Navbar = () => { return ( ); }; diff --git a/apps/ledger-live-desktop/src/renderer/screens/exchange/Swap2/Navbar/routes.json b/apps/ledger-live-desktop/src/renderer/screens/exchange/Swap2/Navbar/routes.json index fa45cf30dd74..c2a8c2e45528 100644 --- a/apps/ledger-live-desktop/src/renderer/screens/exchange/Swap2/Navbar/routes.json +++ b/apps/ledger-live-desktop/src/renderer/screens/exchange/Swap2/Navbar/routes.json @@ -2,7 +2,7 @@ { "path": "/swap", "title": "swap2.tabs.exchange", - "name": "Exchange", + "name": "Swap", "disabled": false }, { diff --git a/apps/ledger-live-desktop/static/i18n/en/app.json b/apps/ledger-live-desktop/static/i18n/en/app.json index 64b3417f32a0..dde519503fdb 100644 --- a/apps/ledger-live-desktop/static/i18n/en/app.json +++ b/apps/ledger-live-desktop/static/i18n/en/app.json @@ -303,7 +303,7 @@ "swap2": { "title": "Swap", "tabs": { - "exchange": "Exchange", + "exchange": "Swap", "history": "History" }, "form": {