Skip to content

Commit

Permalink
fix(regressions): fixing build issues
Browse files Browse the repository at this point in the history
  • Loading branch information
BLuEScioN committed Jun 21, 2024
1 parent 1ef490a commit 5ea9c0b
Show file tree
Hide file tree
Showing 46 changed files with 77 additions and 74 deletions.
2 changes: 1 addition & 1 deletion src/app/PageClient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { NextPage } from 'next';
import dynamic from 'next/dynamic';

import { DEFAULT_BLOCKS_LIST_LIMIT, DEFAULT_LIST_LIMIT_SMALL } from '../common/constants/constants';
import { useGlobalContext } from '../common/context/useAppContext';
import { useGlobalContext } from '../common/context/useGlobalContext';
import { NetworkModes } from '../common/types/network';
import { TxListTabs } from '../features/txs-list/tabs/TxListTabs';
import { Grid } from '../ui/Grid';
Expand Down
3 changes: 1 addition & 2 deletions src/app/_components/BlockList/LayoutA/BurnBlock.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { useColorModeValue } from '@chakra-ui/react';
import { ArrowBendDownLeft } from '@phosphor-icons/react';
import * as React from 'react';
import { memo } from 'react';

import { Timestamp } from '../../../../common/components/Timestamp';
import { useGlobalContext } from '../../../../common/context/useAppContext';
import { useGlobalContext } from '../../../../common/context/useGlobalContext';
import { truncateMiddle } from '../../../../common/utils/utils';
import { Box } from '../../../../ui/Box';
import { Flex, FlexProps } from '../../../../ui/Flex';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useEffect, useRef } from 'react';
import { Block, StacksApiSocketClient } from '@stacks/blockchain-api-client';
import { NakamotoBlock } from '@stacks/blockchain-api-client/src/generated/models';

import { useGlobalContext } from '../../../../common/context/useAppContext';
import { useGlobalContext } from '../../../../common/context/useGlobalContext';

interface Subscription {
unsubscribe(): void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useEffect, useRef } from 'react';
import { StacksApiSocketClient } from '@stacks/blockchain-api-client';
import { NakamotoBlock } from '@stacks/blockchain-api-client/src/generated/models';

import { useGlobalContext } from '../../../../common/context/useAppContext';
import { useGlobalContext } from '../../../../common/context/useGlobalContext';

interface Subscription {
unsubscribe(): void;
Expand Down
2 changes: 1 addition & 1 deletion src/app/_components/BtcAnchorBlockCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Block } from '@stacks/stacks-blockchain-api-types';

import { KeyValueVertical } from '../../common/components/KeyValueVertical';
import { Section } from '../../common/components/Section';
import { useGlobalContext } from '../../common/context/useAppContext';
import { useGlobalContext } from '../../common/context/useGlobalContext';
import { truncateMiddle } from '../../common/utils/utils';
import { Text } from '../../ui/Text';
import { TextLink } from '../../ui/TextLink';
Expand Down
3 changes: 1 addition & 2 deletions src/app/_components/ErrorBox.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { XCircle } from '@phosphor-icons/react';
import * as React from 'react';

import { useGlobalContext } from '../../common/context/useAppContext';
import { useGlobalContext } from '../../common/context/useGlobalContext';
import { buildUrl } from '../../common/utils/buildUrl';
import { Button } from '../../ui/Button';
import { ButtonLink } from '../../ui/ButtonLink';
Expand Down
2 changes: 1 addition & 1 deletion src/app/_components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { FC } from 'react';

import { PAGE_MAX_WIDTH } from '../../common/constants/constants';
import { RELEASE_TAG_NAME } from '../../common/constants/env';
import { useGlobalContext } from '../../common/context/useAppContext';
import { useGlobalContext } from '../../common/context/useGlobalContext';
import { buildUrl } from '../../common/utils/buildUrl';
import { Box } from '../../ui/Box';
import { Flex } from '../../ui/Flex';
Expand Down
2 changes: 1 addition & 1 deletion src/app/_components/NavBar/NetworkLabel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ChainID } from '@stacks/transactions';

