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
75aca5c0
Commit
75aca5c0
authored
Feb 16, 2023
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rest routes
parent
fd349bbb
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
39 additions
and
25 deletions
+39
-25
redirects.js
configs/nextjs/redirects.js
+4
-4
routes.ts
lib/link/routes.ts
+7
-7
csv-export.tsx
pages/csv-export.tsx
+13
-0
nextjs-routes.d.ts
types/nextjs-routes.d.ts
+2
-0
AddressCsvExportLink.tsx
ui/address/AddressCsvExportLink.tsx
+2
-2
NFTItem.tsx
ui/address/tokens/NFTItem.tsx
+1
-2
TokenTransferNft.tsx
ui/shared/TokenTransfer/TokenTransferNft.tsx
+2
-2
TokenInventoryItem.tsx
ui/token/TokenInventoryItem.tsx
+2
-2
TokenInstanceTransfersCount.tsx
ui/tokenInstance/details/TokenInstanceTransfersCount.tsx
+2
-2
NftTokenTransferSnippet.tsx
ui/tx/NftTokenTransferSnippet.tsx
+2
-2
TxDetailsAction.tsx
ui/tx/details/TxDetailsAction.tsx
+2
-2
No files found.
configs/nextjs/redirects.js
View file @
75aca5c0
...
...
@@ -10,19 +10,19 @@ const oldUrls = [
newPath
:
`
${
PATHS
.
txs
}
?tab=pending`
,
},
{
oldPath
:
'
/tx/:
id
/internal-transactions
'
,
oldPath
:
'
/tx/:
hash
/internal-transactions
'
,
newPath
:
`
${
PATHS
.
tx
}
?tab=internal`
,
},
{
oldPath
:
'
/tx/:
id
/logs
'
,
oldPath
:
'
/tx/:
hash
/logs
'
,
newPath
:
`
${
PATHS
.
tx
}
?tab=logs`
,
},
{
oldPath
:
'
/tx/:
id
/raw-trace
'
,
oldPath
:
'
/tx/:
hash
/raw-trace
'
,
newPath
:
`
${
PATHS
.
tx
}
?tab=raw_trace`
,
},
{
oldPath
:
'
/tx/:
id
/state
'
,
oldPath
:
'
/tx/:
hash
/state
'
,
newPath
:
`
${
PATHS
.
tx
}
?tab=state`
,
},
{
...
...
lib/link/routes.ts
View file @
75aca5c0
import
appConfig
from
'
configs/app/config
'
;
import
PATHS
from
'
./paths.json
'
;
//
import PATHS from './paths.json';
export
interface
Route
{
pattern
:
string
;
...
...
@@ -64,9 +64,9 @@ export const ROUTES = {
// pattern: PATHS.token_index,
// crossNetworkNavigation: true,
// },
token_instance_item
:
{
pattern
:
PATHS
.
token_instance_item
,
},
//
token_instance_item: {
//
pattern: PATHS.token_instance_item,
//
},
// ADDRESSES
// address_index: {
...
...
@@ -106,9 +106,9 @@ export const ROUTES = {
// pattern: PATHS.visualize_sol2uml,
// },
csv_export
:
{
pattern
:
PATHS
.
csv_export
,
},
//
csv_export: {
//
pattern: PATHS.csv_export,
//
},
// AUTH
// todo_tom need add page to the app
...
...
pages/csv-export.tsx
0 → 100644
View file @
75aca5c0
import
type
{
NextPage
}
from
'
next
'
;
const
CsvExportPage
:
NextPage
=
()
=>
{
return
null
;
};
export
default
CsvExportPage
;
export
async
function
getServerSideProps
()
{
return
{
notFound
:
true
,
};
}
types/nextjs-routes.d.ts
View file @
75aca5c0
...
...
@@ -22,12 +22,14 @@ declare module "nextjs-routes" {
|
StaticRoute
<
"
/auth/profile
"
>
|
DynamicRoute
<
"
/block/[height]
"
,
{
"
height
"
:
string
}
>
|
StaticRoute
<
"
/blocks
"
>
|
StaticRoute
<
"
/csv-export
"
>
|
StaticRoute
<
"
/graph
"
>
|
StaticRoute
<
"
/
"
>
|
StaticRoute
<
"
/login
"
>
|
StaticRoute
<
"
/search-results
"
>
|
StaticRoute
<
"
/stats
"
>
|
DynamicRoute
<
"
/token/[hash]
"
,
{
"
hash
"
:
string
}
>
|
DynamicRoute
<
"
/token/[hash]/instance/[id]
"
,
{
"
hash
"
:
string
;
"
id
"
:
string
}
>
|
StaticRoute
<
"
/tokens
"
>
|
DynamicRoute
<
"
/tx/[hash]
"
,
{
"
hash
"
:
string
}
>
|
StaticRoute
<
"
/txs
"
>
...
...
ui/address/AddressCsvExportLink.tsx
View file @
75aca5c0
import
{
chakra
,
Icon
,
Link
,
Tooltip
,
Hide
}
from
'
@chakra-ui/react
'
;
import
{
route
}
from
'
nextjs-routes
'
;
import
React
from
'
react
'
;
import
svgFileIcon
from
'
icons/files/csv.svg
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
link
from
'
lib/link/link
'
;
interface
Props
{
address
:
string
;
...
...
@@ -20,7 +20,7 @@ const AddressCsvExportLink = ({ className, address, type }: Props) => {
className=
{
className
}
display=
"inline-flex"
alignItems=
"center"
href=
{
link
(
'
csv_export
'
,
undefined
,
{
type
,
address
})
}
href=
{
route
({
pathname
:
'
/csv-export
'
,
query
:
{
type
,
address
}
})
}
flexShrink=
{
0
}
>
<
Icon
as=
{
svgFileIcon
}
boxSize=
{
{
base
:
'
30px
'
,
lg
:
6
}
}
/>
...
...
ui/address/tokens/NFTItem.tsx
View file @
75aca5c0
...
...
@@ -4,7 +4,6 @@ import React from 'react';
import
type
{
AddressTokenBalance
}
from
'
types/api/address
'
;
import
link
from
'
lib/link/link
'
;
import
NftImage
from
'
ui/shared/nft/NftImage
'
;
import
TokenLogo
from
'
ui/shared/TokenLogo
'
;
import
TruncatedTextTooltip
from
'
ui/shared/TruncatedTextTooltip
'
;
...
...
@@ -42,7 +41,7 @@ const NFTItem = ({ token, token_id: tokenId }: Props) => {
overflow=
"hidden"
whiteSpace=
"nowrap"
textOverflow=
"ellipsis"
href=
{
link
(
'
token_instance_item
'
,
{
hash
:
token
.
address
,
id
:
tokenId
})
}
href=
{
route
({
pathname
:
'
/token/[hash]/instance/[id]
'
,
query
:
{
hash
:
token
.
address
,
id
:
tokenId
}
})
}
>
{
tokenId
}
</
Link
>
...
...
ui/shared/TokenTransfer/TokenTransferNft.tsx
View file @
75aca5c0
import
{
Box
,
Icon
,
Link
,
chakra
}
from
'
@chakra-ui/react
'
;
import
{
route
}
from
'
nextjs-routes
'
;
import
React
from
'
react
'
;
import
nftPlaceholder
from
'
icons/nft_shield.svg
'
;
import
link
from
'
lib/link/link
'
;
import
HashStringShortenDynamic
from
'
ui/shared/HashStringShortenDynamic
'
;
interface
Props
{
...
...
@@ -14,7 +14,7 @@ interface Props {
const
TokenTransferNft
=
({
hash
,
id
,
className
}:
Props
)
=>
{
return
(
<
Link
href=
{
link
(
'
token_instance_item
'
,
{
hash
,
id
})
}
href=
{
route
({
pathname
:
'
/token/[hash]/instance/[id]
'
,
query
:
{
hash
,
id
}
})
}
overflow=
"hidden"
whiteSpace=
"nowrap"
display=
"flex"
...
...
ui/token/TokenInventoryItem.tsx
View file @
75aca5c0
import
{
Flex
,
Link
,
Text
,
LinkBox
,
LinkOverlay
,
useColorModeValue
,
Hide
}
from
'
@chakra-ui/react
'
;
import
{
route
}
from
'
nextjs-routes
'
;
import
React
from
'
react
'
;
import
type
{
TokenInstance
}
from
'
types/api/token
'
;
import
link
from
'
lib/link/link
'
;
import
Address
from
'
ui/shared/address/Address
'
;
import
AddressIcon
from
'
ui/shared/address/AddressIcon
'
;
import
AddressLink
from
'
ui/shared/address/AddressLink
'
;
...
...
@@ -13,7 +13,7 @@ import TruncatedTextTooltip from 'ui/shared/TruncatedTextTooltip';
type
Props
=
{
item
:
TokenInstance
};
const
NFTItem
=
({
item
}:
Props
)
=>
{
const
tokenLink
=
link
(
'
token_instance_item
'
,
{
hash
:
item
.
token
.
address
,
id
:
item
.
id
});
const
tokenLink
=
route
({
pathname
:
'
/token/[hash]/instance/[id]
'
,
query
:
{
hash
:
item
.
token
.
address
,
id
:
item
.
id
}
});
return
(
<
LinkBox
...
...
ui/tokenInstance/details/TokenInstanceTransfersCount.tsx
View file @
75aca5c0
import
{
route
}
from
'
nextjs-routes
'
;
import
React
from
'
react
'
;
import
useApiQuery
from
'
lib/api/useApiQuery
'
;
import
link
from
'
lib/link/link
'
;
import
DetailsInfoItem
from
'
ui/shared/DetailsInfoItem
'
;
import
LinkInternal
from
'
ui/shared/LinkInternal
'
;
import
DetailsSkeletonRow
from
'
ui/shared/skeletons/DetailsSkeletonRow
'
;
...
...
@@ -30,7 +30,7 @@ const TokenInstanceTransfersCount = ({ hash, id, onClick }: Props) => {
}
const
url
=
transfersCountQuery
.
data
.
transfers_count
>
0
?
link
(
'
token_instance_item
'
,
{
id
,
hash
},
{
tab
:
'
token_transfers
'
})
:
route
({
pathname
:
'
/token/[hash]/instance/[id]
'
,
query
:
{
hash
,
id
,
tab
:
'
token_transfers
'
}
})
:
undefined
;
return
(
...
...
ui/tx/NftTokenTransferSnippet.tsx
View file @
75aca5c0
import
{
Flex
,
Link
,
Text
,
Icon
,
Box
}
from
'
@chakra-ui/react
'
;
import
{
route
}
from
'
nextjs-routes
'
;
import
React
from
'
react
'
;
import
nftIcon
from
'
icons/nft_shield.svg
'
;
import
link
from
'
lib/link/link
'
;
import
AddressLink
from
'
ui/shared/address/AddressLink
'
;
import
HashStringShorten
from
'
ui/shared/HashStringShorten
'
;
import
TokenSnippet
from
'
ui/shared/TokenSnippet/TokenSnippet
'
;
...
...
@@ -17,7 +17,7 @@ interface Props {
const
NftTokenTransferSnippet
=
({
value
,
name
,
hash
,
symbol
,
tokenId
}:
Props
)
=>
{
const
num
=
value
===
'
1
'
?
''
:
value
;
const
url
=
link
(
'
token_instance_item
'
,
{
hash
:
hash
,
id
:
tokenId
});
const
url
=
route
({
pathname
:
'
/token/[hash]/instance/[id]
'
,
query
:
{
hash
:
hash
,
id
:
tokenId
}
});
return
(
<
Flex
alignItems=
"center"
columnGap=
{
3
}
rowGap=
{
2
}
flexWrap=
"wrap"
>
...
...
ui/tx/details/TxDetailsAction.tsx
View file @
75aca5c0
import
{
Flex
,
Link
,
Icon
,
chakra
}
from
'
@chakra-ui/react
'
;
import
BigNumber
from
'
bignumber.js
'
;
import
{
route
}
from
'
nextjs-routes
'
;
import
React
from
'
react
'
;
import
type
{
TxAction
,
TxActionGeneral
}
from
'
types/api/txAction
'
;
import
appConfig
from
'
configs/app/config
'
;
import
uniswapIcon
from
'
icons/uniswap.svg
'
;
import
link
from
'
lib/link/link
'
;
import
trimTokenSymbol
from
'
lib/token/trimTokenSymbol
'
;
import
AddressLink
from
'
ui/shared/address/AddressLink
'
;
import
TokenSnippet
from
'
ui/shared/TokenSnippet/TokenSnippet
'
;
...
...
@@ -97,7 +97,7 @@ const TxDetailsAction = ({ action }: Props) => {
<
Flex
columnGap=
{
1
}
rowGap=
{
2
}
pl=
{
3
}
flexDirection=
"column"
mt=
{
2
}
>
{
data
.
ids
.
map
((
id
:
string
)
=>
{
const
url
=
link
(
'
token_instance_item
'
,
{
hash
:
data
.
address
,
id
});
const
url
=
route
({
pathname
:
'
/token/[hash]/instance/[id]
'
,
query
:
{
hash
:
data
.
address
,
id
}
});
return
(
<
Flex
key=
{
data
.
address
+
id
}
whiteSpace=
"pre-wrap"
>
<
span
>
1 of
</
span
>
...
...
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