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
a2597538
Commit
a2597538
authored
Sep 02, 2022
by
tom
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'main' of github.com:tom2drum/block-scout into mobile-view-pages
parents
6a3398d7
32d9cf05
Changes
20
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
173 additions
and
45 deletions
+173
-45
useNavItems.tsx
lib/hooks/useNavItems.tsx
+1
-1
networks.ts
lib/networks.ts
+5
-1
api_key.tsx
pages/[network_type]/[network_sub_type]/account/api_key.tsx
+12
-1
custom_abi.tsx
.../[network_type]/[network_sub_type]/account/custom_abi.tsx
+12
-1
private_tags.tsx
...network_type]/[network_sub_type]/account/private_tags.tsx
+0
-23
public_tags_request.tsx
..._type]/[network_sub_type]/account/public_tags_request.tsx
+12
-1
tag_address.tsx
...[network_type]/[network_sub_type]/account/tag_address.tsx
+27
-0
tag_transaction.tsx
...work_type]/[network_sub_type]/account/tag_transaction.tsx
+27
-0
watchlist.tsx
...s/[network_type]/[network_sub_type]/account/watchlist.tsx
+12
-1
profile.tsx
pages/[network_type]/[network_sub_type]/auth/profile.tsx
+12
-1
index.tsx
pages/[network_type]/[network_sub_type]/index.tsx
+12
-1
ApiKeyForm.tsx
ui/apiKey/ApiKeyModal/ApiKeyForm.tsx
+2
-1
CustomAbiForm.tsx
ui/customAbi/CustomAbiModal/CustomAbiForm.tsx
+6
-1
PrivateTags.tsx
ui/pages/PrivateTags.tsx
+18
-7
AddressForm.tsx
ui/privateTags/AddressModal/AddressForm.tsx
+2
-0
TransactionForm.tsx
ui/privateTags/TransactionModal/TransactionForm.tsx
+2
-0
PublicTagFormAddressInput.tsx
ui/publicTags/PublicTagsForm/PublicTagFormAddressInput.tsx
+4
-1
PublicTagFormComment.tsx
ui/publicTags/PublicTagsForm/PublicTagFormComment.tsx
+4
-1
PublicTagsForm.tsx
ui/publicTags/PublicTagsForm/PublicTagsForm.tsx
+2
-2
PublicTagsFormInput.tsx
ui/publicTags/PublicTagsForm/PublicTagsFormInput.tsx
+1
-1
No files found.
lib/hooks/useNavItems.tsx
View file @
a2597538
...
...
@@ -27,7 +27,7 @@ export default function useNavItems() {
const
accountNavItems
=
[
{
text
:
'
Watchlist
'
,
pathname
:
basePath
+
'
/account/watchlist
'
,
icon
:
watchlistIcon
},
{
text
:
'
Private tags
'
,
pathname
:
basePath
+
'
/account/
private_tag
s
'
,
icon
:
privateTagIcon
},
{
text
:
'
Private tags
'
,
pathname
:
basePath
+
'
/account/
tag_addres
s
'
,
icon
:
privateTagIcon
},
{
text
:
'
Public tags
'
,
pathname
:
basePath
+
'
/account/public_tags_request
'
,
icon
:
publicTagIcon
},
{
text
:
'
API keys
'
,
pathname
:
basePath
+
'
/account/api_key
'
,
icon
:
apiKeysIcon
},
{
text
:
'
Custom ABI
'
,
pathname
:
basePath
+
'
/account/custom_abi
'
,
icon
:
abiIcon
},
...
...
lib/networks.ts
View file @
a2597538
...
...
@@ -106,8 +106,12 @@ export const NETWORKS: Array<Network> = (() => {
// },
// ];
export
const
ACCOUNT_ROUTES
=
[
'
/watchlist
'
,
'
/
private-tags
'
,
'
/public-tags
'
,
'
/api-keys
'
,
'
/custom-
abi
'
];
export
const
ACCOUNT_ROUTES
=
[
'
/watchlist
'
,
'
/
tag_address
'
,
'
/tag_transaction
'
,
'
/public_tags_request
'
,
'
/api_key
'
,
'
/custom_
abi
'
];
export
function
isAccountRoute
(
route
:
string
)
{
return
ACCOUNT_ROUTES
.
includes
(
route
);
}
export
function
getAvailablePaths
()
{
return
NETWORKS
.
map
(({
type
,
subType
})
=>
({
params
:
{
network_type
:
type
,
network_sub_type
:
subType
}
}));
}
pages/[network_type]/[network_sub_type]/account/api_key.tsx
View file @
a2597538
import
type
{
NextPage
}
from
'
next
'
;
import
type
{
NextPage
,
GetStaticPaths
}
from
'
next
'
;
import
Head
from
'
next/head
'
;
import
React
from
'
react
'
;
import
{
getAvailablePaths
}
from
'
lib/networks
'
;
import
ApiKeys
from
'
ui/pages/ApiKeys
'
;
const
ApiKeysPage
:
NextPage
=
()
=>
{
...
...
@@ -14,3 +15,13 @@ const ApiKeysPage: NextPage = () => {
};
export
default
ApiKeysPage
;
export
const
getStaticPaths
:
GetStaticPaths
=
async
()
=>
{
return
{
paths
:
getAvailablePaths
(),
fallback
:
false
};
};
export
const
getStaticProps
=
async
()
=>
{
return
{
props
:
{},
};
};
pages/[network_type]/[network_sub_type]/account/custom_abi.tsx
View file @
a2597538
import
type
{
NextPage
}
from
'
next
'
;
import
type
{
NextPage
,
GetStaticPaths
}
from
'
next
'
;
import
Head
from
'
next/head
'
;
import
React
from
'
react
'
;
import
{
getAvailablePaths
}
from
'
lib/networks
'
;
import
CustomAbi
from
'
ui/pages/CustomAbi
'
;
const
CustomAbiPage
:
NextPage
=
()
=>
{
...
...
@@ -14,3 +15,13 @@ const CustomAbiPage: NextPage = () => {
};
export
default
CustomAbiPage
;
export
const
getStaticPaths
:
GetStaticPaths
=
async
()
=>
{
return
{
paths
:
getAvailablePaths
(),
fallback
:
false
};
};
export
const
getStaticProps
=
async
()
=>
{
return
{
props
:
{},
};
};
pages/[network_type]/[network_sub_type]/account/private_tags.tsx
deleted
100644 → 0
View file @
6a3398d7
import
type
{
NextPage
}
from
'
next
'
;
import
Head
from
'
next/head
'
;
import
React
,
{
useCallback
,
useState
}
from
'
react
'
;
import
PrivateTags
from
'
ui/pages/PrivateTags
'
;
const
TABS
=
[
'
address
'
,
'
transaction
'
];
const
PrivateTagsPage
:
NextPage
=
()
=>
{
const
[
,
setActiveTab
]
=
useState
(
TABS
[
0
]);
const
onChangeTab
=
useCallback
((
index
:
number
)
=>
{
setActiveTab
(
TABS
[
index
]);
},
[
setActiveTab
]);
return
(
<>
<
Head
><
title
>
Private tags
</
title
></
Head
>
<
PrivateTags
onChangeTab=
{
onChangeTab
}
/>
</>
);
};
export
default
PrivateTagsPage
;
pages/[network_type]/[network_sub_type]/account/public_tags_request.tsx
View file @
a2597538
import
type
{
NextPage
}
from
'
next
'
;
import
type
{
NextPage
,
GetStaticPaths
}
from
'
next
'
;
import
Head
from
'
next/head
'
;
import
React
from
'
react
'
;
import
{
getAvailablePaths
}
from
'
lib/networks
'
;
import
PublicTags
from
'
ui/pages/PublicTags
'
;
const
PublicTagsPage
:
NextPage
=
()
=>
{
...
...
@@ -14,3 +15,13 @@ const PublicTagsPage: NextPage = () => {
};
export
default
PublicTagsPage
;
export
const
getStaticPaths
:
GetStaticPaths
=
async
()
=>
{
return
{
paths
:
getAvailablePaths
(),
fallback
:
false
};
};
export
const
getStaticProps
=
async
()
=>
{
return
{
props
:
{},
};
};
pages/[network_type]/[network_sub_type]/account/tag_address.tsx
0 → 100644
View file @
a2597538
import
type
{
NextPage
,
GetStaticPaths
}
from
'
next
'
;
import
Head
from
'
next/head
'
;
import
React
from
'
react
'
;
import
{
getAvailablePaths
}
from
'
lib/networks
'
;
import
PrivateTags
from
'
ui/pages/PrivateTags
'
;
const
AddressTagsPage
:
NextPage
=
()
=>
{
return
(
<>
<
Head
><
title
>
Public tags
</
title
></
Head
>
<
PrivateTags
tab=
"address"
/>
</>
);
};
export
default
AddressTagsPage
;
export
const
getStaticPaths
:
GetStaticPaths
=
async
()
=>
{
return
{
paths
:
getAvailablePaths
(),
fallback
:
false
};
};
export
const
getStaticProps
=
async
()
=>
{
return
{
props
:
{},
};
};
pages/[network_type]/[network_sub_type]/account/tag_transaction.tsx
0 → 100644
View file @
a2597538
import
type
{
NextPage
,
GetStaticPaths
}
from
'
next
'
;
import
Head
from
'
next/head
'
;
import
React
from
'
react
'
;
import
{
getAvailablePaths
}
from
'
lib/networks
'
;
import
PrivateTags
from
'
ui/pages/PrivateTags
'
;
const
TransactionTagsPage
:
NextPage
=
()
=>
{
return
(
<>
<
Head
><
title
>
Public tags
</
title
></
Head
>
<
PrivateTags
tab=
"transaction"
/>
</>
);
};
export
default
TransactionTagsPage
;
export
const
getStaticPaths
:
GetStaticPaths
=
async
()
=>
{
return
{
paths
:
getAvailablePaths
(),
fallback
:
false
};
};
export
const
getStaticProps
=
async
()
=>
{
return
{
props
:
{},
};
};
pages/[network_type]/[network_sub_type]/account/watchlist.tsx
View file @
a2597538
import
type
{
NextPage
}
from
'
next
'
;
import
type
{
NextPage
,
GetStaticPaths
}
from
'
next
'
;
import
Head
from
'
next/head
'
;
import
React
from
'
react
'
;
import
{
getAvailablePaths
}
from
'
lib/networks
'
;
import
WatchList
from
'
ui/pages/Watchlist
'
;
const
WatchListPage
:
NextPage
=
()
=>
{
...
...
@@ -14,3 +15,13 @@ const WatchListPage: NextPage = () => {
};
export
default
WatchListPage
;
export
const
getStaticPaths
:
GetStaticPaths
=
async
()
=>
{
return
{
paths
:
getAvailablePaths
(),
fallback
:
false
};
};
export
const
getStaticProps
=
async
()
=>
{
return
{
props
:
{},
};
};
pages/[network_type]/[network_sub_type]/auth/profile.tsx
View file @
a2597538
import
type
{
NextPage
}
from
'
next
'
;
import
type
{
NextPage
,
GetStaticPaths
}
from
'
next
'
;
import
Head
from
'
next/head
'
;
import
React
from
'
react
'
;
import
{
getAvailablePaths
}
from
'
lib/networks
'
;
import
MyProfile
from
'
ui/pages/MyProfile
'
;
const
MyProfilePage
:
NextPage
=
()
=>
{
...
...
@@ -14,3 +15,13 @@ const MyProfilePage: NextPage = () => {
};
export
default
MyProfilePage
;
export
const
getStaticPaths
:
GetStaticPaths
=
async
()
=>
{
return
{
paths
:
getAvailablePaths
(),
fallback
:
false
};
};
export
const
getStaticProps
=
async
()
=>
{
return
{
props
:
{},
};
};
pages/[network_type]/[network_sub_type]/index.tsx
View file @
a2597538
import
{
Center
,
VStack
,
Box
}
from
'
@chakra-ui/react
'
;
import
type
{
NextPage
}
from
'
next
'
;
import
type
{
NextPage
,
GetStaticPaths
}
from
'
next
'
;
import
{
useRouter
}
from
'
next/router
'
;
import
React
from
'
react
'
;
import
{
getAvailablePaths
}
from
'
lib/networks
'
;
import
Page
from
'
ui/shared/Page/Page
'
;
const
Home
:
NextPage
=
()
=>
{
...
...
@@ -22,3 +23,13 @@ const Home: NextPage = () => {
};
export
default
Home
;
export
const
getStaticPaths
:
GetStaticPaths
=
async
()
=>
{
return
{
paths
:
getAvailablePaths
(),
fallback
:
false
};
};
export
const
getStaticProps
=
async
()
=>
{
return
{
props
:
{},
};
};
ui/apiKey/ApiKeyModal/ApiKeyForm.tsx
View file @
a2597538
...
...
@@ -92,7 +92,7 @@ const ApiKeyForm: React.FC<Props> = ({ data, onClose, setAlertVisible }) => {
const
renderTokenInput
=
useCallback
(({
field
}:
{
field
:
ControllerRenderProps
<
Inputs
,
'
token
'
>
})
=>
{
return
(
<
FormControl
variant=
"floating"
id=
"address"
isRequired
>
<
FormControl
variant=
"floating"
id=
"address"
>
<
Input
{
...
field
}
disabled=
{
true
}
...
...
@@ -134,6 +134,7 @@ const ApiKeyForm: React.FC<Props> = ({ data, onClose, setAlertVisible }) => {
control=
{
control
}
rules=
{
{
maxLength
:
NAME_MAX_LENGTH
,
required
:
true
,
}
}
render=
{
renderNameInput
}
/>
...
...
ui/customAbi/CustomAbiModal/CustomAbiForm.tsx
View file @
a2597538
...
...
@@ -142,7 +142,10 @@ const CustomAbiForm: React.FC<Props> = ({ data, onClose, setAlertVisible }) => {
name=
"contract_address_hash"
control=
{
control
}
render=
{
renderContractAddressInput
}
rules=
{
{
pattern
:
ADDRESS_REGEXP
}
}
rules=
{
{
pattern
:
ADDRESS_REGEXP
,
required
:
true
,
}
}
/>
</
Box
>
<
Box
marginTop=
{
5
}
>
...
...
@@ -150,6 +153,7 @@ const CustomAbiForm: React.FC<Props> = ({ data, onClose, setAlertVisible }) => {
name=
"name"
control=
{
control
}
render=
{
renderNameInput
}
rules=
{
{
required
:
true
}
}
/>
</
Box
>
<
Box
marginTop=
{
5
}
>
...
...
@@ -157,6 +161,7 @@ const CustomAbiForm: React.FC<Props> = ({ data, onClose, setAlertVisible }) => {
name=
"abi"
control=
{
control
}
render=
{
renderAbiInput
}
rules=
{
{
required
:
true
}
}
/>
</
Box
>
<
Box
marginTop=
{
8
}
>
...
...
ui/pages/PrivateTags.tsx
View file @
a2597538
...
...
@@ -6,27 +6,38 @@ import {
TabPanel
,
TabPanels
,
}
from
'
@chakra-ui/react
'
;
import
React
,
{
useCallback
}
from
'
react
'
;
import
React
,
{
useCallback
,
useState
}
from
'
react
'
;
import
useBasePath
from
'
lib/hooks/useBasePath
'
;
import
PrivateAddressTags
from
'
ui/privateTags/PrivateAddressTags
'
;
import
PrivateTransactionTags
from
'
ui/privateTags/PrivateTransactionTags
'
;
import
AccountPageHeader
from
'
ui/shared/AccountPageHeader
'
;
import
Page
from
'
ui/shared/Page/Page
'
;
const
TABS
=
[
'
address
'
,
'
transaction
'
]
as
const
;
type
TabName
=
typeof
TABS
[
number
];
type
Props
=
{
onChangeTab
:
(
index
:
number
)
=>
void
;
tab
:
TabName
;
}
const
PrivateTags
=
({
onChangeTab
:
onChangeTabProps
}:
Props
)
=>
{
const
onTabChange
=
useCallback
((
index
:
number
)
=>
{
onChangeTabProps
(
index
);
},
[
onChangeTabProps
]);
const
PrivateTags
=
({
tab
}:
Props
)
=>
{
const
[
,
setActiveTab
]
=
useState
<
TabName
>
(
tab
);
const
basePath
=
useBasePath
();
const
onChangeTab
=
useCallback
((
index
:
number
)
=>
{
setActiveTab
(
TABS
[
index
]);
const
newUrl
=
basePath
+
'
/account/
'
+
(
TABS
[
index
]
===
'
address
'
?
'
tag_address
'
:
'
tag_transaction
'
);
history
.
replaceState
(
history
.
state
,
''
,
newUrl
);
},
[
setActiveTab
,
basePath
]);
return
(
<
Page
>
<
Box
h=
"100%"
>
<
AccountPageHeader
text=
"Private tags"
/>
<
Tabs
variant=
"soft-rounded"
colorScheme=
"blue"
isLazy
onChange=
{
on
TabChange
}
>
<
Tabs
variant=
"soft-rounded"
colorScheme=
"blue"
isLazy
onChange=
{
on
ChangeTab
}
defaultIndex=
{
TABS
.
indexOf
(
tab
)
}
>
<
TabList
marginBottom=
{
{
base
:
6
,
lg
:
8
}
}
>
<
Tab
>
Address
</
Tab
>
<
Tab
>
Transaction
</
Tab
>
...
...
ui/privateTags/AddressModal/AddressForm.tsx
View file @
a2597538
...
...
@@ -98,6 +98,7 @@ const AddressForm: React.FC<Props> = ({ data, onClose, setAlertVisible }) => {
control=
{
control
}
rules=
{
{
pattern
:
ADDRESS_REGEXP
,
required
:
true
,
}
}
render=
{
renderAddressInput
}
/>
...
...
@@ -108,6 +109,7 @@ const AddressForm: React.FC<Props> = ({ data, onClose, setAlertVisible }) => {
control=
{
control
}
rules=
{
{
maxLength
:
TAG_MAX_LENGTH
,
required
:
true
,
}
}
render=
{
renderTagInput
}
/>
...
...
ui/privateTags/TransactionModal/TransactionForm.tsx
View file @
a2597538
...
...
@@ -97,6 +97,7 @@ const TransactionForm: React.FC<Props> = ({ data, onClose, setAlertVisible }) =>
control=
{
control
}
rules=
{
{
pattern
:
TRANSACTION_HASH_REGEXP
,
required
:
true
,
}
}
render=
{
renderTransactionInput
}
/>
...
...
@@ -107,6 +108,7 @@ const TransactionForm: React.FC<Props> = ({ data, onClose, setAlertVisible }) =>
control=
{
control
}
rules=
{
{
maxLength
:
TAG_MAX_LENGTH
,
required
:
true
,
}
}
render=
{
renderTagInput
}
/>
...
...
ui/publicTags/PublicTagsForm/PublicTagFormAddressInput.tsx
View file @
a2597538
...
...
@@ -40,7 +40,10 @@ export default function PublicTagFormAction({ control, index, fieldsLength, erro
name=
{
`addresses.${ index }.address`
}
control=
{
control
}
render=
{
renderAddressInput
}
rules=
{
{
pattern
:
ADDRESS_REGEXP
}
}
rules=
{
{
pattern
:
ADDRESS_REGEXP
,
required
:
index
===
0
,
}
}
/>
<
Flex
columnGap=
{
5
}
...
...
ui/publicTags/PublicTagsForm/PublicTagFormComment.tsx
View file @
a2597538
...
...
@@ -36,7 +36,10 @@ export default function PublicTagFormComment({ control, error, size }: Props) {
name=
"comment"
control=
{
control
}
render=
{
renderComment
}
rules=
{
{
maxLength
:
TEXT_INPUT_MAX_LENGTH
}
}
rules=
{
{
maxLength
:
TEXT_INPUT_MAX_LENGTH
,
required
:
true
,
}
}
/>
);
}
ui/publicTags/PublicTagsForm/PublicTagsForm.tsx
View file @
a2597538
...
...
@@ -133,7 +133,7 @@ const PublicTagsForm = ({ changeToDataScreen, data }: Props) => {
e
.
error
?.
full_name
&&
setError
(
'
fullName
'
,
{
type
:
'
custom
'
,
message
:
getErrorMessage
(
e
.
error
,
'
full_name
'
)
});
e
.
error
?.
email
&&
setError
(
'
email
'
,
{
type
:
'
custom
'
,
message
:
getErrorMessage
(
e
.
error
,
'
email
'
)
});
e
.
error
?.
tags
&&
setError
(
'
tags
'
,
{
type
:
'
custom
'
,
message
:
getErrorMessage
(
e
.
error
,
'
tags
'
)
});
e
.
error
?.
addresses
&&
setError
(
'
addresses.0
'
,
{
type
:
'
custom
'
,
message
:
getErrorMessage
(
e
.
error
,
'
addresses
'
)
});
e
.
error
?.
addresses
&&
setError
(
'
addresses.0
.address
'
,
{
type
:
'
custom
'
,
message
:
getErrorMessage
(
e
.
error
,
'
addresses
'
)
});
e
.
error
?.
additional_comment
&&
setError
(
'
comment
'
,
{
type
:
'
custom
'
,
message
:
getErrorMessage
(
e
.
error
,
'
additional_comment
'
)
});
}
else
{
setAlertVisible
(
true
);
...
...
@@ -215,7 +215,7 @@ const PublicTagsForm = ({ changeToDataScreen, data }: Props) => {
<
Box
position=
"relative"
key=
{
field
.
id
}
marginBottom=
{
4
}
>
<
PublicTagFormAddressInput
control=
{
control
}
error=
{
errors
?.
addresses
?.[
index
]
as
FieldError
}
error=
{
errors
?.
addresses
?.[
index
]
?.
address
as
FieldError
}
index=
{
index
}
fieldsLength=
{
fields
.
length
}
onAddFieldClick=
{
onAddFieldClick
}
...
...
ui/publicTags/PublicTagsForm/PublicTagsFormInput.tsx
View file @
a2597538
...
...
@@ -45,7 +45,7 @@ export default function PublicTagsFormInput<Inputs extends FieldValues>({
name=
{
fieldName
}
control=
{
control
}
render=
{
renderInput
}
rules=
{
{
pattern
}
}
rules=
{
{
pattern
,
required
}
}
/>
);
}
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