import { Badge } from '../../../common/components/Badge';
import { DEFAULT_DEVNET_SERVER } from '../../../common/constants/constants';
import { useGlobalContext } from '../../../common/context/useAppContext';
import { useGlobalContext } from '../../../common/context/useGlobalContext';
import { useCustomNetworkApiInfo } from '../../../common/queries/useCustomNetworkApiInfo';
import { Network } from '../../../common/types/network';
import { buildUrl } from '../../../common/utils/buildUrl';
Expand Down
2 changes: 1 addition & 1 deletion src/app/_components/NavBar/NetworkModeBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Flask } from '@phosphor-icons/react';
import { FC } from 'react';

import { Badge } from '../../../common/components/Badge';
import { useGlobalContext } from '../../../common/context/useAppContext';
import { useGlobalContext } from '../../../common/context/useGlobalContext';
import { capitalize } from '../../../common/utils/utils';
import { Flex } from '../../../ui/Flex';
import { Icon } from '../../../ui/Icon';
Expand Down
2 changes: 1 addition & 1 deletion src/app/_components/NavBar/__tests__/NetworkLabel.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { fireEvent, render } from '@testing-library/react';

import { ChainID } from '@stacks/transactions';

import { useGlobalContext } from '../../../../common/context/useAppContext';
import { useGlobalContext } from '../../../../common/context/useGlobalContext';
import { Network, NetworkModes } from '../../../../common/types/network';
import { useBreakpointValue } from '../../../../ui/hooks/useBreakpointValue';
import { NetworkLabel } from '../NetworkLabel';
Expand Down
2 changes: 1 addition & 1 deletion src/app/_components/NavBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useMemo } from 'react';

import { openModal } from '../../../common/components/modals/modal-slice';
import { MODALS } from '../../../common/constants/constants';
import { useGlobalContext } from '../../../common/context/useAppContext';
import { useGlobalContext } from '../../../common/context/useGlobalContext';
import { useAppDispatch } from '../../../common/state/hooks';
import { Network } from '../../../common/types/network';
import { TokenPrice } from '../../../common/types/tokenPrice';
Expand Down
2 changes: 1 addition & 1 deletion src/app/_components/StatusBar/IncidentsStatusBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { css } from '@emotion/react';
import { useEffect, useRef } from 'react';
import { IncidentImpact } from 'statuspage.io';

import { useGlobalContext } from '../../../common/context/useAppContext';
import { useGlobalContext } from '../../../common/context/useGlobalContext';
import { useUnresolvedIncidents } from '../../../common/queries/useUnresolvedIncidents';
import { useAppDispatch } from '../../../common/state/hooks';
import { Flex } from '../../../ui/Flex';
Expand Down
4 changes: 1 addition & 3 deletions src/app/block/[hash]/error.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
'use client';

import { useEffect } from 'react';
import * as React from 'react';

import { ErrorMessageLayout } from '../../../common/components/ErrorMessageLayout';
import { Section } from '../../../common/components/Section';
import { useGlobalContext } from '../../../common/context/useAppContext';
import { useGlobalContext } from '../../../common/context/useGlobalContext';
import { useError } from '../../../common/hooks/useError';
import { ExplorerError } from '../../../common/types/Error';
import { buildUrl } from '../../../common/utils/buildUrl';
Expand All @@ -14,7 +13,6 @@ import { ButtonLink } from '../../../ui/ButtonLink';
import { Flex } from '../../../ui/Flex';
import { Grid } from '../../../ui/Grid';
import { HStack } from '../../../ui/HStack';
import { Stack } from '../../../ui/Stack';
import { PageTitle } from '../../_components/PageTitle';

const defaultErrorMessage = 'Failed to fetch block';
Expand Down
2 changes: 1 addition & 1 deletion src/app/blocks/PageClient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import type { NextPage } from 'next';
import dynamic from 'next/dynamic';

import { useGlobalContext } from '../../common/context/useAppContext';
import { useGlobalContext } from '../../common/context/useGlobalContext';
import { NetworkModes } from '../../common/types/network';
import {
BlockPageHeadersSkeleton,
Expand Down
2 changes: 1 addition & 1 deletion src/app/btcblock/[hash]/BitcoinAnchorDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import styled from '@emotion/styled';
import { useParamsBlockHash } from '../../../app/block/[hash]/useParamsBlockHash';
import { KeyValueVertical } from '../../../common/components/KeyValueVertical';
import { Section } from '../../../common/components/Section';
import { useGlobalContext } from '../../../common/context/useAppContext';
import { useGlobalContext } from '../../../common/context/useGlobalContext';
import { useSuspenseBurnBlock } from '../../../common/queries/useBurnBlock';
import { toRelativeTime, truncateMiddle } from '../../../common/utils/utils';
import { Flex } from '../../../ui/Flex';
Expand Down
2 changes: 1 addition & 1 deletion src/app/btcblock/[hash]/NavBlock.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ArrowLeft, ArrowRight } from '@phosphor-icons/react';

