mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
placeholder for the new page
This commit is contained in:
@@ -16,6 +16,7 @@ export { default as marketplace } from './marketplace';
|
||||
export { default as metasuites } from './metasuites';
|
||||
export { default as mixpanel } from './mixpanel';
|
||||
export { default as nameService } from './nameService';
|
||||
export { default as publicTagsSubmission } from './publicTagsSubmission';
|
||||
export { default as restApiDocs } from './restApiDocs';
|
||||
export { default as rollup } from './rollup';
|
||||
export { default as safe } from './safe';
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
import type { Feature } from './types';
|
||||
|
||||
import { getEnvValue } from '../utils';
|
||||
import addressMetadata from './addressMetadata';
|
||||
|
||||
const apiHost = getEnvValue('NEXT_PUBLIC_ADMIN_SERVICE_API_HOST');
|
||||
|
||||
const title = 'Public tag submission';
|
||||
|
||||
const config: Feature<{ api: { endpoint: string; basePath: string } }> = (() => {
|
||||
if (addressMetadata.isEnabled && apiHost) {
|
||||
return Object.freeze({
|
||||
title,
|
||||
isEnabled: true,
|
||||
api: {
|
||||
endpoint: apiHost,
|
||||
basePath: '',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
return Object.freeze({
|
||||
title,
|
||||
isEnabled: false,
|
||||
});
|
||||
})();
|
||||
|
||||
export default config;
|
||||
@@ -351,21 +351,6 @@ const accountSchema = yup
|
||||
}),
|
||||
});
|
||||
|
||||
const adminServiceSchema = yup
|
||||
.object()
|
||||
.shape({
|
||||
NEXT_PUBLIC_ADMIN_SERVICE_API_HOST: yup
|
||||
.string()
|
||||
.when([ 'NEXT_PUBLIC_IS_ACCOUNT_SUPPORTED', 'NEXT_PUBLIC_MARKETPLACE_ENABLED' ], {
|
||||
is: (value1: boolean, value2: boolean) => value1 || value2,
|
||||
then: (schema) => schema.test(urlTest),
|
||||
otherwise: (schema) => schema.max(
|
||||
-1,
|
||||
'NEXT_PUBLIC_ADMIN_SERVICE_API_HOST cannot not be used if NEXT_PUBLIC_IS_ACCOUNT_SUPPORTED or NEXT_PUBLIC_MARKETPLACE_ENABLED is not set to "true"',
|
||||
),
|
||||
}),
|
||||
});
|
||||
|
||||
const featuredNetworkSchema: yup.ObjectSchema<FeaturedNetwork> = yup
|
||||
.object()
|
||||
.shape({
|
||||
@@ -592,6 +577,7 @@ const schema = yup
|
||||
NEXT_PUBLIC_CONTRACT_INFO_API_HOST: yup.string().test(urlTest),
|
||||
NEXT_PUBLIC_NAME_SERVICE_API_HOST: yup.string().test(urlTest),
|
||||
NEXT_PUBLIC_METADATA_SERVICE_API_HOST: yup.string().test(urlTest),
|
||||
NEXT_PUBLIC_ADMIN_SERVICE_API_HOST: yup.string().test(urlTest),
|
||||
NEXT_PUBLIC_GRAPHIQL_TRANSACTION: yup.string().matches(regexp.HEX_REGEXP),
|
||||
NEXT_PUBLIC_WEB3_WALLETS: yup
|
||||
.mixed()
|
||||
@@ -639,7 +625,6 @@ const schema = yup
|
||||
.concat(rollupSchema)
|
||||
.concat(beaconChainSchema)
|
||||
.concat(bridgedTokensSchema)
|
||||
.concat(sentrySchema)
|
||||
.concat(adminServiceSchema);
|
||||
.concat(sentrySchema);
|
||||
|
||||
export default schema;
|
||||
|
||||
@@ -566,6 +566,17 @@ This feature allows name tags and other public tags for addresses.
|
||||
|
||||
|
||||
|
||||
### Public tag submission
|
||||
|
||||
This feature allows you to submit an application with a public address tag.
|
||||
|
||||
| Variable | Type| Description | Compulsoriness | Default value | Example value |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| NEXT_PUBLIC_METADATA_SERVICE_API_HOST | `string` | Metadata Service API endpoint url | Required | - | `https://metadata.services.blockscout.com` |
|
||||
| NEXT_PUBLIC_ADMIN_SERVICE_API_HOST | `string` | Admin Service API endpoint url | Required | - | `https://admin-rs.services.blockscout.com` |
|
||||
|
||||
|
||||
|
||||
### Data Availability
|
||||
|
||||
This feature enables views related to blob transactions (EIP-4844), such as the Blob Txns tab on the Transactions page and the Blob details page.
|
||||
|
||||
@@ -237,6 +237,11 @@ export default function useNavItems(): ReturnType {
|
||||
nextRoute: { pathname: '/gas-tracker' as const },
|
||||
isActive: pathname.startsWith('/gas-tracker'),
|
||||
},
|
||||
config.features.publicTagsSubmission.isEnabled && {
|
||||
text: 'Submit public tag',
|
||||
nextRoute: { pathname: '/public-tags/submit' as const },
|
||||
isActive: pathname.startsWith('/public-tags/submit'),
|
||||
},
|
||||
...config.UI.sidebar.otherLinks,
|
||||
].filter(Boolean),
|
||||
},
|
||||
|
||||
@@ -29,6 +29,7 @@ const OG_TYPE_DICT: Record<Route['pathname'], OGPageType> = {
|
||||
'/account/custom-abi': 'Regular page',
|
||||
'/account/tag-address': 'Regular page',
|
||||
'/account/verified-addresses': 'Root page',
|
||||
'/public-tags/submit': 'Regular page',
|
||||
'/withdrawals': 'Root page',
|
||||
'/visualize/sol2uml': 'Regular page',
|
||||
'/csv-export': 'Regular page',
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable max-len */
|
||||
import type { Route } from 'nextjs-routes';
|
||||
|
||||
// equal og:description
|
||||
@@ -32,6 +33,7 @@ const TEMPLATE_MAP: Record<Route['pathname'], string> = {
|
||||
'/account/custom-abi': DEFAULT_TEMPLATE,
|
||||
'/account/tag-address': DEFAULT_TEMPLATE,
|
||||
'/account/verified-addresses': DEFAULT_TEMPLATE,
|
||||
'/public-tags/submit': 'Propose a new public tag for your address, contract or set of contracts for your dApp. Our team will review and approve your submission. Public tags are incredible tool which helps users identify contracts and addresses.',
|
||||
'/withdrawals': DEFAULT_TEMPLATE,
|
||||
'/visualize/sol2uml': DEFAULT_TEMPLATE,
|
||||
'/csv-export': DEFAULT_TEMPLATE,
|
||||
|
||||
@@ -27,6 +27,7 @@ const TEMPLATE_MAP: Record<Route['pathname'], string> = {
|
||||
'/account/custom-abi': '- custom ABI',
|
||||
'/account/tag-address': '- private tags',
|
||||
'/account/verified-addresses': '- my verified addresses',
|
||||
'/public-tags/submit': 'submit public tag',
|
||||
'/withdrawals': 'withdrawals',
|
||||
'/visualize/sol2uml': 'Solidity UML diagram',
|
||||
'/csv-export': 'export data to CSV',
|
||||
|
||||
@@ -27,6 +27,7 @@ export const PAGE_TYPE_DICT: Record<Route['pathname'], string> = {
|
||||
'/account/custom-abi': 'Custom ABI',
|
||||
'/account/tag-address': 'Private tags',
|
||||
'/account/verified-addresses': 'Verified addresses',
|
||||
'/public-tags/submit': 'Submit public tag',
|
||||
'/withdrawals': 'Withdrawals',
|
||||
'/visualize/sol2uml': 'Solidity UML diagram',
|
||||
'/csv-export': 'Export data to CSV file',
|
||||
|
||||
@@ -240,3 +240,14 @@ export const login: GetServerSideProps<Props> = async(context) => {
|
||||
|
||||
return base(context);
|
||||
};
|
||||
|
||||
export const publicTagsSubmit: GetServerSideProps<Props> = async(context) => {
|
||||
|
||||
if (!config.features.publicTagsSubmission.isEnabled) {
|
||||
return {
|
||||
notFound: true,
|
||||
};
|
||||
}
|
||||
|
||||
return base(context);
|
||||
};
|
||||
|
||||
Vendored
+1
@@ -44,6 +44,7 @@ declare module "nextjs-routes" {
|
||||
| DynamicRoute<"/op/[hash]", { "hash": string }>
|
||||
| StaticRoute<"/ops">
|
||||
| StaticRoute<"/output-roots">
|
||||
| StaticRoute<"/public-tags/submit">
|
||||
| StaticRoute<"/search-results">
|
||||
| StaticRoute<"/stats">
|
||||
| DynamicRoute<"/token/[hash]", { "hash": string }>
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
import type { NextPage } from 'next';
|
||||
import React from 'react';
|
||||
|
||||
import PageNextJs from 'nextjs/PageNextJs';
|
||||
|
||||
import PublicTagsSubmit from 'ui/pages/PublicTagsSubmit';
|
||||
|
||||
const Page: NextPage = () => {
|
||||
return (
|
||||
<PageNextJs pathname="/public-tags/submit">
|
||||
<PublicTagsSubmit/>
|
||||
</PageNextJs>
|
||||
);
|
||||
};
|
||||
|
||||
export default Page;
|
||||
|
||||
export { publicTagsSubmit as getServerSideProps } from 'nextjs/getServerSideProps';
|
||||
@@ -0,0 +1,30 @@
|
||||
import React from 'react';
|
||||
|
||||
import PageTitle from 'ui/shared/Page/PageTitle';
|
||||
|
||||
type Screen = 'form' | 'result';
|
||||
|
||||
const PublicTagsSubmit = () => {
|
||||
|
||||
const [ screen ] = React.useState<Screen>('form');
|
||||
|
||||
const content = (() => {
|
||||
switch (screen) {
|
||||
case 'form':
|
||||
return 'FORM';
|
||||
case 'result':
|
||||
return 'RESULT';
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
})();
|
||||
|
||||
return (
|
||||
<>
|
||||
<PageTitle title="Request a public tag/label"/>
|
||||
{ content }
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default PublicTagsSubmit;
|
||||
@@ -23,7 +23,7 @@ const PublicTagMenuItem = ({ className, hash, onBeforeClick, type }: Props) => {
|
||||
return;
|
||||
}
|
||||
|
||||
router.push({ pathname: '/account/public-tags-request', query: { address: hash } });
|
||||
router.push({ pathname: '/public-tags/submit', query: { address: hash } });
|
||||
}, [ hash, onBeforeClick, router ]);
|
||||
|
||||
const element = (() => {
|
||||
|
||||
Reference in New Issue
Block a user