From d0ea8c7dd615e9bcb83ec60c306f06bd7a82d638 Mon Sep 17 00:00:00 2001 From: Nicholas Barnett Date: Wed, 15 Jan 2025 12:52:12 -0600 Subject: [PATCH] feat: wp --- .../ContractCall/SelectedContractView.tsx | 16 ------- .../sandbox/components/TransactionsPanel.tsx | 9 ++-- src/app/sandbox/layout/SideNav.tsx | 4 +- src/app/token/[tokenId]/PageClient.tsx | 8 +++- src/common/components/icons/_base.tsx | 25 ----------- src/common/components/icons/arrow-left.tsx | 12 ----- src/common/components/icons/arrow-right.tsx | 12 ----- src/common/components/icons/chevron-down.tsx | 10 ----- src/common/components/icons/copy.tsx | 11 ----- src/common/components/icons/drop.tsx | 10 ----- src/common/components/icons/external-link.tsx | 12 ----- src/common/components/icons/filter.tsx | 10 ----- src/common/components/icons/info-circle.tsx | 12 ----- src/common/components/icons/info.tsx | 12 ----- .../components/icons/loader-quarter.tsx | 12 ----- src/common/components/icons/microblock.tsx | 9 ---- src/common/components/icons/tools.tsx | 15 ------- src/common/components/icons/transfer.tsx | 12 ----- src/common/components/status.tsx | 45 ------------------- 19 files changed, 12 insertions(+), 244 deletions(-) delete mode 100644 src/common/components/icons/_base.tsx delete mode 100644 src/common/components/icons/arrow-left.tsx delete mode 100644 src/common/components/icons/arrow-right.tsx delete mode 100644 src/common/components/icons/chevron-down.tsx delete mode 100644 src/common/components/icons/copy.tsx delete mode 100644 src/common/components/icons/drop.tsx delete mode 100644 src/common/components/icons/external-link.tsx delete mode 100644 src/common/components/icons/filter.tsx delete mode 100644 src/common/components/icons/info-circle.tsx delete mode 100644 src/common/components/icons/info.tsx delete mode 100644 src/common/components/icons/loader-quarter.tsx delete mode 100644 src/common/components/icons/microblock.tsx delete mode 100644 src/common/components/icons/tools.tsx delete mode 100644 src/common/components/icons/transfer.tsx diff --git a/src/app/sandbox/components/ContractCall/SelectedContractView.tsx b/src/app/sandbox/components/ContractCall/SelectedContractView.tsx index 69a18cb55..c2b34510d 100644 --- a/src/app/sandbox/components/ContractCall/SelectedContractView.tsx +++ b/src/app/sandbox/components/ContractCall/SelectedContractView.tsx @@ -8,7 +8,6 @@ import { ClarityAbiFunction } from '@stacks/transactions'; import { TxLink } from '../../../../common/components/ExplorerLinks'; import { Section } from '../../../../common/components/Section'; import { TxIcon } from '../../../../common/components/TxIcon'; -import { ArrowLeftIcon } from '../../../../common/components/icons/arrow-left'; import { useGlobalContext } from '../../../../common/context/useGlobalContext'; import { useAppSelector } from '../../../../common/state/hooks'; import { ContractWithParsedAbi } from '../../../../common/types/contract'; @@ -22,21 +21,6 @@ import { AvailableFunctionsView } from './AvailableFunctionsView'; import { FunctionView } from './FunctionView'; import { PluralizedCaption } from './PluralizedCaption'; -const BackLink: React.FC<{ href: string }> = ({ href }) => { - return ( - - - - - - - Back to search - - - - ); -}; - interface ContractInfoProps { contract: ContractWithParsedAbi; } diff --git a/src/app/sandbox/components/TransactionsPanel.tsx b/src/app/sandbox/components/TransactionsPanel.tsx index 4905c83ed..8a7b49738 100644 --- a/src/app/sandbox/components/TransactionsPanel.tsx +++ b/src/app/sandbox/components/TransactionsPanel.tsx @@ -1,7 +1,7 @@ 'use client'; import { AccordionItemContent, Box, Flex, HStack, Icon, Stack } from '@chakra-ui/react'; -import { CaretDown } from '@phosphor-icons/react'; +import { CaretDown, Info } from '@phosphor-icons/react'; import { useRouter } from 'next/navigation'; import React, { useMemo } from 'react'; @@ -10,7 +10,6 @@ import { Transaction } from '@stacks/stacks-blockchain-api-types'; import { Badge } from '../../../common/components/Badge'; import { ExplorerLink } from '../../../common/components/ExplorerLinks'; import { Section } from '../../../common/components/Section'; -import { InfoCircleIcon } from '../../../common/components/icons/info-circle'; import { useGlobalContext } from '../../../common/context/useGlobalContext'; import { useContractById } from '../../../common/queries/useContractById'; import { useAppDispatch } from '../../../common/state/hooks'; @@ -135,15 +134,15 @@ const TxDetailsFunctions = ({ return func.access !== 'private' ? ( {func.access === 'read_only' ? ( - + ) : ( diff --git a/src/app/sandbox/layout/SideNav.tsx b/src/app/sandbox/layout/SideNav.tsx index a5b8fb3c5..79ea7f3a4 100644 --- a/src/app/sandbox/layout/SideNav.tsx +++ b/src/app/sandbox/layout/SideNav.tsx @@ -1,8 +1,8 @@ import { Icon, Stack, StackProps } from '@chakra-ui/react'; +import { Drop } from '@phosphor-icons/react'; import { usePathname } from 'next/navigation'; import React from 'react'; -import { DropIcon } from '../../../common/components/icons/drop'; import { useGlobalContext } from '../../../common/context/useGlobalContext'; import { buildUrl } from '../../../common/utils/buildUrl'; import ClarityIcon from '../../../ui/icons/ClarityIcon'; @@ -54,7 +54,7 @@ export const SideNav: React.FC = () => { url={buildUrl(`/sandbox/faucet`, network)} icon={ - + } isSelected={pathname?.startsWith('/sandbox/faucet')} diff --git a/src/app/token/[tokenId]/PageClient.tsx b/src/app/token/[tokenId]/PageClient.tsx index a54344709..5f4cf5667 100644 --- a/src/app/token/[tokenId]/PageClient.tsx +++ b/src/app/token/[tokenId]/PageClient.tsx @@ -35,7 +35,9 @@ export default function PageClient({ return ( - + + + Warning:  @@ -51,7 +53,9 @@ export default function PageClient({ return ( - + + + Warning:  diff --git a/src/common/components/icons/_base.tsx b/src/common/components/icons/_base.tsx deleted file mode 100644 index d19898faa..000000000 --- a/src/common/components/icons/_base.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import { Icon, IconProps } from '@chakra-ui/react'; -import { forwardRef } from 'react'; - -export type SvgProps = React.FC; - -export const BaseSvg = forwardRef( - ( - { as = 'svg', ...rest }, - ref // TODO: upgrade to v3. this may be broken - ) => ( - - ) -); diff --git a/src/common/components/icons/arrow-left.tsx b/src/common/components/icons/arrow-left.tsx deleted file mode 100644 index 3770981c8..000000000 --- a/src/common/components/icons/arrow-left.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react'; - -import { BaseSvg, SvgProps } from './_base'; - -export const ArrowLeftIcon: SvgProps = props => ( - - - - - - -); diff --git a/src/common/components/icons/arrow-right.tsx b/src/common/components/icons/arrow-right.tsx deleted file mode 100644 index e239b571b..000000000 --- a/src/common/components/icons/arrow-right.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react'; - -import { BaseSvg, SvgProps } from './_base'; - -export const ArrowRightIcon: SvgProps = props => ( - - - - - - -); diff --git a/src/common/components/icons/chevron-down.tsx b/src/common/components/icons/chevron-down.tsx deleted file mode 100644 index 40956e380..000000000 --- a/src/common/components/icons/chevron-down.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import React from 'react'; - -import { BaseSvg, SvgProps } from './_base'; - -export const ChevronDown: SvgProps = props => ( - - - - -); diff --git a/src/common/components/icons/copy.tsx b/src/common/components/icons/copy.tsx deleted file mode 100644 index 957a0191c..000000000 --- a/src/common/components/icons/copy.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import React from 'react'; - -import { BaseSvg, SvgProps } from './_base'; - -export const CopyIcon: SvgProps = props => ( - - - - - -); diff --git a/src/common/components/icons/drop.tsx b/src/common/components/icons/drop.tsx deleted file mode 100644 index f20d00076..000000000 --- a/src/common/components/icons/drop.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import React from 'react'; - -import { BaseSvg, SvgProps } from './_base'; - -export const DropIcon: SvgProps = props => ( - - - - -); diff --git a/src/common/components/icons/external-link.tsx b/src/common/components/icons/external-link.tsx deleted file mode 100644 index d3c0293c4..000000000 --- a/src/common/components/icons/external-link.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react'; - -import { BaseSvg, SvgProps } from './_base'; - -export const ExternalLinkIcon: SvgProps = props => ( - - - - - - -); diff --git a/src/common/components/icons/filter.tsx b/src/common/components/icons/filter.tsx deleted file mode 100644 index 50576d9d5..000000000 --- a/src/common/components/icons/filter.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import React from 'react'; - -import { BaseSvg, SvgProps } from './_base'; - -export const FilterIcon: SvgProps = props => ( - - - - -); diff --git a/src/common/components/icons/info-circle.tsx b/src/common/components/icons/info-circle.tsx deleted file mode 100644 index d0acee6ad..000000000 --- a/src/common/components/icons/info-circle.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react'; - -import { BaseSvg, SvgProps } from './_base'; - -export const InfoCircleIcon: SvgProps = props => ( - - - - - - -); diff --git a/src/common/components/icons/info.tsx b/src/common/components/icons/info.tsx deleted file mode 100644 index 32294b8be..000000000 --- a/src/common/components/icons/info.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react'; - -import { BaseSvg, SvgProps } from './_base'; - -export const InfoIcon: SvgProps = props => ( - - - - - - -); diff --git a/src/common/components/icons/loader-quarter.tsx b/src/common/components/icons/loader-quarter.tsx deleted file mode 100644 index 9d56dbb8f..000000000 --- a/src/common/components/icons/loader-quarter.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react'; - -import { BaseSvg, SvgProps } from './_base'; - -export const LoaderQuarter: SvgProps = props => ( - - - - - - -); diff --git a/src/common/components/icons/microblock.tsx b/src/common/components/icons/microblock.tsx deleted file mode 100644 index cca327e81..000000000 --- a/src/common/components/icons/microblock.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import { Box, BoxProps } from '@chakra-ui/react'; -import { Lightning } from '@phosphor-icons/react'; -import React from 'react'; - -export const MicroblockIcon: React.FC = props => ( - - - -); diff --git a/src/common/components/icons/tools.tsx b/src/common/components/icons/tools.tsx deleted file mode 100644 index 69cfcc51a..000000000 --- a/src/common/components/icons/tools.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import React from 'react'; - -import { BaseSvg, SvgProps } from './_base'; - -export const ToolsIcon: SvgProps = props => ( - - - - - - - - - -); diff --git a/src/common/components/icons/transfer.tsx b/src/common/components/icons/transfer.tsx deleted file mode 100644 index b46f02cc0..000000000 --- a/src/common/components/icons/transfer.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react'; - -import { BaseSvg, SvgProps } from './_base'; - -export const TransferIcon: SvgProps = props => ( - - - - - - -); diff --git a/src/common/components/status.tsx b/src/common/components/status.tsx index c357e22f0..a38318193 100644 --- a/src/common/components/status.tsx +++ b/src/common/components/status.tsx @@ -1,40 +1,8 @@ 'use client'; -import { FlexProps, Icon, Spinner } from '@chakra-ui/react'; -import { Check, WarningCircle } from '@phosphor-icons/react'; -import * as React from 'react'; import { ReactNode } from 'react'; -import { TxStatus } from '../types/tx'; import { Badge, BadgeProps } from './Badge'; -import { LoaderQuarter } from './icons/loader-quarter'; -import { MicroblockIcon } from './icons/microblock'; - -export const Pending = ({ speed = 0.9, ...p }: any) => ; - -const labelMap = { - pending: 'In mempool', - success: 'Confirmed', - success_anchor_block: 'Confirmed in anchor block', - success_microblock: 'Included in microblock', - non_canonical: 'Non-canonical (orphaned)', - failed: 'Failed', - dropped: 'Dropped', -}; - -const iconMap = { - pending: , - success: , - success_anchor_block: , - success_microblock: , - non_canonical: , - failed: , - dropped: , -}; - -interface StatusProps extends FlexProps { - status: TxStatus; -} export function StyledBadge({ children, ...rest }: { children: ReactNode } & BadgeProps) { return ( @@ -51,16 +19,3 @@ export function StyledBadge({ children, ...rest }: { children: ReactNode } & Bad ); } - -export const TxStatusLabel: React.FC = ({ status, ...rest }) => { - const IconComponent = iconMap[status]; - const label = labelMap[status]; - return ( - - - {IconComponent} - - {label} - - ); -};