import { useGlobalContext } from '../../../common/context/useAppContext';
import { useGlobalContext } from '../../../common/context/useGlobalContext';
import { buildUrl } from '../../../common/utils/buildUrl';
import { Flex } from '../../../ui/Flex';
import { Icon } from '../../../ui/Icon';
Expand Down
3 changes: 1 addition & 2 deletions src/app/error.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
'use client';

import * as React from 'react';
import { useEffect } from 'react';

import { ErrorMessageLayout } from '../common/components/ErrorMessageLayout';
import { Section } from '../common/components/Section';
import { useGlobalContext } from '../common/context/useAppContext';
import { useGlobalContext } from '../common/context/useGlobalContext';
import { buildUrl } from '../common/utils/buildUrl';
import { Box } from '../ui/Box';
import { Button } from '../ui/Button';
Expand Down
6 changes: 1 addition & 5 deletions src/app/global-error.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
'use client';

import * as React from 'react';
import { useEffect } from 'react';

import { ErrorMessageLayout } from '../common/components/ErrorMessageLayout';
import { Section } from '../common/components/Section';
import { useGlobalContext } from '../common/context/useAppContext';
import { buildUrl } from '../common/utils/buildUrl';
import { useGlobalContext } from '../common/context/useGlobalContext';
import { Box } from '../ui/Box';
import { ButtonLink } from '../ui/ButtonLink';
import { Grid } from '../ui/Grid';
import { Stack } from '../ui/Stack';

export default function Error({
error,
Expand Down
6 changes: 3 additions & 3 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { headers } from 'next/headers';
import { ReactNode } from 'react';

import { meta } from '../common/constants/meta';
import { AppContextProvider } from '../common/context/AppContextProvider';
import { GlobalContextProvider } from '../common/context/GlobalContextProvider';
import { PageWrapper } from './_components/PageWrapper';
import { Providers } from './_components/Providers';
import { getTokenPrice } from './getTokenPriceInfo';
Expand All @@ -20,11 +20,11 @@ export default async function RootLayout({ children }: { children: ReactNode })
return (
<html lang="en">
<body>
<AppContextProvider headerCookies={headersList.get('cookie')}>
<GlobalContextProvider headerCookies={headersList.get('cookie')}>
<Providers headerCookies={headersList.get('cookie')}>
<PageWrapper tokenPrice={tokenPrice}>{children}</PageWrapper>
</Providers>
</AppContextProvider>
</GlobalContextProvider>
</body>
<GoogleAnalytics gaId="G-NB2VBT0KY2" />
<script
Expand Down
4 changes: 2 additions & 2 deletions src/app/sandbox/Wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import { List, User } from '@phosphor-icons/react';
import dynamic from 'next/dynamic';
import { useRouter } from 'next/navigation';
import React, { ReactNode } from 'react';
import { ReactNode } from 'react';

import { Circle } from '../../common/components/Circle';
import { Section } from '../../common/components/Section';
import { useGlobalContext } from '../../common/context/useAppContext';
import { useGlobalContext } from '../../common/context/useGlobalContext';
import { useAppDispatch, useAppSelector } from '../../common/state/hooks';
import { getQueryParams } from '../../common/utils/buildUrl';
import { Button } from '../../ui/Button';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Form, Formik } from 'formik';
import { useRouter } from 'next/navigation';
import React, { FC } from 'react';

import { useGlobalContext } from '../../../../../common/context/useAppContext';
import { useGlobalContext } from '../../../../../common/context/useGlobalContext';
import { buildUrl } from '../../../../../common/utils/buildUrl';
import { onPaste, validateStacksAddress } from '../../../../../common/utils/utils';
import { Box } from '../../../../../ui/Box';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Section } from '../../../../common/components/Section';
import { TxIcon } from '../../../../common/components/TxIcon';
import { ArrowLeftIcon } from '../../../../common/components/icons/arrow-left';
import { FungibleTokenIcon } from '../../../../common/components/icons/fungible-token';
import { useGlobalContext } from '../../../../common/context/useAppContext';
import { useGlobalContext } from '../../../../common/context/useGlobalContext';
import { useAppSelector } from '../../../../common/state/hooks';
import { ContractWithParsedAbi } from '../../../../common/types/contract';
import { buildUrl } from '../../../../common/utils/buildUrl';
Expand Down
2 changes: 1 addition & 1 deletion src/app/sandbox/components/TransactionsPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ 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/useAppContext';
import { useGlobalContext } from '../../../common/context/useGlobalContext';
import { useContractById } from '../../../common/queries/useContractById';
import { useAppDispatch } from '../../../common/state/hooks';
import { buildUrl } from '../../../common/utils/buildUrl';
Expand Down
2 changes: 1 addition & 1 deletion src/app/sandbox/hooks/useUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
MempoolTransaction,
} from '@stacks/stacks-blockchain-api-types';

