From 0371d9402e06c758cd9701d7150f5d3a75c82651 Mon Sep 17 00:00:00 2001 From: evavirseda Date: Wed, 21 Aug 2024 16:03:12 +0200 Subject: [PATCH] feat(wallet): rebrand staking amount screen (#1881) * feat: update view and remove debris * fix build * feat: show - instead of ~0 * feat: update ui components * feat: rebrand staking flow: amount screen * fix type * feat: update selected style * feat: improvements --- .../atoms/key-value-info/KeyValueInfo.tsx | 18 +- .../src/lib/components/atoms/panel/Panel.tsx | 2 +- .../lib/components/atoms/tooltip/Tooltip.tsx | 2 +- .../lib/components/molecules/input/Input.tsx | 9 +- .../molecules/input/InputWrapper.tsx | 2 +- .../stories/atoms/KeyValueInfo.stories.tsx | 13 +- .../src/ui/app/staking/stake/StakeForm.tsx | 159 ++++++++---------- .../src/ui/app/staking/stake/StakingCard.tsx | 96 +++++------ .../app/staking/stake/ValidatorFormDetail.tsx | 116 +++++-------- 9 files changed, 181 insertions(+), 236 deletions(-) diff --git a/apps/ui-kit/src/lib/components/atoms/key-value-info/KeyValueInfo.tsx b/apps/ui-kit/src/lib/components/atoms/key-value-info/KeyValueInfo.tsx index 972a53873bc..995a229b789 100644 --- a/apps/ui-kit/src/lib/components/atoms/key-value-info/KeyValueInfo.tsx +++ b/apps/ui-kit/src/lib/components/atoms/key-value-info/KeyValueInfo.tsx @@ -5,6 +5,7 @@ import React from 'react'; import cx from 'classnames'; import { Info } from '@iota/ui-icons'; import { ValueSize } from './keyValue.enums'; +import { Tooltip, TooltipPosition } from '../tooltip'; interface KeyValueProps { /** @@ -20,9 +21,13 @@ interface KeyValueProps { */ valueLink?: string; /** - * Show info icon (optional). + * The tooltip position. */ - showInfoIcon?: boolean; + tooltipPosition?: TooltipPosition; + /** + * The tooltip text. + */ + tooltipText?: string; /** * The supporting label of the KeyValue (optional). */ @@ -36,7 +41,8 @@ interface KeyValueProps { export function KeyValueInfo({ keyText, valueText, - showInfoIcon, + tooltipPosition, + tooltipText, supportingLabel, valueLink, size = ValueSize.Small, @@ -45,7 +51,11 @@ export function KeyValueInfo({
{keyText} - {showInfoIcon && } + {tooltipText && ( + + + + )}
{valueLink ? ( diff --git a/apps/ui-kit/src/lib/components/atoms/panel/Panel.tsx b/apps/ui-kit/src/lib/components/atoms/panel/Panel.tsx index 901b12e3b1d..54cd58451d2 100644 --- a/apps/ui-kit/src/lib/components/atoms/panel/Panel.tsx +++ b/apps/ui-kit/src/lib/components/atoms/panel/Panel.tsx @@ -21,7 +21,7 @@ export function Panel({ return (
diff --git a/apps/ui-kit/src/lib/components/atoms/tooltip/Tooltip.tsx b/apps/ui-kit/src/lib/components/atoms/tooltip/Tooltip.tsx index c1ab174d0e8..db0e6d878ed 100644 --- a/apps/ui-kit/src/lib/components/atoms/tooltip/Tooltip.tsx +++ b/apps/ui-kit/src/lib/components/atoms/tooltip/Tooltip.tsx @@ -22,7 +22,7 @@ export function Tooltip({ {children}