Skip to content

Commit

Permalink
fix(build): fix building issue
Browse files Browse the repository at this point in the history
  • Loading branch information
dnoishi committed Feb 28, 2024
1 parent b1af620 commit 0db5734
Show file tree
Hide file tree
Showing 15 changed files with 66 additions and 40 deletions.
1 change: 1 addition & 0 deletions pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import React from 'react';

import * as serverTiming from 'nextjs/utils/serverTiming';

import config from 'configs/app';
import theme from 'theme';
import * as svgSprite from 'ui/shared/IconSvg';

Expand Down
2 changes: 1 addition & 1 deletion ui/pages/Address.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import AddressEnsDomains from 'ui/address/ensDomains/AddressEnsDomains';
import SolidityscanReport from 'ui/address/SolidityscanReport';
import useAddressQuery from 'ui/address/utils/useAddressQuery';
import AccountActionsMenu from 'ui/shared/AccountActionsMenu/AccountActionsMenu';
import TextAd from 'ui/shared/ad/TextAd';
//import TextAd from 'ui/shared/ad/TextAd';
import AddressAddToWallet from 'ui/shared/address/AddressAddToWallet';
import AddressEntity from 'ui/shared/entities/address/AddressEntity';
import EnsEntity from 'ui/shared/entities/ens/EnsEntity';
Expand Down
2 changes: 1 addition & 1 deletion ui/pages/Block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import BlockWithdrawals from 'ui/block/BlockWithdrawals';
import useBlockQuery from 'ui/block/useBlockQuery';
import useBlockTxQuery from 'ui/block/useBlockTxQuery';
import useBlockWithdrawalsQuery from 'ui/block/useBlockWithdrawalsQuery';
import TextAd from 'ui/shared/ad/TextAd';
//import TextAd from 'ui/shared/ad/TextAd';
import ServiceDegradationWarning from 'ui/shared/alerts/ServiceDegradationWarning';
import AddressEntity from 'ui/shared/entities/address/AddressEntity';
import NetworkExplorers from 'ui/shared/NetworkExplorers';
Expand Down
4 changes: 2 additions & 2 deletions ui/pages/NameDomain.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import getQueryParamString from 'lib/router/getQueryParamString';
import { ENS_DOMAIN } from 'stubs/ENS';
import NameDomainDetails from 'ui/nameDomain/NameDomainDetails';
import NameDomainHistory from 'ui/nameDomain/NameDomainHistory';
import TextAd from 'ui/shared/ad/TextAd';
//import TextAd from 'ui/shared/ad/TextAd';
import AddressEntity from 'ui/shared/entities/address/AddressEntity';
import EnsEntity from 'ui/shared/entities/ens/EnsEntity';
import IconSvg from 'ui/shared/IconSvg';
Expand Down Expand Up @@ -84,7 +84,7 @@ const NameDomain = () => {

return (
<>
<TextAd mb={ 6 }/>
{ /* <TextAd mb={ 6 }/> */ }
<PageTitle title="Name details" secondRow={ titleSecondRow }/>
{ infoQuery.isPlaceholderData ? (
<>
Expand Down
2 changes: 1 addition & 1 deletion ui/pages/Token.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { generateListStub } from 'stubs/utils';
import AddressContract from 'ui/address/AddressContract';
import AddressQrCode from 'ui/address/details/AddressQrCode';
import AccountActionsMenu from 'ui/shared/AccountActionsMenu/AccountActionsMenu';
import TextAd from 'ui/shared/ad/TextAd';
//import TextAd from 'ui/shared/ad/TextAd';
import AddressAddToWallet from 'ui/shared/address/AddressAddToWallet';
import AddressEntity from 'ui/shared/entities/address/AddressEntity';
import * as TokenEntity from 'ui/shared/entities/token/TokenEntity';
Expand Down
2 changes: 1 addition & 1 deletion ui/pages/TokenInstance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import * as tokenStubs from 'stubs/token';
import { generateListStub } from 'stubs/utils';
import AddressQrCode from 'ui/address/details/AddressQrCode';
import AccountActionsMenu from 'ui/shared/AccountActionsMenu/AccountActionsMenu';
import TextAd from 'ui/shared/ad/TextAd';
//import TextAd from 'ui/shared/ad/TextAd';
import AddressAddToWallet from 'ui/shared/address/AddressAddToWallet';
import Tag from 'ui/shared/chakra/Tag';
import TokenEntity from 'ui/shared/entities/token/TokenEntity';
Expand Down
2 changes: 1 addition & 1 deletion ui/pages/Transaction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { useAppContext } from 'lib/contexts/app';
import throwOnResourceLoadError from 'lib/errors/throwOnResourceLoadError';
import getQueryParamString from 'lib/router/getQueryParamString';
import { publicClient } from 'lib/web3/client';
import TextAd from 'ui/shared/ad/TextAd';
//import TextAd from 'ui/shared/ad/TextAd';
import EntityTags from 'ui/shared/EntityTags';
import PageTitle from 'ui/shared/Page/PageTitle';
import RoutedTabs from 'ui/shared/Tabs/RoutedTabs';
Expand Down
4 changes: 2 additions & 2 deletions ui/pages/UserOp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import throwOnAbsentParamError from 'lib/errors/throwOnAbsentParamError';
import throwOnResourceLoadError from 'lib/errors/throwOnResourceLoadError';
import getQueryParamString from 'lib/router/getQueryParamString';
import { USER_OP } from 'stubs/userOps';
import TextAd from 'ui/shared/ad/TextAd';
//import TextAd from 'ui/shared/ad/TextAd';
import UserOpEntity from 'ui/shared/entities/userOp/UserOpEntity';
import PageTitle from 'ui/shared/Page/PageTitle';
import RoutedTabs from 'ui/shared/Tabs/RoutedTabs';
Expand Down Expand Up @@ -94,7 +94,7 @@ const UserOp = () => {

return (
<>
<TextAd mb={ 6 }/>
{ /* <TextAd mb={ 6 }/> */ }
<PageTitle
title="User operation details"
backLink={ backLink }
Expand Down
57 changes: 40 additions & 17 deletions ui/pages/ZkEvmL2TxnBatch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import getQueryParamString from 'lib/router/getQueryParamString';
import { TX_ZKEVM_L2 } from 'stubs/tx';
import { generateListStub } from 'stubs/utils';
import { ZKEVM_L2_TXN_BATCH } from 'stubs/zkEvmL2';
import TextAd from 'ui/shared/ad/TextAd';
//import TextAd from "ui/shared/ad/TextAd";
import PageTitle from 'ui/shared/Page/PageTitle';
import useQueryWithPages from 'ui/shared/pagination/useQueryWithPages';
import RoutedTabs from 'ui/shared/Tabs/RoutedTabs';
Expand All @@ -37,22 +37,48 @@ const ZkEvmL2TxnBatch = () => {
resourceName: 'zkevm_l2_txn_batch_txs',
pathParams: { number },
options: {
enabled: Boolean(!batchQuery.isPlaceholderData && batchQuery.data?.number && tab === 'txs'),
enabled: Boolean(
!batchQuery.isPlaceholderData &&
batchQuery.data?.number &&
tab === 'txs',
),
// there is no pagination in zkevm_l2_txn_batch_txs
placeholderData: generateListStub<'zkevm_l2_txn_batch_txs'>(TX_ZKEVM_L2, 50, { next_page_params: null }),
placeholderData: generateListStub<'zkevm_l2_txn_batch_txs'>(
TX_ZKEVM_L2,
50,
{ next_page_params: null },
),
},
});

throwOnAbsentParamError(number);
throwOnResourceLoadError(batchQuery);

const tabs: Array<RoutedTab> = React.useMemo(() => ([
{ id: 'index', title: 'Details', component: <ZkEvmL2TxnBatchDetails query={ batchQuery }/> },
{ id: 'txs', title: 'Transactions', component: <TxsWithFrontendSorting query={ batchTxsQuery } showSocketInfo={ false }/> },
].filter(Boolean)), [ batchQuery, batchTxsQuery ]);
const tabs: Array<RoutedTab> = React.useMemo(
() =>
[
{
id: 'index',
title: 'Details',
component: <ZkEvmL2TxnBatchDetails query={ batchQuery }/>,
},
{
id: 'txs',
title: 'Transactions',
component: (
<TxsWithFrontendSorting
query={ batchTxsQuery }
showSocketInfo={ false }
/>
),
},
].filter(Boolean),
[ batchQuery, batchTxsQuery ],
);

const backLink = React.useMemo(() => {
const hasGoBackLink = appProps.referrer && appProps.referrer.includes('/zkevm_l2_txn_batches');
const hasGoBackLink =
appProps.referrer && appProps.referrer.includes('/zkevm_l2_txn_batches');

if (!hasGoBackLink) {
return;
Expand All @@ -66,15 +92,12 @@ const ZkEvmL2TxnBatch = () => {

return (
<>
<TextAd mb={ 6 }/>
<PageTitle
title={ `Tx batch #${ number }` }
backLink={ backLink }
/>
{ batchQuery.isPlaceholderData ? <TabsSkeleton tabs={ tabs }/> : (
<RoutedTabs
tabs={ tabs }
/>
{ /* <TextAd mb={ 6 }/> */ }
<PageTitle title={ `Tx batch #${ number }` } backLink={ backLink }/>
{ batchQuery.isPlaceholderData ? (
<TabsSkeleton tabs={ tabs }/>
) : (
<RoutedTabs tabs={ tabs }/>
) }
</>
);
Expand Down
6 changes: 3 additions & 3 deletions ui/shared/Page/PageTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import _debounce from 'lodash/debounce';
import React from 'react';

import useIsMobile from 'lib/hooks/useIsMobile';
import TextAd from 'ui/shared/ad/TextAd';
//import TextAd from 'ui/shared/ad/TextAd';
import IconSvg from 'ui/shared/IconSvg';
import LinkInternal from 'ui/shared/LinkInternal';

Expand Down Expand Up @@ -53,7 +53,7 @@ const BackLink = (props: BackLinkProp & { isLoading?: boolean }) => {
);
};

const PageTitle = ({ title, contentAfter, withTextAd, backLink, className, isLoading, afterTitle, beforeTitle, secondRow }: Props) => {
const PageTitle = ({ title, contentAfter, backLink, className, isLoading, afterTitle, beforeTitle, secondRow }: Props) => {
const tooltip = useDisclosure();
const isMobile = useIsMobile();
const [ isTextTruncated, setIsTextTruncated ] = React.useState(false);
Expand Down Expand Up @@ -140,7 +140,7 @@ const PageTitle = ({ title, contentAfter, withTextAd, backLink, className, isLoa
{ afterTitle }
</Flex>
{ contentAfter }
{ withTextAd && <TextAd order={{ base: -1, lg: 100 }} mb={{ base: 6, lg: 0 }} ml="auto" w={{ base: '100%', lg: 'auto' }}/> }
{ /* { withTextAd && <TextAd order={{ base: -1, lg: 100 }} mb={{ base: 6, lg: 0 }} ml="auto" w={{ base: '100%', lg: 'auto' }}/> } */ }
</Flex>
{ secondRow && (
<Flex alignItems="center" minH={ 10 } overflow="hidden">
Expand Down
6 changes: 3 additions & 3 deletions ui/shared/ad/AdBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as cookies from 'lib/cookies';
import AdbutlerBanner from './AdbutlerBanner';
import CoinzillaBanner from './CoinzillaBanner';
import HypeBanner from './HypeBanner';
import SliseBanner from './SliseBanner';
//import SliseBanner from './SliseBanner';

const feature = config.features.adsBanner;

Expand All @@ -27,8 +27,8 @@ const AdBanner = ({ className, isLoading }: { className?: string; isLoading?: bo
return <CoinzillaBanner/>;
case 'hype':
return <HypeBanner/>;
case 'slise':
return <SliseBanner/>;
// case 'slise':
// return <SliseBanner/>;
}
})();

Expand Down
8 changes: 5 additions & 3 deletions ui/snippets/footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type { CustomLinksGroup } from 'types/footerLinks';
import config from 'configs/app';
import type { ResourceError } from 'lib/api/resources';
import useFetch from 'lib/hooks/useFetch';
import useIssueUrl from 'lib/hooks/useIssueUrl';
//import useIssueUrl from 'lib/hooks/useIssueUrl';
import NetworkAddToWallet from 'ui/shared/NetworkAddToWallet';

import FooterLinkItem from './FooterLinkItem';
Expand All @@ -22,6 +22,8 @@ const FRONT_COMMIT_URL = `https://github.com/blockscout/frontend/commit/${ confi

const Footer = () => {

const apiVersionUrl = getApiVersionUrl(config.UI.footer.frontendVersion);

const BLOCKSCOUT_LINKS = [
{
icon: 'edit' as const,
Expand Down Expand Up @@ -117,7 +119,7 @@ const Footer = () => {
<VStack spacing={ 1 } mt={ 6 } alignItems="start">
{ apiVersionUrl && (
<Text fontSize="xs">
Backend: <Link href={ apiVersionUrl } target="_blank">{ backendVersionData?.backend_version }</Link>
Backend: <Link href={ apiVersionUrl } target="_blank">{ config.UI.footer.frontendVersion }</Link>
</Text>
) }
{ frontendLink && (
Expand All @@ -128,7 +130,7 @@ const Footer = () => {
</VStack>
</Box>
);
}, [ apiVersionUrl, backendVersionData?.backend_version, frontendLink ]);
}, [ apiVersionUrl, frontendLink ]);

const containerProps: GridProps = {
as: 'footer',
Expand Down
2 changes: 1 addition & 1 deletion ui/token/TokenDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ const TokenDetails = ({ tokenQuery }: Props) => {

{ type !== 'ERC-20' && <TokenNftMarketplaces hash={ hash } isLoading={ tokenQuery.isPlaceholderData }/> }

<DetailsSponsoredItem isLoading={ tokenQuery.isPlaceholderData }/>
{ /* <DetailsSponsoredItem isLoading={ tokenQuery.isPlaceholderData }/> */ }
</Grid>
);
};
Expand Down
4 changes: 2 additions & 2 deletions ui/tokenInstance/TokenInstanceDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type { TokenInfo, TokenInstance } from 'types/api/token';
import CopyToClipboard from 'ui/shared/CopyToClipboard';
import DetailsInfoItem from 'ui/shared/DetailsInfoItem';
import DetailsInfoItemDivider from 'ui/shared/DetailsInfoItemDivider';
import DetailsSponsoredItem from 'ui/shared/DetailsSponsoredItem';
// import DetailsSponsoredItem from 'ui/shared/DetailsSponsoredItem';
import AddressEntity from 'ui/shared/entities/address/AddressEntity';
import HashStringShortenDynamic from 'ui/shared/HashStringShortenDynamic';
import NftMedia from 'ui/shared/nft/NftMedia';
Expand Down Expand Up @@ -91,7 +91,7 @@ const TokenInstanceDetails = ({ data, token, scrollRef, isLoading }: Props) => {
>
<TokenInstanceMetadataInfo data={ data } isLoading={ isLoading }/>
<DetailsInfoItemDivider/>
<DetailsSponsoredItem isLoading={ isLoading }/>
{ /* <DetailsSponsoredItem isLoading={ isLoading }/> */ }
</Grid>
</>
);
Expand Down
4 changes: 2 additions & 2 deletions ui/tx/details/TxInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import CopyToClipboard from 'ui/shared/CopyToClipboard';
import CurrencyValue from 'ui/shared/CurrencyValue';
import DetailsInfoItem from 'ui/shared/DetailsInfoItem';
import DetailsInfoItemDivider from 'ui/shared/DetailsInfoItemDivider';
import DetailsSponsoredItem from 'ui/shared/DetailsSponsoredItem';
// import DetailsSponsoredItem from 'ui/shared/DetailsSponsoredItem';
import DetailsTimestamp from 'ui/shared/DetailsTimestamp';
import AddressEntity from 'ui/shared/entities/address/AddressEntity';
import BatchEntityL2 from 'ui/shared/entities/block/BatchEntityL2';
Expand Down Expand Up @@ -241,7 +241,7 @@ const TxInfo = ({ data, isLoading, socketStatus }: Props) => {
{ data.allowed_peekers && data.allowed_peekers.length > 0 && (
<TxAllowedPeekers items={ data.allowed_peekers }/>
) }
<DetailsSponsoredItem isLoading={ isLoading }/>
{ /* <DetailsSponsoredItem isLoading={ isLoading }/> */ }

<DetailsInfoItemDivider/>

Expand Down

0 comments on commit 0db5734

Please sign in to comment.