import { useGlobalContext } from '../../../common/context/useAppContext';
import { useGlobalContext } from '../../../common/context/useGlobalContext';
import { useInfiniteQueryResult } from '../../../common/hooks/useInfiniteQueryResult';
import { useAccountBalance } from '../../../common/queries/useAccountBalance';
import { useAddressConfirmedTxsWithTransfersInfinite } from '../../../common/queries/useAddressConfirmedTxsWithTransfersInfinite';
Expand Down
2 changes: 1 addition & 1 deletion src/app/sandbox/layout/SideNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { usePathname } from 'next/navigation';
import React from 'react';

import { DropIcon } from '../../../common/components/icons/drop';
import { useGlobalContext } from '../../../common/context/useAppContext';
import { useGlobalContext } from '../../../common/context/useGlobalContext';
import { buildUrl } from '../../../common/utils/buildUrl';
import { Icon } from '../../../ui/Icon';
import { Stack, StackProps } from '../../../ui/Stack';
Expand Down
2 changes: 1 addition & 1 deletion src/app/signers/data/UseSignerAddresses.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Add missing import statement
import { useSuspenseQuery } from '@tanstack/react-query';

import { useGlobalContext } from '../../../common/context/useAppContext';
import { useGlobalContext } from '../../../common/context/useGlobalContext';
import { TEN_MINUTES, TWO_MINUTES } from '../../../common/queries/query-stale-time';

const SIGNER_ADDRESSES_QUERY_KEY = 'signer-addresses';
Expand Down
2 changes: 1 addition & 1 deletion src/app/signers/data/useSigners.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useSuspenseQuery } from '@tanstack/react-query';

import { useGlobalContext } from '../../../common/context/useAppContext';
import { useGlobalContext } from '../../../common/context/useGlobalContext';
import { TEN_MINUTES } from '../../../common/queries/query-stale-time';
import { ApiResponseWithResultsOffset } from '../../../common/types/api';

Expand Down
2 changes: 1 addition & 1 deletion src/app/signers/useSignerLocations.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useSuspenseQuery } from '@tanstack/react-query';

import { useGlobalContext } from '../../common/context/useAppContext';
import { useGlobalContext } from '../../common/context/useGlobalContext';
import { TEN_MINUTES } from '../../common/queries/query-stale-time';

const SIGNER_LOCATION_QUERY_KEY = 'signer-addresses';
Expand Down
3 changes: 1 addition & 2 deletions src/app/token/[tokenId]/error.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
'use client';

import * as React from 'react';
import { useEffect } from 'react';

import { ErrorMessageLayout } from '../../../common/components/ErrorMessageLayout';
import { Section } from '../../../common/components/Section';
import { useGlobalContext } from '../../../common/context/useAppContext';
import { useGlobalContext } from '../../../common/context/useGlobalContext';
import { useError } from '../../../common/hooks/useError';
import { ExplorerError } from '../../../common/types/Error';
import { buildUrl } from '../../../common/utils/buildUrl';
Expand Down
4 changes: 2 additions & 2 deletions src/app/txid/[txId]/BlocksVisualizer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import { useColorMode } from '@chakra-ui/react';
import { css } from '@emotion/react';
import { ArrowRight, CheckCircle, WarningCircle } from '@phosphor-icons/react';
import { useRouter } from 'next/navigation';
import { useEffect, useState } from 'react';
import * as React from 'react';
import { useEffect, useState } from 'react';

