Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
7d9b5029
Commit
7d9b5029
authored
May 07, 2024
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
placeholder for the new page
parent
7bfbb3a1
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
113 additions
and
18 deletions
+113
-18
index.ts
configs/app/features/index.ts
+1
-0
publicTagsSubmission.ts
configs/app/features/publicTagsSubmission.ts
+28
-0
schema.ts
deploy/tools/envs-validator/schema.ts
+2
-17
ENVS.md
docs/ENVS.md
+11
-0
useNavItems.tsx
lib/hooks/useNavItems.tsx
+5
-0
getPageOgType.ts
lib/metadata/getPageOgType.ts
+1
-0
description.ts
lib/metadata/templates/description.ts
+2
-0
title.ts
lib/metadata/templates/title.ts
+1
-0
getPageType.ts
lib/mixpanel/getPageType.ts
+1
-0
getServerSideProps.ts
nextjs/getServerSideProps.ts
+11
-0
nextjs-routes.d.ts
nextjs/nextjs-routes.d.ts
+1
-0
submit.tsx
pages/public-tags/submit.tsx
+18
-0
PublicTagsSubmit.tsx
ui/pages/PublicTagsSubmit.tsx
+30
-0
PublicTagMenuItem.tsx
ui/shared/AccountActionsMenu/items/PublicTagMenuItem.tsx
+1
-1
No files found.
configs/app/features/index.ts
View file @
7d9b5029
...
...
@@ -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
'
;
...
...
configs/app/features/publicTagsSubmission.ts
0 → 100644
View file @
7d9b5029
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
;
deploy/tools/envs-validator/schema.ts
View file @
7d9b5029
...
...
@@ -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
;
docs/ENVS.md
View file @
7d9b5029
...
...
@@ -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.
...
...
lib/hooks/useNavItems.tsx
View file @
7d9b5029
...
...
@@ -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
),
},
...
...
lib/metadata/getPageOgType.ts
View file @
7d9b5029
...
...
@@ -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
'
,
...
...
lib/metadata/templates/description.ts
View file @
7d9b5029
/* 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
,
...
...
lib/metadata/templates/title.ts
View file @
7d9b5029
...
...
@@ -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
'
,
...
...
lib/mixpanel/getPageType.ts
View file @
7d9b5029
...
...
@@ -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
'
,
...
...
nextjs/getServerSideProps.ts
View file @
7d9b5029
...
...
@@ -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
);
};
nextjs/nextjs-routes.d.ts
View file @
7d9b5029
...
...
@@ -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
}
>
...
...
pages/public-tags/submit.tsx
0 → 100644
View file @
7d9b5029
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
'
;
ui/pages/PublicTagsSubmit.tsx
0 → 100644
View file @
7d9b5029
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
;
ui/shared/AccountActionsMenu/items/PublicTagMenuItem.tsx
View file @
7d9b5029
...
...
@@ -23,7 +23,7 @@ const PublicTagMenuItem = ({ className, hash, onBeforeClick, type }: Props) => {
return
;
}
router
.
push
({
pathname
:
'
/
account/public-tags-reques
t
'
,
query
:
{
address
:
hash
}
});
router
.
push
({
pathname
:
'
/
public-tags/submi
t
'
,
query
:
{
address
:
hash
}
});
},
[
hash
,
onBeforeClick
,
router
]);
const
element
=
(()
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment