From fd6801795ecce792a3b2314cd87c62d3d44e1b3e Mon Sep 17 00:00:00 2001 From: mulan xia Date: Tue, 18 Jun 2024 13:28:53 -0400 Subject: [PATCH 01/12] wip --- package.json | 2 +- pnpm-lock.yaml | 8 +- src/components/Details.tsx | 4 +- src/components/DropdownIcon.tsx | 36 +++ src/components/FormMaxInputToggleButton.tsx | 4 +- src/components/Popover.tsx | 3 + src/components/Table.tsx | 31 ++- src/components/ValidatorDropdown.tsx | 257 ++++++++++++++++++ src/components/ValidatorName.tsx | 93 ------- src/constants/validators.ts | 9 + src/hooks/useStakingValidator.ts | 3 + src/lib/testFlags.ts | 3 +- src/pages/token/rewards/UnbondingPanels.tsx | 2 +- src/views/MarketsDropdown.tsx | 2 +- src/views/StakeRewardButtonAndReceipt.tsx | 2 + src/views/dialogs/StakeDialog.tsx | 1 + src/views/dialogs/UnstakeDialog.tsx | 14 +- .../forms/StakeForm/StakeButtonAndReceipt.tsx | 32 ++- src/views/forms/StakeForm/index.tsx | 19 +- src/views/forms/UnstakeForm/index.tsx | 11 +- 20 files changed, 394 insertions(+), 142 deletions(-) create mode 100644 src/components/DropdownIcon.tsx create mode 100644 src/components/ValidatorDropdown.tsx delete mode 100644 src/components/ValidatorName.tsx create mode 100644 src/constants/validators.ts diff --git a/package.json b/package.json index 0b43b5fe8..5ab9134a1 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "@cosmjs/tendermint-rpc": "^0.32.1", "@dydxprotocol/v4-abacus": "1.7.83", "@dydxprotocol/v4-client-js": "^1.1.20", - "@dydxprotocol/v4-localization": "^1.1.127", + "@dydxprotocol/v4-localization": "^1.1.128", "@ethersproject/providers": "^5.7.2", "@js-joda/core": "^5.5.3", "@privy-io/react-auth": "^1.69.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 852e0c37a..fe98d3f3d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -36,8 +36,8 @@ dependencies: specifier: ^1.1.20 version: 1.1.22 '@dydxprotocol/v4-localization': - specifier: ^1.1.127 - version: 1.1.127 + specifier: ^1.1.128 + version: 1.1.128 '@ethersproject/providers': specifier: ^5.7.2 version: 5.7.2 @@ -1423,8 +1423,8 @@ packages: - utf-8-validate dev: false - /@dydxprotocol/v4-localization@1.1.127: - resolution: {integrity: sha512-6aN+pRLrOqbhZFHGcmfhBxC/S8mui/0zl2jt61Z8lP4BF8P9jLr7W0EF9UTCVydHJVUbjxJui8c1ApWtOBDZtQ==} + /@dydxprotocol/v4-localization@1.1.128: + resolution: {integrity: sha512-jVGDTQUXWkx325Pd0Kca2z7vLZy61Q0gG7oQuNdJ6TB15zMRU74XMQvDZgJvCeM2WmiIqdyR5HnRJwL/gdnzQA==} dev: false /@dydxprotocol/v4-proto@5.0.0-dev.0: diff --git a/src/components/Details.tsx b/src/components/Details.tsx index 52b3fcf71..0a65ff76d 100644 --- a/src/components/Details.tsx +++ b/src/components/Details.tsx @@ -153,8 +153,6 @@ const detailsLayoutVariants = { const itemLayoutVariants = { column: css` - isolation: isolate; - ${layoutMixins.scrollArea} ${layoutMixins.stickyArea0} @@ -264,7 +262,7 @@ const $Item = styled.div<{ /* > label { */ /* > dt { */ - > :first-child { + > :first-child {x color: var(--color-text-0); // Tooltip Icon centering when display: inline diff --git a/src/components/DropdownIcon.tsx b/src/components/DropdownIcon.tsx new file mode 100644 index 000000000..12540c84a --- /dev/null +++ b/src/components/DropdownIcon.tsx @@ -0,0 +1,36 @@ +import styled, { css } from 'styled-components'; + +import { Icon, IconName } from '@/components/Icon'; + +type ElementProps = { + iconName: IconName; + isOpen?: boolean; +}; + +type StyleProps = { + className?: string; +}; + +export const DropdownIcon = ({ + iconName = IconName.Triangle, + isOpen, + className, +}: ElementProps & StyleProps) => { + return ( + <$DropdownIcon aria-hidden="true" isOpen={isOpen} className={className}> +