From 70e9a10bc32681a86d5559dbba3de08c346a676a Mon Sep 17 00:00:00 2001 From: sebastianPiekarczyk Date: Thu, 24 Oct 2024 10:33:46 +0200 Subject: [PATCH] rebalance activity comp update --- .../StrategiesListView/StrategiesListView.tsx | 5 ++-- ...PortfolioRebalanceActivityList.module.scss | 9 ++++++- .../PortfolioRebalanceActivityList.tsx | 27 +++++++++++++++---- packages/app-icons/src/icons/withdraw.svg | 2 +- 4 files changed, 34 insertions(+), 9 deletions(-) diff --git a/apps/earn-protocol/components/layout/StrategiesListView/StrategiesListView.tsx b/apps/earn-protocol/components/layout/StrategiesListView/StrategiesListView.tsx index 9b7c58c45..13c8b29b6 100644 --- a/apps/earn-protocol/components/layout/StrategiesListView/StrategiesListView.tsx +++ b/apps/earn-protocol/components/layout/StrategiesListView/StrategiesListView.tsx @@ -9,6 +9,7 @@ import { StrategySimulationForm, } from '@summerfi/app-earn-ui' import { type DropdownRawOption, type IconNamesList, type NetworkNames } from '@summerfi/app-types' +import { capitalize } from 'lodash-es' import { strategiesList } from '@/constants/dev-strategies-list' import { networkIconByNetworkName } from '@/constants/networkIcons' @@ -50,7 +51,7 @@ export const StrategiesListView = ({ selectedNetwork }: StrategiesListViewProps) localStrategyNetwork !== 'all-networks' ? networkIconByNetworkName[localStrategyNetwork] : 'network_ethereum', - label: localStrategyNetwork, + label: capitalize(localStrategyNetwork), value: localStrategyNetwork, } : allNetworksOption, @@ -60,7 +61,7 @@ export const StrategiesListView = ({ selectedNetwork }: StrategiesListViewProps) () => [ ...[...new Set(strategiesList.map(({ network }) => network))].map((network) => ({ iconName: networkIconByNetworkName[network], - label: network, + label: capitalize(network), value: network, })), allNetworksOption, diff --git a/apps/earn-protocol/features/portfolio/components/PortfolioRebalanceActivityList/PortfolioRebalanceActivityList.module.scss b/apps/earn-protocol/features/portfolio/components/PortfolioRebalanceActivityList/PortfolioRebalanceActivityList.module.scss index a90a7e1c8..880760636 100644 --- a/apps/earn-protocol/features/portfolio/components/PortfolioRebalanceActivityList/PortfolioRebalanceActivityList.module.scss +++ b/apps/earn-protocol/features/portfolio/components/PortfolioRebalanceActivityList/PortfolioRebalanceActivityList.module.scss @@ -17,13 +17,19 @@ display: flex; justify-content: space-between; align-items: center; - padding: 22px 0 12px 0; + padding: var(--general-space-16) 0; border-bottom: 1px solid var(--earn-protocol-neutral-70); cursor: pointer; &:first-child { padding-top: var(--general-space-8); } + + &:hover { + .leftContent { + color: var(--earn-protocol-secondary-100); + } + } } .leftContentWrapper { @@ -36,6 +42,7 @@ display: flex; flex-direction: column; gap: var(--general-space-4); + color: var(--earn-protocol-secondary-40); &Description { display: flex; diff --git a/apps/earn-protocol/features/portfolio/components/PortfolioRebalanceActivityList/PortfolioRebalanceActivityList.tsx b/apps/earn-protocol/features/portfolio/components/PortfolioRebalanceActivityList/PortfolioRebalanceActivityList.tsx index 67d6b8ad6..149af67e4 100644 --- a/apps/earn-protocol/features/portfolio/components/PortfolioRebalanceActivityList/PortfolioRebalanceActivityList.tsx +++ b/apps/earn-protocol/features/portfolio/components/PortfolioRebalanceActivityList/PortfolioRebalanceActivityList.tsx @@ -1,4 +1,5 @@ -import { Card, Icon, Text } from '@summerfi/app-earn-ui' +import { useState } from 'react' +import { Icon, Text } from '@summerfi/app-earn-ui' import { type IconNamesList, type TokenSymbolsList } from '@summerfi/app-types' import { formatDecimalAsPercent, timeAgo } from '@summerfi/app-utils' import BigNumber from 'bignumber.js' @@ -65,14 +66,30 @@ const dummyList: { ] export const PortfolioRebalanceActivityList = () => { + // timestamp should be unique, so can be used as id + const [hoveredItemTimestamp, setHoveredItemTimestamp] = useState() + return ( - +
{dummyList.map((item) => ( - + setHoveredItemTimestamp(item.timestamp)} + onMouseLeave={() => setHoveredItemTimestamp(undefined)} + >
- +
@@ -96,6 +113,6 @@ export const PortfolioRebalanceActivityList = () => {
))} - +
) } diff --git a/packages/app-icons/src/icons/withdraw.svg b/packages/app-icons/src/icons/withdraw.svg index 79d7ccf01..ed72e30ce 100644 --- a/packages/app-icons/src/icons/withdraw.svg +++ b/packages/app-icons/src/icons/withdraw.svg @@ -1,3 +1,3 @@ - +