Skip to content

Commit

Permalink
feat: linted and updated snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
BLuEScioN committed Jan 3, 2025
1 parent 87445b4 commit c34054f
Show file tree
Hide file tree
Showing 53 changed files with 306 additions and 322 deletions.
2 changes: 1 addition & 1 deletion src/app/_components/BlockList/BlockCount.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Icon, Text } from '@chakra-ui/react';
import { CaretDown } from '@phosphor-icons/react';
import pluralize from 'pluralize';
import { memo } from 'react';

import { Button } from '../../../ui/Button';
import { Icon, Text} from '@chakra-ui/react';

export const BlockCount = memo(function ({
count,
Expand Down
2 changes: 1 addition & 1 deletion src/app/_components/BlockList/BlockListItem.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Flex, FlexProps } from '@chakra-ui/react';
import pluralize from 'pluralize';
import React from 'react';

Expand All @@ -6,7 +7,6 @@ import { Block } from '@stacks/stacks-blockchain-api-types';
import { BtcStxBlockLinks } from '../../../common/components/BtcStxBlockLinks';
import { TwoColsListItem } from '../../../common/components/TwoColumnsListItem';
import { addSepBetweenStrings, toRelativeTime, truncateMiddle } from '../../../common/utils/utils';
import { Flex, FlexProps } from '@chakra-ui/react';
import { Caption } from '../../../ui/typography';

export const BlockListItem: React.FC<{ block: Block } & FlexProps> = React.memo(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
'use client';

import { Box, Flex } from '@chakra-ui/react';
import { Suspense, useMemo } from 'react';

import { ListFooter } from '../../../../common/components/ListFooter';
import { Section } from '../../../../common/components/Section';
import { Flex, Box } from '@chakra-ui/react';
import { ExplorerErrorBoundary } from '../../ErrorBoundary';
import { useBlockListContext } from '../BlockListContext';
import { BlockListGrouped } from '../Grouped/BlockListGrouped';
Expand Down
2 changes: 1 addition & 1 deletion src/app/_components/BlockList/Controls.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Field, Fieldset } from '@chakra-ui/react';
import { Flex, FlexProps, StackProps } from '@chakra-ui/react';
import { ReactNode } from 'react';

import { Switch, SwitchProps } from '../../../components/ui/switch';
import { Flex, FlexProps, StackProps } from '@chakra-ui/react';

interface ControlsProps extends StackProps {
groupByBtc: SwitchProps;
Expand Down
2 changes: 1 addition & 1 deletion src/app/_components/BlockList/Grouped/skeleton.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Stack, Flex, Box } from '@chakra-ui/react';
import { Box, Flex, Stack } from '@chakra-ui/react';

import { SkeletonText } from '../../../..//components/ui/skeleton';
import { Skeleton } from '../../../../components/ui/skeleton';
Expand Down
2 changes: 1 addition & 1 deletion src/app/_components/BlockList/LineAndNode.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Box, Flex } from '@chakra-ui/react';
import { ReactNode } from 'react';

import { Circle } from '../../../common/components/Circle';
import { Flex, Box } from '@chakra-ui/react';

export function LineAndNode({
rowHeight,
Expand Down
3 changes: 1 addition & 2 deletions src/app/_components/BlockList/ScrollableDiv.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { ReactNode, useEffect, useRef, useState } from 'react';

import { Box, BoxProps } from '@chakra-ui/react';
import { ReactNode, useEffect, useRef, useState } from 'react';

// adds horizontal scrolling to its children if they overflow the container's width, and adds a class to the container when it has a horizontal scrollbar
export function ScrollableBox({ children, ...rest }: BoxProps & { children: ReactNode }) {
Expand Down
2 changes: 1 addition & 1 deletion src/app/_components/BlockList/Ungrouped/skeleton.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Box, Flex, HStack, Icon, Stack } from '@chakra-ui/react';
import { Circle } from '@phosphor-icons/react';
import React from 'react';

import { SkeletonText } from '../../../../components/ui/skeleton';
import { Icon, HStack, Flex, Box, Stack } from '@chakra-ui/react';
import { Caption } from '../../../../ui/typography';
import { BlockListGridHeaderRowSkeleton } from '../Grouped/skeleton';
import { LineAndNode } from '../LineAndNode';
Expand Down
2 changes: 1 addition & 1 deletion src/app/_components/ErrorBox.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Flex, FlexProps, Icon, Text } from '@chakra-ui/react';
import { XCircle } from '@phosphor-icons/react';

import { useGlobalContext } from '../../common/context/useGlobalContext';
import { buildUrl } from '../../common/utils/buildUrl';
import { Button } from '../../ui/Button';
import { ButtonLink } from '../../ui/ButtonLink';
import { Icon, Flex, FlexProps, Text } from '@chakra-ui/react';

export function ErrorBox({
error,
Expand Down
2 changes: 1 addition & 1 deletion src/app/_components/NavBar/BtcStxPrice.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
'use client';

import { Flex, FlexProps, Icon } from '@chakra-ui/react';
import { ReactNode } from 'react';

import { Circle } from '../../../common/components/Circle';
import { TokenPrice } from '../../../common/types/tokenPrice';
import { usdFormatter } from '../../../common/utils/utils';
import { Icon, Flex, FlexProps } from '@chakra-ui/react';
import BitcoinIcon from '../../../ui/icons/BitcoinIcon';
import StxIcon from '../../../ui/icons/StxIcon';
import { ExplorerErrorBoundary } from '../ErrorBoundary';
Expand Down
3 changes: 2 additions & 1 deletion src/app/_components/NavBar/Logo.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ExplorerLink } from '../../../common/components/ExplorerLinks';
import { Icon, IconProps } from '@chakra-ui/react';

import { ExplorerLink } from '../../../common/components/ExplorerLinks';
import StxIcon from '../../../ui/icons/StxIcon';

export function Logo({ ...iconProps }: IconProps) {
Expand Down
2 changes: 1 addition & 1 deletion src/app/_components/NavBar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use client';

import { IconButton, useDisclosure } from '@chakra-ui/react';
import { Box, Flex, Icon } from '@chakra-ui/react';
import { List, Plus } from '@phosphor-icons/react';
import { useMemo } from 'react';

Expand All @@ -13,7 +14,6 @@ import { TokenPrice } from '../../../common/types/tokenPrice';
import { buildUrl } from '../../../common/utils/buildUrl';
import { capitalize } from '../../../common/utils/utils';
import { Search } from '../../../features/search/Search';
import { Icon, Flex, Box } from '@chakra-ui/react';
import { BtcStxPrice } from './BtcStxPrice';
import { DesktopColorModeButton } from './DesktopColorModeButton';
import { DesktopNav } from './DesktopNav';
Expand Down
2 changes: 1 addition & 1 deletion src/app/_components/Stats/CurrentStackingCycle/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use client';

import { Flex, Icon, StackProps, Text } from '@chakra-ui/react';
import { Info } from '@phosphor-icons/react';
import { useMemo } from 'react';

import { Flex, StackProps, Icon, Text } from '@chakra-ui/react';
import { Tooltip } from '../../../../ui/Tooltip';
import { ExplorerErrorBoundary } from '../../ErrorBoundary';
import { StackingCycle } from '../StackingCycle';
Expand Down
2 changes: 1 addition & 1 deletion src/app/_components/Stats/LastBlock/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import { Box, Flex, StackProps, Icon } from '@chakra-ui/react';
import { Box, Flex, Icon, StackProps } from '@chakra-ui/react';

import { useSuspenseBlockListInfinite } from '../../../../common/queries/useBlockListInfinite';
import BitcoinIcon from '../../../../ui/icons/BitcoinIcon';
Expand Down
2 changes: 1 addition & 1 deletion src/app/_components/Stats/NextStackingCycle/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import { Flex, StackProps, Icon, Text } from '@chakra-ui/react';
import { Flex, Icon, StackProps, Text } from '@chakra-ui/react';
import { Info } from '@phosphor-icons/react';
import { useMemo } from 'react';

Expand Down
11 changes: 9 additions & 2 deletions src/app/_components/Stats/StatSection.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import { Flex, StackProps, Stack, Text } from '@chakra-ui/react';
import { Flex, Stack, StackProps, Text } from '@chakra-ui/react';
import { FC, ReactNode } from 'react';

export const StatSection: FC<
Expand All @@ -11,7 +11,14 @@ export const StatSection: FC<
caption: ReactNode;
} & Omit<StackProps, 'title'>
> = ({ title, bodyMainText, bodySecondaryText, caption, ...rest }) => (
<Stack p={5} gap={0} height={32} justifyContent={'center'} borderColor={'borderPrimary'} {...rest}>
<Stack
p={5}
gap={0}
height={32}
justifyContent={'center'}
borderColor={'borderPrimary'}
{...rest}
>
<Text fontSize={'xs'} fontWeight="semibold" mb={3} whiteSpace={'nowrap'}>
{title}
</Text>
Expand Down
2 changes: 1 addition & 1 deletion src/app/_components/Stats/Stats.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use client';

import { FlexProps } from '@chakra-ui/react';
import dynamic from 'next/dynamic';
import { ErrorBoundary } from 'react-error-boundary';

import { FlexProps } from '@chakra-ui/react';
import { SkeletonStatSection } from './SkeletonStatSection';
import { Wrapper } from './Wrapper';

Expand Down
2 changes: 1 addition & 1 deletion src/app/_components/Stats/StxSupply/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import { Box, Flex, StackProps, Icon } from '@chakra-ui/react';
import { Box, Flex, Icon, StackProps } from '@chakra-ui/react';
import { Info } from '@phosphor-icons/react';

import { useGlobalContext } from '../../../../common/context/useGlobalContext';
Expand Down
3 changes: 1 addition & 2 deletions src/app/address/[principal]/StxBalance/QRcode.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Box, BoxProps } from '@chakra-ui/react';
import vkQr from '@vkontakte/vk-qr';
import * as React from 'react';

import { Box, BoxProps } from '@chakra-ui/react';

export const QRcode = ({ address, ...rest }: { address: string } & BoxProps) => {
const qrSvg = React.useMemo(
() =>
Expand Down
2 changes: 1 addition & 1 deletion src/app/address/[principal]/TokenBalanceCard/FtBalance.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
'use client';

import { Box, Grid } from '@chakra-ui/react';
import dynamic from 'next/dynamic';
import * as React from 'react';
import { useState } from 'react';

import { AddressBalanceResponse } from '@stacks/stacks-blockchain-api-types';

import { TwoColumnsListItemSkeleton } from '../../../../common/components/TwoColumnsListItemSkeleton';
import { Box, Grid } from '@chakra-ui/react';
import { Button } from '../../../../ui/Button';
import { Caption } from '../../../../ui/typography';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use client';

import { Box, Grid } from '@chakra-ui/react';
import dynamic from 'next/dynamic';
import * as React from 'react';
import { useState } from 'react';
Expand All @@ -11,7 +12,6 @@ import {

import { TwoColumnsListItemSkeleton } from '../../../../common/components/TwoColumnsListItemSkeleton';
import { initBigNumber } from '../../../../common/utils/utils';
import { Box, Grid } from '@chakra-ui/react';
import { Button } from '../../../../ui/Button';
import { Caption } from '../../../../ui/typography';

Expand Down
2 changes: 1 addition & 1 deletion src/app/block/[hash]/tx-lists/BlockTxsList.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use client';

import { Box, Flex } from '@chakra-ui/react';
import * as React from 'react';

import { Transaction } from '@stacks/stacks-blockchain-api-types';
Expand All @@ -13,7 +14,6 @@ import { FilteredTxs } from '../../../../features/txs-list/FilteredTxs';
import { TxListItem } from '../../../../features/txs-list/ListItem/TxListItem';
import { FilterButton } from '../../../../features/txsFilterAndSort/FilterButton';
import { ShowValueMenu } from '../../../../features/txsFilterAndSort/ShowValueMenu';
import { Flex, Box } from '@chakra-ui/react';
import { ExplorerErrorBoundary } from '../../../_components/ErrorBoundary';

interface BlockTxsListProps {
Expand Down
2 changes: 1 addition & 1 deletion src/app/btcblock/[hash]/skeleton.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use client';

import { Box, Flex } from '@chakra-ui/react';
import styled from '@emotion/styled';

import { BurnBlockGroupGridLayout } from '../../../app/_components/BlockList/Grouped/BlockListGrouped';
Expand All @@ -12,7 +13,6 @@ import { BlockListRowSkeleton } from '../../../app/_components/BlockList/Ungroup
import { KeyValueVertical } from '../../../common/components/KeyValueVertical';
import { Section } from '../../../common/components/Section';
import '../../../common/components/loaders/skeleton-text';
import { Flex, Box } from '@chakra-ui/react';
import { Skeleton } from '../../../ui/Skeleton';
import { TowColLayout } from '../../_components/TwoColLayout';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Box, Flex, Input, Stack } from '@chakra-ui/react';
import { Form, Formik } from 'formik';
import { useRouter } from 'next/navigation';
import React, { FC } from 'react';
import { Box, Stack, Flex, Input } from '@chakra-ui/react';

import { useGlobalContext } from '../../../../../common/context/useGlobalContext';
import { buildUrl } from '../../../../../common/utils/buildUrl';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { FungibleConditionCode, PostConditionType } from '@stacks/transactions';
import { FunctionFormikState } from '../FunctionView';
import { checkPostConditionParameters } from '../PostConditionForm';

describe('checkPostConditionParameters', () => { // TODO: fix this test
describe('checkPostConditionParameters', () => {
// TODO: fix this test
it('should return no errors when post condition is not enabled', () => {
const pcValues: FunctionFormikState = {
isPostConditionEnabled: false,
Expand Down
2 changes: 1 addition & 1 deletion src/app/sandbox/components/TransactionsPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use client';

import { AccordionItemContent, Box, Flex, HStack, Stack } from '@chakra-ui/react';
import { Icon } from '@chakra-ui/react';
import { CaretDown } from '@phosphor-icons/react';
import { useRouter } from 'next/navigation';
import React, { useMemo } from 'react';
Expand All @@ -25,7 +26,6 @@ import { TxListItemMini } from '../../../features/txs-list/ListItem/TxListItemMi
import { FilterButton } from '../../../features/txsFilterAndSort/FilterButton';
import { AllTransactionsFilteredMessage } from '../../../features/txsFilterAndSort/TransactionMessages';
import { useFilterAndSortState } from '../../../features/txsFilterAndSort/useFilterAndSortState';
import { Icon } from '@chakra-ui/react';
import { IconButton } from '../../../ui/IconButton';
import FunctionXIcon from '../../../ui/icons/FunctionX';
import { Caption, Text, Title } from '../../../ui/typography';
Expand Down
2 changes: 1 addition & 1 deletion src/app/sandbox/deploy/RightSection.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
'use client';

import { Box, HStack, Icon } from '@chakra-ui/react';
import Editor, { Monaco } from '@monaco-editor/react';
import { useCallback, useState } from 'react';

import { claritySyntax } from '../../../common/constants/claritySyntax';
import { useAppDispatch, useAppSelector } from '../../../common/state/hooks';
import { Icon, Box, HStack } from '@chakra-ui/react';
import ClarityIcon from '../../../ui/icons/ClarityIcon';
import { Caption } from '../../../ui/typography';
import { Toolbar } from '../components/Toolbar';
Expand Down
2 changes: 1 addition & 1 deletion src/app/search/PageClient.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
'use client';

import { Flex, Text } from '@chakra-ui/react';
import React from 'react';

import { Section } from '../../common/components/Section';
import { filterToFormattedValueMap, getKeywordByFilter } from '../../common/queries/useSearchQuery';
import { Flex, Text } from '@chakra-ui/react';
import { TxSearchResult } from './TxSearchResult';
import { FilterProps, FiltersWithWrapper } from './filters';

Expand Down
2 changes: 1 addition & 1 deletion src/app/search/TxSearchResult.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Flex, Text } from '@chakra-ui/react';
import * as React from 'react';

import { Transaction } from '@stacks/stacks-blockchain-api-types';
Expand All @@ -11,7 +12,6 @@ import { TxListItem } from '../../features/txs-list/ListItem/TxListItem';
import { ShowValueMenu } from '../../features/txsFilterAndSort/ShowValueMenu';
import { ConfirmedTxsSortMenu } from '../../features/txsFilterAndSort/SortMenu';
import { useFilterAndSortState } from '../../features/txsFilterAndSort/useFilterAndSortState';
import { Flex, Text } from '@chakra-ui/react';
import { FilterProps } from './filters';

function Header({ txCount }: { txCount: number }) {
Expand Down
10 changes: 4 additions & 6 deletions src/app/search/filters/Address.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Flex, Stack, Text, Box, Icon } from '@chakra-ui/react';
import { Box, Flex, Icon, Stack, Text } from '@chakra-ui/react';
import { ArrowDownRight, ArrowUpRight, CaretDown } from '@phosphor-icons/react';
import { Field, FieldProps, Form, Formik } from 'formik';
import { useRouter, useSearchParams } from 'next/navigation';
Expand Down Expand Up @@ -117,16 +117,14 @@ export function AddressFilter({
<Form>
<Stack gap={4}>
<Field name="fromAddress">
{(
{ field, form }: FieldProps<string, FormValues>
) => (
{({ field, form }: FieldProps<string, FormValues>) => (
<ChakraField
invalid={!!form.errors.fromAddress}
errorText={form.errors.fromAddress}
label="From:"
>
<ExpandingTextarea
{...field}
{...field}
placeholder="STX Address"
fontSize={'sm'}
css={{
Expand All @@ -146,7 +144,7 @@ export function AddressFilter({
label="To:"
>
<ExpandingTextarea
{...field}
{...field}
placeholder="STX Address"
fontSize={'sm'}
css={{
Expand Down
4 changes: 2 additions & 2 deletions src/app/search/filters/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Stack, Icon, Flex, Text} from '@chakra-ui/react';
import { Flex, Icon, Stack, Text } from '@chakra-ui/react';
import { Backspace, FunnelSimple } from '@phosphor-icons/react';
import { usePathname, useSearchParams } from 'next/navigation';

Expand Down Expand Up @@ -31,7 +31,7 @@ export function ClearFiltersButton({ filters }: FilterProps) {
<Flex gap={2} alignItems={'center'}>
<TextLink
href={pageUrlWithNoFilters}
// color={'secondary'}
// color={'secondary'}
width={'full'}
fontSize={'sm'}
fontWeight={'medium'}
Expand Down
3 changes: 2 additions & 1 deletion src/app/signers/PageClient.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
'use client';

import { TokenPrice } from '../../common/types/tokenPrice';
import { Flex } from '@chakra-ui/react';

import { TokenPrice } from '../../common/types/tokenPrice';
import { PageTitle } from '../_components/PageTitle';
import { SignersHeader } from './SignersHeader';
import SignersTable from './SignersTable';
Expand Down
Loading

0 comments on commit c34054f

Please sign in to comment.