From 70850536daf028ff8d2ea608dba634c6f7bcbcc4 Mon Sep 17 00:00:00 2001 From: Gabe Rodriguez Date: Mon, 26 Feb 2024 14:00:57 +0100 Subject: [PATCH] Show tooltip icon no matter the toggle state (#573) * Show tooltip icon no matter the toggle state * Fixing various css bugs with cards --- .../src/components/dashboard/layout.tsx | 4 +-- apps/webapp/src/components/send/layout.tsx | 11 ++++--- apps/webapp/src/components/swap/layout.tsx | 15 ++++------ .../src/components/swap/swap-loader.tsx | 2 +- .../src/components/swap/unclaimed-swaps.tsx | 17 +++++++---- apps/webapp/src/state/swap.ts | 2 +- packages/ui/components/ui/select-account.tsx | 30 +++++++++---------- 7 files changed, 40 insertions(+), 41 deletions(-) diff --git a/apps/webapp/src/components/dashboard/layout.tsx b/apps/webapp/src/components/dashboard/layout.tsx index 1e854a4026..5a48c894e0 100644 --- a/apps/webapp/src/components/dashboard/layout.tsx +++ b/apps/webapp/src/components/dashboard/layout.tsx @@ -13,9 +13,9 @@ export const DashboardLayout = () => {
- + { return (
- - + + { return (
-
- -
- + + - +
+ +
); }; diff --git a/apps/webapp/src/components/swap/swap-loader.tsx b/apps/webapp/src/components/swap/swap-loader.tsx index d7fc99977e..5594aab2ae 100644 --- a/apps/webapp/src/components/swap/swap-loader.tsx +++ b/apps/webapp/src/components/swap/swap-loader.tsx @@ -9,7 +9,7 @@ import { viewClient } from '../../clients/grpc'; import { getSwapAsset1, getSwapAsset2, uint8ArrayToBase64 } from '@penumbra-zone/types'; import { localAssets } from '@penumbra-zone/constants'; -interface UnclaimedSwapsWithMetadata { +export interface UnclaimedSwapsWithMetadata { swap: SwapRecord; asset1: Metadata; asset2: Metadata; diff --git a/apps/webapp/src/components/swap/unclaimed-swaps.tsx b/apps/webapp/src/components/swap/unclaimed-swaps.tsx index db8c126080..21eebc47ee 100644 --- a/apps/webapp/src/components/swap/unclaimed-swaps.tsx +++ b/apps/webapp/src/components/swap/unclaimed-swaps.tsx @@ -1,20 +1,27 @@ import { Button, Card } from '@penumbra-zone/ui'; import { useLoaderData, useRevalidator } from 'react-router-dom'; -import { SwapLoaderResponse } from './swap-loader'; +import { SwapLoaderResponse, UnclaimedSwapsWithMetadata } from './swap-loader'; import { AssetIcon } from '@penumbra-zone/ui/components/ui/tx/view/asset-icon'; import { getSwapRecordCommitment, uint8ArrayToBase64 } from '@penumbra-zone/types'; import { useStore } from '../../state'; import { unclaimedSwapsSelector } from '../../state/unclaimed-swaps'; export const UnclaimedSwaps = () => { + const { unclaimedSwaps } = useLoaderData() as SwapLoaderResponse; + + return !unclaimedSwaps.length ? ( +
+ ) : ( + <_UnclaimedSwaps unclaimedSwaps={unclaimedSwaps}> + ); +}; + +const _UnclaimedSwaps = ({ unclaimedSwaps }: { unclaimedSwaps: UnclaimedSwapsWithMetadata[] }) => { const { revalidate } = useRevalidator(); const { claimSwap, isInProgress } = useStore(unclaimedSwapsSelector); - const { unclaimedSwaps } = useLoaderData() as SwapLoaderResponse; - if (!unclaimedSwaps.length) return <>; - return ( - +

Unclaimed Swaps

diff --git a/apps/webapp/src/state/swap.ts b/apps/webapp/src/state/swap.ts index cfa6f6114c..be30f17acf 100644 --- a/apps/webapp/src/state/swap.ts +++ b/apps/webapp/src/state/swap.ts @@ -26,7 +26,7 @@ import { BigNumber } from 'bignumber.js'; import { getAddressByIndex } from '../fetchers/address'; import { StateCommitment } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/crypto/tct/v1/tct_pb'; import { simulateSwapOutput } from '../fetchers/simulate'; -import { TransactionToast, errorToast } from '@penumbra-zone/ui'; +import { errorToast, TransactionToast } from '@penumbra-zone/ui'; import { Transaction } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/transaction/v1/transaction_pb'; export interface SwapSlice { diff --git a/packages/ui/components/ui/select-account.tsx b/packages/ui/components/ui/select-account.tsx index c26e6d8dba..ba2a49c27d 100644 --- a/packages/ui/components/ui/select-account.tsx +++ b/packages/ui/components/ui/select-account.tsx @@ -115,22 +115,20 @@ export const SelectAccount = ({ getAddrByIndex }: SelectAccountProps) => {

IBC Deposit Address

- {ephemeral && ( - - - - - - -

- IBC transfers into Penumbra post the destination address in public on the - source chain. Use this randomized IBC deposit address to preserve privacy - when transferring funds into Penumbra. -

-
-
-
- )} + + + + + + +

+ IBC transfers into Penumbra post the destination address in public on the + source chain. Use this randomized IBC deposit address to preserve privacy when + transferring funds into Penumbra. +

+
+
+