import { Block as BlockType } from '@stacks/stacks-blockchain-api-types/generated';

import { Circle } from '../../../common/components/Circle';
import { Section } from '../../../common/components/Section';
import { useGlobalContext } from '../../../common/context/useAppContext';
import { useGlobalContext } from '../../../common/context/useGlobalContext';
import { useBlockListInfinite } from '../../../common/queries/useBlockListInfinite';
import { buildUrl } from '../../../common/utils/buildUrl';
import { Box } from '../../../ui/Box';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { cvToJSON, hexToCV } from '@stacks/transactions';

import { AddressLink, TxLink } from '../../../../common/components/ExplorerLinks';
import { Value } from '../../../../common/components/Value';
import { useGlobalContext } from '../../../../common/context/useAppContext';
import { isJSONString, microToStacksFormatted } from '../../../../common/utils/utils';
import { useGlobalContext } from '../../../../common/context/useGlobalContext';
import { microToStacksFormatted } from '../../../../common/utils/utils';
import { Box } from '../../../../ui/Box';
import { HStack } from '../../../../ui/HStack';
import { TextLink } from '../../../../ui/TextLink';
Expand Down
3 changes: 1 addition & 2 deletions src/app/txid/[txId]/TxAlerts.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
'use client';

import dayjs from 'dayjs';
import React from 'react';

import { MempoolTransaction, Transaction } from '@stacks/stacks-blockchain-api-types';

import { TransactionStatus } from '../../../common/constants/constants';
import { useGlobalContext } from '../../../common/context/useAppContext';
import { useGlobalContext } from '../../../common/context/useGlobalContext';
import { getTransactionStatus } from '../../../common/utils/transactions';
import { ExplorerErrorBoundary } from '../../_components/ErrorBoundary';
import { AlertBase } from './Alert';
Expand Down
2 changes: 1 addition & 1 deletion src/app/txid/[txId]/TxPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { MempoolTransaction, Transaction } from '@stacks/stacks-blockchain-api-t

import { getTxTypeIcon } from '../../../common/components/TxIcon';
import { TransactionType } from '../../../common/constants/constants';
import { useGlobalContext } from '../../../common/context/useAppContext';
import { useGlobalContext } from '../../../common/context/useGlobalContext';
import { getTransactionStatus } from '../../../common/utils/transactions';
import { getTxTitle } from '../../../common/utils/utils';
import { Flex } from '../../../ui/Flex';
Expand Down
4 changes: 1 addition & 3 deletions src/app/txid/[txId]/error.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
'use client';

import { useEffect } from 'react';
import * as React from 'react';

import { ErrorMessageLayout } from '../../../common/components/ErrorMessageLayout';
import { Section } from '../../../common/components/Section';
import { useGlobalContext } from '../../../common/context/useAppContext';
import { useGlobalContext } from '../../../common/context/useGlobalContext';
import { useError } from '../../../common/hooks/useError';
import { ExplorerError } from '../../../common/types/Error';
import { buildUrl } from '../../../common/utils/buildUrl';
Expand All @@ -14,7 +13,6 @@ import { ButtonLink } from '../../../ui/ButtonLink';
import { Flex } from '../../../ui/Flex';
import { Grid } from '../../../ui/Grid';
import { HStack } from '../../../ui/HStack';
import { Stack } from '../../../ui/Stack';
import { PageTitle } from '../../_components/PageTitle';

const defaultErrorMessage = 'Failed to fetch transaction';
Expand Down
2 changes: 1 addition & 1 deletion src/common/api/useApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { Configuration as TokenMetadataApiConfiguration } from '@hirosystems/token-metadata-api-client';

import { useGlobalContext } from '../context/useAppContext';
import { useGlobalContext } from '../context/useGlobalContext';
import { apiClients, createConfig } from './client';

export const useApi = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/common/components/BtcStxBlockLinks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Icon } from '../../ui/Icon';
import { TextLink } from '../../ui/TextLink';
import BitcoinIcon from '../../ui/icons/BitcoinIcon';
import StxIcon from '../../ui/icons/StxIcon';
import { useGlobalContext } from '../context/useAppContext';
import { useGlobalContext } from '../context/useGlobalContext';
import { Circle } from './Circle';
import { BlockLink } from './ExplorerLinks';

Expand Down
Loading

0 comments on commit 5ea9c0b

Please sign in to comment.