Skip to content

Commit

Permalink
reset branch
Browse files Browse the repository at this point in the history
  • Loading branch information
fnkk committed Jun 6, 2024
1 parent f95bb0f commit 25aa9ed
Show file tree
Hide file tree
Showing 12 changed files with 111 additions and 92 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ module.exports = {
afterColon: true,
} ],
'keyword-spacing': 'error',
'linebreak-style': [ 'error', 'unix' ],
// 'linebreak-style': [ 'error', 'unix' ],
'lines-around-comment': [ 'error', {
beforeBlockComment: true,
allowBlockStart: true,
Expand Down
75 changes: 38 additions & 37 deletions lib/hooks/useNavItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ export default function useNavItems(): ReturnType {
} : null;

const verifiedContracts: NavItem | null =
{
text: 'Verified contracts',
nextRoute: { pathname: '/verified-contracts' as const },
icon: 'verified',
isActive: pathname === '/verified-contracts',
};
{
text: 'Verified contracts',
nextRoute: { pathname: '/verified-contracts' as const },
icon: 'verified',
isActive: pathname === '/verified-contracts',
};
const ensLookup = config.features.nameService.isEnabled ? {
text: 'Name services lookup',
nextRoute: { pathname: '/name-domains' as const },
Expand Down Expand Up @@ -161,7 +161,7 @@ export default function useNavItems(): ReturnType {
txs,
userOps,
blocks,
topAccounts,
// topAccounts, hide this nav
validators,
verifiedContracts,
ensLookup,
Expand All @@ -174,30 +174,30 @@ export default function useNavItems(): ReturnType {
].filter(Boolean);
}

const apiNavItems: Array<NavItem> = [
config.features.restApiDocs.isEnabled ? {
text: 'REST API',
nextRoute: { pathname: '/api-docs' as const },
icon: 'restAPI',
isActive: pathname === '/api-docs',
} : null,
config.features.graphqlApiDocs.isEnabled ? {
text: 'GraphQL',
nextRoute: { pathname: '/graphiql' as const },
icon: 'graphQL',
isActive: pathname === '/graphiql',
} : null,
!config.UI.sidebar.hiddenLinks?.rpc_api && {
text: 'RPC API',
icon: 'RPC',
url: 'https://docs.blockscout.com/for-users/api/rpc-endpoints',
},
!config.UI.sidebar.hiddenLinks?.eth_rpc_api && {
text: 'Eth RPC API',
icon: 'RPC',
url: ' https://docs.blockscout.com/for-users/api/eth-rpc',
},
].filter(Boolean);
// const apiNavItems: Array<NavItem> = [
// config.features.restApiDocs.isEnabled ? {
// text: 'REST API',
// nextRoute: { pathname: '/api-docs' as const },
// icon: 'restAPI',
// isActive: pathname === '/api-docs',
// } : null,
// config.features.graphqlApiDocs.isEnabled ? {
// text: 'GraphQL',
// nextRoute: { pathname: '/graphiql' as const },
// icon: 'graphQL',
// isActive: pathname === '/graphiql',
// } : null,
// !config.UI.sidebar.hiddenLinks?.rpc_api && {
// text: 'RPC API',
// icon: 'RPC',
// url: 'https://docs.blockscout.com/for-users/api/rpc-endpoints',
// },
// !config.UI.sidebar.hiddenLinks?.eth_rpc_api && {
// text: 'Eth RPC API',
// icon: 'RPC',
// url: ' https://docs.blockscout.com/for-users/api/eth-rpc',
// },
// ].filter(Boolean);

const mainNavItems: ReturnType['mainNavItems'] = [
{
Expand All @@ -224,12 +224,13 @@ export default function useNavItems(): ReturnType {
icon: 'stats',
isActive: pathname === '/stats',
} : null,
apiNavItems.length > 0 && {
text: 'API',
icon: 'restAPI',
isActive: apiNavItems.some(item => isInternalItem(item) && item.isActive),
subItems: apiNavItems,
},
// 去掉Api
// apiNavItems.length > 0 && {
// text: 'API',
// icon: 'restAPI',
// isActive: apiNavItems.some(item => isInternalItem(item) && item.isActive),
// subItems: apiNavItems,
// },
{
text: 'Other',
icon: 'gear',
Expand Down
2 changes: 1 addition & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const moduleExports = {
rewrites,
redirects,
headers,
output: 'standalone',
// output: 'standalone',
productionBrowserSourceMaps: true,
experimental: {
instrumentationHook: true,
Expand Down
6 changes: 3 additions & 3 deletions nextjs/nextjs-routes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ declare module "nextjs-routes" {
| StaticRoute<"/api/metrics">
| StaticRoute<"/api/proxy">
| StaticRoute<"/api-docs">
| DynamicRoute<"/apps/[id]", { "id": string }>
| StaticRoute<"/apps">
| DynamicRoute<"/apps/[id]", { "id": string }>
| StaticRoute<"/auth/auth0">
| StaticRoute<"/auth/profile">
| StaticRoute<"/auth/unverified-email">
| DynamicRoute<"/batches/[number]", { "number": string }>
| StaticRoute<"/batches">
| DynamicRoute<"/batches/[number]", { "number": string }>
| DynamicRoute<"/blobs/[hash]", { "hash": string }>
| DynamicRoute<"/block/[height_or_hash]", { "height_or_hash": string }>
| StaticRoute<"/blocks">
Expand All @@ -40,8 +40,8 @@ declare module "nextjs-routes" {
| StaticRoute<"/graphiql">
| StaticRoute<"/">
| StaticRoute<"/login">
| DynamicRoute<"/name-domains/[name]", { "name": string }>
| StaticRoute<"/name-domains">
| DynamicRoute<"/name-domains/[name]", { "name": string }>
| DynamicRoute<"/op/[hash]", { "hash": string }>
| StaticRoute<"/ops">
| StaticRoute<"/output-roots">
Expand Down
24 changes: 21 additions & 3 deletions ui/address/AddressDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import ServiceDegradationWarning from 'ui/shared/alerts/ServiceDegradationWarnin
import isCustomAppError from 'ui/shared/AppError/isCustomAppError';
import DataFetchAlert from 'ui/shared/DataFetchAlert';
import DetailsInfoItem from 'ui/shared/DetailsInfoItem';
import DetailsSponsoredItem from 'ui/shared/DetailsSponsoredItem';
// import DetailsSponsoredItem from 'ui/shared/DetailsSponsoredItem';
import AddressEntity from 'ui/shared/entities/address/AddressEntity';
import BlockEntity from 'ui/shared/entities/block/BlockEntity';
import TxEntity from 'ui/shared/entities/tx/TxEntity';
Expand All @@ -34,7 +34,6 @@ const AddressDetails = ({ addressQuery, scrollRef }: Props) => {
hash: addressHash,
addressQuery,
});

const handleCounterItemClick = React.useCallback(() => {
window.setTimeout(() => {
// cannot do scroll instantly, have to wait a little
Expand Down Expand Up @@ -214,7 +213,26 @@ const AddressDetails = ({ addressQuery, scrollRef }: Props) => {
/>
</DetailsInfoItem>
) }
<DetailsSponsoredItem isLoading={ addressQuery.isPlaceholderData }/>
{ countersQuery.data?.gas_usage_count && (
<DetailsInfoItem
title="Binding Aspect"
hint="The number of bound aspects"
isLoading={ addressQuery.isPlaceholderData || countersQuery.isPlaceholderData }
>
{ addressQuery.data ? (
<AddressCounterItem
prop="gas_usage_count"
query={ countersQuery }
address={ data.hash }
onClick={ handleCounterItemClick }
isAddressQueryLoading={ addressQuery.isPlaceholderData }
isDegradedData={ addressQuery.isDegradedData }
/>
) :
0 }
</DetailsInfoItem>
) }
{ /* <DetailsSponsoredItem isLoading={addressQuery.isPlaceholderData} /> */ }
</Grid>
</>
);
Expand Down
4 changes: 2 additions & 2 deletions ui/blob/BlobInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type { Blob } from 'types/api/blobs';
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 TxEntity from 'ui/shared/entities/tx/TxEntity';

import BlobData from './BlobData';
Expand Down Expand Up @@ -77,7 +77,7 @@ const BlobInfo = ({ data, isLoading }: Props) => {
<TxEntity hash={ data.transaction_hashes[0].transaction_hash } isLoading={ isLoading } noIcon noCopy={ false }/>
</DetailsInfoItem>
) }
<DetailsSponsoredItem isLoading={ isLoading }/>
{ /* <DetailsSponsoredItem isLoading={ isLoading }/> */ }

{ data.blob_data && (
<>
Expand Down
4 changes: 2 additions & 2 deletions ui/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import LatestBlocks from 'ui/home/LatestBlocks';
import LatestZkEvmL2Batches from 'ui/home/LatestZkEvmL2Batches';
import Stats from 'ui/home/Stats';
import Transactions from 'ui/home/Transactions';
import AdBanner from 'ui/shared/ad/AdBanner';
// import AdBanner from 'ui/shared/ad/AdBanner';
import ProfileMenuDesktop from 'ui/snippets/profileMenu/ProfileMenuDesktop';
import SearchBar from 'ui/snippets/searchBar/SearchBar';
import WalletMenuDesktop from 'ui/snippets/walletMenu/WalletMenuDesktop';
Expand Down Expand Up @@ -44,7 +44,7 @@ const Home = () => {
</Box>
<Stats/>
<ChainIndicators/>
<AdBanner mt={{ base: 6, lg: 8 }} mx="auto" display="flex" justifyContent="center"/>
{ /* <AdBanner mt={{ base: 6, lg: 8 }} mx="auto" display="flex" justifyContent="center"/> */ }
<Flex mt={ 8 } direction={{ base: 'column', lg: 'row' }} columnGap={ 12 } rowGap={ 8 }>
{ rollupFeature.isEnabled && rollupFeature.type === 'zkEvm' ? <LatestZkEvmL2Batches/> : <LatestBlocks/> }
<Box flexGrow={ 1 }>
Expand Down
8 changes: 4 additions & 4 deletions ui/pages/Transaction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import TxBlobs from 'ui/tx/TxBlobs';
import TxDetails from 'ui/tx/TxDetails';
import TxDetailsDegraded from 'ui/tx/TxDetailsDegraded';
import TxDetailsWrapped from 'ui/tx/TxDetailsWrapped';
import TxInternals from 'ui/tx/TxInternals';
// import TxInternals from 'ui/tx/TxInternals';
import TxLogs from 'ui/tx/TxLogs';
import TxRawTrace from 'ui/tx/TxRawTrace';
// import TxRawTrace from 'ui/tx/TxRawTrace';
import TxState from 'ui/tx/TxState';
import TxSubHeading from 'ui/tx/TxSubHeading';
import TxTokenTransfer from 'ui/tx/TxTokenTransfer';
Expand Down Expand Up @@ -62,13 +62,13 @@ const TransactionPageContent = () => {
config.features.userOps.isEnabled ?
{ id: 'user_ops', title: 'User operations', component: <TxUserOps txQuery={ txQuery }/> } :
undefined,
{ id: 'internal', title: 'Internal txns', component: <TxInternals txQuery={ txQuery }/> },
// { id: 'internal', title: 'Internal txns', component: <TxInternals txQuery={ txQuery }/> },
config.features.dataAvailability.isEnabled && txQuery.data?.blob_versioned_hashes?.length ?
{ id: 'blobs', title: 'Blobs', component: <TxBlobs txQuery={ txQuery }/> } :
undefined,
{ id: 'logs', title: 'Logs', component: <TxLogs txQuery={ txQuery }/> },
{ id: 'state', title: 'State', component: <TxState txQuery={ txQuery }/> },
{ id: 'raw_trace', title: 'Raw trace', component: <TxRawTrace txQuery={ txQuery }/> },
// { id: 'raw_trace', title: 'Raw trace', component: <TxRawTrace txQuery={ txQuery }/> },
].filter(Boolean);
})();

Expand Down
66 changes: 33 additions & 33 deletions ui/snippets/footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import config from 'configs/app';
import type { ResourceError } from 'lib/api/resources';
import useApiQuery from 'lib/api/useApiQuery';
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 @@ -29,50 +29,50 @@ const Footer = () => {
},
});
const apiVersionUrl = getApiVersionUrl(backendVersionData?.backend_version);
const issueUrl = useIssueUrl(backendVersionData?.backend_version);
// const issueUrl = useIssueUrl(backendVersionData?.backend_version);
const BLOCKSCOUT_LINKS = [
{
icon: 'edit' as const,
iconSize: '16px',
text: 'Submit an issue',
url: issueUrl,
},
{
icon: 'social/canny' as const,
iconSize: '20px',
text: 'Feature request',
url: 'https://blockscout.canny.io/feature-requests',
},
// {
// icon: 'edit' as const,
// iconSize: '16px',
// text: 'Submit an issue',
// url: issueUrl,
// },
// {
// icon: 'social/canny' as const,
// iconSize: '20px',
// text: 'Feature request',
// url: 'https://blockscout.canny.io/feature-requests',
// },
{
icon: 'social/git' as const,
iconSize: '18px',
text: 'Contribute',
url: 'https://github.com/blockscout/blockscout',
url: 'https://github.com/artela-network/block-explorer',
},
{
icon: 'social/twitter' as const,
iconSize: '18px',
text: 'X (ex-Twitter)',
url: 'https://www.twitter.com/blockscoutcom',
url: 'https://twitter.com/artela_network',
},
{
icon: 'social/discord' as const,
iconSize: '24px',
text: 'Discord',
url: 'https://discord.gg/blockscout',
},
{
icon: 'discussions' as const,
iconSize: '20px',
text: 'Discussions',
url: 'https://github.com/orgs/blockscout/discussions',
},
{
icon: 'donate' as const,
iconSize: '20px',
text: 'Donate',
url: 'https://github.com/sponsors/blockscout',
url: 'https://discord.com/invite/artela',
},
// {
// icon: 'discussions' as const,
// iconSize: '20px',
// text: 'Discussions',
// url: 'https://github.com/orgs/blockscout/discussions',
// },
// {
// icon: 'donate' as const,
// iconSize: '20px',
// text: 'Donate',
// url: 'https://github.com/sponsors/blockscout',
// },
];

const frontendLink = (() => {
Expand Down Expand Up @@ -118,9 +118,9 @@ const Footer = () => {
const renderProjectInfo = React.useCallback((gridArea?: GridProps['gridArea']) => {
return (
<Box gridArea={ gridArea }>
<Link fontSize="xs" href="https://www.blockscout.com">blockscout.com</Link>
<Link fontSize="xs" href="https://www.artela.network">artela.network</Link>
<Text mt={ 3 } fontSize="xs">
Blockscout is a tool for inspecting and analyzing EVM based blockchains. Blockchain explorer for Ethereum Networks.
Artela is an extensible blockchain network enabling developers to build feature rich dApps.
</Text>
<VStack spacing={ 1 } mt={ 6 } alignItems="start">
{ apiVersionUrl && (
Expand Down Expand Up @@ -210,8 +210,8 @@ const Footer = () => {
}}
gridTemplateRows={{
base: 'auto',
lg: 'repeat(3, auto)',
xl: 'repeat(2, auto)',
lg: 'repeat(2, auto)',
xl: 'repeat(1, auto)',
}}
gridAutoFlow={{ base: 'row', lg: 'column' }}
alignContent="start"
Expand Down
4 changes: 2 additions & 2 deletions ui/token/TokenDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import getCurrencyValue from 'lib/getCurrencyValue';
import { TOKEN_COUNTERS } from 'stubs/token';
import type { TokenTabs } from 'ui/pages/Token';
import DetailsInfoItem from 'ui/shared/DetailsInfoItem';
import DetailsSponsoredItem from 'ui/shared/DetailsSponsoredItem';
// import DetailsSponsoredItem from 'ui/shared/DetailsSponsoredItem';
import TruncatedValue from 'ui/shared/TruncatedValue';

import TokenNftMarketplaces from './TokenNftMarketplaces';
Expand Down Expand Up @@ -163,7 +163,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
Loading

0 comments on commit 25aa9ed

Please sign in to comment.