diff --git a/src/components/buttons/BackButton.tsx b/src/components/buttons/BackButton.tsx index 329d1b1..1fd948d 100644 --- a/src/components/buttons/BackButton.tsx +++ b/src/components/buttons/BackButton.tsx @@ -9,7 +9,7 @@ export function BackButton({ page, ...rest }: ComponentProps & { return ( ); diff --git a/src/consts/app.ts b/src/consts/app.ts index 13a9ec7..d0a4512 100644 --- a/src/consts/app.ts +++ b/src/consts/app.ts @@ -11,6 +11,6 @@ export const APP_NAME = 'Hyperlane Deploy'; export const APP_DESCRIPTION = 'A DApp to deploy Hyperlane contracts and applications, such as Warp Routes.'; export const APP_URL = 'TODO'; -export const BRAND_COLOR = Color.primary; -export const BACKGROUND_COLOR = Color.primary; +export const BRAND_COLOR = Color.primary['500']; +export const BACKGROUND_COLOR = Color.primary['500']; export const BACKGROUND_IMAGE = 'url(/backgrounds/main.svg)'; diff --git a/src/features/chains/ChainSelectField.tsx b/src/features/chains/ChainSelectField.tsx index 760847c..b4782d0 100644 --- a/src/features/chains/ChainSelectField.tsx +++ b/src/features/chains/ChainSelectField.tsx @@ -15,18 +15,18 @@ export function ChainSelectField({ value, onChange }: Props) { const { isOpen, close, open } = useModal(); return ( -
- +
+
- +
- + {displayName}
- +
diff --git a/src/features/deployment/warp/TokenTypeSelectField.tsx b/src/features/deployment/warp/TokenTypeSelectField.tsx index 02a9b11..166a2b5 100644 --- a/src/features/deployment/warp/TokenTypeSelectField.tsx +++ b/src/features/deployment/warp/TokenTypeSelectField.tsx @@ -1,24 +1,88 @@ import { TokenType } from '@hyperlane-xyz/sdk'; -import { toTitleCase } from '@hyperlane-xyz/utils'; -import { Button, Modal, useModal } from '@hyperlane-xyz/widgets'; +import { Button, ChevronIcon, Modal, useModal } from '@hyperlane-xyz/widgets'; import { FormButton } from '../../../components/buttons/FormButton'; -const TokenTypes = Object.values(TokenType); +const TokenTypes = Object.values(TokenType).sort(); +const TokenTypeDescriptions: Record = { + [TokenType.collateral]: { + label: 'Collateral', + description: 'A lock-and-mint wrapper for ERC20 tokens.', + }, + [TokenType.collateralFiat]: { + label: 'Collateral Fiat', + description: 'A lock-and-mint wrapper for the FiatToken standard by Circle.', + }, + [TokenType.collateralUri]: { + label: 'Collateral NFT', + description: 'A lock-and-mint wrapper for ERC721 tokens.', + }, + [TokenType.collateralVault]: { + label: 'Collateral Vault', + description: + 'A lock-and-mint wrapper for ERC4626 vaults. Yields are manually claimed by owner.', + }, + [TokenType.collateralVaultRebase]: { + label: 'Collateral Rebased Vault', + description: 'A lock-and-mint wrapper for ERC4626 vaults. Rebases yields to token holders.', + }, + [TokenType.fastCollateral]: { + label: 'Fast Collateral', + description: 'A collateralized wrapper but with support for LP-provided faster transfers.', + }, + [TokenType.fastSynthetic]: { + label: 'Fast Synthetic', + description: 'A synthetic HypErc20 token to pair with a Fast Collateral token.', + }, + [TokenType.native]: { + label: 'Native', + description: 'A lock-and-mint wrapper for native currencies such as Ether (ETH).', + }, + [TokenType.nativeScaled]: { + label: 'Fast Collateral', + description: 'A native type but with support for token decimal scaling.', + }, + [TokenType.synthetic]: { + label: 'Synthetic', + description: 'A synthetic HypErc20 token to pair with any collateralized type.', + }, + [TokenType.syntheticRebase]: { + label: 'Synthetic Rebased', + description: 'A synthetic HypErc20 token to pair with a Collateral Rebased Vault.', + }, + [TokenType.syntheticUri]: { + label: 'Synthetic NFT', + description: 'A synthetic HypErc721 token to pair with a Collateral NFT.', + }, + [TokenType.XERC20]: { + label: 'xERC20', + description: 'A lock-and-mint wrapper for xERC20 tokens.', + }, + [TokenType.XERC20Lockbox]: { + label: 'xERC20 Lockbox', + description: 'A lock-and-mint wrapper for xERC20 Lockbox tokens.', + }, +}; export function TokenTypeSelectField({ value, + onChange, }: { value: TokenType; onChange: (t: TokenType) => void; }) { const { isOpen, close, open } = useModal(); + const onClick = (t: TokenType) => { + onChange(t); + close(); + }; + return ( -
+
- + {TokenTypes.map((t, i) => ( - + ))}
@@ -27,23 +91,24 @@ export function TokenTypeSelectField({ function TokenTypeButton({ value, onClick }: { value: TokenType; onClick: () => void }) { return ( - - -
{toTitleCase(value)}
+ +
+ + {TokenTypeDescriptions[value].label} +
+
); } -function TokenTypeOption({ type, close }: { type: TokenType; close: () => void }) { - const onClick = () => { - close(); - }; - +function TokenTypeOption({ type, onClick }: { type: TokenType; onClick: (t: TokenType) => void }) { return ( - ); } diff --git a/src/features/deployment/warp/WarpDeploymentForm.tsx b/src/features/deployment/warp/WarpDeploymentForm.tsx index a6fe7b7..bc47e1d 100644 --- a/src/features/deployment/warp/WarpDeploymentForm.tsx +++ b/src/features/deployment/warp/WarpDeploymentForm.tsx @@ -1,7 +1,7 @@ import { arbitrum, ethereum } from '@hyperlane-xyz/registry'; import { TokenType } from '@hyperlane-xyz/sdk'; -import { ProtocolType, errorToString } from '@hyperlane-xyz/utils'; -import { AccountInfo, useAccounts } from '@hyperlane-xyz/widgets'; +import { errorToString, ProtocolType } from '@hyperlane-xyz/utils'; +import { AccountInfo, IconButton, useAccounts, XIcon } from '@hyperlane-xyz/widgets'; import { Form, Formik, useFormikContext } from 'formik'; import { BackButton } from '../../../components/buttons/BackButton'; import { ConnectAwareSubmitButton } from '../../../components/buttons/ConnectAwareSubmitButton'; @@ -9,6 +9,7 @@ import { H1 } from '../../../components/text/H1'; import { config } from '../../../consts/config'; import { CardPage } from '../../../flows/CardPage'; import { Stepper } from '../../../flows/Stepper'; +import { Color } from '../../../styles/Color'; import { logger } from '../../../utils/logger'; import { ChainConnectionWarning } from '../../chains/ChainConnectionWarning'; import { ChainSelectField } from '../../chains/ChainSelectField'; @@ -77,7 +78,7 @@ function ConfigListSection() { const { values } = useFormikContext(); return ( -
+
{values.configs.map((config, index) => ( ))} @@ -95,20 +96,37 @@ function ChainTokenConfig({ config, index }: { config: WarpDeploymentConfigEntry setValues({ configs: allConfigs }); }; + const isRemoveDisabled = values.configs.length <= 2; + + const onRemove = () => { + if (isRemoveDisabled) return; + const allConfigs = [...values.configs]; + allConfigs.splice(index, 1); + setValues({ configs: allConfigs }); + }; + return ( -
- { - onChange({ chainName: v }); - }} - /> - { - onChange({ tokenType: v }); - }} - /> +
+
+

{`Chain ${index + 1}`}

+ + + +
+
+ { + onChange({ chainName: v }); + }} + /> + { + onChange({ tokenType: v }); + }} + /> +
); } diff --git a/src/features/wallet/WalletFloatingButtons.tsx b/src/features/wallet/WalletFloatingButtons.tsx index 7345c06..da7ab85 100644 --- a/src/features/wallet/WalletFloatingButtons.tsx +++ b/src/features/wallet/WalletFloatingButtons.tsx @@ -18,14 +18,14 @@ export function WalletFloatingButtons() { title="History" onClick={() => setIsSideBarOpen(!isSideBarOpen)} > - + - +
); diff --git a/src/features/wallet/context/EvmWalletContext.tsx b/src/features/wallet/context/EvmWalletContext.tsx index d9fe2c6..c56035b 100644 --- a/src/features/wallet/context/EvmWalletContext.tsx +++ b/src/features/wallet/context/EvmWalletContext.tsx @@ -59,7 +59,7 @@ export function EvmWalletContext({ children }: PropsWithChildren) { ; export const Color = { black: themeColors.black, white: themeColors.white, - gray: themeColors.gray[500], - lightGray: themeColors.gray[200], - primary: themeColors.primary[500], - accent: themeColors.accent[500], - red: themeColors.red[500], + gray: themeColors.gray, + primary: themeColors.primary, + accent: themeColors.accent, + red: themeColors.red, } as const; diff --git a/tailwind.config.js b/tailwind.config.js index 66adf09..17ea7ef 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,6 +1,7 @@ /** @type {import('tailwindcss').Config} */ const defaultTheme = require('tailwindcss/defaultTheme'); +const defaultColors = require('tailwindcss/colors'); module.exports = { content: ['./src/**/*.{js,ts,jsx,tsx}'], @@ -19,7 +20,7 @@ module.exports = { colors: { black: '#010101', white: '#ffffff', - gray: { ...defaultTheme.colors.gray, 150: '#EBEDF0', 250: '#404040', 350: '#6B6B6B' }, + gray: { ...defaultColors.gray, '150': '#EBEDF0', '250': '#404040', '350': '#6B6B6B' }, primary: { 50: '#E6EDF9', 100: '#CDDCF4',