From 939f47bcdedb697024f3dc52b8dd1259039bfc23 Mon Sep 17 00:00:00 2001 From: Usame Algan Date: Fri, 31 May 2024 10:52:28 +0200 Subject: [PATCH] fix: optimize widget for mobile, adjust badges and chips style --- src/components/common/Chip/index.tsx | 2 +- src/components/sidebar/SidebarList/index.tsx | 26 +++++++++++++++++-- .../sidebar/SidebarNavigation/config.tsx | 2 +- .../swap/components/SwapWidget/index.tsx | 8 +++--- .../components/SwapWidget/styles.module.css | 26 +++++++++++++++---- 5 files changed, 51 insertions(+), 13 deletions(-) diff --git a/src/components/common/Chip/index.tsx b/src/components/common/Chip/index.tsx index ea616c405b..81bb623685 100644 --- a/src/components/common/Chip/index.tsx +++ b/src/components/common/Chip/index.tsx @@ -4,5 +4,5 @@ import type { ReactElement } from 'react' import React from 'react' export function Chip(props: ChipProps): ReactElement { - return + return } diff --git a/src/components/sidebar/SidebarList/index.tsx b/src/components/sidebar/SidebarList/index.tsx index eba0ae05f1..fb6d63b8e3 100644 --- a/src/components/sidebar/SidebarList/index.tsx +++ b/src/components/sidebar/SidebarList/index.tsx @@ -64,10 +64,32 @@ export const SidebarListItemText = ({ bold = false, ...rest }: ListItemTextProps & { bold?: boolean }): ReactElement => ( - + {children} ) export const SidebarListItemCounter = ({ count }: { count?: string }): ReactElement | null => - count ? : null + count ? ( + + ) : null diff --git a/src/components/sidebar/SidebarNavigation/config.tsx b/src/components/sidebar/SidebarNavigation/config.tsx index 1236cd1177..3829c7d4f3 100644 --- a/src/components/sidebar/SidebarNavigation/config.tsx +++ b/src/components/sidebar/SidebarNavigation/config.tsx @@ -33,7 +33,7 @@ export const navItems: NavItem[] = [ label: 'Swap', icon: , href: AppRoutes.swap, - tag: , + tag: , }, { label: 'Transactions', diff --git a/src/features/swap/components/SwapWidget/index.tsx b/src/features/swap/components/SwapWidget/index.tsx index 37dccdfb2e..26fda6272d 100644 --- a/src/features/swap/components/SwapWidget/index.tsx +++ b/src/features/swap/components/SwapWidget/index.tsx @@ -44,7 +44,7 @@ function SwapWidget(): ReactElement | null { Introducing native swaps - + @@ -59,13 +59,13 @@ function SwapWidget(): ReactElement | null { passHref legacyBehavior > - - diff --git a/src/features/swap/components/SwapWidget/styles.module.css b/src/features/swap/components/SwapWidget/styles.module.css index 578266f31a..484637f100 100644 --- a/src/features/swap/components/SwapWidget/styles.module.css +++ b/src/features/swap/components/SwapWidget/styles.module.css @@ -4,13 +4,12 @@ } .card { - height: inherit; + border: none; } .grid { display: flex; - align-items: center; height: inherit; gap: var(--space-3); } @@ -25,11 +24,12 @@ .title { font-weight: 700; display: inline; + margin-right: var(--space-1); } .imageContainer { - display: flex; - align-items: center; + display: flex; + align-items: flex-end; } .buttonContainer { @@ -37,5 +37,21 @@ flex-direction: row; justify-content: flex-start; align-items: flex-start; - gap: var(--space-3); + gap: var(--space-2); +} + +@media (max-width: 599.95px) { + .imageContainer { + width: 100%; + justify-content: flex-end; + } + + .buttonContainer { + gap: 0; + justify-content: space-between; + } + + .wrapper { + padding: var(--space-3); + } }